summaryrefslogtreecommitdiff
path: root/Source/WebKit2/PluginProcess/WebProcessConnection.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-10-22 15:40:17 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-10-22 15:40:17 +0200
commit43a42f108af6bcbd91f2672731c3047c26213af1 (patch)
tree7fa092e5f5d873c72f2486a70e26be26f7a38bec /Source/WebKit2/PluginProcess/WebProcessConnection.cpp
parentd9cf437c840c6eb7417bdd97e6c40979255d3158 (diff)
downloadqtwebkit-43a42f108af6bcbd91f2672731c3047c26213af1.tar.gz
Imported WebKit commit 302e7806bff028bd1167a1ec7c86a1ee00ecfb49 (http://svn.webkit.org/repository/webkit/trunk@132067)
New snapshot that fixes build without QtWidgets
Diffstat (limited to 'Source/WebKit2/PluginProcess/WebProcessConnection.cpp')
-rw-r--r--Source/WebKit2/PluginProcess/WebProcessConnection.cpp74
1 files changed, 15 insertions, 59 deletions
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*)