Title: [123915] trunk/Source/WebKit2
Revision
123915
Author
[email protected]
Date
2012-07-27 13:48:18 -0700 (Fri, 27 Jul 2012)

Log Message

Don't use an NSUserDefault for disabling the web process sandbox
https://bugs.webkit.org/show_bug.cgi?id=92542
<rdar://problem/11976060>

Reviewed by Mark Rowe.

The user default was really helpful during WebKit2 bringup, but we no longer need to pay the IPC cost of initializing NSUserDefaults at startup,
so get rid of the preference and use a good old #ifdef instead.

* WebProcess/mac/WebProcessMac.mm:
(WebKit::initializeSandbox):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (123914 => 123915)


--- trunk/Source/WebKit2/ChangeLog	2012-07-27 20:43:32 UTC (rev 123914)
+++ trunk/Source/WebKit2/ChangeLog	2012-07-27 20:48:18 UTC (rev 123915)
@@ -1,3 +1,17 @@
+2012-07-27  Anders Carlsson  <[email protected]>
+
+        Don't use an NSUserDefault for disabling the web process sandbox
+        https://bugs.webkit.org/show_bug.cgi?id=92542
+        <rdar://problem/11976060>
+
+        Reviewed by Mark Rowe.
+
+        The user default was really helpful during WebKit2 bringup, but we no longer need to pay the IPC cost of initializing NSUserDefaults at startup,
+        so get rid of the preference and use a good old #ifdef instead.
+
+        * WebProcess/mac/WebProcessMac.mm:
+        (WebKit::initializeSandbox):
+
 2012-07-27  Christophe Dumez  <[email protected]>
 
         [WK2][WTR] LayoutTestController.deliverWebIntent() needs to be implemented

Modified: trunk/Source/WebKit2/WebProcess/mac/WebProcessMac.mm (123914 => 123915)


--- trunk/Source/WebKit2/WebProcess/mac/WebProcessMac.mm	2012-07-27 20:43:32 UTC (rev 123914)
+++ trunk/Source/WebKit2/WebProcess/mac/WebProcessMac.mm	2012-07-27 20:48:18 UTC (rev 123915)
@@ -62,6 +62,9 @@
 #define SANDBOX_NAMED_EXTERNAL 0x0003
 extern "C" int sandbox_init_with_parameters(const char *profile, uint64_t flags, const char *const parameters[], char **errorbuf);
 
+// Define this to 1 to bypass the sandbox for debugging purposes.
+#define DEBUG_BYPASS_SANDBOX 0
+
 #endif
 
 using namespace WebCore;
@@ -180,11 +183,12 @@
 static void initializeSandbox(const WebProcessCreationParameters& parameters)
 {
 #if ENABLE(WEB_PROCESS_SANDBOX)
-    if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DisableSandbox"]) {
-        WTFLogAlways("Bypassing sandbox due to DisableSandbox user default.\n");
-        return;
-    }
 
+#if DEBUG_BYPASS_SANDBOX
+    WTFLogAlways("Bypassing web process sandbox.\n");
+    return;
+#endif
+
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
     // Use private temporary and cache directories.
     String systemDirectorySuffix = "com.apple.WebProcess+" + parameters.uiProcessBundleIdentifier;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to