Bug 159691 - [WK2][NetworkSession] Fix unsafe RunLoop::dispatch() in NetworkLoad constructor
Summary: [WK2][NetworkSession] Fix unsafe RunLoop::dispatch() in NetworkLoad constructor
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-07-12 15:02 PDT by Chris Dumez
Modified: 2016-07-13 15:01 PDT (History)
5 users (show)

See Also:


Attachments
Patch (10.16 KB, patch)
2016-07-12 15:06 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2016-07-12 15:02:03 PDT
Fix unsafe RunLoop::dispatch() in NetworkLoad constructor. It captures |this| but there is no guarantee the NetworkLoad will still be alive by the time the lambda gets executed.
Comment 1 Chris Dumez 2016-07-12 15:06:17 PDT
Created attachment 283455 [details]
Patch
Comment 2 Chris Dumez 2016-07-12 15:07:10 PDT
Let me know if after seeing the code you think we should use a factory function on NetworkLoad and PendingDownload instead. I hesitated between the two approaches.
Comment 3 Chris Dumez 2016-07-12 15:11:27 PDT
<rdar://problem/27240886>
Comment 4 Chris Dumez 2016-07-12 15:44:06 PDT
Comment on attachment 283455 [details]
Patch

Clearing flags on attachment: 283455

Committed r203133: <http://trac.webkit.org/changeset/203133>
Comment 5 Chris Dumez 2016-07-12 15:44:11 PDT
All reviewed patches have been landed.  Closing bug.