[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
andersca at apple.com
andersca at apple.com
Wed Dec 22 15:13:03 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 1854436b4d0473e7c4e684aa102f1a5321a2c2cc
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Oct 29 01:29:35 2010 +0000
Move code to dispatch a sync message out into a separate function
https://bugs.webkit.org/show_bug.cgi?id=48605
Reviewed by Adam Roben.
* Platform/CoreIPC/Connection.cpp:
(CoreIPC::Connection::dispatchSyncMessage):
Factor code out from dispatchMessage. Handle receiving a message with an invalid reply ID.
(CoreIPC::Connection::dispatchMessages):
Call dispatchSyncMessage.
* Platform/CoreIPC/Connection.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70833 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 4846654..204a00f 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,5 +1,21 @@
2010-10-28 Anders Carlsson <andersca at apple.com>
+ Reviewed by Adam Roben.
+
+ Move code to dispatch a sync message out into a separate function
+ https://bugs.webkit.org/show_bug.cgi?id=48605
+
+ * Platform/CoreIPC/Connection.cpp:
+ (CoreIPC::Connection::dispatchSyncMessage):
+ Factor code out from dispatchMessage. Handle receiving a message with an invalid reply ID.
+
+ (CoreIPC::Connection::dispatchMessages):
+ Call dispatchSyncMessage.
+
+ * Platform/CoreIPC/Connection.h:
+
+2010-10-28 Anders Carlsson <andersca at apple.com>
+
Reviewed by Darin Adler.
Add NPObjectMessageReceiver class.
diff --git a/WebKit2/Platform/CoreIPC/Connection.cpp b/WebKit2/Platform/CoreIPC/Connection.cpp
index 1fefa7e..c678d17 100644
--- a/WebKit2/Platform/CoreIPC/Connection.cpp
+++ b/WebKit2/Platform/CoreIPC/Connection.cpp
@@ -312,6 +312,38 @@ void Connection::sendOutgoingMessages()
}
}
+void Connection::dispatchSyncMessage(MessageID messageID, ArgumentDecoder* arguments)
+{
+ ASSERT(messageID.isSync());
+
+ // Decode the sync request ID.
+ uint64_t syncRequestID = 0;
+
+ if (!arguments->decodeUInt64(syncRequestID) || !syncRequestID) {
+ // We received an invalid sync message.
+ arguments->markInvalid();
+ return;
+ }
+
+ // Create our reply encoder.
+ ArgumentEncoder* replyEncoder = new ArgumentEncoder(syncRequestID);
+
+ // Hand off both the decoder and encoder to the client..
+ SyncReplyMode syncReplyMode = m_client->didReceiveSyncMessage(this, messageID, arguments, replyEncoder);
+
+ // FIXME: If the message was invalid, we should send back a SyncMessageError.
+ ASSERT(!arguments->isInvalid());
+
+ if (syncReplyMode == ManualReply) {
+ // The client will take ownership of the reply encoder and send it at some point in the future.
+ // We won't do anything here.
+ return;
+ }
+
+ // Send the reply.
+ sendSyncReply(replyEncoder);
+}
+
void Connection::dispatchMessages()
{
Vector<IncomingMessage> incomingMessages;
@@ -330,32 +362,9 @@ void Connection::dispatchMessages()
IncomingMessage& message = incomingMessages[i];
OwnPtr<ArgumentDecoder> arguments = message.releaseArguments();
- if (message.messageID().isSync()) {
- // Decode the sync request ID.
- uint64_t syncRequestID = 0;
-
- if (!arguments->decodeUInt64(syncRequestID)) {
- // FIXME: Handle this case.
- ASSERT_NOT_REACHED();
- }
-
- // Create our reply encoder.
- ArgumentEncoder* replyEncoder = new ArgumentEncoder(syncRequestID);
-
- // Hand off both the decoder and encoder to the client..
- SyncReplyMode syncReplyMode = m_client->didReceiveSyncMessage(this, message.messageID(), arguments.get(), replyEncoder);
-
- // FIXME: If the message was invalid, we should send back a SyncMessageError.
- ASSERT(!arguments->isInvalid());
-
- if (syncReplyMode == AutomaticReply) {
- // Send the reply.
- sendSyncReply(replyEncoder);
- } else {
- // The client will take ownership of the reply encoder and send it at some point in the future.
- // We won't do anything here.
- }
- } else
+ if (message.messageID().isSync())
+ dispatchSyncMessage(message.messageID(), arguments.get());
+ else
m_client->didReceiveMessage(this, message.messageID(), arguments.get());
if (arguments->isInvalid())
diff --git a/WebKit2/Platform/CoreIPC/Connection.h b/WebKit2/Platform/CoreIPC/Connection.h
index e514452..eeec26f 100644
--- a/WebKit2/Platform/CoreIPC/Connection.h
+++ b/WebKit2/Platform/CoreIPC/Connection.h
@@ -168,7 +168,8 @@ private:
// Called on the listener thread.
void dispatchConnectionDidClose();
void dispatchMessages();
-
+ void dispatchSyncMessage(MessageID, ArgumentDecoder*);
+
Client* m_client;
bool m_isServer;
uint64_t m_syncRequestID;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list