Title: [184090] releases/WebKitGTK/webkit-2.8/Source/WebKit2
- Revision
- 184090
- Author
- [email protected]
- Date
- 2015-05-11 06:12:20 -0700 (Mon, 11 May 2015)
Log Message
Merge r182980 - 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.
Modified Paths
Diff
Modified: releases/WebKitGTK/webkit-2.8/Source/WebKit2/ChangeLog (184089 => 184090)
--- releases/WebKitGTK/webkit-2.8/Source/WebKit2/ChangeLog 2015-05-11 13:10:17 UTC (rev 184089)
+++ releases/WebKitGTK/webkit-2.8/Source/WebKit2/ChangeLog 2015-05-11 13:12:20 UTC (rev 184090)
@@ -1,3 +1,25 @@
+2015-04-17 Tim Horton <[email protected]>
+
+ 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.
+
2015-04-17 Chris Dumez <[email protected]>
Possible null pointer dereference in WebDiagnosticLoggingClient::logDiagnosticMessageWithValue()
Modified: releases/WebKitGTK/webkit-2.8/Source/WebKit2/Platform/IPC/Connection.cpp (184089 => 184090)
--- releases/WebKitGTK/webkit-2.8/Source/WebKit2/Platform/IPC/Connection.cpp 2015-05-11 13:10:17 UTC (rev 184089)
+++ releases/WebKitGTK/webkit-2.8/Source/WebKit2/Platform/IPC/Connection.cpp 2015-05-11 13:12:20 UTC (rev 184090)
@@ -410,6 +410,8 @@
{
ASSERT(&m_clientRunLoop == &RunLoop::current());
+ bool hasIncomingSynchronousMessage = false;
+
// First, check if this message is already in the incoming messages queue.
{
std::lock_guard<std::mutex> lock(m_incomingMessagesMutex);
@@ -423,9 +425,18 @@
m_incomingMessages.remove(it);
return returnedMessage;
}
+
+ if (message->isSyncMessage())
+ hasIncomingSynchronousMessage = true;
}
}
+ // Don't even start waiting if we have InterruptWaitingIfSyncMessageArrives and there's a sync message already in the queue.
+ if (hasIncomingSynchronousMessage && waitForMessageFlags & InterruptWaitingIfSyncMessageArrives) {
+ m_waitingForMessage = nullptr;
+ return nullptr;
+ }
+
WaitForMessageState waitingForMessage(messageReceiverName, messageName, destinationID, waitForMessageFlags);
{
@@ -436,7 +447,7 @@
m_waitingForMessage = &waitingForMessage;
}
-
+
// Now wait for it to be set.
while (true) {
std::unique_lock<std::mutex> lock(m_waitForMessageMutex);
Modified: releases/WebKitGTK/webkit-2.8/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm (184089 => 184090)
--- releases/WebKitGTK/webkit-2.8/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm 2015-05-11 13:10:17 UTC (rev 184089)
+++ releases/WebKitGTK/webkit-2.8/Source/WebKit2/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm 2015-05-11 13:12:20 UTC (rev 184090)
@@ -76,7 +76,7 @@
if (m_webPageProxy.process().state() != WebProcessProxy::State::Running)
return;
- m_webPageProxy.process().connection()->waitForAndDispatchImmediately<Messages::DrawingAreaProxy::DidUpdateGeometry>(m_webPageProxy.pageID(), timeout);
+ m_webPageProxy.process().connection()->waitForAndDispatchImmediately<Messages::DrawingAreaProxy::DidUpdateGeometry>(m_webPageProxy.pageID(), timeout, InterruptWaitingIfSyncMessageArrives);
}
void TiledCoreAnimationDrawingAreaProxy::colorSpaceDidChange()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes