Changeset 116226 in webkit
- Timestamp:
- May 5, 2012 12:38:46 PM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r116205 r116226 1 2012-05-04 Jon Lee <jonlee@apple.com> 2 3 [WK2] Incoming events may be processed out-of-order 4 https://bugs.webkit.org/show_bug.cgi?id=85696 5 <rdar://problem/11386129> 6 7 Reviewed by Maciej Stachowiak. 8 9 All messages go to a single queue that gets iterated over by dispatchMessages(). If an input 10 event arrives in the middle of a flood of messages, all of them will be dispatched before the 11 input event is dispatched. 12 13 In other words, the first dispatchMessages() call will process all of the messages in the queue, 14 and all subsequent dispatchMessages() calls will act as no-ops, since there is nothing in the queue. 15 16 To fix this, we rename dispatchMessages to dispatchOneMessage, and only process one message at a 17 time. 18 19 * Platform/CoreIPC/Connection.h: Rename dispatchMessages() to dispatchOneMessage(). 20 * Platform/CoreIPC/Connection.cpp: 21 (CoreIPC::Connection::enqueueIncomingMessage): Dispatch a call to dispatchOneMessage() on the 22 run loop. 23 (CoreIPC::Connection::dispatchOneMessage): Remove the while(true) loop. 24 1 25 2012-05-04 Gustavo Noronha Silva <gns@gnome.org> 2 26 -
trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp
r112555 r116226 667 667 m_incomingMessages.append(incomingMessage); 668 668 669 m_clientRunLoop->dispatch(bind(&Connection::dispatch Messages, this));669 m_clientRunLoop->dispatch(bind(&Connection::dispatchOneMessage, this)); 670 670 } 671 671 … … 704 704 } 705 705 706 void Connection::dispatchMessages() 707 { 708 while (true) { 709 IncomingMessage incomingMessage; 710 711 { 712 MutexLocker locker(m_incomingMessagesLock); 713 if (m_incomingMessages.isEmpty()) 714 break; 715 716 incomingMessage = m_incomingMessages.takeFirst(); 717 } 718 719 dispatchMessage(incomingMessage); 720 } 706 void Connection::dispatchOneMessage() 707 { 708 IncomingMessage incomingMessage; 709 710 { 711 MutexLocker locker(m_incomingMessagesLock); 712 if (m_incomingMessages.isEmpty()) 713 return; 714 715 incomingMessage = m_incomingMessages.takeFirst(); 716 } 717 718 dispatchMessage(incomingMessage); 721 719 } 722 720 -
trunk/Source/WebKit2/Platform/CoreIPC/Connection.h
r112353 r116226 239 239 void dispatchConnectionDidClose(); 240 240 void dispatchMessage(IncomingMessage&); 241 void dispatch Messages();241 void dispatchOneMessage(); 242 242 void dispatchSyncMessage(MessageID, ArgumentDecoder*); 243 243 void didFailToSendSyncMessage();
Note: See TracChangeset
for help on using the changeset viewer.