Bug 174013

Summary: ResourceLoadObserver does not need a ResourceLoadStatisticsStore
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebCore Misc.Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, commit-queue, ggaren, wilander
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
WIP Patch
none
WIP Patch
none
WIP Patch
none
Patch
none
Patch none

Chris Dumez
Reported 2017-06-29 21:18:33 PDT
ResourceLoadObserver does not need a ResourceLoadStatisticsStore. ResourceLoadStatisticsStore is too complicated for its needs. ResourceLoadStatisticsStore can then be moved to WebKit2/UIProcess.
Attachments
WIP Patch (31.23 KB, patch)
2017-06-29 21:20 PDT, Chris Dumez
no flags
WIP Patch (33.33 KB, patch)
2017-06-29 21:31 PDT, Chris Dumez
no flags
WIP Patch (33.46 KB, patch)
2017-06-29 22:03 PDT, Chris Dumez
no flags
Patch (38.23 KB, patch)
2017-06-30 09:11 PDT, Chris Dumez
no flags
Patch (38.51 KB, patch)
2017-06-30 09:15 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2017-06-29 21:20:24 PDT
Created attachment 314226 [details] WIP Patch
Chris Dumez
Comment 2 2017-06-29 21:31:56 PDT
Created attachment 314227 [details] WIP Patch
Chris Dumez
Comment 3 2017-06-29 22:03:40 PDT
Created attachment 314233 [details] WIP Patch
Brent Fulgham
Comment 4 2017-06-29 23:22:08 PDT
Comment on attachment 314233 [details] WIP Patch View in context: https://bugs.webkit.org/attachment.cgi?id=314233&action=review This is a GREAT cleanup! I’m so excited to see these simplifications. Thank you! > Source/WebCore/loader/ResourceLoadObserver.cpp:112 > + shouldCallNotificationCallback = targetStatistics.dataRecordsRemoved > 0; Why don’t we just declare and initialize right here? > Source/WebCore/loader/ResourceLoadObserver.cpp:194 > + shouldCallNotificationCallback = targetStatistics.dataRecordsRemoved > 0; Bool shoukdCallNotificationCallback ... ? > Source/WebCore/loader/ResourceLoadObserver.cpp:204 > + auto& updatedTargetStatistics = ensureResourceStatisticsForPrimaryDomain(targetPrimaryDomain); Could we do your ‘take’ approach here like you did in an earlier patch and avoid getting multiple times? > Source/WebCore/loader/ResourceLoadObserver.cpp:261 > + shouldCallNotificationCallback = targetStatistics.dataRecordsRemoved > 0; Bool ... > Source/WebCore/loader/ResourceLoadObserver.cpp:294 > + WallTime newTime = reduceTimeResolution(WallTime::now()); Auto? > Source/WebCore/loader/ResourceLoadObserver.cpp:335 > + return "Statistics for " + origin + ":\n" + iter->value.toString(); Should this be done with a StringBuilder? I’m never sure when it is the best time to do so. > Source/WebCore/loader/ResourceLoadObserver.cpp:338 > +Vector<ResourceLoadStatistics> ResourceLoadObserver::takeStatistics() Should this be returning a move value? Or does return-value-optimization do the right thing here? > Source/WebCore/loader/ResourceLoadObserver.h:-59 > - WEBCORE_EXPORT void setStatisticsQueue(Ref<WTF::WorkQueue>&&); Hooray! > Source/WebKit/mac/WebView/WebView.mm:-1180 > - Hooray ++ ! > Source/WebKit2/WebProcess/WebProcess.cpp:202 > + ResourceLoadObserver::sharedObserver().setNotificationCallback([this] { ResourceLoadObserver::shared() ?
Chris Dumez
Comment 5 2017-06-30 09:09:04 PDT
Comment on attachment 314233 [details] WIP Patch View in context: https://bugs.webkit.org/attachment.cgi?id=314233&action=review >> Source/WebCore/loader/ResourceLoadObserver.cpp:335 >> + return "Statistics for " + origin + ":\n" + iter->value.toString(); > > Should this be done with a StringBuilder? I’m never sure when it is the best time to do so. I don't know either but this is used only for testing so this is probably good enough. It has the benefit of being concise. >> Source/WebCore/loader/ResourceLoadObserver.cpp:338 >> +Vector<ResourceLoadStatistics> ResourceLoadObserver::takeStatistics() > > Should this be returning a move value? Or does return-value-optimization do the right thing here? return-value-optimization does the right thing.
Chris Dumez
Comment 6 2017-06-30 09:11:55 PDT
Chris Dumez
Comment 7 2017-06-30 09:15:08 PDT
Brent Fulgham
Comment 8 2017-06-30 11:15:39 PDT
Comment on attachment 314271 [details] Patch Looks great. r=me.
Chris Dumez
Comment 9 2017-06-30 11:18:27 PDT
Comment on attachment 314271 [details] Patch Clearing flags on attachment: 314271 Committed r219005: <http://trac.webkit.org/changeset/219005>
Chris Dumez
Comment 10 2017-06-30 11:18:29 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.