Title: [261115] trunk/Source/WebKit
Revision
261115
Author
[email protected]
Date
2020-05-04 15:00:27 -0700 (Mon, 04 May 2020)

Log Message

REGRESSION (JazzkonE): ResourceLoadStatisticsDatabaseStore checks 'hasHadUserInteraction' without ensuring the domain has been added to the ITP database (211388)
https://bugs.webkit.org/show_bug.cgi?id=211388
<rdar://problem/62849919>

Reviewed by John Wilander.

A spurious log entry is created if we check 'hasHadUserInteraction' before inserting a row for the domain
being checked (if that domain had not previosly been observed). This patch changes the order of the two
commands to avoid this possibility. This makes the database implementation behave like the in-memory version.

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::ResourceLoadStatisticsDatabaseStore::logUserInteraction):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (261114 => 261115)


--- trunk/Source/WebKit/ChangeLog	2020-05-04 21:58:29 UTC (rev 261114)
+++ trunk/Source/WebKit/ChangeLog	2020-05-04 22:00:27 UTC (rev 261115)
@@ -1,3 +1,18 @@
+2020-05-04  Brent Fulgham  <[email protected]>
+
+        REGRESSION (JazzkonE): ResourceLoadStatisticsDatabaseStore checks 'hasHadUserInteraction' without ensuring the domain has been added to the ITP database (211388)
+        https://bugs.webkit.org/show_bug.cgi?id=211388
+        <rdar://problem/62849919>
+
+        Reviewed by John Wilander.
+
+        A spurious log entry is created if we check 'hasHadUserInteraction' before inserting a row for the domain
+        being checked (if that domain had not previosly been observed). This patch changes the order of the two
+        commands to avoid this possibility. This makes the database implementation behave like the in-memory version.
+
+        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
+        (WebKit::ResourceLoadStatisticsDatabaseStore::logUserInteraction):
+
 2020-05-04  Alex Christensen  <[email protected]>
 
         Reduce AlternativeService assertion to debug-only assert

Modified: trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp (261114 => 261115)


--- trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp	2020-05-04 21:58:29 UTC (rev 261114)
+++ trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp	2020-05-04 22:00:27 UTC (rev 261115)
@@ -1852,12 +1852,12 @@
 {
     ASSERT(!RunLoop::isMain());
 
-    bool didHavePreviousUserInteraction = hasHadUserInteraction(domain, OperatingDatesWindow::Long);
     auto result = ensureResourceStatisticsForRegistrableDomain(domain);
     if (!result.second) {
         RELEASE_LOG_ERROR_IF_ALLOWED(m_sessionID, "%p - ResourceLoadStatisticsDatabaseStore::logUserInteraction was not completed due to failed insert attempt", this);
         return;
     }
+    bool didHavePreviousUserInteraction = hasHadUserInteraction(domain, OperatingDatesWindow::Long);
     setUserInteraction(domain, true, WallTime::now());
     if (didHavePreviousUserInteraction) {
         completionHandler();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to