Bug 173174 - Make sure we protect |this| in lambdas in WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver()
Summary: Make sure we protect |this| in lambdas in WebResourceLoadStatisticsStore::reg...
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: 2017-06-09 11:37 PDT by Chris Dumez
Modified: 2017-06-09 15:17 PDT (History)
5 users (show)

See Also:


Attachments
Patch (2.49 KB, patch)
2017-06-09 11:39 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (2.49 KB, patch)
2017-06-09 11:44 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 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.