Title: [129451] trunk
Revision
129451
Author
[email protected]
Date
2012-09-24 21:09:02 -0700 (Mon, 24 Sep 2012)

Log Message

Use NSUserDefaults rather than an environment variable to control whether to use an XPC Service for the WebProcess
https://bugs.webkit.org/show_bug.cgi?id=97514

Reviewed by Anders Carlsson.

Source/WebKit2: 

* GNUmakefile.list.am:
* PlatformEfl.cmake:
* Target.pri:
Add new files.

* UIProcess/Launcher/ProcessLauncher.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::connect):
Move platform specific launch options to a new function, platformConnect.

* UIProcess/WebProcessProxy.h:
* UIProcess/efl/WebProcessProxyEfl.cpp: Added.
Move Efl specific launch options here.
 
(WebKit::WebProcessProxy::platformConnect):
* UIProcess/gtk/WebProcessProxyGtk.cpp: Added.
Add stub.

(WebKit::WebProcessProxy::platformConnect):
* UIProcess/mac/WebProcessProxyMac.mm:
(WebKit::WebProcessProxy::platformConnect):
Move Mac specific launch option setting here, and switch from
using an environment variable to NSUserDefaults.

* UIProcess/qt/WebProcessProxyQt.cpp: Added.
(WebKit::WebProcessProxy::platformConnect):
Add stub.

* UIProcess/win/WebProcessProxyWin.cpp:
(WebKit::WebProcessProxy::platformConnect):
Add stub.

Tools: 

* Scripts/webkitdirs.pm:
(argumentsForRunAndDebugMacWebKitApp):
Push "-WebKit2UseXPCServiceForWebProcess YES" as arguments when --use-web-process-xpc-service
is provided to set the user default. Move adding of @ARGV to after custom additions as calling
shouldUseXPCServiceForWebProcess() can change @ARGV.

(runMacWebKitApp):
(execMacWebKitAppForDebugging):
Stop setting the WEBKIT_USE_XPC_SERVICE_FOR_WEB_PROCESS environment variable.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (129450 => 129451)


--- trunk/Source/WebKit2/ChangeLog	2012-09-25 03:55:25 UTC (rev 129450)
+++ trunk/Source/WebKit2/ChangeLog	2012-09-25 04:09:02 UTC (rev 129451)
@@ -1,3 +1,42 @@
+2012-09-24  Sam Weinig  <[email protected]>
+
+        Use NSUserDefaults rather than an environment variable to control whether to use an XPC Service for the WebProcess
+        https://bugs.webkit.org/show_bug.cgi?id=97514
+
+        Reviewed by Anders Carlsson.
+
+        * GNUmakefile.list.am:
+        * PlatformEfl.cmake:
+        * Target.pri:
+        Add new files.
+
+        * UIProcess/Launcher/ProcessLauncher.h:
+        * UIProcess/WebProcessProxy.cpp:
+        (WebKit::WebProcessProxy::connect):
+        Move platform specific launch options to a new function, platformConnect.
+
+        * UIProcess/WebProcessProxy.h:
+        * UIProcess/efl/WebProcessProxyEfl.cpp: Added.
+        Move Efl specific launch options here.
+ 
+        (WebKit::WebProcessProxy::platformConnect):
+        * UIProcess/gtk/WebProcessProxyGtk.cpp: Added.
+        Add stub.
+
+        (WebKit::WebProcessProxy::platformConnect):
+        * UIProcess/mac/WebProcessProxyMac.mm:
+        (WebKit::WebProcessProxy::platformConnect):
+        Move Mac specific launch option setting here, and switch from
+        using an environment variable to NSUserDefaults.
+
+        * UIProcess/qt/WebProcessProxyQt.cpp: Added.
+        (WebKit::WebProcessProxy::platformConnect):
+        Add stub.
+
+        * UIProcess/win/WebProcessProxyWin.cpp:
+        (WebKit::WebProcessProxy::platformConnect):
+        Add stub.
+
 2012-09-24  Laszlo Gombos  <[email protected]>
 
         [GTK][EFL] Remove cairo prefix from include statements

Modified: trunk/Source/WebKit2/GNUmakefile.list.am (129450 => 129451)


--- trunk/Source/WebKit2/GNUmakefile.list.am	2012-09-25 03:55:25 UTC (rev 129450)
+++ trunk/Source/WebKit2/GNUmakefile.list.am	2012-09-25 04:09:02 UTC (rev 129451)
@@ -779,6 +779,7 @@
 	Source/WebKit2/UIProcess/gtk/WebPopupMenuProxyGtk.cpp \
 	Source/WebKit2/UIProcess/gtk/WebPopupMenuProxyGtk.h \
 	Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp \
+	Source/WebKit2/UIProcess/gtk/WebProcessProxyGtk.cpp \
 	Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp \
 	Source/WebKit2/UIProcess/Launcher/ProcessLauncher.cpp \
 	Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h \

Modified: trunk/Source/WebKit2/PlatformEfl.cmake (129450 => 129451)


--- trunk/Source/WebKit2/PlatformEfl.cmake	2012-09-25 03:55:25 UTC (rev 129450)
+++ trunk/Source/WebKit2/PlatformEfl.cmake	2012-09-25 04:09:02 UTC (rev 129451)
@@ -76,6 +76,7 @@
     UIProcess/efl/WebPageProxyEfl.cpp
     UIProcess/efl/WebPopupMenuProxyEfl.cpp
     UIProcess/efl/WebPreferencesEfl.cpp
+    UIProcess/efl/WebProcessProxyEfl.cpp
 
     UIProcess/soup/WebCookieManagerProxySoup.cpp
     UIProcess/soup/WebSoupRequestManagerClient.cpp

Modified: trunk/Source/WebKit2/Target.pri (129450 => 129451)


--- trunk/Source/WebKit2/Target.pri	2012-09-25 03:55:25 UTC (rev 129450)
+++ trunk/Source/WebKit2/Target.pri	2012-09-25 04:09:02 UTC (rev 129451)
@@ -623,6 +623,7 @@
     UIProcess/qt/WebInspectorProxyQt.cpp \
     UIProcess/qt/WebPageProxyQt.cpp \
     UIProcess/qt/WebPreferencesQt.cpp \
+    UIProcess/qt/WebProcessProxyQt.cpp \
     WebProcess/ApplicationCache/WebApplicationCacheManager.cpp \
     WebProcess/Authentication/AuthenticationManager.cpp \
     WebProcess/Battery/WebBatteryManager.cpp \

Modified: trunk/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h (129450 => 129451)


--- trunk/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h	2012-09-25 03:55:25 UTC (rev 129450)
+++ trunk/Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h	2012-09-25 04:09:02 UTC (rev 129451)
@@ -61,9 +61,11 @@
         bool useXPC;
 #endif
 #endif
+#if PLATFORM(EFL)
 #ifndef NDEBUG
         String processCmdPrefix;
 #endif
+#endif
     };
 
     static PassRefPtr<ProcessLauncher> create(Client* client, const LaunchOptions& launchOptions)

Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp (129450 => 129451)


--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp	2012-09-25 03:55:25 UTC (rev 129450)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp	2012-09-25 04:09:02 UTC (rev 129451)
@@ -108,21 +108,8 @@
 
     ProcessLauncher::LaunchOptions launchOptions;
     launchOptions.processType = ProcessLauncher::WebProcess;
-
-#if PLATFORM(MAC)
-    // We want the web process to match the architecture of the UI process.
-    launchOptions.architecture = ProcessLauncher::LaunchOptions::MatchCurrentArchitecture;
-    launchOptions.executableHeap = false;
-#if HAVE(XPC)
-    launchOptions.useXPC = getenv("WEBKIT_USE_XPC_SERVICE_FOR_WEB_PROCESS");
-#endif
-#endif
-#ifndef NDEBUG
-    const char* webProcessCmdPrefix = getenv("WEB_PROCESS_CMD_PREFIX");
-    if (webProcessCmdPrefix && *webProcessCmdPrefix)
-        launchOptions.processCmdPrefix = String::fromUTF8(webProcessCmdPrefix);
-#endif
-
+    platformConnect(launchOptions);
+    
     m_processLauncher = ProcessLauncher::create(this, launchOptions);
 }
 

Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.h (129450 => 129451)


--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.h	2012-09-25 03:55:25 UTC (rev 129450)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.h	2012-09-25 04:09:02 UTC (rev 129451)
@@ -123,6 +123,7 @@
 
     // Initializes the process launcher which will begin launching the process.
     void connect();
+    void platformConnect(ProcessLauncher::LaunchOptions&);
 
     // Called when the web process has crashed or we know that it will terminate soon.
     // Will potentially cause the WebProcessProxy object to be freed.

Added: trunk/Source/WebKit2/UIProcess/efl/WebProcessProxyEfl.cpp (0 => 129451)


--- trunk/Source/WebKit2/UIProcess/efl/WebProcessProxyEfl.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/efl/WebProcessProxyEfl.cpp	2012-09-25 04:09:02 UTC (rev 129451)
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebProcessProxy.h"
+
+namespace WebKit {
+
+void WebProcessProxy::platformConnect(ProcessLauncher::LaunchOptions& launchOptions)
+{
+#ifndef NDEBUG
+    const char* webProcessCmdPrefix = getenv("WEB_PROCESS_CMD_PREFIX");
+    if (webProcessCmdPrefix && *webProcessCmdPrefix)
+        launchOptions.processCmdPrefix = String::fromUTF8(webProcessCmdPrefix);
+#else
+    UNUSED_PARAM(launchOptions);
+#endif
+}
+
+} // namespace WebKit

Added: trunk/Source/WebKit2/UIProcess/gtk/WebProcessProxyGtk.cpp (0 => 129451)


--- trunk/Source/WebKit2/UIProcess/gtk/WebProcessProxyGtk.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/gtk/WebProcessProxyGtk.cpp	2012-09-25 04:09:02 UTC (rev 129451)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebProcessProxy.h"
+
+namespace WebKit {
+
+void WebProcessProxy::platformConnect(ProcessLauncher::LaunchOptions&)
+{
+}
+
+} // namespace WebKit

Modified: trunk/Source/WebKit2/UIProcess/mac/WebProcessProxyMac.mm (129450 => 129451)


--- trunk/Source/WebKit2/UIProcess/mac/WebProcessProxyMac.mm	2012-09-25 03:55:25 UTC (rev 129450)
+++ trunk/Source/WebKit2/UIProcess/mac/WebProcessProxyMac.mm	2012-09-25 04:09:02 UTC (rev 129451)
@@ -149,4 +149,15 @@
     return [WKFullKeyboardAccessWatcher fullKeyboardAccessEnabled];
 }
 
+void WebProcessProxy::platformConnect(ProcessLauncher::LaunchOptions& launchOptions)
+{
+    // We want the web process to match the architecture of the UI process.
+    launchOptions.architecture = ProcessLauncher::LaunchOptions::MatchCurrentArchitecture;
+    launchOptions.executableHeap = false;
+
+#if HAVE(XPC)
+    launchOptions.useXPC = [[NSUserDefaults standardUserDefaults] boolForKey:@"WebKit2UseXPCServiceForWebProcess"];
+#endif
+}
+
 } // namespace WebKit

Added: trunk/Source/WebKit2/UIProcess/qt/WebProcessProxyQt.cpp (0 => 129451)


--- trunk/Source/WebKit2/UIProcess/qt/WebProcessProxyQt.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/qt/WebProcessProxyQt.cpp	2012-09-25 04:09:02 UTC (rev 129451)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebProcessProxy.h"
+
+namespace WebKit {
+
+void WebProcessProxy::platformConnect(ProcessLauncher::LaunchOptions&)
+{
+}
+
+} // namespace WebKit

Modified: trunk/Source/WebKit2/UIProcess/win/WebProcessProxyWin.cpp (129450 => 129451)


--- trunk/Source/WebKit2/UIProcess/win/WebProcessProxyWin.cpp	2012-09-25 03:55:25 UTC (rev 129450)
+++ trunk/Source/WebKit2/UIProcess/win/WebProcessProxyWin.cpp	2012-09-25 04:09:02 UTC (rev 129451)
@@ -33,4 +33,8 @@
     return Vector<HWND>();
 }
 
+void WebProcessProxy::platformConnect(ProcessLauncher::LaunchOptions&)
+{
+}
+
 } // namespace WebKit

Modified: trunk/Tools/ChangeLog (129450 => 129451)


--- trunk/Tools/ChangeLog	2012-09-25 03:55:25 UTC (rev 129450)
+++ trunk/Tools/ChangeLog	2012-09-25 04:09:02 UTC (rev 129451)
@@ -1,3 +1,20 @@
+2012-09-24  Sam Weinig  <[email protected]>
+
+        Use NSUserDefaults rather than an environment variable to control whether to use an XPC Service for the WebProcess
+        https://bugs.webkit.org/show_bug.cgi?id=97514
+
+        Reviewed by Anders Carlsson.
+
+        * Scripts/webkitdirs.pm:
+        (argumentsForRunAndDebugMacWebKitApp):
+        Push "-WebKit2UseXPCServiceForWebProcess YES" as arguments when --use-web-process-xpc-service
+        is provided to set the user default. Move adding of @ARGV to after custom additions as calling
+        shouldUseXPCServiceForWebProcess() can change @ARGV.
+
+        (runMacWebKitApp):
+        (execMacWebKitAppForDebugging):
+        Stop setting the WEBKIT_USE_XPC_SERVICE_FOR_WEB_PROCESS environment variable.
+
 2012-09-24  Laszlo Gombos  <[email protected]>
 
         [GTK][EFL] Make sure cairo is built with fontconfig support

Modified: trunk/Tools/Scripts/webkitdirs.pm (129450 => 129451)


--- trunk/Tools/Scripts/webkitdirs.pm	2012-09-25 03:55:25 UTC (rev 129450)
+++ trunk/Tools/Scripts/webkitdirs.pm	2012-09-25 04:09:02 UTC (rev 129451)
@@ -2527,8 +2527,11 @@
 
 sub argumentsForRunAndDebugMacWebKitApp()
 {
-    my @args = @ARGV;
+    my @args = ();
     push @args, ("-ApplePersistenceIgnoreState", "YES") if !isSnowLeopard() && checkForArgumentAndRemoveFromArrayRef("--no-saved-state", \@args);
+    push @args, ("-WebKit2UseXPCServiceForWebProcess", "YES") if shouldUseXPCServiceForWebProcess();
+    unshift @args, @ARGV;
+
     return @args;
 }
 
@@ -2542,10 +2545,6 @@
 
     setUpGuardMallocIfNeeded();
 
-    if (shouldUseXPCServiceForWebProcess()) {
-        $ENV{WEBKIT_USE_XPC_SERVICE_FOR_WEB_PROCESS} = "YES";
-    }
-
     if (defined($useOpenCommand) && $useOpenCommand == USE_OPEN_COMMAND) {
         return system("open", "-W", "-a", $appPath, "--args", argumentsForRunAndDebugMacWebKitApp());
     }
@@ -2583,9 +2582,6 @@
 
     my @architectureFlags = ($architectureSwitch, architecture());
     if (!shouldTargetWebProcess()) {
-        if (shouldUseXPCServiceForWebProcess()) {
-            $ENV{WEBKIT_USE_XPC_SERVICE_FOR_WEB_PROCESS} = "YES";
-        }
         print "Starting @{[basename($appPath)]} under $debugger with DYLD_FRAMEWORK_PATH set to point to built WebKit in $productDir.\n";
         exec { $debuggerPath } $debuggerPath, @architectureFlags, $argumentsSeparator, $appPath, argumentsForRunAndDebugMacWebKitApp() or die;
     } else {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to