Bug 173174

Summary: Make sure we protect |this| in lambdas in WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver()
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, commit-queue, darin, webkit-bug-importer, wilander
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Chris Dumez 2017-06-09 11:37:42 PDT
Make sure we protect |this| in lambdas in WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver().
Comment 1 Chris Dumez 2017-06-09 11:37:58 PDT
<rdar://problem/32598919>
Comment 2 Chris Dumez 2017-06-09 11:39:39 PDT
Created attachment 312464 [details]
Patch
Comment 3 Chris Dumez 2017-06-09 11:44:01 PDT
Created attachment 312466 [details]
Patch
Comment 4 Darin Adler 2017-06-09 11:49:58 PDT
Comment on attachment 312466 [details]
Patch

Looks good to me.

After this change, though, WebResourceLoadStatisticsStore::processStatisticsAndDataRecords is the one remaining lambda that captures [this], but does not ref/deref it. The one passed to coreStore().processStatistics. Perhaps that function is guaranteed to run synchronously?
Comment 5 Chris Dumez 2017-06-09 11:50:42 PDT
(In reply to Darin Adler from comment #4)
> Comment on attachment 312466 [details]
> Patch
> 
> Looks good to me.
> 
> After this change, though,
> WebResourceLoadStatisticsStore::processStatisticsAndDataRecords is the one
> remaining lambda that captures [this], but does not ref/deref it. The one
> passed to coreStore().processStatistics. Perhaps that function is guaranteed
> to run synchronously?

That one is safe because it is synchronous.
Comment 6 Chris Dumez 2017-06-09 11:52:13 PDT
Comment on attachment 312466 [details]
Patch

Clearing flags on attachment: 312466

Committed r218006: <http://trac.webkit.org/changeset/218006>
Comment 7 Chris Dumez 2017-06-09 11:52:14 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Chris Dumez 2017-06-09 15:17:40 PDT
Landed a follow-up fix in https://trac.webkit.org/r218022.