Switch to entering the sandbox directly from main(), rather than waiting for the...
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 9 Sep 2012 22:48:00 +0000 (22:48 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 9 Sep 2012 22:48:00 +0000 (22:48 +0000)
commit5c67c2b047946e14bd9804d98c05410f9b18dcff
treedddd0a7cfc437f972448bcabfae02a6fba926825
parent62d12438200f934c679685de5100fdd091f5023c
Switch to entering the sandbox directly from main(), rather than waiting for the initialization message
https://bugs.webkit.org/show_bug.cgi?id=96194

Reviewed by Dan Bernstein.

Source/WebKit2:

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
Pass a client identifier to WebProcess as a command line argument
so that it can be used to create private temporary and cache directories.

* WebProcess/WebProcess.h:
(WebProcess):
* WebProcess/mac/WebProcessMac.mm:
(WebKit::WebProcess::initializeSandbox):
(WebKit::WebProcess::platformInitializeWebProcess):
Expose the initializeSandbox() function and stop calling it from platformInitializeWebProcess()
since it is now going to be called from WebProcessMain.  Also, move changing the current working
directory to sandbox initialization function and replace use of creation parameters with just
the client identifier.

* WebProcess/com.apple.WebProcess.sb.in:
Add some new exceptions that come from entering the sandbox earlier in the AppKit
initialization process. Don't allow access to com.apple.coreservices.appleevents.

* WebProcess/mac/WebProcessMainMac.mm:
(WebKit::WebProcessMainXPC):
(WebKit::WebProcessMain):
Enter the sandbox explicitly, not waiting until the initialization message.  Also,
since we now have an extra parameter for the client identifier, make the WebProcess
launches the UIProcess code path work by extracting a client identifier from the
client executable path.

WebKitLibraries:

Update WKSI with SPI for getting the bundle URL from an executable URL.

* WebKitSystemInterface.h:
* libWebKitSystemInterfaceLion.a:
* libWebKitSystemInterfaceMountainLion.a:
* libWebKitSystemInterfaceSnowLeopard.a:
Adds WKCopyBundleURLForExecutableURL().

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@128003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm
Source/WebKit2/WebProcess/WebProcess.h
Source/WebKit2/WebProcess/com.apple.WebProcess.sb.in
Source/WebKit2/WebProcess/mac/WebProcessMac.mm
Source/WebKit2/WebProcess/mac/WebProcessMainMac.mm
Tools/Scripts/run-test-webkit-api
WebKitLibraries/ChangeLog
WebKitLibraries/WebKitSystemInterface.h
WebKitLibraries/libWebKitSystemInterfaceLion.a
WebKitLibraries/libWebKitSystemInterfaceMountainLion.a
WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a