Use different process types for 32-bit and 64-bit plug-ins
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Feb 2016 21:11:28 +0000 (21:11 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Feb 2016 21:11:28 +0000 (21:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=154186

Reviewed by Tim Horton.

* UIProcess/Databases/DatabaseProcessProxy.cpp:
(WebKit::DatabaseProcessProxy::getLaunchOptions):
* UIProcess/Launcher/ProcessLauncher.h:
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::serviceName):
(WebKit::shouldLeakBoost):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getLaunchOptions):
* UIProcess/Plugins/PluginProcessProxy.cpp:
(WebKit::PluginProcessProxy::getLaunchOptions): Deleted.
* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::PluginProcessProxy::platformGetLaunchOptions):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getLaunchOptions):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196499 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/Databases/DatabaseProcessProxy.cpp
Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h
Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm
Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp
Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp
Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm
Source/WebKit2/UIProcess/WebProcessProxy.cpp

index f095bf3..070c814 100644 (file)
@@ -1,3 +1,25 @@
+2016-02-12  Anders Carlsson  <andersca@apple.com>
+
+        Use different process types for 32-bit and 64-bit plug-ins
+        https://bugs.webkit.org/show_bug.cgi?id=154186
+
+        Reviewed by Tim Horton.
+
+        * UIProcess/Databases/DatabaseProcessProxy.cpp:
+        (WebKit::DatabaseProcessProxy::getLaunchOptions):
+        * UIProcess/Launcher/ProcessLauncher.h:
+        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
+        (WebKit::serviceName):
+        (WebKit::shouldLeakBoost):
+        * UIProcess/Network/NetworkProcessProxy.cpp:
+        (WebKit::NetworkProcessProxy::getLaunchOptions):
+        * UIProcess/Plugins/PluginProcessProxy.cpp:
+        (WebKit::PluginProcessProxy::getLaunchOptions): Deleted.
+        * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
+        (WebKit::PluginProcessProxy::platformGetLaunchOptions):
+        * UIProcess/WebProcessProxy.cpp:
+        (WebKit::WebProcessProxy::getLaunchOptions):
+
 2016-02-12  Beth Dakin  <bdakin@apple.com>
 
         Re-name isClickableElement in InteractionInformationAtPosition to isElement
index 2c8e071..7564303 100644 (file)
@@ -66,7 +66,7 @@ DatabaseProcessProxy::~DatabaseProcessProxy()
 
 void DatabaseProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOptions)
 {
-    launchOptions.processType = ProcessLauncher::DatabaseProcess;
+    launchOptions.processType = ProcessLauncher::ProcessType::Database;
     ChildProcessProxy::getLaunchOptions(launchOptions);
     platformGetLaunchOptions(launchOptions);
 }
index 2809c7a..b1b1197 100644 (file)
@@ -45,14 +45,15 @@ public:
         virtual void didFinishLaunching(ProcessLauncher*, IPC::Connection::Identifier) = 0;
     };
     
-    enum ProcessType {
-        WebProcess,
+    enum class ProcessType {
+        Web,
 #if ENABLE(NETSCAPE_PLUGIN_API)
-        PluginProcess,
+        Plugin32,
+        Plugin64,
 #endif
-        NetworkProcess,
+        Network,
 #if ENABLE(DATABASE_PROCESS)
-        DatabaseProcess,
+        Database,
 #endif
     };
 
index 72e079b..6926f20 100644 (file)
@@ -84,24 +84,19 @@ typedef void (ProcessLauncher::*DidFinishLaunchingProcessFunction)(PlatformProce
 static const char* serviceName(const ProcessLauncher::LaunchOptions& launchOptions)
 {
     switch (launchOptions.processType) {
-    case ProcessLauncher::WebProcess:
+    case ProcessLauncher::ProcessType::Web:
         return "com.apple.WebKit.WebContent" WK_XPC_SERVICE_SUFFIX;
-    case ProcessLauncher::NetworkProcess:
+    case ProcessLauncher::ProcessType::Network:
         return "com.apple.WebKit.Networking" WK_XPC_SERVICE_SUFFIX;
 #if ENABLE(DATABASE_PROCESS)
-    case ProcessLauncher::DatabaseProcess:
+    case ProcessLauncher::ProcessType::Database:
         return "com.apple.WebKit.Databases" WK_XPC_SERVICE_SUFFIX;
 #endif
 #if ENABLE(NETSCAPE_PLUGIN_API)
-    case ProcessLauncher::PluginProcess:
-        // FIXME: Support plugins that require an executable heap.
-        if (launchOptions.architecture == CPU_TYPE_X86)
-            return "com.apple.WebKit.Plugin.32" WK_XPC_SERVICE_SUFFIX;
-        if (launchOptions.architecture == CPU_TYPE_X86_64)
-            return "com.apple.WebKit.Plugin.64" WK_XPC_SERVICE_SUFFIX;
-
-        ASSERT_NOT_REACHED();
-        return 0;
+    case ProcessLauncher::ProcessType::Plugin32:
+        return "com.apple.WebKit.Plugin.32" WK_XPC_SERVICE_SUFFIX;
+    case ProcessLauncher::ProcessType::Plugin64:
+        return "com.apple.WebKit.Plugin.64" WK_XPC_SERVICE_SUFFIX;
 #endif
     }
 }
@@ -114,7 +109,7 @@ static bool shouldLeakBoost(const ProcessLauncher::LaunchOptions& launchOptions)
     return true;
 #else
     // On Mac, leak a boost onto the NetworkProcess.
-    return launchOptions.processType == ProcessLauncher::NetworkProcess;
+    return launchOptions.processType == ProcessLauncher::ProcessType::Network;
 #endif
 }
     
index 05b03d0..51f2283 100644 (file)
@@ -80,7 +80,7 @@ NetworkProcessProxy::~NetworkProcessProxy()
 
 void NetworkProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOptions)
 {
-    launchOptions.processType = ProcessLauncher::NetworkProcess;
+    launchOptions.processType = ProcessLauncher::ProcessType::Network;
     ChildProcessProxy::getLaunchOptions(launchOptions);
     platformGetLaunchOptions(launchOptions);
 }
index f7817c7..8f505a6 100644 (file)
@@ -84,7 +84,6 @@ PluginProcessProxy::~PluginProcessProxy()
 
 void PluginProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOptions)
 {
-    launchOptions.processType = ProcessLauncher::PluginProcess;
     ChildProcessProxy::getLaunchOptions(launchOptions);
     platformGetLaunchOptions(launchOptions, m_pluginProcessAttributes);
 }
index 93a01a5..8cb854d 100644 (file)
@@ -113,6 +113,11 @@ bool PluginProcessProxy::createPropertyListFile(const PluginModuleInfo& plugin)
 
 void PluginProcessProxy::platformGetLaunchOptions(ProcessLauncher::LaunchOptions& launchOptions, const PluginProcessAttributes& pluginProcessAttributes)
 {
+    if (pluginProcessAttributes.moduleInfo.pluginArchitecture == CPU_TYPE_X86)
+        launchOptions.processType = ProcessLauncher::ProcessType::Plugin32;
+    else
+        launchOptions.processType = ProcessLauncher::ProcessType::Plugin64;
+
     launchOptions.architecture = pluginProcessAttributes.moduleInfo.pluginArchitecture;
     launchOptions.executableHeap = PluginProcessProxy::pluginNeedsExecutableHeap(pluginProcessAttributes.moduleInfo);
     launchOptions.extraInitializationData.add("plugin-path", pluginProcessAttributes.moduleInfo.path);
index 65cabfe..27bc89f 100644 (file)
@@ -129,7 +129,7 @@ WebProcessProxy::~WebProcessProxy()
 
 void WebProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOptions)
 {
-    launchOptions.processType = ProcessLauncher::WebProcess;
+    launchOptions.processType = ProcessLauncher::ProcessType::Web;
 
     ChildProcessProxy::getLaunchOptions(launchOptions);