Bug 209463 - Refactor ResourceLoadStatisticsStore::registrableDomainsToDeleteOrRestrictWebsiteDataFor() to return a struct instead of a Vector of pairs
Summary: Refactor ResourceLoadStatisticsStore::registrableDomainsToDeleteOrRestrictWeb...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: John Wilander
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-03-23 21:17 PDT by John Wilander
Modified: 2020-03-24 20:21 PDT (History)
3 users (show)

See Also:


Attachments
Patch (44.10 KB, patch)
2020-03-23 21:32 PDT, John Wilander
no flags Details | Formatted Diff | Diff
Patch for landing (45.00 KB, patch)
2020-03-24 19:53 PDT, John Wilander
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].