Changeset 174244 in webkit


Ignore:
Timestamp:
Oct 2, 2014 4:39:34 PM (10 years ago)
Author:
psolanki@apple.com
Message:

[iOS] Networking process stops loading web pages while running Alexa test with random URL list
https://bugs.webkit.org/show_bug.cgi?id=137362
<rdar://problem/18507382>

Reviewed by Alexey Proskuryakov.

ResourceHandleCFURLConnectionDelegateWithOperationQueue needs to signal threads waiting on
its semaphore when the handle is being destroyed. Otherwise, we can leave dispatch threads
hanging around waiting for a response. This can happen when the Web Content process dies.
Any thread/queue waiting on a response from that web process will leak and stay around
forever. If we reach the dispatch queue limit of 64, then all networking will cease to
happen in the Networking process. Fix this by signalling waiting threads and clearing out
our state in much the same way that -[WebCoreResourceHandleAsOperationQueueDelegate
detachHandle] does for Mac.

  • platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
  • platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:

(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::releaseHandle):

  • platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r174236 r174244  
     12014-10-02  Pratik Solanki  <psolanki@apple.com>
     2
     3        [iOS] Networking process stops loading web pages while running Alexa test with random URL list
     4        https://bugs.webkit.org/show_bug.cgi?id=137362
     5        <rdar://problem/18507382>
     6
     7        Reviewed by Alexey Proskuryakov.
     8
     9        ResourceHandleCFURLConnectionDelegateWithOperationQueue needs to signal threads waiting on
     10        its semaphore when the handle is being destroyed. Otherwise, we can leave dispatch threads
     11        hanging around waiting for a response. This can happen when the Web Content process dies.
     12        Any thread/queue waiting on a response from that web process will leak and stay around
     13        forever. If we reach the dispatch queue limit of 64, then all networking will cease to
     14        happen in the Networking process. Fix this by signalling waiting threads and clearing out
     15        our state in much the same way that -[WebCoreResourceHandleAsOperationQueueDelegate
     16        detachHandle] does for Mac.
     17
     18        * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
     19        * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
     20        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::releaseHandle):
     21        * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
     22
    1232014-10-02  Christophe Dumez  <cdumez@apple.com>
    224
  • trunk/Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegate.h

    r169082 r174244  
    4646    virtual void setupRequest(CFMutableURLRequestRef) = 0;
    4747    virtual void setupConnectionScheduling(CFURLConnectionRef) = 0;
    48     void releaseHandle();
     48    virtual void releaseHandle();
    4949
    5050    virtual void continueWillSendRequest(CFURLRequestRef) = 0;
  • trunk/Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp

    r171540 r174244  
    6464}
    6565
     66void ResourceHandleCFURLConnectionDelegateWithOperationQueue::releaseHandle()
     67{
     68    ResourceHandleCFURLConnectionDelegate::releaseHandle();
     69    m_requestResult = nullptr;
     70    m_cachedResponseResult = nullptr;
     71    m_boolResult = false;
     72    dispatch_semaphore_signal(m_semaphore);
     73}
     74
    6675void ResourceHandleCFURLConnectionDelegateWithOperationQueue::setupRequest(CFMutableURLRequestRef request)
    6776{
  • trunk/Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h

    r169082 r174244  
    4646    virtual void setupRequest(CFMutableURLRequestRef) override;
    4747    virtual void setupConnectionScheduling(CFURLConnectionRef) override;
     48    virtual void releaseHandle() override;
    4849
    4950    virtual CFURLRequestRef willSendRequest(CFURLRequestRef, CFURLResponseRef) override;
Note: See TracChangeset for help on using the changeset viewer.