Title: [141432] trunk/Source/WebKit2
Revision
141432
Author
[email protected]
Date
2013-01-31 10:18:55 -0800 (Thu, 31 Jan 2013)

Log Message

Stop using OutgoingMessage
https://bugs.webkit.org/show_bug.cgi?id=108495

Reviewed by Sam Weinig.

* Platform/CoreIPC/Connection.cpp:
(CoreIPC::Connection::sendMessage):
(CoreIPC::Connection::sendOutgoingMessages):
* Platform/CoreIPC/Connection.h:
(Connection):
* Shared/ChildProcessProxy.cpp:
(WebKit::ChildProcessProxy::~ChildProcessProxy):
(WebKit::ChildProcessProxy::sendMessage):
(WebKit::ChildProcessProxy::didFinishLaunching):
* Shared/ChildProcessProxy.h:
(ChildProcessProxy):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (141431 => 141432)


--- trunk/Source/WebKit2/ChangeLog	2013-01-31 18:12:23 UTC (rev 141431)
+++ trunk/Source/WebKit2/ChangeLog	2013-01-31 18:18:55 UTC (rev 141432)
@@ -1,3 +1,22 @@
+2013-01-31  Anders Carlsson  <[email protected]>
+
+        Stop using OutgoingMessage
+        https://bugs.webkit.org/show_bug.cgi?id=108495
+
+        Reviewed by Sam Weinig.
+
+        * Platform/CoreIPC/Connection.cpp:
+        (CoreIPC::Connection::sendMessage):
+        (CoreIPC::Connection::sendOutgoingMessages):
+        * Platform/CoreIPC/Connection.h:
+        (Connection):
+        * Shared/ChildProcessProxy.cpp:
+        (WebKit::ChildProcessProxy::~ChildProcessProxy):
+        (WebKit::ChildProcessProxy::sendMessage):
+        (WebKit::ChildProcessProxy::didFinishLaunching):
+        * Shared/ChildProcessProxy.h:
+        (ChildProcessProxy):
+
 2013-01-31  Simon Hausmann  <[email protected]>
 
         [Qt] Make it possible to compile WebKit2 Qt related files without access to internal WK2 C++ API

Modified: trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp (141431 => 141432)


--- trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp	2013-01-31 18:12:23 UTC (rev 141431)
+++ trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp	2013-01-31 18:18:55 UTC (rev 141432)
@@ -327,7 +327,7 @@
 
     {
         MutexLocker locker(m_outgoingMessagesLock);
-        m_outgoingMessages.append(OutgoingMessage(MessageID(), encoder));
+        m_outgoingMessages.append(encoder);
     }
     
     // FIXME: We should add a boolean flag so we don't call this when work has already been scheduled.
@@ -669,7 +669,7 @@
         return;
 
     while (true) {
-        OutgoingMessage message;
+        OwnPtr<MessageEncoder> message;
         {
             MutexLocker locker(m_outgoingMessagesLock);
             if (m_outgoingMessages.isEmpty())
@@ -677,7 +677,7 @@
             message = m_outgoingMessages.takeFirst();
         }
 
-        if (!sendOutgoingMessage(message.messageID(), adoptPtr(message.arguments())))
+        if (!sendOutgoingMessage(MessageID(), message.release()))
             break;
     }
 }

Modified: trunk/Source/WebKit2/Platform/CoreIPC/Connection.h (141431 => 141432)


--- trunk/Source/WebKit2/Platform/CoreIPC/Connection.h	2013-01-31 18:12:23 UTC (rev 141431)
+++ trunk/Source/WebKit2/Platform/CoreIPC/Connection.h	2013-01-31 18:18:55 UTC (rev 141432)
@@ -228,10 +228,6 @@
         T* m_arguments;
     };
 
-public:
-    typedef Message<MessageEncoder> OutgoingMessage;
-
-private:
     Connection(Identifier, bool isServer, Client*, WebCore::RunLoop* clientRunLoop);
     void platformInitialize(Identifier);
     void platformInvalidate();
@@ -292,7 +288,7 @@
 
     // Outgoing messages.
     Mutex m_outgoingMessagesLock;
-    Deque<OutgoingMessage> m_outgoingMessages;
+    Deque<OwnPtr<MessageEncoder>> m_outgoingMessages;
     
     ThreadCondition m_waitForMessageCondition;
     Mutex m_waitForMessageMutex;

Modified: trunk/Source/WebKit2/Shared/ChildProcessProxy.cpp (141431 => 141432)


--- trunk/Source/WebKit2/Shared/ChildProcessProxy.cpp	2013-01-31 18:12:23 UTC (rev 141431)
+++ trunk/Source/WebKit2/Shared/ChildProcessProxy.cpp	2013-01-31 18:18:55 UTC (rev 141432)
@@ -42,9 +42,6 @@
     if (m_connection)
         m_connection->invalidate();
 
-    for (size_t i = 0; i < m_pendingMessages.size(); ++i)
-        m_pendingMessages[i].first.releaseArguments();
-
     if (m_processLauncher) {
         m_processLauncher->invalidate();
         m_processLauncher = 0;
@@ -80,7 +77,7 @@
     // If we're waiting for the web process to launch, we need to stash away the messages so we can send them once we have
     // a CoreIPC connection.
     if (isLaunching()) {
-        m_pendingMessages.append(std::make_pair(CoreIPC::Connection::OutgoingMessage(CoreIPC::MessageID(), encoder), messageSendFlags));
+        m_pendingMessages.append(std::make_pair(encoder, messageSendFlags));
         return true;
     }
 
@@ -115,9 +112,9 @@
     m_connection->open();
 
     for (size_t i = 0; i < m_pendingMessages.size(); ++i) {
-        CoreIPC::Connection::OutgoingMessage& outgoingMessage = m_pendingMessages[i].first;
+        OwnPtr<CoreIPC::MessageEncoder> message = m_pendingMessages[i].first.release();
         unsigned messageSendFlags = m_pendingMessages[i].second;
-        m_connection->sendMessage(adoptPtr(outgoingMessage.arguments()), messageSendFlags);
+        m_connection->sendMessage(message.release(), messageSendFlags);
     }
 
     m_pendingMessages.clear();

Modified: trunk/Source/WebKit2/Shared/ChildProcessProxy.h (141431 => 141432)


--- trunk/Source/WebKit2/Shared/ChildProcessProxy.h	2013-01-31 18:12:23 UTC (rev 141431)
+++ trunk/Source/WebKit2/Shared/ChildProcessProxy.h	2013-01-31 18:18:55 UTC (rev 141432)
@@ -70,7 +70,7 @@
 
     bool sendMessage(PassOwnPtr<CoreIPC::MessageEncoder>, unsigned messageSendFlags);
 
-    Vector<std::pair<CoreIPC::Connection::OutgoingMessage, unsigned> > m_pendingMessages;
+    Vector<std::pair<OwnPtr<CoreIPC::MessageEncoder>, unsigned>> m_pendingMessages;
     RefPtr<ProcessLauncher> m_processLauncher;
     RefPtr<CoreIPC::Connection> m_connection;
     CoreIPC::Connection::QueueClient* m_queueClient;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to