From 5466563f4b5b6b86523e3f89bb7f77e5b5270c78 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 15 Oct 2012 16:08:57 +0200 Subject: Imported WebKit commit 0dc6cd75e1d4836eaffbb520be96fac4847cc9d2 (http://svn.webkit.org/repository/webkit/trunk@131300) WebKit update which introduces the QtWebKitWidgets module that contains the WK1 widgets based API. (In fact it renames QtWebKit to QtWebKitWidgets while we're working on completing the entire split as part of https://bugs.webkit.org/show_bug.cgi?id=99314 --- .../WebProcess/WebConnectionToUIProcess.cpp | 42 +++++++--------------- 1 file changed, 12 insertions(+), 30 deletions(-) (limited to 'Source/WebKit2/WebProcess/WebConnectionToUIProcess.cpp') diff --git a/Source/WebKit2/WebProcess/WebConnectionToUIProcess.cpp b/Source/WebKit2/WebProcess/WebConnectionToUIProcess.cpp index 5e7955d67..5e152ee98 100644 --- a/Source/WebKit2/WebProcess/WebConnectionToUIProcess.cpp +++ b/Source/WebKit2/WebProcess/WebConnectionToUIProcess.cpp @@ -40,47 +40,34 @@ PassRefPtr WebConnectionToUIProcess::create(WebProcess } WebConnectionToUIProcess::WebConnectionToUIProcess(WebProcess* process, CoreIPC::Connection::Identifier connectionIdentifier, RunLoop* runLoop) - : m_process(process) - , m_connection(CoreIPC::Connection::createClientConnection(connectionIdentifier, this, runLoop)) + : WebConnection(CoreIPC::Connection::createClientConnection(connectionIdentifier, this, runLoop)) + , m_process(process) { m_connection->setDidCloseOnConnectionWorkQueueCallback(ChildProcess::didCloseOnConnectionWorkQueue); m_connection->setShouldExitOnSyncMessageSendFailure(true); } -void WebConnectionToUIProcess::invalidate() +// WebConnection + +void WebConnectionToUIProcess::encodeMessageBody(CoreIPC::ArgumentEncoder* argumentEncoder, APIObject* messageBody) { - m_connection->invalidate(); - m_connection = nullptr; - m_process = 0; + argumentEncoder->encode(InjectedBundleUserMessageEncoder(messageBody)); } -// WebConnection - -void WebConnectionToUIProcess::postMessage(const String& messageName, APIObject* messageBody) +bool WebConnectionToUIProcess::decodeMessageBody(CoreIPC::ArgumentDecoder* argumentDecoder, RefPtr& messageBody) { - if (!m_process) - return; + if (!argumentDecoder->decode(InjectedBundleUserMessageDecoder(messageBody))) + return false; - m_connection->deprecatedSend(WebConnectionLegacyMessage::PostMessage, 0, CoreIPC::In(messageName, InjectedBundleUserMessageEncoder(messageBody))); + return true; } // CoreIPC::Connection::Client void WebConnectionToUIProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments) { - if (messageID.is()) { - switch (messageID.get()) { - case WebConnectionLegacyMessage::PostMessage: { - String messageName; - RefPtr messageBody; - InjectedBundleUserMessageDecoder messageDecoder(messageBody); - if (!arguments->decode(CoreIPC::Out(messageName, messageDecoder))) - return; - - forwardDidReceiveMessageToClient(messageName, messageBody.get()); - return; - } - } + if (messageID.is()) { + didReceiveWebConnectionMessage(connection, messageID, arguments); return; } @@ -102,11 +89,6 @@ void WebConnectionToUIProcess::didReceiveInvalidMessage(CoreIPC::Connection* con m_process->didReceiveInvalidMessage(connection, messageID); } -void WebConnectionToUIProcess::syncMessageSendTimedOut(CoreIPC::Connection* connection) -{ - m_process->syncMessageSendTimedOut(connection); -} - #if PLATFORM(WIN) Vector WebConnectionToUIProcess::windowsToReceiveSentMessagesWhileWaitingForSyncReply() { -- cgit v1.2.1