Title: [224348] trunk/Source/WebCore
Revision
224348
Author
[email protected]
Date
2017-11-02 12:12:05 -0700 (Thu, 02 Nov 2017)

Log Message

Fix iOS WebKitLegacy after r224267
https://bugs.webkit.org/show_bug.cgi?id=179189

Reviewed by Tim Horton.

Use callOnMainThread instead of dispatch_async to work correctly on the web thread.

* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didFailWithError:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (224347 => 224348)


--- trunk/Source/WebCore/ChangeLog	2017-11-02 18:55:57 UTC (rev 224347)
+++ trunk/Source/WebCore/ChangeLog	2017-11-02 19:12:05 UTC (rev 224348)
@@ -1,3 +1,23 @@
+2017-11-02  Alex Christensen  <[email protected]>
+
+        Fix iOS WebKitLegacy after r224267
+        https://bugs.webkit.org/show_bug.cgi?id=179189
+
+        Reviewed by Tim Horton.
+
+        Use callOnMainThread instead of dispatch_async to work correctly on the web thread.
+
+        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
+        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
+        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
+        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
+        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
+        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
+        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:]):
+        (-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]):
+        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didFailWithError:]):
+        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
+
 2017-11-02  Adrian Perez de Castro  <[email protected]>
 
         [WPE] Add some error reporting during EGL display/context creation

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


--- trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm	2017-11-02 18:55:57 UTC (rev 224347)
+++ trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm	2017-11-02 19:12:05 UTC (rev 224348)
@@ -129,7 +129,7 @@
     if (m_messageQueue)
         m_messageQueue->append(std::make_unique<Function<void()>>(WTFMove(work)));
     else
-        dispatch_async(dispatch_get_main_queue(), work);
+        callOnMainThread(WTFMove(work));
 
     dispatch_semaphore_wait(m_semaphore, DISPATCH_TIME_FOREVER);
     return m_requestResult.autorelease();
@@ -153,7 +153,7 @@
     if (m_messageQueue)
         m_messageQueue->append(std::make_unique<Function<void()>>(WTFMove(work)));
     else
-        dispatch_async(dispatch_get_main_queue(), work);
+        callOnMainThread(WTFMove(work));
 }
 
 - (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace
@@ -175,8 +175,8 @@
     if (m_messageQueue)
         m_messageQueue->append(std::make_unique<Function<void()>>(WTFMove(work)));
     else
-        dispatch_async(dispatch_get_main_queue(), work);
-    
+        callOnMainThread(WTFMove(work));
+
     dispatch_semaphore_wait(m_semaphore, DISPATCH_TIME_FOREVER);
     return m_boolResult;
 }
@@ -214,8 +214,8 @@
     if (m_messageQueue)
         m_messageQueue->append(std::make_unique<Function<void()>>(WTFMove(work)));
     else
-        dispatch_async(dispatch_get_main_queue(), work);
-    
+        callOnMainThread(WTFMove(work));
+
     dispatch_semaphore_wait(m_semaphore, DISPATCH_TIME_FOREVER);
 }
 
@@ -243,7 +243,7 @@
     if (m_messageQueue)
         m_messageQueue->append(std::make_unique<Function<void()>>(WTFMove(work)));
     else
-        dispatch_async(dispatch_get_main_queue(), work);
+        callOnMainThread(WTFMove(work));
 }
 
 - (void)connection:(NSURLConnection *)connection didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite
@@ -263,7 +263,7 @@
     if (m_messageQueue)
         m_messageQueue->append(std::make_unique<Function<void()>>(WTFMove(work)));
     else
-        dispatch_async(dispatch_get_main_queue(), work);
+        callOnMainThread(WTFMove(work));
 }
 
 - (void)connectionDidFinishLoading:(NSURLConnection *)connection
@@ -273,7 +273,7 @@
 
     LOG(Network, "Handle %p delegate connectionDidFinishLoading:%p", m_handle, connection);
 
-    auto task = [self = self, protectedSelf = RetainPtr<id>(self)] () mutable {
+    auto work = [self = self, protectedSelf = RetainPtr<id>(self)] () mutable {
         if (!m_handle || !m_handle->client())
             return;
 
@@ -285,9 +285,9 @@
     };
 
     if (m_messageQueue)
-        m_messageQueue->append(std::make_unique<Function<void()>>(WTFMove(task)));
+        m_messageQueue->append(std::make_unique<Function<void()>>(WTFMove(work)));
     else
-        dispatch_async(dispatch_get_main_queue(), task);
+        callOnMainThread(WTFMove(work));
 }
 
 - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
@@ -311,7 +311,7 @@
     if (m_messageQueue)
         m_messageQueue->append(std::make_unique<Function<void()>>(WTFMove(work)));
     else
-        dispatch_async(dispatch_get_main_queue(), work);
+        callOnMainThread(WTFMove(work));
 }
 
 
@@ -335,7 +335,7 @@
     if (m_messageQueue)
         m_messageQueue->append(std::make_unique<Function<void()>>(WTFMove(work)));
     else
-        dispatch_async(dispatch_get_main_queue(), work);
+        callOnMainThread(WTFMove(work));
 
     dispatch_semaphore_wait(m_semaphore, DISPATCH_TIME_FOREVER);
     return m_cachedResponseResult.autorelease();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to