Changeset 182980 in webkit


Ignore:
Timestamp:
Apr 17, 2015, 6:04:24 PM (10 years ago)
Author:
timothy_horton@apple.com
Message:

Clients sometimes block for 500ms in waitForPossibleGeometryUpdates
https://bugs.webkit.org/show_bug.cgi?id=143901
<rdar://problem/20488655>

Reviewed by Anders Carlsson.

  • Platform/IPC/Connection.cpp:

(IPC::Connection::waitForMessage):
InterruptWaitingIfSyncMessageArrives already cancels waitForMessage if
a sync message arrives while waiting, but it should also avoid waiting
if there's a sync message already in the queue when the waiting starts,
as that will have the same nasty effect.

  • UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:

(WebKit::TiledCoreAnimationDrawingAreaProxy::waitForPossibleGeometryUpdate):
If a synchronous message comes in from the Web process while we're waiting,
cancel our synchronous wait for DidUpdateGeometry. This will cause the size
change to not synchronize with the Web process' painting, but that is better
than pointlessly blocking for 500ms.

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r182979 r182980  
     12015-04-17  Tim Horton  <timothy_horton@apple.com>
     2
     3        Clients sometimes block for 500ms in waitForPossibleGeometryUpdates
     4        https://bugs.webkit.org/show_bug.cgi?id=143901
     5        <rdar://problem/20488655>
     6
     7        Reviewed by Anders Carlsson.
     8
     9        * Platform/IPC/Connection.cpp:
     10        (IPC::Connection::waitForMessage):
     11        InterruptWaitingIfSyncMessageArrives already cancels waitForMessage if
     12        a sync message arrives while waiting, but it should also avoid waiting
     13        if there's a sync message already in the queue when the waiting starts,
     14        as that will have the same nasty effect.
     15
     16        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
     17        (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForPossibleGeometryUpdate):
     18        If a synchronous message comes in from the Web process while we're waiting,
     19        cancel our synchronous wait for DidUpdateGeometry. This will cause the size
     20        change to not synchronize with the Web process' painting, but that is better
     21        than pointlessly blocking for 500ms.
     22
    1232015-04-17  Chris Dumez  <cdumez@apple.com>
    224
  • trunk/Source/WebKit2/Platform/IPC/Connection.cpp

    r182028 r182980  
    419419    ASSERT(&m_clientRunLoop == &RunLoop::current());
    420420
     421    bool hasIncomingSynchronousMessage = false;
     422
    421423    // First, check if this message is already in the incoming messages queue.
    422424    {
     
    432434                return returnedMessage;
    433435            }
     436
     437            if (message->isSyncMessage())
     438                hasIncomingSynchronousMessage = true;
    434439        }
     440    }
     441
     442    // Don't even start waiting if we have InterruptWaitingIfSyncMessageArrives and there's a sync message already in the queue.
     443    if (hasIncomingSynchronousMessage && waitForMessageFlags & InterruptWaitingIfSyncMessageArrives) {
     444        m_waitingForMessage = nullptr;
     445        return nullptr;
    435446    }
    436447
     
    445456        m_waitingForMessage = &waitingForMessage;
    446457    }
    447    
     458
    448459    // Now wait for it to be set.
    449460    while (true) {
  • trunk/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm

    r173163 r182980  
    7777        return;
    7878
    79     m_webPageProxy.process().connection()->waitForAndDispatchImmediately<Messages::DrawingAreaProxy::DidUpdateGeometry>(m_webPageProxy.pageID(), timeout);
     79    m_webPageProxy.process().connection()->waitForAndDispatchImmediately<Messages::DrawingAreaProxy::DidUpdateGeometry>(m_webPageProxy.pageID(), timeout, InterruptWaitingIfSyncMessageArrives);
    8080}
    8181
Note: See TracChangeset for help on using the changeset viewer.