Changeset 224348 in webkit


Ignore:
Timestamp:
Nov 2, 2017 12:12:05 PM (6 years ago)
Author:
achristensen@apple.com
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:]):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r224347 r224348  
     12017-11-02  Alex Christensen  <achristensen@webkit.org>
     2
     3        Fix iOS WebKitLegacy after r224267
     4        https://bugs.webkit.org/show_bug.cgi?id=179189
     5
     6        Reviewed by Tim Horton.
     7
     8        Use callOnMainThread instead of dispatch_async to work correctly on the web thread.
     9
     10        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
     11        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
     12        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
     13        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
     14        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
     15        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
     16        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:]):
     17        (-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]):
     18        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didFailWithError:]):
     19        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
     20
    1212017-11-02  Adrian Perez de Castro  <aperez@igalia.com>
    222
  • trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm

    r224267 r224348  
    130130        m_messageQueue->append(std::make_unique<Function<void()>>(WTFMove(work)));
    131131    else
    132         dispatch_async(dispatch_get_main_queue(), work);
     132        callOnMainThread(WTFMove(work));
    133133
    134134    dispatch_semaphore_wait(m_semaphore, DISPATCH_TIME_FOREVER);
     
    154154        m_messageQueue->append(std::make_unique<Function<void()>>(WTFMove(work)));
    155155    else
    156         dispatch_async(dispatch_get_main_queue(), work);
     156        callOnMainThread(WTFMove(work));
    157157}
    158158
     
    176176        m_messageQueue->append(std::make_unique<Function<void()>>(WTFMove(work)));
    177177    else
    178         dispatch_async(dispatch_get_main_queue(), work);
    179    
     178        callOnMainThread(WTFMove(work));
     179
    180180    dispatch_semaphore_wait(m_semaphore, DISPATCH_TIME_FOREVER);
    181181    return m_boolResult;
     
    215215        m_messageQueue->append(std::make_unique<Function<void()>>(WTFMove(work)));
    216216    else
    217         dispatch_async(dispatch_get_main_queue(), work);
    218    
     217        callOnMainThread(WTFMove(work));
     218
    219219    dispatch_semaphore_wait(m_semaphore, DISPATCH_TIME_FOREVER);
    220220}
     
    244244        m_messageQueue->append(std::make_unique<Function<void()>>(WTFMove(work)));
    245245    else
    246         dispatch_async(dispatch_get_main_queue(), work);
     246        callOnMainThread(WTFMove(work));
    247247}
    248248
     
    264264        m_messageQueue->append(std::make_unique<Function<void()>>(WTFMove(work)));
    265265    else
    266         dispatch_async(dispatch_get_main_queue(), work);
     266        callOnMainThread(WTFMove(work));
    267267}
    268268
     
    274274    LOG(Network, "Handle %p delegate connectionDidFinishLoading:%p", m_handle, connection);
    275275
    276     auto task = [self = self, protectedSelf = RetainPtr<id>(self)] () mutable {
     276    auto work = [self = self, protectedSelf = RetainPtr<id>(self)] () mutable {
    277277        if (!m_handle || !m_handle->client())
    278278            return;
     
    286286
    287287    if (m_messageQueue)
    288         m_messageQueue->append(std::make_unique<Function<void()>>(WTFMove(task)));
    289     else
    290         dispatch_async(dispatch_get_main_queue(), task);
     288        m_messageQueue->append(std::make_unique<Function<void()>>(WTFMove(work)));
     289    else
     290        callOnMainThread(WTFMove(work));
    291291}
    292292
     
    312312        m_messageQueue->append(std::make_unique<Function<void()>>(WTFMove(work)));
    313313    else
    314         dispatch_async(dispatch_get_main_queue(), work);
     314        callOnMainThread(WTFMove(work));
    315315}
    316316
     
    336336        m_messageQueue->append(std::make_unique<Function<void()>>(WTFMove(work)));
    337337    else
    338         dispatch_async(dispatch_get_main_queue(), work);
     338        callOnMainThread(WTFMove(work));
    339339
    340340    dispatch_semaphore_wait(m_semaphore, DISPATCH_TIME_FOREVER);
Note: See TracChangeset for help on using the changeset viewer.