Title: [174244] trunk/Source/WebCore
- Revision
- 174244
- Author
- psola...@apple.com
- Date
- 2014-10-02 16:39:34 -0700 (Thu, 02 Oct 2014)
Log 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:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (174243 => 174244)
--- trunk/Source/WebCore/ChangeLog 2014-10-02 23:36:34 UTC (rev 174243)
+++ trunk/Source/WebCore/ChangeLog 2014-10-02 23:39:34 UTC (rev 174244)
@@ -1,3 +1,25 @@
+2014-10-02 Pratik Solanki <psola...@apple.com>
+
+ [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:
+
2014-10-02 Christophe Dumez <cdu...@apple.com>
Use is<>() / downcast<>() for CSSBasicShape objects
Modified: trunk/Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegate.h (174243 => 174244)
--- trunk/Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegate.h 2014-10-02 23:36:34 UTC (rev 174243)
+++ trunk/Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegate.h 2014-10-02 23:39:34 UTC (rev 174244)
@@ -45,7 +45,7 @@
CFURLConnectionClient_V6 makeConnectionClient() const;
virtual void setupRequest(CFMutableURLRequestRef) = 0;
virtual void setupConnectionScheduling(CFURLConnectionRef) = 0;
- void releaseHandle();
+ virtual void releaseHandle();
virtual void continueWillSendRequest(CFURLRequestRef) = 0;
virtual void continueDidReceiveResponse() = 0;
Modified: trunk/Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp (174243 => 174244)
--- trunk/Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp 2014-10-02 23:36:34 UTC (rev 174243)
+++ trunk/Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp 2014-10-02 23:39:34 UTC (rev 174244)
@@ -63,6 +63,15 @@
return !!m_handle;
}
+void ResourceHandleCFURLConnectionDelegateWithOperationQueue::releaseHandle()
+{
+ ResourceHandleCFURLConnectionDelegate::releaseHandle();
+ m_requestResult = nullptr;
+ m_cachedResponseResult = nullptr;
+ m_boolResult = false;
+ dispatch_semaphore_signal(m_semaphore);
+}
+
void ResourceHandleCFURLConnectionDelegateWithOperationQueue::setupRequest(CFMutableURLRequestRef request)
{
#if PLATFORM(IOS)
Modified: trunk/Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h (174243 => 174244)
--- trunk/Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h 2014-10-02 23:36:34 UTC (rev 174243)
+++ trunk/Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h 2014-10-02 23:39:34 UTC (rev 174244)
@@ -45,6 +45,7 @@
virtual void setupRequest(CFMutableURLRequestRef) override;
virtual void setupConnectionScheduling(CFURLConnectionRef) override;
+ virtual void releaseHandle() override;
virtual CFURLRequestRef willSendRequest(CFURLRequestRef, CFURLResponseRef) override;
virtual void didReceiveResponse(CFURLConnectionRef, CFURLResponseRef) override;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes