Bug 214401

Summary: Fix ITP data summary when using the memory store and blocking all third-party cookies
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: katherine_cheney, mcatanzaro, webkit-bug-importer, wilander, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 213493    
Attachments:
Description Flags
Patch
mcatanzaro: review+
Patch for landing none

Description Carlos Garcia Campos 2020-07-16 03:31:15 PDT
The memory store behaves differently than the database one, it only includes prevalent resources in the list, while the database store includes all resources when cooking blocking policy is All.
Comment 1 Carlos Garcia Campos 2020-07-16 03:34:05 PDT
Created attachment 404432 [details]
Patch
Comment 2 Michael Catanzaro 2020-07-16 05:52:00 PDT
Comment on attachment 404432 [details]
Patch

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

I'm pretty sure this change is correct.

Let's give John a day or two to do the final review, though, since it's his code.

> Source/WebKit/ChangeLog:3
> +        Fix ITP data summary when using the memory satre and blocking all third-party cookies

memory store
Comment 3 Kate Cheney 2020-07-20 08:56:40 PDT
Great catch! I am the engineer who added the ITP data summary, this change looks good. It would be nice to also update the ITP data summary test case in this patch before landing, looks like it is missing the piece of code which turns off database mode.

You can turn it off by adding:

 static bool doneFlag = false;
    [dataStore _setUseITPDatabase:false completionHandler: ^(void) {
        doneFlag = true;
    }];

    TestWebKitAPI::Util::run(&doneFlag);

right after calling 

[dataStore _setResourceLoadStatisticsEnabled:YES] 

in the GetResourceLoadStatisticsDataSummary test in TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm. The test should fail before your change, and pass after.
Comment 4 Carlos Garcia Campos 2020-07-21 03:08:42 PDT
Created attachment 404805 [details]
Patch for landing
Comment 5 Carlos Garcia Campos 2020-07-21 05:19:00 PDT
Committed r264650: <https://trac.webkit.org/changeset/264650>
Comment 6 Radar WebKit Bug Importer 2020-07-21 05:19:15 PDT
<rdar://problem/65878342>