Title: [200388] trunk/Source/WebKit2
- Revision
- 200388
- Author
- [email protected]
- Date
- 2016-05-03 14:46:06 -0700 (Tue, 03 May 2016)
Log Message
Remove firing assertion when redirecting
https://bugs.webkit.org/show_bug.cgi?id=155800
rdar://25299194
Reviewed by Sam Weinig.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:willCacheResponse:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
With NSURLConnection, we stopped getting delegate callbacks once the delegate is destroyed, and everything was cancelled.
With NSURLSession we continue getting delegate callbacks because the session's delegate is not destroyed after each load.
As documented in NSURLSession.h: "In some cases, the task may signal other work before it acknowledges the cancelation."
In the cases where we cancel a load, delete the NetworkLoad and corresponding NetworkDataTask, we want to call all
completion handlers indicating that we really want to cancel instead of asserting.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (200387 => 200388)
--- trunk/Source/WebKit2/ChangeLog 2016-05-03 21:42:44 UTC (rev 200387)
+++ trunk/Source/WebKit2/ChangeLog 2016-05-03 21:46:06 UTC (rev 200388)
@@ -1,3 +1,22 @@
+2016-05-03 Alex Christensen <[email protected]>
+
+ Remove firing assertion when redirecting
+ https://bugs.webkit.org/show_bug.cgi?id=155800
+ rdar://25299194
+
+ Reviewed by Sam Weinig.
+
+ * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+ (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
+ (-[WKNetworkSessionDelegate URLSession:dataTask:willCacheResponse:completionHandler:]):
+ (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
+ (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
+ With NSURLConnection, we stopped getting delegate callbacks once the delegate is destroyed, and everything was cancelled.
+ With NSURLSession we continue getting delegate callbacks because the session's delegate is not destroyed after each load.
+ As documented in NSURLSession.h: "In some cases, the task may signal other work before it acknowledges the cancelation."
+ In the cases where we cancel a load, delete the NetworkLoad and corresponding NetworkDataTask, we want to call all
+ completion handlers indicating that we really want to cancel instead of asserting.
+
2016-05-02 Darin Adler <[email protected]>
Change IDL enumerations to be nested in their C++ class instead of at WebCore namespace level
Modified: trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm (200387 => 200388)
--- trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm 2016-05-03 21:42:44 UTC (rev 200387)
+++ trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm 2016-05-03 21:46:06 UTC (rev 200388)
@@ -121,10 +121,8 @@
completionHandlerCopy(request.nsURLRequest(WebCore::UpdateHTTPBody));
Block_release(completionHandlerCopy);
});
- } else {
- ASSERT_NOT_REACHED();
+ } else
completionHandler(nil);
- }
}
- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask willCacheResponse:(NSCachedURLResponse *)proposedResponse completionHandler:(void (^)(NSCachedURLResponse * _Nullable cachedResponse))completionHandler
@@ -168,10 +166,8 @@
Block_release(completionHandlerCopy);
};
networkDataTask->didReceiveChallenge(challenge, challengeCompletionHandler);
- } else {
- ASSERT_NOT_REACHED();
- completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil);
- }
+ } else
+ completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil);
}
- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes