- Revision
- 199002
- Author
- [email protected]
- Date
- 2016-04-04 03:26:28 -0700 (Mon, 04 Apr 2016)
Log Message
Fix WEB_PROCESS_CMD_PREFIX and NETWORK_PROCESS_CMD_PREFIX after r196500
https://bugs.webkit.org/show_bug.cgi?id=156060
Patch by Emanuele Aina <[email protected]> on 2016-04-04
Reviewed by Darin Adler.
Commit r196500 was a bit too eager in removing the
platformGetLaunchOptions() callsites as non-mac platform still use
that in debug builds to attach debugging tools to spawned
subprocesses (eg. gdbserver).
Instead of reinstating them and relying on each subprocess type to
implement its own platformGetLaunchOptions() version (all alike),
avoid duplication and check the *_PROCESS_CMD_PREFIX environment
variables in a single place, ChildProcessProxy::getLaunchOptions().
Doing so also improves consistency in *_PROCESS_CMD_PREFIX support:
only WEB_PROCESS_CMD_PREFIX and NETWORK_PROCESS_CMD_PREFIX worked with
both the GTK and EFL ports while PLUGIN_PROCESS_CMD_PREFIX only
worked for EFL and there was no corresponding
DATABASE_PROCESS_CMD_PREFIX implementation.
* UIProcess/ChildProcessProxy.cpp:
(WebKit::ChildProcessProxy::getLaunchOptions): Check the
appropriate *_PROCESS_CMD_PREFIX environment variable.
* UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
(WebKit::PluginProcessProxy::platformGetLaunchOptions): Drop
check for PLUGIN_PROCESS_COMMAND_PREFIX, now handled by
ChildProcessProxy::getLaunchOptions().
* UIProcess/Databases/DatabaseProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebProcessProxy.h: Drop platformGetLaunchOptions()
prototypes.
* UIProcess/Network/soup/NetworkProcessProxySoup.cpp:
* UIProcess/Databases/efl/DatabaseProcessProxyEfl.cpp:
* UIProcess/Databases/gtk/DatabaseProcessProxyGtk.cpp:
* UIProcess/efl/WebProcessProxyEfl.cpp:
* UIProcess/gtk/WebProcessProxyGtk.cpp: Removed, they only contained
platformGetLaunchOptions() implementations.
* PlatformEfl.cmake:
* PlatformGTK.cmake: Drop removed files.
Modified Paths
Removed Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (199001 => 199002)
--- trunk/Source/WebKit2/ChangeLog 2016-04-04 10:26:23 UTC (rev 199001)
+++ trunk/Source/WebKit2/ChangeLog 2016-04-04 10:26:28 UTC (rev 199002)
@@ -1,3 +1,46 @@
+2016-04-04 Emanuele Aina <[email protected]>
+
+ Fix WEB_PROCESS_CMD_PREFIX and NETWORK_PROCESS_CMD_PREFIX after r196500
+ https://bugs.webkit.org/show_bug.cgi?id=156060
+
+ Reviewed by Darin Adler.
+
+ Commit r196500 was a bit too eager in removing the
+ platformGetLaunchOptions() callsites as non-mac platform still use
+ that in debug builds to attach debugging tools to spawned
+ subprocesses (eg. gdbserver).
+
+ Instead of reinstating them and relying on each subprocess type to
+ implement its own platformGetLaunchOptions() version (all alike),
+ avoid duplication and check the *_PROCESS_CMD_PREFIX environment
+ variables in a single place, ChildProcessProxy::getLaunchOptions().
+
+ Doing so also improves consistency in *_PROCESS_CMD_PREFIX support:
+ only WEB_PROCESS_CMD_PREFIX and NETWORK_PROCESS_CMD_PREFIX worked with
+ both the GTK and EFL ports while PLUGIN_PROCESS_CMD_PREFIX only
+ worked for EFL and there was no corresponding
+ DATABASE_PROCESS_CMD_PREFIX implementation.
+
+ * UIProcess/ChildProcessProxy.cpp:
+ (WebKit::ChildProcessProxy::getLaunchOptions): Check the
+ appropriate *_PROCESS_CMD_PREFIX environment variable.
+ * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
+ (WebKit::PluginProcessProxy::platformGetLaunchOptions): Drop
+ check for PLUGIN_PROCESS_COMMAND_PREFIX, now handled by
+ ChildProcessProxy::getLaunchOptions().
+ * UIProcess/Databases/DatabaseProcessProxy.h:
+ * UIProcess/Network/NetworkProcessProxy.h:
+ * UIProcess/WebProcessProxy.h: Drop platformGetLaunchOptions()
+ prototypes.
+ * UIProcess/Network/soup/NetworkProcessProxySoup.cpp:
+ * UIProcess/Databases/efl/DatabaseProcessProxyEfl.cpp:
+ * UIProcess/Databases/gtk/DatabaseProcessProxyGtk.cpp:
+ * UIProcess/efl/WebProcessProxyEfl.cpp:
+ * UIProcess/gtk/WebProcessProxyGtk.cpp: Removed, they only contained
+ platformGetLaunchOptions() implementations.
+ * PlatformEfl.cmake:
+ * PlatformGTK.cmake: Drop removed files.
+
2016-04-02 Daniel Bates <[email protected]>
REGRESSION (r198933): Web Inspector and inspected page hang in local builds
Modified: trunk/Source/WebKit2/PlatformEfl.cmake (199001 => 199002)
--- trunk/Source/WebKit2/PlatformEfl.cmake 2016-04-04 10:26:23 UTC (rev 199001)
+++ trunk/Source/WebKit2/PlatformEfl.cmake 2016-04-04 10:26:28 UTC (rev 199002)
@@ -126,8 +126,6 @@
UIProcess/CoordinatedGraphics/PageViewportController.cpp
UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp
- UIProcess/Databases/efl/DatabaseProcessProxyEfl.cpp
-
UIProcess/InspectorServer/efl/WebInspectorServerEfl.cpp
UIProcess/InspectorServer/soup/WebSocketServerSoup.cpp
@@ -138,8 +136,6 @@
UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp
UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp
- UIProcess/Network/soup/NetworkProcessProxySoup.cpp
-
UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp
UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp
@@ -178,7 +174,6 @@
UIProcess/efl/WebPopupMenuProxyEfl.cpp
UIProcess/efl/WebPreferencesEfl.cpp
UIProcess/efl/WebProcessPoolEfl.cpp
- UIProcess/efl/WebProcessProxyEfl.cpp
UIProcess/efl/WebView.cpp
UIProcess/efl/WebViewClient.cpp
Modified: trunk/Source/WebKit2/PlatformGTK.cmake (199001 => 199002)
--- trunk/Source/WebKit2/PlatformGTK.cmake 2016-04-04 10:26:23 UTC (rev 199001)
+++ trunk/Source/WebKit2/PlatformGTK.cmake 2016-04-04 10:26:28 UTC (rev 199002)
@@ -277,8 +277,6 @@
UIProcess/API/gtk/WebKitWindowPropertiesPrivate.h
UIProcess/API/gtk/webkit2.h
- UIProcess/Databases/gtk/DatabaseProcessProxyGtk.cpp
-
UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp
UIProcess/InspectorServer/soup/WebSocketServerSoup.cpp
@@ -289,8 +287,6 @@
UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp
UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp
- UIProcess/Network/soup/NetworkProcessProxySoup.cpp
-
UIProcess/Plugins/gtk/PluginInfoCache.cpp
UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp
@@ -321,7 +317,6 @@
UIProcess/gtk/WebPopupMenuProxyGtk.cpp
UIProcess/gtk/WebPreferencesGtk.cpp
UIProcess/gtk/WebProcessPoolGtk.cpp
- UIProcess/gtk/WebProcessProxyGtk.cpp
UIProcess/soup/WebCookieManagerProxySoup.cpp
UIProcess/soup/WebProcessPoolSoup.cpp
Modified: trunk/Source/WebKit2/UIProcess/ChildProcessProxy.cpp (199001 => 199002)
--- trunk/Source/WebKit2/UIProcess/ChildProcessProxy.cpp 2016-04-04 10:26:23 UTC (rev 199001)
+++ trunk/Source/WebKit2/UIProcess/ChildProcessProxy.cpp 2016-04-04 10:26:28 UTC (rev 199002)
@@ -60,6 +60,32 @@
{
if (const char* userDirectorySuffix = getenv("DIRHELPER_USER_DIR_SUFFIX"))
launchOptions.extraInitializationData.add(ASCIILiteral("user-directory-suffix"), userDirectorySuffix);
+
+#if !defined(NDEBUG) && (PLATFORM(GTK) || PLATFORM(EFL))
+ const char* varname;
+ switch (launchOptions.processType) {
+ case ProcessLauncher::ProcessType::Web:
+ varname = "WEB_PROCESS_CMD_PREFIX";
+ break;
+#if ENABLE(NETSCAPE_PLUGIN_API)
+ case ProcessLauncher::ProcessType::Plugin64:
+ case ProcessLauncher::ProcessType::Plugin32:
+ varname = "PLUGIN_PROCESS_CMD_PREFIX";
+ break;
+#endif
+ case ProcessLauncher::ProcessType::Network:
+ varname = "NETWORK_PROCESS_CMD_PREFIX";
+ break;
+#if ENABLE(DATABASE_PROCESS)
+ case ProcessLauncher::ProcessType::Database:
+ varname = "DATABASE_PROCESS_CMD_PREFIX";
+ break;
+#endif
+ }
+ const char* processCmdPrefix = getenv(varname);
+ if (processCmdPrefix && *processCmdPrefix)
+ launchOptions.processCmdPrefix = String::fromUTF8(processCmdPrefix);
+#endif // !defined(NDEBUG) && (PLATFORM(GTK) || PLATFORM(EFL)
}
void ChildProcessProxy::connect()
Modified: trunk/Source/WebKit2/UIProcess/Databases/DatabaseProcessProxy.h (199001 => 199002)
--- trunk/Source/WebKit2/UIProcess/Databases/DatabaseProcessProxy.h 2016-04-04 10:26:23 UTC (rev 199001)
+++ trunk/Source/WebKit2/UIProcess/Databases/DatabaseProcessProxy.h 2016-04-04 10:26:28 UTC (rev 199002)
@@ -80,8 +80,6 @@
// ProcessLauncher::Client
void didFinishLaunching(ProcessLauncher*, IPC::Connection::Identifier) override;
- void platformGetLaunchOptions(ProcessLauncher::LaunchOptions&);
-
WebProcessPool* m_processPool;
unsigned m_numPendingConnectionRequests;
Modified: trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h (199001 => 199002)
--- trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h 2016-04-04 10:26:23 UTC (rev 199001)
+++ trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h 2016-04-04 10:26:28 UTC (rev 199002)
@@ -82,7 +82,6 @@
void connectionWillOpen(IPC::Connection&) override;
void processWillShutDown(IPC::Connection&) override;
- void platformGetLaunchOptions(ProcessLauncher::LaunchOptions&);
void networkProcessCrashedOrFailedToLaunch();
// ProcessThrottlerClient
Modified: trunk/Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp (199001 => 199002)
--- trunk/Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp 2016-04-04 10:26:23 UTC (rev 199001)
+++ trunk/Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp 2016-04-04 10:26:28 UTC (rev 199002)
@@ -54,12 +54,6 @@
{
launchOptions.processType = ProcessLauncher::ProcessType::Plugin64;
-#if PLATFORM(EFL) && !defined(NDEBUG)
- const char* commandPrefix = getenv("PLUGIN_PROCESS_COMMAND_PREFIX");
- if (commandPrefix && *commandPrefix)
- launchOptions.processCmdPrefix = String::fromUTF8(commandPrefix);
-#endif
-
launchOptions.extraInitializationData.add("plugin-path", pluginProcessAttributes.moduleInfo.path);
#if PLATFORM(GTK)
if (pluginProcessAttributes.moduleInfo.requiresGtk2)
Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.h (199001 => 199002)
--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.h 2016-04-04 10:26:23 UTC (rev 199001)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.h 2016-04-04 10:26:28 UTC (rev 199002)
@@ -158,7 +158,6 @@
// From ChildProcessProxy
void getLaunchOptions(ProcessLauncher::LaunchOptions&) override;
- void platformGetLaunchOptions(ProcessLauncher::LaunchOptions&);
void connectionWillOpen(IPC::Connection&) override;
void processWillShutDown(IPC::Connection&) override;
Deleted: trunk/Source/WebKit2/UIProcess/efl/WebProcessProxyEfl.cpp (199001 => 199002)
--- trunk/Source/WebKit2/UIProcess/efl/WebProcessProxyEfl.cpp 2016-04-04 10:26:23 UTC (rev 199001)
+++ trunk/Source/WebKit2/UIProcess/efl/WebProcessProxyEfl.cpp 2016-04-04 10:26:28 UTC (rev 199002)
@@ -1,42 +0,0 @@
-/*
- * 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::platformGetLaunchOptions(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
Deleted: trunk/Source/WebKit2/UIProcess/gtk/WebProcessProxyGtk.cpp (199001 => 199002)
--- trunk/Source/WebKit2/UIProcess/gtk/WebProcessProxyGtk.cpp 2016-04-04 10:26:23 UTC (rev 199001)
+++ trunk/Source/WebKit2/UIProcess/gtk/WebProcessProxyGtk.cpp 2016-04-04 10:26:28 UTC (rev 199002)
@@ -1,43 +0,0 @@
-/*
- * 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"
-#include <glib.h>
-
-namespace WebKit {
-
-void WebProcessProxy::platformGetLaunchOptions(ProcessLauncher::LaunchOptions& launchOptions)
-{
-#ifndef NDEBUG
- const char* webProcessCmdPrefix = g_getenv("WEB_PROCESS_CMD_PREFIX");
- if (webProcessCmdPrefix && *webProcessCmdPrefix)
- launchOptions.processCmdPrefix = String::fromUTF8(webProcessCmdPrefix);
-#else
- UNUSED_PARAM(launchOptions);
-#endif
-}
-
-} // namespace WebKit