Use closeReason provided in didCloseWithCode delegate. Currently we're looking at the task's closeReason (which is not wrong), but making sure that we use the close code and reason provided in the delegate callback to ensure there is no weird bug that we hit in the future
Created attachment 406612 [details] Using the closeReason in the delegate
Comment on attachment 406612 [details] Using the closeReason in the delegate View in context: https://bugs.webkit.org/attachment.cgi?id=406612&action=review > Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:1021 > + auto closeReason = adoptNS([[NSString alloc] initWithData:reason encoding:NSUTF8StringEncoding]); ASSERT([reason isEqualToData:task.closeReason]); That'll catch these future bugs you mentioned.
(In reply to Alex Christensen from comment #2) > Comment on attachment 406612 [details] > Using the closeReason in the delegate > > View in context: > https://bugs.webkit.org/attachment.cgi?id=406612&action=review > > > Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm:1021 > > + auto closeReason = adoptNS([[NSString alloc] initWithData:reason encoding:NSUTF8StringEncoding]); > > ASSERT([reason isEqualToData:task.closeReason]); > That'll catch these future bugs you mentioned. That sounds good
Created attachment 406984 [details] Updating patch to add assertions and ChangeLog
<rdar://problem/67570472>
Committed r266011: <https://trac.webkit.org/changeset/266011> All reviewed patches have been landed. Closing bug and clearing flags on attachment 406984 [details].