Title: [141191] trunk/Source/WebKit2
Revision
141191
Author
[email protected]
Date
2013-01-29 17:38:28 -0800 (Tue, 29 Jan 2013)

Log Message

Remove MessageID parameter from Connection::sendMessage
https://bugs.webkit.org/show_bug.cgi?id=108269

Reviewed by Sam Weinig.

* Platform/CoreIPC/Connection.cpp:
(CoreIPC::Connection::sendMessage):
(CoreIPC::Connection::sendSyncReply):
(CoreIPC::Connection::sendSyncMessage):
(CoreIPC::Connection::sendSyncMessageFromSecondaryThread):
* Platform/CoreIPC/Connection.h:
(Connection):
(CoreIPC::Connection::send):
(CoreIPC::Connection::sendSync):
* Platform/CoreIPC/MessageSender.h:
(CoreIPC::MessageSender::send):
(CoreIPC::MessageSender::sendMessage):
* Platform/CoreIPC/mac/ConnectionMac.cpp:
(CoreIPC::Connection::open):
* Shared/ChildProcessProxy.cpp:
(WebKit::ChildProcessProxy::sendMessage):
(WebKit::ChildProcessProxy::didFinishLaunching):
* Shared/WebConnection.cpp:
(WebKit::WebConnection::postMessage):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::postMessage):
(WebKit::InjectedBundle::postSynchronousMessage):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (141190 => 141191)


--- trunk/Source/WebKit2/ChangeLog	2013-01-30 01:31:37 UTC (rev 141190)
+++ trunk/Source/WebKit2/ChangeLog	2013-01-30 01:38:28 UTC (rev 141191)
@@ -1,5 +1,35 @@
 2013-01-29  Anders Carlsson  <[email protected]>
 
+        Remove MessageID parameter from Connection::sendMessage
+        https://bugs.webkit.org/show_bug.cgi?id=108269
+
+        Reviewed by Sam Weinig.
+
+        * Platform/CoreIPC/Connection.cpp:
+        (CoreIPC::Connection::sendMessage):
+        (CoreIPC::Connection::sendSyncReply):
+        (CoreIPC::Connection::sendSyncMessage):
+        (CoreIPC::Connection::sendSyncMessageFromSecondaryThread):
+        * Platform/CoreIPC/Connection.h:
+        (Connection):
+        (CoreIPC::Connection::send):
+        (CoreIPC::Connection::sendSync):
+        * Platform/CoreIPC/MessageSender.h:
+        (CoreIPC::MessageSender::send):
+        (CoreIPC::MessageSender::sendMessage):
+        * Platform/CoreIPC/mac/ConnectionMac.cpp:
+        (CoreIPC::Connection::open):
+        * Shared/ChildProcessProxy.cpp:
+        (WebKit::ChildProcessProxy::sendMessage):
+        (WebKit::ChildProcessProxy::didFinishLaunching):
+        * Shared/WebConnection.cpp:
+        (WebKit::WebConnection::postMessage):
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::postMessage):
+        (WebKit::InjectedBundle::postSynchronousMessage):
+
+2013-01-29  Anders Carlsson  <[email protected]>
+
         Stop generating the message kind enum
         https://bugs.webkit.org/show_bug.cgi?id=108258
 

Modified: trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp (141190 => 141191)


--- trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp	2013-01-30 01:31:37 UTC (rev 141190)
+++ trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp	2013-01-30 01:38:28 UTC (rev 141191)
@@ -315,7 +315,7 @@
     return encoder.release();
 }
 
-bool Connection::sendMessage(MessageID messageID, PassOwnPtr<MessageEncoder> encoder, unsigned messageSendFlags)
+bool Connection::sendMessage(PassOwnPtr<MessageEncoder> encoder, unsigned messageSendFlags)
 {
     if (!isValid())
         return false;
@@ -327,7 +327,7 @@
 
     {
         MutexLocker locker(m_outgoingMessagesLock);
-        m_outgoingMessages.append(OutgoingMessage(messageID, encoder));
+        m_outgoingMessages.append(OutgoingMessage(MessageID(), encoder));
     }
     
     // FIXME: We should add a boolean flag so we don't call this when work has already been scheduled.
@@ -337,7 +337,7 @@
 
 bool Connection::sendSyncReply(PassOwnPtr<MessageEncoder> encoder)
 {
-    return sendMessage(MessageID(), encoder);
+    return sendMessage(encoder);
 }
 
 PassOwnPtr<MessageDecoder> Connection::waitForMessage(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID, double timeout)
@@ -396,12 +396,12 @@
     return nullptr;
 }
 
-PassOwnPtr<MessageDecoder> Connection::sendSyncMessage(MessageID messageID, uint64_t syncRequestID, PassOwnPtr<MessageEncoder> encoder, double timeout, unsigned syncSendFlags)
+PassOwnPtr<MessageDecoder> Connection::sendSyncMessage(uint64_t syncRequestID, PassOwnPtr<MessageEncoder> encoder, double timeout, unsigned syncSendFlags)
 {
     if (RunLoop::current() != m_clientRunLoop) {
         // No flags are supported for synchronous messages sent from secondary threads.
         ASSERT(!syncSendFlags);
-        return sendSyncMessageFromSecondaryThread(messageID, syncRequestID, encoder, timeout);
+        return sendSyncMessageFromSecondaryThread(syncRequestID, encoder, timeout);
     }
 
     if (!isValid()) {
@@ -421,7 +421,7 @@
     }
 
     // First send the message.
-    sendMessage(messageID, encoder, DispatchMessageEvenWhenWaitingForSyncReply);
+    sendMessage(encoder, DispatchMessageEvenWhenWaitingForSyncReply);
 
     // Then wait for a reply. Waiting for a reply could involve dispatching incoming sync messages, so
     // keep an extra reference to the connection here in case it's invalidated.
@@ -441,7 +441,7 @@
     return reply.release();
 }
 
-PassOwnPtr<MessageDecoder> Connection::sendSyncMessageFromSecondaryThread(MessageID messageID, uint64_t syncRequestID, PassOwnPtr<MessageEncoder> encoder, double timeout)
+PassOwnPtr<MessageDecoder> Connection::sendSyncMessageFromSecondaryThread(uint64_t syncRequestID, PassOwnPtr<MessageEncoder> encoder, double timeout)
 {
     ASSERT(RunLoop::current() != m_clientRunLoop);
 
@@ -460,7 +460,7 @@
         m_secondaryThreadPendingSyncReplyMap.add(syncRequestID, &pendingReply);
     }
 
-    sendMessage(messageID, encoder, 0);
+    sendMessage(encoder, 0);
 
     // Use a really long timeout.
     if (timeout == NoTimeout)

Modified: trunk/Source/WebKit2/Platform/CoreIPC/Connection.h (141190 => 141191)


--- trunk/Source/WebKit2/Platform/CoreIPC/Connection.h	2013-01-30 01:31:37 UTC (rev 141190)
+++ trunk/Source/WebKit2/Platform/CoreIPC/Connection.h	2013-01-30 01:38:28 UTC (rev 141191)
@@ -180,9 +180,9 @@
     template<typename T> bool waitForAndDispatchImmediately(uint64_t destinationID, double timeout);
 
     PassOwnPtr<MessageEncoder> createSyncMessageEncoder(StringReference messageReceiverName, StringReference messageName, uint64_t destinationID, uint64_t& syncRequestID);
-    bool sendMessage(MessageID, PassOwnPtr<MessageEncoder>, unsigned messageSendFlags = 0);
-    PassOwnPtr<MessageDecoder> sendSyncMessage(MessageID, uint64_t syncRequestID, PassOwnPtr<MessageEncoder>, double timeout, unsigned syncSendFlags = 0);
-    PassOwnPtr<MessageDecoder> sendSyncMessageFromSecondaryThread(MessageID, uint64_t syncRequestID, PassOwnPtr<MessageEncoder>, double timeout);
+    bool sendMessage(PassOwnPtr<MessageEncoder>, unsigned messageSendFlags = 0);
+    PassOwnPtr<MessageDecoder> sendSyncMessage(uint64_t syncRequestID, PassOwnPtr<MessageEncoder>, double timeout, unsigned syncSendFlags = 0);
+    PassOwnPtr<MessageDecoder> sendSyncMessageFromSecondaryThread(uint64_t syncRequestID, PassOwnPtr<MessageEncoder>, double timeout);
     bool sendSyncReply(PassOwnPtr<MessageEncoder>);
 
     void wakeUpRunLoop();
@@ -405,7 +405,7 @@
     OwnPtr<MessageEncoder> encoder = MessageEncoder::create(T::receiverName(), T::name(), destinationID);
     encoder->encode(message);
     
-    return sendMessage(MessageID(), encoder.release(), messageSendFlags);
+    return sendMessage(encoder.release(), messageSendFlags);
 }
 
 template<typename T> bool Connection::sendSync(const T& message, const typename T::Reply& reply, uint64_t destinationID, double timeout, unsigned syncSendFlags)
@@ -419,7 +419,7 @@
     encoder->encode(message);
 
     // Now send the message and wait for a reply.
-    OwnPtr<MessageDecoder> replyDecoder = sendSyncMessage(MessageID(), syncRequestID, encoder.release(), timeout, syncSendFlags);
+    OwnPtr<MessageDecoder> replyDecoder = sendSyncMessage(syncRequestID, encoder.release(), timeout, syncSendFlags);
     if (!replyDecoder)
         return false;
 

Modified: trunk/Source/WebKit2/Platform/CoreIPC/MessageSender.h (141190 => 141191)


--- trunk/Source/WebKit2/Platform/CoreIPC/MessageSender.h	2013-01-30 01:31:37 UTC (rev 141190)
+++ trunk/Source/WebKit2/Platform/CoreIPC/MessageSender.h	2013-01-30 01:38:28 UTC (rev 141191)
@@ -44,15 +44,15 @@
         OwnPtr<MessageEncoder> encoder = MessageEncoder::create(U::receiverName(), U::name(), destinationID);
         encoder->encode(message);
         
-        return static_cast<T*>(this)->sendMessage(MessageID(), encoder.release());
+        return static_cast<T*>(this)->sendMessage(encoder.release());
     }
     
-    bool sendMessage(MessageID messageID, PassOwnPtr<MessageEncoder> encoder)
+    bool sendMessage(PassOwnPtr<MessageEncoder> encoder)
     {
         Connection* connection = static_cast<T*>(this)->connection();
         ASSERT(connection);
 
-        return connection->sendMessage(messageID, encoder);
+        return connection->sendMessage(encoder);
     }
 
     template<typename U> bool sendSync(const U& message, const typename U::Reply& reply, double timeout = Connection::NoTimeout)

Modified: trunk/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp (141190 => 141191)


--- trunk/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp	2013-01-30 01:31:37 UTC (rev 141190)
+++ trunk/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp	2013-01-30 01:38:28 UTC (rev 141191)
@@ -135,7 +135,7 @@
         OwnPtr<MessageEncoder> encoder = MessageEncoder::create("IPC", "InitializeConnection", 0);
         encoder->encode(MachPort(m_receivePort, MACH_MSG_TYPE_MAKE_SEND));
 
-        sendMessage(MessageID(), encoder.release());
+        sendMessage(encoder.release());
 
         // Set the dead name handler for our send port.
         initializeDeadNameSource();
@@ -156,7 +156,7 @@
         OwnPtr<MessageEncoder> encoder = MessageEncoder::create("IPC", "SetExceptionPort", 0);
         encoder->encode(MachPort(m_exceptionPort, MACH_MSG_TYPE_MAKE_SEND));
 
-        sendMessage(MessageID(), encoder.release());
+        sendMessage(encoder.release());
     }
 
     return true;

Modified: trunk/Source/WebKit2/Shared/ChildProcessProxy.cpp (141190 => 141191)


--- trunk/Source/WebKit2/Shared/ChildProcessProxy.cpp	2013-01-30 01:31:37 UTC (rev 141190)
+++ trunk/Source/WebKit2/Shared/ChildProcessProxy.cpp	2013-01-30 01:38:28 UTC (rev 141191)
@@ -88,7 +88,7 @@
     if (!m_connection)
         return false;
 
-    return connection()->sendMessage(messageID, encoder, messageSendFlags);
+    return connection()->sendMessage(encoder, messageSendFlags);
 }
 
 bool ChildProcessProxy::isLaunching() const
@@ -117,7 +117,7 @@
     for (size_t i = 0; i < m_pendingMessages.size(); ++i) {
         CoreIPC::Connection::OutgoingMessage& outgoingMessage = m_pendingMessages[i].first;
         unsigned messageSendFlags = m_pendingMessages[i].second;
-        m_connection->sendMessage(outgoingMessage.messageID(), adoptPtr(outgoingMessage.arguments()), messageSendFlags);
+        m_connection->sendMessage(adoptPtr(outgoingMessage.arguments()), messageSendFlags);
     }
 
     m_pendingMessages.clear();

Modified: trunk/Source/WebKit2/Shared/WebConnection.cpp (141190 => 141191)


--- trunk/Source/WebKit2/Shared/WebConnection.cpp	2013-01-30 01:31:37 UTC (rev 141190)
+++ trunk/Source/WebKit2/Shared/WebConnection.cpp	2013-01-30 01:38:28 UTC (rev 141191)
@@ -55,7 +55,7 @@
     encoder->encode(messageName);
     encodeMessageBody(*encoder, messageBody);
 
-    sendMessage(CoreIPC::MessageID(), encoder.release());
+    sendMessage(encoder.release());
 }
 
 void WebConnection::didClose()

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (141190 => 141191)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2013-01-30 01:31:37 UTC (rev 141190)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2013-01-30 01:38:28 UTC (rev 141191)
@@ -112,7 +112,7 @@
     encoder->encode(messageName);
     encoder->encode(InjectedBundleUserMessageEncoder(messageBody));
 
-    WebProcess::shared().connection()->sendMessage(CoreIPC::MessageID(WebContextLegacyMessage::PostMessage), encoder.release());
+    WebProcess::shared().connection()->sendMessage(encoder.release());
 }
 
 void InjectedBundle::postSynchronousMessage(const String& messageName, APIObject* messageBody, RefPtr<APIObject>& returnData)
@@ -124,7 +124,7 @@
     encoder->encode(messageName);
     encoder->encode(InjectedBundleUserMessageEncoder(messageBody));
 
-    OwnPtr<CoreIPC::MessageDecoder> replyDecoder = WebProcess::shared().connection()->sendSyncMessage(CoreIPC::MessageID(WebContextLegacyMessage::PostSynchronousMessage), syncRequestID, encoder.release(), CoreIPC::Connection::NoTimeout);
+    OwnPtr<CoreIPC::MessageDecoder> replyDecoder = WebProcess::shared().connection()->sendSyncMessage(syncRequestID, encoder.release(), CoreIPC::Connection::NoTimeout);
     if (!replyDecoder || !replyDecoder->decode(messageDecoder)) {
         returnData = nullptr;
         return;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to