summaryrefslogtreecommitdiff
path: root/Source/WebKit2/PluginProcess
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit2/PluginProcess')
-rw-r--r--Source/WebKit2/PluginProcess/PluginControllerProxy.h4
-rw-r--r--Source/WebKit2/PluginProcess/PluginProcess.cpp4
-rw-r--r--Source/WebKit2/PluginProcess/PluginProcess.h8
-rw-r--r--Source/WebKit2/PluginProcess/WebProcessConnection.cpp74
-rw-r--r--Source/WebKit2/PluginProcess/WebProcessConnection.h8
-rw-r--r--Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp8
6 files changed, 33 insertions, 73 deletions
diff --git a/Source/WebKit2/PluginProcess/PluginControllerProxy.h b/Source/WebKit2/PluginProcess/PluginControllerProxy.h
index 83dd3fb74..3c4f92a7d 100644
--- a/Source/WebKit2/PluginProcess/PluginControllerProxy.h
+++ b/Source/WebKit2/PluginProcess/PluginControllerProxy.h
@@ -61,8 +61,8 @@ public:
bool initialize(const PluginCreationParameters&);
void destroy();
- void didReceivePluginControllerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- void didReceiveSyncPluginControllerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
+ void didReceivePluginControllerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+ void didReceiveSyncPluginControllerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
bool wantsWheelEvents() const;
diff --git a/Source/WebKit2/PluginProcess/PluginProcess.cpp b/Source/WebKit2/PluginProcess/PluginProcess.cpp
index 7125d7d86..03c6f00b9 100644
--- a/Source/WebKit2/PluginProcess/PluginProcess.cpp
+++ b/Source/WebKit2/PluginProcess/PluginProcess.cpp
@@ -134,9 +134,9 @@ bool PluginProcess::shouldTerminate()
return true;
}
-void PluginProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void PluginProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- didReceivePluginProcessMessage(connection, messageID, arguments);
+ didReceivePluginProcessMessage(connection, messageID, decoder);
}
void PluginProcess::didClose(CoreIPC::Connection*)
diff --git a/Source/WebKit2/PluginProcess/PluginProcess.h b/Source/WebKit2/PluginProcess/PluginProcess.h
index 645153cee..0d855429d 100644
--- a/Source/WebKit2/PluginProcess/PluginProcess.h
+++ b/Source/WebKit2/PluginProcess/PluginProcess.h
@@ -74,12 +74,12 @@ private:
virtual bool shouldTerminate();
// CoreIPC::Connection::Client
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- virtual void didClose(CoreIPC::Connection*);
- virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
+ virtual void didClose(CoreIPC::Connection*) OVERRIDE;
+ virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID) OVERRIDE;
// Message handlers.
- void didReceivePluginProcessMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+ void didReceivePluginProcessMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
void initializePluginProcess(const PluginProcessCreationParameters&);
void createWebProcessConnection();
void getSitesWithData(uint64_t callbackID);
diff --git a/Source/WebKit2/PluginProcess/WebProcessConnection.cpp b/Source/WebKit2/PluginProcess/WebProcessConnection.cpp
index 0507d613b..21a867038 100644
--- a/Source/WebKit2/PluginProcess/WebProcessConnection.cpp
+++ b/Source/WebKit2/PluginProcess/WebProcessConnection.cpp
@@ -29,6 +29,7 @@
#if ENABLE(PLUGIN_PROCESS)
#include "ArgumentCoders.h"
+#include "ConnectionStack.h"
#include "NPRemoteObjectMap.h"
#include "PluginControllerProxy.h"
#include "PluginCreationParameters.h"
@@ -42,51 +43,6 @@ using namespace WebCore;
namespace WebKit {
-class ConnectionStack {
-public:
- CoreIPC::Connection* current()
- {
- return m_connectionStack.last();
- }
-
- class CurrentConnectionPusher {
- public:
- CurrentConnectionPusher(ConnectionStack& connectionStack, CoreIPC::Connection* connection)
- : m_connectionStack(connectionStack)
-#if !ASSERT_DISABLED
- , m_connection(connection)
-#endif
- {
- m_connectionStack.m_connectionStack.append(connection);
- }
-
- ~CurrentConnectionPusher()
- {
- ASSERT(m_connectionStack.current() == m_connection);
- m_connectionStack.m_connectionStack.removeLast();
- }
-
- private:
- ConnectionStack& m_connectionStack;
-#if !ASSERT_DISABLED
- CoreIPC::Connection* m_connection;
-#endif
- };
-
-private:
- // It's OK for these to be weak pointers because we only push object on the stack
- // from within didReceiveMessage and didReceiveSyncMessage and the Connection objects are
- // already ref'd for the duration of those functions.
- Vector<CoreIPC::Connection*, 4> m_connectionStack;
-};
-
-static ConnectionStack& connectionStack()
-{
- DEFINE_STATIC_LOCAL(ConnectionStack, connectionStack, ());
-
- return connectionStack;
-}
-
PassRefPtr<WebProcessConnection> WebProcessConnection::create(CoreIPC::Connection::Identifier connectionIdentifier)
{
return adoptRef(new WebProcessConnection(connectionIdentifier));
@@ -151,57 +107,57 @@ void WebProcessConnection::removePluginControllerProxy(PluginControllerProxy* pl
void WebProcessConnection::setGlobalException(const String& exceptionString)
{
- CoreIPC::Connection* connection = connectionStack().current();
+ CoreIPC::Connection* connection = ConnectionStack::shared().current();
if (!connection)
return;
connection->sendSync(Messages::PluginProcessConnection::SetException(exceptionString), Messages::PluginProcessConnection::SetException::Reply(), 0);
}
-void WebProcessConnection::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+void WebProcessConnection::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
{
- ConnectionStack::CurrentConnectionPusher currentConnection(connectionStack(), connection);
+ ConnectionStack::CurrentConnectionPusher currentConnection(ConnectionStack::shared(), connection);
if (messageID.is<CoreIPC::MessageClassWebProcessConnection>()) {
- didReceiveWebProcessConnectionMessage(connection, messageID, arguments);
+ didReceiveWebProcessConnectionMessage(connection, messageID, decoder);
return;
}
- if (!arguments->destinationID()) {
+ if (!decoder.destinationID()) {
ASSERT_NOT_REACHED();
return;
}
- PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(arguments->destinationID());
+ PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(decoder.destinationID());
if (!pluginControllerProxy)
return;
PluginController::PluginDestructionProtector protector(pluginControllerProxy->asPluginController());
- pluginControllerProxy->didReceivePluginControllerProxyMessage(connection, messageID, arguments);
+ pluginControllerProxy->didReceivePluginControllerProxyMessage(connection, messageID, decoder);
}
-void WebProcessConnection::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply)
+void WebProcessConnection::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, OwnPtr<CoreIPC::MessageEncoder>& replyEncoder)
{
- ConnectionStack::CurrentConnectionPusher currentConnection(connectionStack(), connection);
+ ConnectionStack::CurrentConnectionPusher currentConnection(ConnectionStack::shared(), connection);
- uint64_t destinationID = arguments->destinationID();
+ uint64_t destinationID = decoder.destinationID();
if (!destinationID) {
- didReceiveSyncWebProcessConnectionMessage(connection, messageID, arguments, reply);
+ didReceiveSyncWebProcessConnectionMessage(connection, messageID, decoder, replyEncoder);
return;
}
if (messageID.is<CoreIPC::MessageClassNPObjectMessageReceiver>()) {
- m_npRemoteObjectMap->didReceiveSyncMessage(connection, messageID, arguments, reply);
+ m_npRemoteObjectMap->didReceiveSyncMessage(connection, messageID, decoder, replyEncoder);
return;
}
- PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(arguments->destinationID());
+ PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(decoder.destinationID());
if (!pluginControllerProxy)
return;
PluginController::PluginDestructionProtector protector(pluginControllerProxy->asPluginController());
- pluginControllerProxy->didReceiveSyncPluginControllerProxyMessage(connection, messageID, arguments, reply);
+ pluginControllerProxy->didReceiveSyncPluginControllerProxyMessage(connection, messageID, decoder, replyEncoder);
}
void WebProcessConnection::didClose(CoreIPC::Connection*)
diff --git a/Source/WebKit2/PluginProcess/WebProcessConnection.h b/Source/WebKit2/PluginProcess/WebProcessConnection.h
index 8296b5470..8a15c9c2b 100644
--- a/Source/WebKit2/PluginProcess/WebProcessConnection.h
+++ b/Source/WebKit2/PluginProcess/WebProcessConnection.h
@@ -62,14 +62,14 @@ private:
void destroyPluginControllerProxy(PluginControllerProxy*);
// CoreIPC::Connection::Client
- virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
+ virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
+ virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&) OVERRIDE;
virtual void didClose(CoreIPC::Connection*);
virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
// Message handlers.
- void didReceiveWebProcessConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
- void didReceiveSyncWebProcessConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
+ void didReceiveWebProcessConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+ void didReceiveSyncWebProcessConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
void createPlugin(const PluginCreationParameters&, PassRefPtr<Messages::WebProcessConnection::CreatePlugin::DelayedReply>);
void createPluginAsynchronously(const PluginCreationParameters&);
void destroyPlugin(uint64_t pluginInstanceID, bool asynchronousCreationIncomplete);
diff --git a/Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp b/Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp
index 4113d3dfa..e25f0674e 100644
--- a/Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp
+++ b/Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp
@@ -28,6 +28,8 @@
#include "config.h"
#include "PluginProcessMainUnix.h"
+#if ENABLE(PLUGIN_PROCESS)
+
#include "Logging.h"
#include "NetscapePlugin.h"
#include "PluginProcess.h"
@@ -71,9 +73,9 @@ static int webkitXError(Display* xdisplay, XErrorEvent* error)
WK_EXPORT int PluginProcessMainUnix(int argc, char* argv[])
{
- ASSERT(argc == 2 || argc == 3);
+ ASSERT_UNUSED(argc, argc == 2 || argc == 3);
bool scanPlugin = !strcmp(argv[1], "-scanPlugin");
- ASSERT(argc == 2 || (argc == 3 && scanPlugin));
+ ASSERT_UNUSED(argc, argc == 2 || (argc == 3 && scanPlugin));
#if PLATFORM(GTK)
gtk_init(&argc, &argv);
@@ -111,3 +113,5 @@ WK_EXPORT int PluginProcessMainUnix(int argc, char* argv[])
}
} // namespace WebKit
+
+#endif