Title: [117092] branches/safari-536-branch/Source/WebKit2

Diff

Modified: branches/safari-536-branch/Source/WebKit2/ChangeLog (117091 => 117092)


--- branches/safari-536-branch/Source/WebKit2/ChangeLog	2012-05-15 17:41:34 UTC (rev 117091)
+++ branches/safari-536-branch/Source/WebKit2/ChangeLog	2012-05-15 17:47:43 UTC (rev 117092)
@@ -1,3 +1,31 @@
+2012-05-15  Lucas Forschler  <[email protected]>
+
+    Merge 116226
+
+    2012-05-04  Jon Lee  <[email protected]>
+
+            [WK2] Incoming events may be processed out-of-order
+            https://bugs.webkit.org/show_bug.cgi?id=85696
+            <rdar://problem/11386129>
+
+            Reviewed by Maciej Stachowiak.
+
+            All messages go to a single queue that gets iterated over by dispatchMessages(). If an input
+            event arrives in the middle of a flood of messages, all of them will be dispatched before the
+            input event is dispatched.
+
+            In other words, the first dispatchMessages() call will process all of the messages in the queue,
+            and all subsequent dispatchMessages() calls will act as no-ops, since there is nothing in the queue.
+
+            To fix this, we rename dispatchMessages to dispatchOneMessage, and only process one message at a
+            time.
+
+            * Platform/CoreIPC/Connection.h: Rename dispatchMessages() to dispatchOneMessage().
+            * Platform/CoreIPC/Connection.cpp:
+            (CoreIPC::Connection::enqueueIncomingMessage): Dispatch a call to dispatchOneMessage() on the
+            run loop.
+            (CoreIPC::Connection::dispatchOneMessage): Remove the while(true) loop.
+
 2012-05-04  Gustavo Noronha Silva  <[email protected]>
 
         [GTK] Simplify how libWebCoreModules is linked in, and fix WebKit2 build

Modified: branches/safari-536-branch/Source/WebKit2/Platform/CoreIPC/Connection.cpp (117091 => 117092)


--- branches/safari-536-branch/Source/WebKit2/Platform/CoreIPC/Connection.cpp	2012-05-15 17:41:34 UTC (rev 117091)
+++ branches/safari-536-branch/Source/WebKit2/Platform/CoreIPC/Connection.cpp	2012-05-15 17:47:43 UTC (rev 117092)
@@ -666,7 +666,7 @@
     MutexLocker locker(m_incomingMessagesLock);
     m_incomingMessages.append(incomingMessage);
 
-    m_clientRunLoop->dispatch(bind(&Connection::dispatchMessages, this));
+    m_clientRunLoop->dispatch(bind(&Connection::dispatchOneMessage, this));
 }
 
 void Connection::dispatchMessage(IncomingMessage& message)
@@ -703,21 +703,19 @@
     m_didReceiveInvalidMessage = oldDidReceiveInvalidMessage;
 }
 
-void Connection::dispatchMessages()
+void Connection::dispatchOneMessage()
 {
-    while (true) {
-        IncomingMessage incomingMessage;
+    IncomingMessage incomingMessage;
 
-        {
-            MutexLocker locker(m_incomingMessagesLock);
-            if (m_incomingMessages.isEmpty())
-                break;
+    {
+        MutexLocker locker(m_incomingMessagesLock);
+        if (m_incomingMessages.isEmpty())
+            return;
 
-            incomingMessage = m_incomingMessages.takeFirst();
-        }
-
-        dispatchMessage(incomingMessage);
+        incomingMessage = m_incomingMessages.takeFirst();
     }
+
+    dispatchMessage(incomingMessage);
 }
 
 } // namespace CoreIPC

Modified: branches/safari-536-branch/Source/WebKit2/Platform/CoreIPC/Connection.h (117091 => 117092)


--- branches/safari-536-branch/Source/WebKit2/Platform/CoreIPC/Connection.h	2012-05-15 17:41:34 UTC (rev 117091)
+++ branches/safari-536-branch/Source/WebKit2/Platform/CoreIPC/Connection.h	2012-05-15 17:47:43 UTC (rev 117092)
@@ -238,7 +238,7 @@
     // Called on the listener thread.
     void dispatchConnectionDidClose();
     void dispatchMessage(IncomingMessage&);
-    void dispatchMessages();
+    void dispatchOneMessage();
     void dispatchSyncMessage(MessageID, ArgumentDecoder*);
     void didFailToSendSyncMessage();
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to