Bug 187165 - Stop using lambdas for WebResourceLoadStatisticsStore to interact with its WebsiteDataStore
Summary: Stop using lambdas for WebResourceLoadStatisticsStore to interact with its We...
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: 187189
Blocks:
  Show dependency treegraph
 
Reported: 2018-06-28 18:33 PDT by Chris Dumez
Modified: 2018-06-29 12:14 PDT (History)
6 users (show)

See Also:


Attachments
Patch (15.85 KB, patch)
2018-06-28 18:39 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (15.80 KB, patch)
2018-06-28 18:52 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (16.08 KB, patch)
2018-06-28 18:57 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 2018-06-28 18:33:34 PDT
Stop using lambdas for WebResourceLoadStatisticsStore to interact with its WebsiteDataStore. Instead, WebResourceLoadStatisticsStore now holds a weak pointer to its WebsiteDataStore and is able to call methods on it directly. Reducing the indirection makes the code less complex and more understandable.
Comment 1 Chris Dumez 2018-06-28 18:39:05 PDT
Created attachment 343880 [details]
Patch
Comment 2 Chris Dumez 2018-06-28 18:52:22 PDT
Created attachment 343881 [details]
Patch
Comment 3 Chris Dumez 2018-06-28 18:57:35 PDT
Created attachment 343882 [details]
Patch
Comment 4 Brent Fulgham 2018-06-29 09:26:53 PDT
Comment on attachment 343882 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=343882&action=review

r=me

> Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:1480
> +    m_resourceLoadStatistics->setStatisticsTestingCallback(WTFMove(callback));

Yes, I like this much better. We only worry about the testing callback in the one case where we need it.
Comment 5 Brent Fulgham 2018-06-29 09:27:10 PDT
Comment on attachment 343882 [details]
Patch

r=me
Comment 6 Brent Fulgham 2018-06-29 09:27:40 PDT
Comment on attachment 343882 [details]
Patch

r=me
Comment 7 WebKit Commit Bot 2018-06-29 09:54:12 PDT
Comment on attachment 343882 [details]
Patch

Clearing flags on attachment: 343882

Committed r233359: <https://trac.webkit.org/changeset/233359>
Comment 8 WebKit Commit Bot 2018-06-29 09:54:14 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Radar WebKit Bug Importer 2018-06-29 09:55:24 PDT
<rdar://problem/41639643>