Diff
Modified: trunk/Source/WebKit2/ChangeLog (142629 => 142630)
--- trunk/Source/WebKit2/ChangeLog 2013-02-12 16:45:26 UTC (rev 142629)
+++ trunk/Source/WebKit2/ChangeLog 2013-02-12 16:55:47 UTC (rev 142630)
@@ -1,3 +1,26 @@
+2013-02-11 Brady Eidson <[email protected]>
+
+ Make PluginProcessProxy a ChildProcessProxy.
+ https://bugs.webkit.org/show_bug.cgi?id=109513
+
+ Reviewed by Anders Carlsson.
+
+ * Shared/ChildProcessProxy.h: Inherit from ThreadSafeRefCounted.
+ * UIProcess/Network/NetworkProcessProxy.h: Don't inherit from RefCounted.
+ * UIProcess/WebProcessProxy.h: Don't inherit from ThreadSafeRefCounted
+ * UIProcess/Plugins/PluginProcessProxy.h: Don't inherit from RefCounted, do inherit from ChildProcessProxy
+
+ Rely on ChildProcessProxy for process launcher management and launch options:
+ * UIProcess/Plugins/PluginProcessProxy.cpp:
+ (WebKit::PluginProcessProxy::PluginProcessProxy):
+ (WebKit::PluginProcessProxy::getLaunchOptions):
+ (WebKit::PluginProcessProxy::getPluginProcessConnection):
+ (WebKit::PluginProcessProxy::getSitesWithData):
+ (WebKit::PluginProcessProxy::clearSiteData):
+ * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
+ (WebKit::PluginProcessProxy::platformGetLaunchOptions):
+ (WebKit::PluginProcessProxy::getPluginProcessSerialNumber):
+
2013-02-11 Alexey Proskuryakov <[email protected]>
<rdar://problem/13196331> NetworkProcess deny mach-lookup com.apple.PowerManagement.control
Modified: trunk/Source/WebKit2/Shared/ChildProcessProxy.h (142629 => 142630)
--- trunk/Source/WebKit2/Shared/ChildProcessProxy.h 2013-02-12 16:45:26 UTC (rev 142629)
+++ trunk/Source/WebKit2/Shared/ChildProcessProxy.h 2013-02-12 16:55:47 UTC (rev 142630)
@@ -30,9 +30,11 @@
#include "MessageReceiverMap.h"
#include "ProcessLauncher.h"
+#include <wtf/ThreadSafeRefCounted.h>
+
namespace WebKit {
-class ChildProcessProxy : ProcessLauncher::Client, public CoreIPC::Connection::Client {
+class ChildProcessProxy : ProcessLauncher::Client, public CoreIPC::Connection::Client, public ThreadSafeRefCounted<ChildProcessProxy> {
WTF_MAKE_NONCOPYABLE(ChildProcessProxy);
public:
Modified: trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h (142629 => 142630)
--- trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h 2013-02-12 16:45:26 UTC (rev 142629)
+++ trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h 2013-02-12 16:55:47 UTC (rev 142630)
@@ -48,7 +48,7 @@
class WebContext;
struct NetworkProcessCreationParameters;
-class NetworkProcessProxy : public RefCounted<NetworkProcessProxy>, public ChildProcessProxy {
+class NetworkProcessProxy : public ChildProcessProxy {
public:
static PassRefPtr<NetworkProcessProxy> create(WebContext*);
~NetworkProcessProxy();
Modified: trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp (142629 => 142630)
--- trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp 2013-02-12 16:45:26 UTC (rev 142629)
+++ trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp 2013-02-12 16:55:47 UTC (rev 142630)
@@ -66,25 +66,26 @@
#endif
, m_processType(processType)
{
- ProcessLauncher::LaunchOptions launchOptions;
- launchOptions.processType = ProcessLauncher::PluginProcess;
-
- platformInitializeLaunchOptions(launchOptions, pluginInfo);
-
- m_processLauncher = ProcessLauncher::create(this, launchOptions);
+ connect();
}
PluginProcessProxy::~PluginProcessProxy()
{
}
+void PluginProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOptions)
+{
+ launchOptions.processType = ProcessLauncher::PluginProcess;
+ platformGetLaunchOptions(launchOptions, m_pluginInfo);
+}
+
// Asks the plug-in process to create a new connection to a web process. The connection identifier will be
// encoded in the given argument encoder and sent back to the connection of the given web process.
void PluginProcessProxy::getPluginProcessConnection(PassRefPtr<Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply> reply)
{
m_pendingConnectionReplies.append(reply);
- if (m_processLauncher->isLaunching()) {
+ if (isLaunching()) {
m_numPendingConnectionRequests++;
return;
}
@@ -99,7 +100,7 @@
ASSERT(!m_pendingGetSitesReplies.contains(callbackID));
m_pendingGetSitesReplies.set(callbackID, webPluginSiteDataManager);
- if (m_processLauncher->isLaunching()) {
+ if (isLaunching()) {
m_pendingGetSitesRequests.append(callbackID);
return;
}
@@ -113,7 +114,7 @@
ASSERT(!m_pendingClearSiteDataReplies.contains(callbackID));
m_pendingClearSiteDataReplies.set(callbackID, webPluginSiteDataManager);
- if (m_processLauncher->isLaunching()) {
+ if (isLaunching()) {
ClearSiteDataRequest request;
request.sites = sites;
request.flags = flags;
@@ -127,11 +128,6 @@
m_connection->send(Messages::PluginProcess::ClearSiteData(sites, flags, maxAgeInSeconds, callbackID), 0);
}
-void PluginProcessProxy::terminate()
-{
- m_processLauncher->terminateProcess();
-}
-
void PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch()
{
// The plug-in process must have crashed or exited, send any pending sync replies we might have.
Modified: trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h (142629 => 142630)
--- trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h 2013-02-12 16:45:26 UTC (rev 142629)
+++ trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h 2013-02-12 16:55:47 UTC (rev 142630)
@@ -28,6 +28,7 @@
#if ENABLE(PLUGIN_PROCESS)
+#include "ChildProcessProxy.h"
#include "Connection.h"
#include "PluginModuleInfo.h"
#include "PluginProcess.h"
@@ -61,7 +62,7 @@
};
#endif
-class PluginProcessProxy : public RefCounted<PluginProcessProxy>, CoreIPC::Connection::Client, ProcessLauncher::Client {
+class PluginProcessProxy : public ChildProcessProxy {
public:
static PassRefPtr<PluginProcessProxy> create(PluginProcessManager*, const PluginModuleInfo&, PluginProcess::Type);
~PluginProcessProxy();
@@ -78,9 +79,6 @@
// Asks the plug-in process to clear the data for the given sites.
void clearSiteData(WebPluginSiteDataManager*, const Vector<String>& sites, uint64_t flags, uint64_t maxAgeInSeconds, uint64_t callbackID);
- // Terminates the plug-in process.
- void terminate();
-
bool isValid() const { return m_connection; }
PluginProcess::Type processType() const { return m_processType; }
@@ -102,6 +100,9 @@
private:
PluginProcessProxy(PluginProcessManager*, const PluginModuleInfo&, PluginProcess::Type);
+ virtual void getLaunchOptions(ProcessLauncher::LaunchOptions&) OVERRIDE;
+ void platformGetLaunchOptions(ProcessLauncher::LaunchOptions&, const PluginModuleInfo&);
+
void pluginProcessCrashedOrFailedToLaunch();
// CoreIPC::Connection::Client
@@ -134,7 +135,6 @@
void applicationDidBecomeActive();
#endif
- static void platformInitializeLaunchOptions(ProcessLauncher::LaunchOptions&, const PluginModuleInfo& pluginInfo);
void platformInitializePluginProcess(PluginProcessCreationParameters& parameters);
// The plug-in host process manager.
@@ -146,9 +146,6 @@
// The connection to the plug-in host process.
RefPtr<CoreIPC::Connection> m_connection;
- // The process launcher for the plug-in host process.
- RefPtr<ProcessLauncher> m_processLauncher;
-
Deque<RefPtr<Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply> > m_pendingConnectionReplies;
Vector<uint64_t> m_pendingGetSitesRequests;
Modified: trunk/Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm (142629 => 142630)
--- trunk/Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm 2013-02-12 16:45:26 UTC (rev 142629)
+++ trunk/Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm 2013-02-12 16:55:47 UTC (rev 142630)
@@ -131,7 +131,7 @@
}
#endif
-void PluginProcessProxy::platformInitializeLaunchOptions(ProcessLauncher::LaunchOptions& launchOptions, const PluginModuleInfo& pluginInfo)
+void PluginProcessProxy::platformGetLaunchOptions(ProcessLauncher::LaunchOptions& launchOptions, const PluginModuleInfo& pluginInfo)
{
launchOptions.architecture = pluginInfo.pluginArchitecture;
launchOptions.executableHeap = PluginProcessProxy::pluginNeedsExecutableHeap(pluginInfo);
@@ -162,7 +162,7 @@
bool PluginProcessProxy::getPluginProcessSerialNumber(ProcessSerialNumber& pluginProcessSerialNumber)
{
- pid_t pluginProcessPID = m_processLauncher->processIdentifier();
+ pid_t pluginProcessPID = processIdentifier();
#if COMPILER(CLANG)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.h (142629 => 142630)
--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.h 2013-02-12 16:45:26 UTC (rev 142629)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.h 2013-02-12 16:55:47 UTC (rev 142630)
@@ -58,7 +58,7 @@
class WebPageGroup;
struct WebNavigationDataStore;
-class WebProcessProxy : public ThreadSafeRefCounted<WebProcessProxy>, public ChildProcessProxy, ResponsivenessTimer::Client {
+class WebProcessProxy : public ChildProcessProxy, ResponsivenessTimer::Client {
public:
typedef HashMap<uint64_t, RefPtr<WebBackForwardListItem> > WebBackForwardListItemMap;
typedef HashMap<uint64_t, RefPtr<WebFrameProxy> > WebFrameProxyMap;