Title: [147287] trunk/Source/WebCore
Revision
147287
Author
beid...@apple.com
Date
2013-03-31 13:13:52 -0700 (Sun, 31 Mar 2013)

Log Message

NetworkProcess crashes in WebCoreResourceHandleAsOperationQueueDelegate callbacks.
<rdar://problem/13541868> and https://bugs.webkit.org/show_bug.cgi?id=113664

Reviewed by Dan Bernstein.

In the "two-part" callbacks that involve waiting on a semaphore for the async block to finish,
the delegate might have been destroyed by the time the wait completes.

A RetainPtr<> protector will fix that up nicely.

* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connectionShouldUseCredentialStorage:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (147286 => 147287)


--- trunk/Source/WebCore/ChangeLog	2013-03-31 19:33:53 UTC (rev 147286)
+++ trunk/Source/WebCore/ChangeLog	2013-03-31 20:13:52 UTC (rev 147287)
@@ -1,3 +1,21 @@
+2013-03-31  Brady Eidson  <beid...@apple.com>
+
+        NetworkProcess crashes in WebCoreResourceHandleAsOperationQueueDelegate callbacks.
+        <rdar://problem/13541868> and https://bugs.webkit.org/show_bug.cgi?id=113664
+
+        Reviewed by Dan Bernstein.
+
+        In the "two-part" callbacks that involve waiting on a semaphore for the async block to finish,
+        the delegate might have been destroyed by the time the wait completes.
+
+        A RetainPtr<> protector will fix that up nicely.
+
+        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
+        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
+        (-[WebCoreResourceHandleAsOperationQueueDelegate connectionShouldUseCredentialStorage:]):
+        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
+        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
+
 2013-03-30  Adam Barth  <aba...@webkit.org>
 
         Remove unused include of RegularExpression.h

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


--- trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm	2013-03-31 19:33:53 UTC (rev 147286)
+++ trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm	2013-03-31 20:13:52 UTC (rev 147287)
@@ -115,6 +115,8 @@
         LOG(Network, "Handle %p delegate connection:%p willSendRequest:%@ redirectResponse:non-HTTP", m_handle, connection, [newRequest description]); 
 #endif
 
+    RetainPtr<id> protector(self);
+
     dispatch_async(dispatch_get_main_queue(), ^{
         if (!m_handle) {
             m_requestResult = nullptr;
@@ -138,6 +140,8 @@
 
     LOG(Network, "Handle %p delegate connectionShouldUseCredentialStorage:%p", m_handle, connection);
 
+    RetainPtr<id> protector(self);
+
     dispatch_async(dispatch_get_main_queue(), ^{
         if (!m_handle) {
             m_boolResult = NO;
@@ -191,6 +195,8 @@
 
     LOG(Network, "Handle %p delegate connection:%p canAuthenticateAgainstProtectionSpace:%@://%@:%u realm:%@ method:%@ %@%@", m_handle, connection, [protectionSpace protocol], [protectionSpace host], [protectionSpace port], [protectionSpace realm], [protectionSpace authenticationMethod], [protectionSpace isProxy] ? @"proxy:" : @"", [protectionSpace isProxy] ? [protectionSpace proxyType] : @"");
 
+    RetainPtr<id> protector(self);
+
     dispatch_async(dispatch_get_main_queue(), ^{
         if (!m_handle) {
             m_boolResult = NO;
@@ -341,6 +347,8 @@
 
     LOG(Network, "Handle %p delegate connection:%p willCacheResponse:%p", m_handle, connection, cachedResponse);
 
+    RetainPtr<id> protector(self);
+
     dispatch_async(dispatch_get_main_queue(), ^{
         if (!m_handle || !m_handle->client()) {
             m_cachedResponseResult = nullptr;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to