Use a SQLite database to hold the ResourceLoadStatistics data
authorHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2019 04:24:44 +0000 (04:24 +0000)
committerHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2019 04:24:44 +0000 (04:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194867
<rdar://problem/24240854>

Unreviewed build fix for WinCairo.

ResourceLoadStatisticsDebug and RELEASE_LOG_INFO_IF are not
defined because WinCairo port defines RELEASE_LOG_DISABLED.

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess): Enclosed RELEASE_LOG_INFO_IF with #if !RELEASE_LOG_DISABLED.
(WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener): Ditto.
(WebKit::ResourceLoadStatisticsDatabaseStore::updateCookieBlocking): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242409 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp

index 5b243e0..774336a 100644 (file)
@@ -1,3 +1,19 @@
+2019-03-04  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        Use a SQLite database to hold the ResourceLoadStatistics data
+        https://bugs.webkit.org/show_bug.cgi?id=194867
+        <rdar://problem/24240854>
+
+        Unreviewed build fix for WinCairo.
+
+        ResourceLoadStatisticsDebug and RELEASE_LOG_INFO_IF are not
+        defined because WinCairo port defines RELEASE_LOG_DISABLED.
+
+        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
+        (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess): Enclosed RELEASE_LOG_INFO_IF with #if !RELEASE_LOG_DISABLED.
+        (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener): Ditto.
+        (WebKit::ResourceLoadStatisticsDatabaseStore::updateCookieBlocking): Ditto.
+
 2019-03-04  Brent Fulgham  <bfulgham@apple.com>
 
         Use a SQLite database to hold the ResourceLoadStatistics data
index 82c8e94..a80f331 100644 (file)
@@ -734,12 +734,16 @@ void ResourceLoadStatisticsDatabaseStore::requestStorageAccess(SubFrameDomain&&
 
     switch (cookieTreatmentForOrigin(subFrameDomain)) {
     case CookieTreatmentResult::BlockAndPurge: {
+#if !RELEASE_LOG_DISABLED
         RELEASE_LOG_INFO_IF(debugLoggingEnabled(), ResourceLoadStatisticsDebug, "Cannot grant storage access to %{public}s since its cookies are blocked in third-party contexts and it has not received user interaction as first-party.", subFrameDomain.string().utf8().data());
+#endif
         completionHandler(StorageAccessStatus::CannotRequestAccess);
         }
         return;
     case CookieTreatmentResult::BlockAndKeep: {
+#if !RELEASE_LOG_DISABLED
         RELEASE_LOG_INFO_IF(debugLoggingEnabled(), ResourceLoadStatisticsDebug, "No need to grant storage access to %{public}s since its cookies are not blocked in third-party contexts.", subFrameDomain.string().utf8().data());
+#endif
         completionHandler(StorageAccessStatus::HasAccess);
         }
         return;
@@ -750,13 +754,17 @@ void ResourceLoadStatisticsDatabaseStore::requestStorageAccess(SubFrameDomain&&
 
     auto userWasPromptedEarlier = promptEnabled && hasUserGrantedStorageAccessThroughPrompt(subFrameStatus.second, topFrameDomain);
     if (promptEnabled && !userWasPromptedEarlier) {
+#if !RELEASE_LOG_DISABLED
         RELEASE_LOG_INFO_IF(debugLoggingEnabled(), ResourceLoadStatisticsDebug, "About to ask the user whether they want to grant storage access to %{public}s under %{public}s or not.", subFrameDomain.string().utf8().data(), topFrameDomain.string().utf8().data());
+#endif
         completionHandler(StorageAccessStatus::RequiresUserPrompt);
         return;
     }
 
+#if !RELEASE_LOG_DISABLED
     if (userWasPromptedEarlier)
         RELEASE_LOG_INFO_IF(debugLoggingEnabled(), ResourceLoadStatisticsDebug, "Storage access was granted to %{public}s under %{public}s.", subFrameDomain.string().utf8().data(), topFrameDomain.string().utf8().data());
+#endif
 
     SQLiteStatement incrementStorageAccess(m_database, makeString("UPDATE ObservedDomains SET timesAccessedAsFirstPartyDueToStorageAccessAPI = timesAccessedAsFirstPartyDueToStorageAccessAPI + 1 WHERE domainID = ", String::number(subFrameStatus.second)));
     if (incrementStorageAccess.prepare() != SQLITE_OK
@@ -783,7 +791,9 @@ void ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener(Domain
     if (cookieTreatmentForOrigin(domainInNeedOfStorageAccess) != CookieTreatmentResult::Allow)
         return;
 
+#if !RELEASE_LOG_DISABLED
     RELEASE_LOG_INFO_IF(debugLoggingEnabled(), ResourceLoadStatisticsDebug, "[Temporary combatibility fix] Storage access was granted for %{public}s under opener page from %{public}s, with user interaction in the opened window.", domainInNeedOfStorageAccess.string().utf8().data(), openerDomain.string().utf8().data());
+#endif
     grantStorageAccessInternal(WTFMove(domainInNeedOfStorageAccess), WTFMove(openerDomain), WTF::nullopt, openerPageID, false, [](bool) { });
 }
 
@@ -861,7 +871,9 @@ Vector<RegistrableDomain> ResourceLoadStatisticsDatabaseStore::ensurePrevalentRe
         ensureResourceStatisticsForRegistrableDomain(debugManualPrevalentResource());
         setPrevalentResource(debugManualPrevalentResource(), ResourceLoadPrevalence::High);
         primaryDomainsToBlock.uncheckedAppend(debugManualPrevalentResource());
+#if !RELEASE_LOG_DISABLED
         RELEASE_LOG_INFO(ResourceLoadStatisticsDebug, "Did set %{public}s as prevalent resource for the purposes of ITP Debug Mode.", debugManualPrevalentResource().string().utf8().data());
+#endif
     }
 
     return primaryDomainsToBlock;
@@ -1351,7 +1363,9 @@ void ResourceLoadStatisticsDatabaseStore::updateCookieBlocking(CompletionHandler
                 completionHandler();
                 if (!weakThis)
                     return;
+#if !RELEASE_LOG_DISABLED
                 RELEASE_LOG_INFO_IF(weakThis->debugLoggingEnabled(), ResourceLoadStatisticsDebug, "Done updating cookie blocking.");
+#endif
             });
         });
     });