Title: [217810] trunk
Revision
217810
Author
[email protected]
Date
2017-06-05 19:03:29 -0700 (Mon, 05 Jun 2017)

Log Message

ASSERTION FAILED: RunLoop::isMain() in com.apple.WebKit: IPC::Connection::sendSyncMessage + 128
https://bugs.webkit.org/show_bug.cgi?id=172943
<rdar://problem/31288058>

Reviewed by Alexey Proskuryakov.

Source/WebKit2:

In Connection::sendMessage(), make sure we only ever transform asynchronous messages into synchronous
ones if sendMessage() is called on the main thread. This is necessary because we no longer support
sending synchronous messages from a background thread since r205125.

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

LayoutTests:

Add better test coverage.

* storage/domstorage/sessionstorage/set-item-synchronous-keydown-expected.txt: Added.
* storage/domstorage/sessionstorage/set-item-synchronous-keydown.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (217809 => 217810)


--- trunk/LayoutTests/ChangeLog	2017-06-06 00:03:55 UTC (rev 217809)
+++ trunk/LayoutTests/ChangeLog	2017-06-06 02:03:29 UTC (rev 217810)
@@ -1,3 +1,16 @@
+2017-06-05  Chris Dumez  <[email protected]>
+
+        ASSERTION FAILED: RunLoop::isMain() in com.apple.WebKit: IPC::Connection::sendSyncMessage + 128
+        https://bugs.webkit.org/show_bug.cgi?id=172943
+        <rdar://problem/31288058>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Add better test coverage.
+
+        * storage/domstorage/sessionstorage/set-item-synchronous-keydown-expected.txt: Added.
+        * storage/domstorage/sessionstorage/set-item-synchronous-keydown.html: Added.
+
 2017-06-05  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: Improve ES6 Class instances in Heap Snapshot instances view

Added: trunk/LayoutTests/storage/domstorage/sessionstorage/set-item-synchronous-keydown-expected.txt (0 => 217810)


--- trunk/LayoutTests/storage/domstorage/sessionstorage/set-item-synchronous-keydown-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/storage/domstorage/sessionstorage/set-item-synchronous-keydown-expected.txt	2017-06-06 02:03:29 UTC (rev 217810)
@@ -0,0 +1,12 @@
+Tests updating sessionStorage in the keydown handler and makes sure the value is updated synchronously.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS sessionStorage.setItemSynchronousKeydownTestValue is "0"
+Setting setItemSynchronousKeydownTestValue to 1 in keydown handler.
+PASS sessionStorage.setItemSynchronousKeydownTestValue is "1"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/storage/domstorage/sessionstorage/set-item-synchronous-keydown.html (0 => 217810)


--- trunk/LayoutTests/storage/domstorage/sessionstorage/set-item-synchronous-keydown.html	                        (rev 0)
+++ trunk/LayoutTests/storage/domstorage/sessionstorage/set-item-synchronous-keydown.html	2017-06-06 02:03:29 UTC (rev 217810)
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<script src=""
+<input id="testInput" type="text"></input>
+<script>
+description("Tests updating sessionStorage in the keydown handler and makes sure the value is updated synchronously.");
+
+function keydownHandler()
+{
+    debug("Setting setItemSynchronousKeydownTestValue to 1 in keydown handler.");
+    sessionStorage.setItemSynchronousKeydownTestValue = 1;
+}
+
+testInput.focus();
+testInput._onkeydown_ = keydownHandler;
+sessionStorage.setItemSynchronousKeydownTestValue = 0;
+shouldBeEqualToString("sessionStorage.setItemSynchronousKeydownTestValue", "0");
+
+// keydownHandler() should be called synchronously.
+if (window.eventSender)
+    eventSender.keyDown('a');
+
+shouldBeEqualToString("sessionStorage.setItemSynchronousKeydownTestValue", "1");
+
+sessionStorage.removeItem("setItemSynchronousKeydownTestValue");
+</script>
+</body>
+</html>

Modified: trunk/Source/WebKit2/ChangeLog (217809 => 217810)


--- trunk/Source/WebKit2/ChangeLog	2017-06-06 00:03:55 UTC (rev 217809)
+++ trunk/Source/WebKit2/ChangeLog	2017-06-06 02:03:29 UTC (rev 217810)
@@ -1,3 +1,19 @@
+2017-06-05  Chris Dumez  <[email protected]>
+
+        ASSERTION FAILED: RunLoop::isMain() in com.apple.WebKit: IPC::Connection::sendSyncMessage + 128
+        https://bugs.webkit.org/show_bug.cgi?id=172943
+        <rdar://problem/31288058>
+
+        Reviewed by Alexey Proskuryakov.
+
+        In Connection::sendMessage(), make sure we only ever transform asynchronous messages into synchronous
+        ones if sendMessage() is called on the main thread. This is necessary because we no longer support
+        sending synchronous messages from a background thread since r205125.
+
+        * Platform/IPC/Connection.cpp:
+        (IPC::Connection::sendMessage):
+        (IPC::Connection::sendSyncMessage):
+
 2017-06-05  Joseph Pecoraro  <[email protected]>
 
         Revert r217405, this headerpad increase is no longer needed.

Modified: trunk/Source/WebKit2/Platform/IPC/Connection.cpp (217809 => 217810)


--- trunk/Source/WebKit2/Platform/IPC/Connection.cpp	2017-06-06 00:03:55 UTC (rev 217809)
+++ trunk/Source/WebKit2/Platform/IPC/Connection.cpp	2017-06-06 02:03:29 UTC (rev 217810)
@@ -379,7 +379,7 @@
     if (!isValid())
         return false;
 
-    if (m_inDispatchMessageMarkedToUseFullySynchronousModeForTesting && !encoder->isSyncMessage() && !(encoder->messageReceiverName() == "IPC")) {
+    if (RunLoop::isMain() && m_inDispatchMessageMarkedToUseFullySynchronousModeForTesting && !encoder->isSyncMessage() && !(encoder->messageReceiverName() == "IPC")) {
         uint64_t syncRequestID;
         auto wrappedMessage = createSyncMessageEncoder("IPC", "WrappedAsyncMessageForTesting", encoder->destinationID(), syncRequestID);
         wrappedMessage->setFullySynchronousModeForTesting();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to