Title: [202493] trunk/Source/WebCore
Revision
202493
Author
[email protected]
Date
2016-06-27 10:50:25 -0700 (Mon, 27 Jun 2016)

Log Message

Crash in layout test /media/video-buffered-range-contains-currentTime.html
https://bugs.webkit.org/show_bug.cgi?id=159109
<rdar://problem/26535750>

Reviewed by Alex Christensen.

Guard against a dealloc race condition by holding a retain on the session
until the task's _resource:loadFinishedWithError: completes, including
main thread callbacks.

* platform/network/cocoa/WebCoreNSURLSession.mm:
(-[WebCoreNSURLSessionDataTask _resource:loadFinishedWithError:]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (202492 => 202493)


--- trunk/Source/WebCore/ChangeLog	2016-06-27 17:50:17 UTC (rev 202492)
+++ trunk/Source/WebCore/ChangeLog	2016-06-27 17:50:25 UTC (rev 202493)
@@ -1,3 +1,18 @@
+2016-06-27  Jer Noble  <[email protected]>
+
+        Crash in layout test /media/video-buffered-range-contains-currentTime.html
+        https://bugs.webkit.org/show_bug.cgi?id=159109
+        <rdar://problem/26535750>
+
+        Reviewed by Alex Christensen.
+
+        Guard against a dealloc race condition by holding a retain on the session
+        until the task's _resource:loadFinishedWithError: completes, including
+        main thread callbacks.
+        
+        * platform/network/cocoa/WebCoreNSURLSession.mm:
+        (-[WebCoreNSURLSessionDataTask _resource:loadFinishedWithError:]):
+
 2016-06-27  Frederic Wang  <[email protected]>
 
         Set an upper limit for the size or number of pieces of stretchy operators

Modified: trunk/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm (202492 => 202493)


--- trunk/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm	2016-06-27 17:50:17 UTC (rev 202492)
+++ trunk/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm	2016-06-27 17:50:25 UTC (rev 202493)
@@ -618,14 +618,15 @@
     self.state = NSURLSessionTaskStateCompleted;
 
     RetainPtr<WebCoreNSURLSessionDataTask> strongSelf { self };
+    RetainPtr<WebCoreNSURLSession> strongSession { self.session };
     RetainPtr<NSError> strongError { error };
-    [self.session addDelegateOperation:[strongSelf, strongError] {
-        id<NSURLSessionTaskDelegate> delegate = (id<NSURLSessionTaskDelegate>)strongSelf.get().session.delegate;
+    [self.session addDelegateOperation:[strongSelf, strongSession, strongError] {
+        id<NSURLSessionTaskDelegate> delegate = (id<NSURLSessionTaskDelegate>)strongSession.get().delegate;
         if ([delegate respondsToSelector:@selector(URLSession:task:didCompleteWithError:)])
-            [delegate URLSession:(NSURLSession *)strongSelf.get().session task:(NSURLSessionDataTask *)strongSelf.get() didCompleteWithError:strongError.get()];
+            [delegate URLSession:(NSURLSession *)strongSession.get() task:(NSURLSessionDataTask *)strongSelf.get() didCompleteWithError:strongError.get()];
 
-        callOnMainThread([strongSelf] {
-            [strongSelf.get().session taskCompleted:strongSelf.get()];
+        callOnMainThread([strongSelf, strongSession] {
+            [strongSession taskCompleted:strongSelf.get()];
         });
     }];
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to