Diff
Modified: trunk/Source/WebKit/ChangeLog (246560 => 246561)
--- trunk/Source/WebKit/ChangeLog 2019-06-18 19:50:06 UTC (rev 246560)
+++ trunk/Source/WebKit/ChangeLog 2019-06-18 20:22:40 UTC (rev 246561)
@@ -1,3 +1,28 @@
+2019-06-18 John Wilander <wilan...@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 Brent Fulgham.
+
+ * 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 Youenn Fablet <you...@apple.com>
StorageManager::removeAllowedSessionStorageNamespaceConnection should make sure its storageNamespaceID is valid
Modified: trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp (246560 => 246561)
--- trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp 2019-06-18 19:50:06 UTC (rev 246560)
+++ trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp 2019-06-18 20:22:40 UTC (rev 246561)
@@ -751,16 +751,12 @@
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 @@
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 @@
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 @@
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 @@
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.");
});
});
});
Modified: trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp (246560 => 246561)
--- trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp 2019-06-18 19:50:06 UTC (rev 246560)
+++ trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp 2019-06-18 20:22:40 UTC (rev 246561)
@@ -230,17 +230,13 @@
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;
}
@@ -247,17 +243,13 @@
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 @@
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 @@
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 @@
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.");
});
});
});
Modified: trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp (246560 => 246561)
--- trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp 2019-06-18 19:50:06 UTC (rev 246560)
+++ trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp 2019-06-18 20:22:40 UTC (rev 246561)
@@ -201,9 +201,7 @@
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 +221,7 @@
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 +283,8 @@
{
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 +571,12 @@
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,7 +587,7 @@
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;
}
@@ -601,11 +594,7 @@
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
Modified: trunk/Source/WebKit/Platform/Logging.h (246560 => 246561)
--- trunk/Source/WebKit/Platform/Logging.h 2019-06-18 19:50:06 UTC (rev 246560)
+++ trunk/Source/WebKit/Platform/Logging.h 2019-06-18 20:22:40 UTC (rev 246561)
@@ -55,6 +55,7 @@
M(IconDatabase) \
M(IndexedDB) \
M(IPC) \
+ M(ITPDebug) \
M(KeyHandling) \
M(Layers) \
M(Layout) \
@@ -77,7 +78,6 @@
M(RemoteLayerTree) \
M(Resize) \
M(ResourceLoadStatistics) \
- M(ResourceLoadStatisticsDebug) \
M(Scrolling) \
M(Selection) \
M(ServiceWorker) \