Bug 187165

Summary: Stop using lambdas for WebResourceLoadStatisticsStore to interact with its WebsiteDataStore
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, commit-queue, webkit-bug-importer, wilander, youennf, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 187189    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

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>