Bug 209463

Summary: Refactor ResourceLoadStatisticsStore::registrableDomainsToDeleteOrRestrictWebsiteDataFor() to return a struct instead of a Vector of pairs
Product: WebKit Reporter: John Wilander <wilander>
Component: WebKit Misc.Assignee: John Wilander <wilander>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, cdumez, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

Description John Wilander 2020-03-23 21:17:12 PDT
The current return type Vector<std::pair<RegistrableDomain, WebsiteDataToRemove>> of ResourceLoadStatisticsStore::registrableDomainsToDeleteOrRestrictWebsiteDataFor() is ill-suited for its purpose since the destination NetworkProcess::deleteAndRestrictWebsiteDataForRegistrableDomains() needs separate Vectors to delete website data for. It should instead return a struct with Vectors ready to use. This would also prepare for additional use of that struct for other types of website data deletion or restriction.
Comment 1 Radar WebKit Bug Importer 2020-03-23 21:17:32 PDT
<rdar://problem/60808759>
Comment 2 John Wilander 2020-03-23 21:19:46 PDT
This was requested by Alex Christensen as a follow-up when the code first landed: https://bugs.webkit.org/show_bug.cgi?id=195923#c7
Comment 3 John Wilander 2020-03-23 21:32:36 PDT
Created attachment 394352 [details]
Patch
Comment 4 John Wilander 2020-03-24 12:25:57 PDT
Comment on attachment 394352 [details]
Patch

Thanks, Alex!
Comment 5 EWS 2020-03-24 12:29:50 PDT
Committed r258928: <https://trac.webkit.org/changeset/258928>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 394352 [details].
Comment 6 Chris Dumez 2020-03-24 13:14:14 PDT
Reverted r258928 for reason:

Broke the build

Committed r258932: <https://trac.webkit.org/changeset/258932>
Comment 7 Chris Dumez 2020-03-24 13:14:42 PDT
(In reply to Chris Dumez from comment #6)
> Reverted r258928 for reason:
> 
> Broke the build
> 
> Committed r258932: <https://trac.webkit.org/changeset/258932>

In file included from WebKitBuild/Debug/DerivedSources/WebKit2/unified-sources/UnifiedSource10.cpp:3:
/Volumes/Data/WebKit/OpenSource/Source/WebKit/NetworkProcess/NetworkProcess.cpp:1783:71: error: no member named 'size' in 'WebKit::RegistrableDomainsToDeleteOrRestrictWebsiteDataFor'
            registrableDomainsToDelete.reserveInitialCapacity(domains.size());
Source/WebKit/NetworkProcess/NetworkProcess.cpp:1784:31: error: invalid range expression of type 'WebKit::RegistrableDomainsToDeleteOrRestrictWebsiteDataFor'; no viable 'begin' function available
            for (auto& domain : domains)
2 errors generated.
Comment 8 John Wilander 2020-03-24 19:53:28 PDT
Created attachment 394463 [details]
Patch for landing
Comment 9 EWS 2020-03-24 20:21:30 PDT
Committed r258969: <https://trac.webkit.org/changeset/258969>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 394463 [details].