Title: [228635] releases/WebKitGTK/webkit-2.20/Source/WebKit
Revision
228635
Author
carlo...@webkit.org
Date
2018-02-19 02:13:58 -0800 (Mon, 19 Feb 2018)

Log Message

Merge r228152 - Avoid unnecessarily constructing RunLoops for GC AutomaticThreads in Connection::sendMessage() after r228001
https://bugs.webkit.org/show_bug.cgi?id=182494
<rdar://problem/37147632>

Reviewed by Ryosuke Niwa.

Somebody fixed a GC crash in r228001 by allowing RunLoop::current() to be called from a
GC thread. However, this is still unnecessarily inefficient. Calling RunLoop::current()
will construct RunLoops for background GC threads (WTF::AutomaticThreads). This patches
updates the IPC code to call isMainThread() instead of RunLoop::isMain() in
Connection::sendMessage(). This should mean the same thing since this code runs in
WebKit2 and should be more efficient as it ends up simply calling pthread_main_np(),
without constructing a RunLoop.

* Platform/IPC/Connection.cpp:
(IPC::Connection::sendMessage):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.20/Source/WebKit/ChangeLog (228634 => 228635)


--- releases/WebKitGTK/webkit-2.20/Source/WebKit/ChangeLog	2018-02-19 10:12:07 UTC (rev 228634)
+++ releases/WebKitGTK/webkit-2.20/Source/WebKit/ChangeLog	2018-02-19 10:13:58 UTC (rev 228635)
@@ -1,3 +1,22 @@
+2018-02-05  Chris Dumez  <cdu...@apple.com>
+
+        Avoid unnecessarily constructing RunLoops for GC AutomaticThreads in Connection::sendMessage() after r228001
+        https://bugs.webkit.org/show_bug.cgi?id=182494
+        <rdar://problem/37147632>
+
+        Reviewed by Ryosuke Niwa.
+
+        Somebody fixed a GC crash in r228001 by allowing RunLoop::current() to be called from a
+        GC thread. However, this is still unnecessarily inefficient. Calling RunLoop::current()
+        will construct RunLoops for background GC threads (WTF::AutomaticThreads). This patches
+        updates the IPC code to call isMainThread() instead of RunLoop::isMain() in
+        Connection::sendMessage(). This should mean the same thing since this code runs in
+        WebKit2 and should be more efficient as it ends up simply calling pthread_main_np(),
+        without constructing a RunLoop.
+
+        * Platform/IPC/Connection.cpp:
+        (IPC::Connection::sendMessage):
+
 2018-02-05  Ryosuke Niwa  <rn...@webkit.org>
 
         Release assertion in inlineVideoFrame

Modified: releases/WebKitGTK/webkit-2.20/Source/WebKit/Platform/IPC/Connection.cpp (228634 => 228635)


--- releases/WebKitGTK/webkit-2.20/Source/WebKit/Platform/IPC/Connection.cpp	2018-02-19 10:12:07 UTC (rev 228634)
+++ releases/WebKitGTK/webkit-2.20/Source/WebKit/Platform/IPC/Connection.cpp	2018-02-19 10:13:58 UTC (rev 228635)
@@ -379,7 +379,7 @@
     if (!isValid())
         return false;
 
-    if (RunLoop::isMain() && m_inDispatchMessageMarkedToUseFullySynchronousModeForTesting && !encoder->isSyncMessage() && !(encoder->messageReceiverName() == "IPC")) {
+    if (isMainThread() && m_inDispatchMessageMarkedToUseFullySynchronousModeForTesting && !encoder->isSyncMessage() && !(encoder->messageReceiverName() == "IPC")) {
         uint64_t syncRequestID;
         auto wrappedMessage = createSyncMessageEncoder("IPC", "WrappedAsyncMessageForTesting", encoder->destinationID(), syncRequestID);
         wrappedMessage->setFullySynchronousModeForTesting();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to