Title: [264650] trunk
Revision
264650
Author
carlo...@webkit.org
Date
2020-07-21 05:18:53 -0700 (Tue, 21 Jul 2020)

Log Message

Fix ITP data summary when using the memory store and blocking all third-party cookies
https://bugs.webkit.org/show_bug.cgi?id=214401

Reviewed by Michael Catanzaro.

Source/WebKit:

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.

* NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::aggregatedThirdPartyData const): Only check isPrevalentResource if
third party cookie blocking mode is not All to decide whether to include the domain in the report.

Tools:

Fix GetResourceLoadStatisticsDataSummary test to actually use the memory store.

* TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm:
(TEST):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (264649 => 264650)


--- trunk/Source/WebKit/ChangeLog	2020-07-21 09:04:27 UTC (rev 264649)
+++ trunk/Source/WebKit/ChangeLog	2020-07-21 12:18:53 UTC (rev 264650)
@@ -1,5 +1,19 @@
 2020-07-21  Carlos Garcia Campos  <cgar...@igalia.com>
 
+        Fix ITP data summary when using the memory store and blocking all third-party cookies
+        https://bugs.webkit.org/show_bug.cgi?id=214401
+
+        Reviewed by Michael Catanzaro.
+
+        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.
+
+        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
+        (WebKit::ResourceLoadStatisticsMemoryStore::aggregatedThirdPartyData const): Only check isPrevalentResource if
+        third party cookie blocking mode is not All to decide whether to include the domain in the report.
+
+2020-07-21  Carlos Garcia Campos  <cgar...@igalia.com>
+
         [GTK] Prepare unit tests for GTK4
         https://bugs.webkit.org/show_bug.cgi?id=214251
 

Modified: trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp (264649 => 264650)


--- trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp	2020-07-21 09:04:27 UTC (rev 264649)
+++ trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp	2020-07-21 12:18:53 UTC (rev 264650)
@@ -139,7 +139,7 @@
 
     Vector<WebResourceLoadStatisticsStore::ThirdPartyData> thirdPartyDataList;
     for (auto& statistic : m_resourceStatisticsMap.values()) {
-        if (hasBeenThirdParty(statistic) && statistic.isPrevalentResource)
+        if (hasBeenThirdParty(statistic) && (thirdPartyCookieBlockingMode() == ThirdPartyCookieBlockingMode::All || statistic.isPrevalentResource))
             thirdPartyDataList.append(WebResourceLoadStatisticsStore::ThirdPartyData { statistic.registrableDomain, getThirdPartyDataForSpecificFirstPartyDomains(statistic) });
     }
     std::sort(thirdPartyDataList.rbegin(), thirdPartyDataList.rend());

Modified: trunk/Tools/ChangeLog (264649 => 264650)


--- trunk/Tools/ChangeLog	2020-07-21 09:04:27 UTC (rev 264649)
+++ trunk/Tools/ChangeLog	2020-07-21 12:18:53 UTC (rev 264650)
@@ -1,5 +1,17 @@
 2020-07-21  Carlos Garcia Campos  <cgar...@igalia.com>
 
+        Fix ITP data summary when using the memory store and blocking all third-party cookies
+        https://bugs.webkit.org/show_bug.cgi?id=214401
+
+        Reviewed by Michael Catanzaro.
+
+        Fix GetResourceLoadStatisticsDataSummary test to actually use the memory store.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm:
+        (TEST):
+
+2020-07-21  Carlos Garcia Campos  <cgar...@igalia.com>
+
         [GTK] Prepare unit tests for GTK4
         https://bugs.webkit.org/show_bug.cgi?id=214251
 

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm (264649 => 264650)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm	2020-07-21 09:04:27 UTC (rev 264649)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm	2020-07-21 12:18:53 UTC (rev 264650)
@@ -970,6 +970,13 @@
     [dataStore _setResourceLoadStatisticsEnabled:YES];
 
     static bool doneFlag = false;
+    [dataStore _setUseITPDatabase:false completionHandler: ^(void) {
+        doneFlag = true;
+    }];
+
+    TestWebKitAPI::Util::run(&doneFlag);
+
+    doneFlag = false;
     [dataStore _clearResourceLoadStatistics:^(void) {
         doneFlag = true;
     }];
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to