diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-15 16:08:57 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-15 16:08:57 +0200 |
commit | 5466563f4b5b6b86523e3f89bb7f77e5b5270c78 (patch) | |
tree | 8caccf7cd03a15207cde3ba282c88bf132482a91 /Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp | |
parent | 33b26980cb24288b5a9f2590ccf32a949281bb79 (diff) | |
download | qtwebkit-5466563f4b5b6b86523e3f89bb7f77e5b5270c78.tar.gz |
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
Diffstat (limited to 'Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp')
-rw-r--r-- | Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp | 44 |
1 files changed, 12 insertions, 32 deletions
diff --git a/Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp b/Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp index dbf12ccf0..86ba91c08 100644 --- a/Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp +++ b/Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp @@ -40,8 +40,8 @@ PassRefPtr<WebConnectionToWebProcess> WebConnectionToWebProcess::create(WebProce } WebConnectionToWebProcess::WebConnectionToWebProcess(WebProcessProxy* process, CoreIPC::Connection::Identifier connectionIdentifier, RunLoop* runLoop) - : m_process(process) - , m_connection(CoreIPC::Connection::createServerConnection(connectionIdentifier, this, runLoop)) + : WebConnection(CoreIPC::Connection::createServerConnection(connectionIdentifier, this, runLoop)) + , m_process(process) { #if OS(DARWIN) m_connection->setShouldCloseConnectionOnMachExceptions(); @@ -50,42 +50,27 @@ WebConnectionToWebProcess::WebConnectionToWebProcess(WebProcessProxy* process, C #endif } -void WebConnectionToWebProcess::invalidate() +// WebConnection + +void WebConnectionToWebProcess::encodeMessageBody(CoreIPC::ArgumentEncoder* argumentEncoder, APIObject* messageBody) { - m_connection->invalidate(); - m_connection = nullptr; - m_process = 0; + argumentEncoder->encode(WebContextUserMessageEncoder(messageBody)); } -// WebConnection - -void WebConnectionToWebProcess::postMessage(const String& messageName, APIObject* messageBody) +bool WebConnectionToWebProcess::decodeMessageBody(CoreIPC::ArgumentDecoder* argumentDecoder, RefPtr<APIObject>& messageBody) { - // We need to check if we have an underlying process here since a user of the API can hold - // onto us and call postMessage even after the process has been invalidated. - if (!m_process) - return; + if (!argumentDecoder->decode(WebContextUserMessageDecoder(messageBody, m_process))) + return false; - m_process->deprecatedSend(WebConnectionLegacyMessage::PostMessage, 0, CoreIPC::In(messageName, WebContextUserMessageEncoder(messageBody))); + return true; } // CoreIPC::Connection::Client void WebConnectionToWebProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments) { - if (messageID.is<CoreIPC::MessageClassWebConnectionLegacy>()) { - switch (messageID.get<WebConnectionLegacyMessage::Kind>()) { - case WebConnectionLegacyMessage::PostMessage: { - String messageName; - RefPtr<APIObject> messageBody; - WebContextUserMessageDecoder messageDecoder(messageBody, m_process); - if (!arguments->decode(CoreIPC::Out(messageName, messageDecoder))) - return; - - forwardDidReceiveMessageToClient(messageName, messageBody.get()); - return; - } - } + if (messageID.is<CoreIPC::MessageClassWebConnection>()) { + didReceiveWebConnectionMessage(connection, messageID, arguments); return; } @@ -124,11 +109,6 @@ void WebConnectionToWebProcess::didReceiveInvalidMessage(CoreIPC::Connection* co m_client.didClose(this); } -void WebConnectionToWebProcess::syncMessageSendTimedOut(CoreIPC::Connection* connection) -{ - m_process->syncMessageSendTimedOut(connection); -} - #if PLATFORM(WIN) Vector<HWND> WebConnectionToWebProcess::windowsToReceiveSentMessagesWhileWaitingForSyncReply() { |