Title: [226818] trunk
Revision
226818
Author
achristen...@apple.com
Date
2018-01-11 16:18:32 -0800 (Thu, 11 Jan 2018)

Log Message

REGRESSION(r225003): Loading hangs in environments where dispatch_async does not work
https://bugs.webkit.org/show_bug.cgi?id=181553
Source/WebCore:

<rdar://problem/35733938>

Reviewed by Eric Carlson.

There is an environment where dispatch_async does not work, but performSelectorOnMainThread works.
r225003 broke loading in this environment.  This fixes it and updates the test that r225003 fixed.
It failed sometimes because loading was happening in a different order than html parsing, so I made
the test not depend on html parsing timing by updating media/video-src-remove.html.

* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]):

LayoutTests:


Reviewed by Eric Carlson.

* media/video-src-remove.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (226817 => 226818)


--- trunk/LayoutTests/ChangeLog	2018-01-12 00:15:54 UTC (rev 226817)
+++ trunk/LayoutTests/ChangeLog	2018-01-12 00:18:32 UTC (rev 226818)
@@ -1,3 +1,12 @@
+2018-01-11  Alex Christensen  <achristen...@webkit.org>
+
+        REGRESSION(r225003): Loading hangs in environments where dispatch_async does not work
+        https://bugs.webkit.org/show_bug.cgi?id=181553
+
+        Reviewed by Eric Carlson.
+
+        * media/video-src-remove.html:
+
 2018-01-11  Dean Jackson  <d...@apple.com>
 
         Rolling out 226814. It crashes on some bots.

Modified: trunk/LayoutTests/media/video-src-remove.html (226817 => 226818)


--- trunk/LayoutTests/media/video-src-remove.html	2018-01-12 00:15:54 UTC (rev 226817)
+++ trunk/LayoutTests/media/video-src-remove.html	2018-01-12 00:18:32 UTC (rev 226818)
@@ -3,16 +3,10 @@
     <script src=""
     <script src=""
     <div id=panel></div>
-    <script>
-        var panel = document.getElementById("panel");
-        var mediaFile = findMediaFile("video", "content/test");
-        panel.innerHTML = "<video src="" + mediaFile + " controls _onloadedmetadata_='loadedmetadata()'><source src=""
-    </script>
 
     <p>Test that removing valid 'src' attribute DOES NOT trigger load of &lt;source&gt; elements</p>
 
     <script>
-        findMediaElement();
 
         var loadCount = 0;
         
@@ -49,6 +43,11 @@
             consoleWrite("");
         }
 
+        var panel = document.getElementById("panel");
+        var mediaFile = findMediaFile("video", "content/test");
+        panel.innerHTML = "<video src="" + mediaFile + " controls _onloadedmetadata_='loadedmetadata()'><source src=""
+        findMediaElement();
+
         consoleWrite("");
     </script>
 

Modified: trunk/Source/WebCore/ChangeLog (226817 => 226818)


--- trunk/Source/WebCore/ChangeLog	2018-01-12 00:15:54 UTC (rev 226817)
+++ trunk/Source/WebCore/ChangeLog	2018-01-12 00:18:32 UTC (rev 226818)
@@ -1,3 +1,19 @@
+2018-01-11  Alex Christensen  <achristen...@webkit.org>
+
+        REGRESSION(r225003): Loading hangs in environments where dispatch_async does not work
+        https://bugs.webkit.org/show_bug.cgi?id=181553
+        <rdar://problem/35733938>
+
+        Reviewed by Eric Carlson.
+
+        There is an environment where dispatch_async does not work, but performSelectorOnMainThread works.
+        r225003 broke loading in this environment.  This fixes it and updates the test that r225003 fixed.
+        It failed sometimes because loading was happening in a different order than html parsing, so I made
+        the test not depend on html parsing timing by updating media/video-src-remove.html.
+
+        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
+        (-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]):
+
 2018-01-11  Dean Jackson  <d...@apple.com>
 
         Rolling out 226814. It crashes on some bots.

Modified: trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm (226817 => 226818)


--- trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm	2018-01-12 00:15:54 UTC (rev 226817)
+++ trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm	2018-01-12 00:18:32 UTC (rev 226818)
@@ -64,13 +64,8 @@
 
     // This is the common case.
     SchedulePairHashSet* pairs = m_handle && m_handle->context() ? m_handle->context()->scheduledRunLoopPairs() : nullptr;
-    if (!scheduledWithCustomRunLoopMode(pairs)) {
-#if PLATFORM(MAC)
-        return dispatch_async(dispatch_get_main_queue(), BlockPtr<void()>::fromCallable(WTFMove(function)).get());
-#else
+    if (!scheduledWithCustomRunLoopMode(pairs))
         return callOnMainThread(WTFMove(function));
-#endif
-    }
 
     // If we have been scheduled in a custom run loop mode, schedule a block in that mode.
     auto block = BlockPtr<void()>::fromCallable([alreadyCalled = false, function = WTFMove(function)] () mutable {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to