WebKit Bugzilla
Attachment 372351 Details for
Bug 198970
: Change log channel name from ResourceLoadStatisticsDebug to ITPDebug and remove unnecessary #if !RELEASE_LOG_DISABLED
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198970-20190618104736.patch (text/plain), 18.59 KB, created by
John Wilander
on 2019-06-18 10:47:37 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
John Wilander
Created:
2019-06-18 10:47:37 PDT
Size:
18.59 KB
patch
obsolete
>Subversion Revision: 246546 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index b445a8ea571e73f2bf4061e3b7cdb20f43eac808..3b511a4bb53edd01573aa5c7b9496cd16d58d985 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,28 @@ >+2019-06-18 John Wilander <wilander@apple.com> >+ >+ Change log channel name from ResourceLoadStatisticsDebug to ITPDebug and remove unnecessary #if !RELEASE_LOG_DISABLED >+ https://bugs.webkit.org/show_bug.cgi?id=198970 >+ <rdar://problem/51855836> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: >+ (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccess): >+ (WebKit::ResourceLoadStatisticsDatabaseStore::requestStorageAccessUnderOpener): >+ (WebKit::ResourceLoadStatisticsDatabaseStore::ensurePrevalentResourcesForDebugMode): >+ (WebKit::ResourceLoadStatisticsDatabaseStore::updateCookieBlocking): >+ * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: >+ (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccess): >+ (WebKit::ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener): >+ (WebKit::ResourceLoadStatisticsMemoryStore::ensurePrevalentResourcesForDebugMode): >+ (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking): >+ * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp: >+ (WebKit::domainsToString): >+ (WebKit::ResourceLoadStatisticsStore::removeDataRecords): >+ (WebKit::ResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode): >+ (WebKit::ResourceLoadStatisticsStore::debugLogDomainsInBatches): >+ * Platform/Logging.h: >+ > 2019-06-18 Tim Horton <timothy_horton@apple.com> > > Expose DataDetectors context generation on WKContentViewInteraction >diff --git a/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp b/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp >index b689c3e25ad823ecf6d304ee789ca9f345da2d42..3c2ecd5bc8ce5869f40b6c436bb5dd13e674765f 100644 >--- a/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp >+++ b/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp >@@ -751,16 +751,12 @@ 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 >+ RELEASE_LOG_INFO_IF(debugLoggingEnabled(), ITPDebug, "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()); > 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 >+ RELEASE_LOG_INFO_IF(debugLoggingEnabled(), ITPDebug, "No need to grant storage access to %{public}s since its cookies are not blocked in third-party contexts.", subFrameDomain.string().utf8().data()); > completionHandler(StorageAccessStatus::HasAccess); > } > return; >@@ -771,17 +767,13 @@ void ResourceLoadStatisticsDatabaseStore::requestStorageAccess(SubFrameDomain&& > > auto userWasPromptedEarlier = hasUserGrantedStorageAccessThroughPrompt(subFrameStatus.second, topFrameDomain); > if (userWasPromptedEarlier == StorageAccessPromptWasShown::No) { >-#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 >+ RELEASE_LOG_INFO_IF(debugLoggingEnabled(), ITPDebug, "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()); > completionHandler(StorageAccessStatus::RequiresUserPrompt); > return; > } > >-#if !RELEASE_LOG_DISABLED > if (userWasPromptedEarlier == StorageAccessPromptWasShown::Yes) >- 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 >+ RELEASE_LOG_INFO_IF(debugLoggingEnabled(), ITPDebug, "Storage access was granted to %{public}s under %{public}s.", subFrameDomain.string().utf8().data(), topFrameDomain.string().utf8().data()); > > SQLiteStatement incrementStorageAccess(m_database, makeString("UPDATE ObservedDomains SET timesAccessedAsFirstPartyDueToStorageAccessAPI = timesAccessedAsFirstPartyDueToStorageAccessAPI + 1 WHERE domainID = ", String::number(subFrameStatus.second))); > if (incrementStorageAccess.prepare() != SQLITE_OK >@@ -808,9 +800,7 @@ 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 >+ RELEASE_LOG_INFO_IF(debugLoggingEnabled(), ITPDebug, "[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()); > grantStorageAccessInternal(WTFMove(domainInNeedOfStorageAccess), WTFMove(openerDomain), WTF::nullopt, openerPageID, StorageAccessPromptWasShown::No, [](StorageAccessWasGranted) { }); > } > >@@ -887,9 +877,7 @@ 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 >+ RELEASE_LOG_INFO(ITPDebug, "Did set %{public}s as prevalent resource for the purposes of ITP Debug Mode.", debugManualPrevalentResource().string().utf8().data()); > } > > return primaryDomainsToBlock; >@@ -1400,9 +1388,7 @@ void ResourceLoadStatisticsDatabaseStore::updateCookieBlocking(CompletionHandler > completionHandler(); > if (!weakThis) > return; >-#if !RELEASE_LOG_DISABLED >- RELEASE_LOG_INFO_IF(weakThis->debugLoggingEnabled(), ResourceLoadStatisticsDebug, "Done updating cookie blocking."); >-#endif >+ RELEASE_LOG_INFO_IF(weakThis->debugLoggingEnabled(), ITPDebug, "Done updating cookie blocking."); > }); > }); > }); >diff --git a/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp b/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp >index b8ee09578a3064ee8e63ffa277bc5182c8720c26..82134fe76d70e3cf508209a191cce44e094b577e 100644 >--- a/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp >+++ b/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp >@@ -230,34 +230,26 @@ void ResourceLoadStatisticsMemoryStore::requestStorageAccess(SubFrameDomain&& su > > auto& subFrameStatistic = ensureResourceStatisticsForRegistrableDomain(subFrameDomain); > if (shouldBlockAndPurgeCookies(subFrameStatistic)) { >-#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 >+ RELEASE_LOG_INFO_IF(debugLoggingEnabled(), ITPDebug, "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()); > completionHandler(StorageAccessStatus::CannotRequestAccess); > return; > } > > if (!shouldBlockAndKeepCookies(subFrameStatistic)) { >-#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 >+ RELEASE_LOG_INFO_IF(debugLoggingEnabled(), ITPDebug, "No need to grant storage access to %{public}s since its cookies are not blocked in third-party contexts.", subFrameDomain.string().utf8().data()); > completionHandler(StorageAccessStatus::HasAccess); > return; > } > > auto userWasPromptedEarlier = hasUserGrantedStorageAccessThroughPrompt(subFrameStatistic, topFrameDomain); > if (userWasPromptedEarlier == StorageAccessPromptWasShown::No) { >-#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 >+ RELEASE_LOG_INFO_IF(debugLoggingEnabled(), ITPDebug, "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()); > completionHandler(StorageAccessStatus::RequiresUserPrompt); > return; > } > >-#if !RELEASE_LOG_DISABLED > if (userWasPromptedEarlier == StorageAccessPromptWasShown::Yes) >- 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 >+ RELEASE_LOG_INFO_IF(debugLoggingEnabled(), ITPDebug, "Storage access was granted to %{public}s under %{public}s.", subFrameDomain.string().utf8().data(), topFrameDomain.string().utf8().data()); > > subFrameStatistic.timesAccessedAsFirstPartyDueToStorageAccessAPI++; > >@@ -281,9 +273,7 @@ void ResourceLoadStatisticsMemoryStore::requestStorageAccessUnderOpener(DomainIn > if (!cookiesBlockedAndPurged && !shouldBlockAndKeepCookies(domainInNeedOfStorageAccessStatistic)) > 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 >+ RELEASE_LOG_INFO_IF(debugLoggingEnabled(), ITPDebug, "[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()); > grantStorageAccessInternal(WTFMove(domainInNeedOfStorageAccess), WTFMove(openerDomain), WTF::nullopt, openerPageID, StorageAccessPromptWasShown::No, [](StorageAccessWasGranted) { }); > } > >@@ -348,9 +338,7 @@ Vector<RegistrableDomain> ResourceLoadStatisticsMemoryStore::ensurePrevalentReso > auto& manualResourceStatistic = ensureResourceStatisticsForRegistrableDomain(debugManualPrevalentResource()); > setPrevalentResource(manualResourceStatistic, ResourceLoadPrevalence::High); > domainsToBlock.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 >+ RELEASE_LOG_INFO(ITPDebug, "Did set %{public}s as prevalent resource for the purposes of ITP Debug Mode.", debugManualPrevalentResource().string().utf8().data()); > } > > return domainsToBlock; >@@ -772,9 +760,7 @@ void ResourceLoadStatisticsMemoryStore::updateCookieBlocking(CompletionHandler<v > completionHandler(); > if (!weakThis) > return; >-#if !RELEASE_LOG_DISABLED >- RELEASE_LOG_INFO_IF(weakThis->debugLoggingEnabled(), ResourceLoadStatisticsDebug, "Done updating cookie blocking."); >-#endif >+ RELEASE_LOG_INFO_IF(weakThis->debugLoggingEnabled(), ITPDebug, "Done updating cookie blocking."); > }); > }); > }); >diff --git a/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp b/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp >index f8078b3083d57a6f7b41652ddabfa537b82ed072..77851ab1a8de3f4dfae4c7ede45fc14d46dc76e7 100644 >--- a/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp >+++ b/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp >@@ -53,7 +53,6 @@ constexpr Seconds minimumStatisticsProcessingInterval { 5_s }; > constexpr unsigned operatingDatesWindowLong { 30 }; > constexpr unsigned operatingDatesWindowShort { 7 }; > >-#if !RELEASE_LOG_DISABLED > static String domainsToString(const Vector<RegistrableDomain>& domains) > { > StringBuilder builder; >@@ -86,7 +85,6 @@ static String domainsToString(const HashMap<RegistrableDomain, WebsiteDataToRemo > } > return builder.toString(); > } >-#endif > > OperatingDate OperatingDate::fromWallTime(WallTime time) > { >@@ -201,9 +199,7 @@ void ResourceLoadStatisticsStore::removeDataRecords(CompletionHandler<void()>&& > return; > } > >-#if !RELEASE_LOG_DISABLED >- RELEASE_LOG_INFO_IF(m_debugLoggingEnabled, ResourceLoadStatisticsDebug, "About to remove data records for %{public}s.", domainsToString(domainsToRemoveWebsiteDataFor).utf8().data()); >-#endif >+ RELEASE_LOG_INFO_IF(m_debugLoggingEnabled, ITPDebug, "About to remove data records for %{public}s.", domainsToString(domainsToRemoveWebsiteDataFor).utf8().data()); > > setDataRecordsBeingRemoved(true); > >@@ -223,9 +219,7 @@ void ResourceLoadStatisticsStore::removeDataRecords(CompletionHandler<void()>&& > weakThis->setDataRecordsBeingRemoved(false); > weakThis->m_store.tryDumpResourceLoadStatistics(); > completionHandler(); >-#if !RELEASE_LOG_DISABLED >- RELEASE_LOG_INFO_IF(weakThis->m_debugLoggingEnabled, ResourceLoadStatisticsDebug, "Done removing data records."); >-#endif >+ RELEASE_LOG_INFO_IF(weakThis->m_debugLoggingEnabled, ITPDebug, "Done removing data records."); > }); > }); > }); >@@ -287,10 +281,8 @@ void ResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode(bool enable > { > ASSERT(!RunLoop::isMain()); > >-#if !RELEASE_LOG_DISABLED > if (enable) >- RELEASE_LOG_INFO(ResourceLoadStatisticsDebug, "Turned ITP Debug Mode on."); >-#endif >+ RELEASE_LOG_INFO(ITPDebug, "Turned ITP Debug Mode on."); > > m_debugModeEnabled = enable; > m_debugLoggingEnabled = enable; >@@ -577,13 +569,12 @@ void ResourceLoadStatisticsStore::didCreateNetworkProcess() > > void ResourceLoadStatisticsStore::debugLogDomainsInBatches(const char* action, const Vector<RegistrableDomain>& domains) > { >-#if !RELEASE_LOG_DISABLED > static const auto maxNumberOfDomainsInOneLogStatement = 50; > if (domains.isEmpty()) > return; > > if (domains.size() <= maxNumberOfDomainsInOneLogStatement) { >- RELEASE_LOG_INFO(ResourceLoadStatisticsDebug, "About to %{public}s cookies in third-party contexts for: %{public}s.", action, domainsToString(domains).utf8().data()); >+ RELEASE_LOG_INFO(ITPDebug, "About to %{public}s cookies in third-party contexts for: %{public}s.", action, domainsToString(domains).utf8().data()); > return; > } > >@@ -594,18 +585,14 @@ void ResourceLoadStatisticsStore::debugLogDomainsInBatches(const char* action, c > > for (auto& domain : domains) { > if (batch.size() == maxNumberOfDomainsInOneLogStatement) { >- RELEASE_LOG_INFO(ResourceLoadStatisticsDebug, "About to %{public}s cookies in third-party contexts for (%{public}d of %u): %{public}s.", action, batchNumber, numberOfBatches, domainsToString(batch).utf8().data()); >+ RELEASE_LOG_INFO(ITPDebug, "About to %{public}s cookies in third-party contexts for (%{public}d of %u): %{public}s.", action, batchNumber, numberOfBatches, domainsToString(batch).utf8().data()); > batch.shrink(0); > ++batchNumber; > } > batch.append(domain); > } > if (!batch.isEmpty()) >- RELEASE_LOG_INFO(ResourceLoadStatisticsDebug, "About to %{public}s cookies in third-party contexts for (%{public}d of %u): %{public}s.", action, batchNumber, numberOfBatches, domainsToString(batch).utf8().data()); >-#else >- UNUSED_PARAM(action); >- UNUSED_PARAM(domains); >-#endif >+ RELEASE_LOG_INFO(ITPDebug, "About to %{public}s cookies in third-party contexts for (%{public}d of %u): %{public}s.", action, batchNumber, numberOfBatches, domainsToString(batch).utf8().data()); > } > > } // namespace WebKit >diff --git a/Source/WebKit/Platform/Logging.h b/Source/WebKit/Platform/Logging.h >index ccf4c782f1430e3e25d058c61c5e06c1cb6ed611..d838e303ae7c192531444bcfdb0a023c1ffcd719 100644 >--- a/Source/WebKit/Platform/Logging.h >+++ b/Source/WebKit/Platform/Logging.h >@@ -55,6 +55,7 @@ extern "C" { > M(IconDatabase) \ > M(IndexedDB) \ > M(IPC) \ >+ M(ITPDebug) \ > M(KeyHandling) \ > M(Layers) \ > M(Layout) \ >@@ -77,7 +78,6 @@ extern "C" { > M(RemoteLayerTree) \ > M(Resize) \ > M(ResourceLoadStatistics) \ >- M(ResourceLoadStatisticsDebug) \ > M(Scrolling) \ > M(Selection) \ > M(ServiceWorker) \
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198970
:
372351
|
372357