Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 42860c4e30eafd4f3bb5d9db93216f397801171f
      
https://github.com/WebKit/WebKit/commit/42860c4e30eafd4f3bb5d9db93216f397801171f
  Author: Sihui Liu <sihui_...@apple.com>
  Date:   2024-03-18 (Mon, 18 Mar 2024)

  Changed paths:
    M Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp
    M Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.h

  Log Message:
  -----------
  Improve logging in ResourceLoadStatisticsStore
https://bugs.webkit.org/show_bug.cgi?id=271082
rdar://124713253

Reviewed by Per Arne Vollan.

When debugging an ITP issue I notice the logs are not easy to find and read, so 
this patch makes following improvements:
1. Intead of using Network channel, which is usually very noisy, make the logs 
use the dedicated ResourceLoadStatistics
channel.
2. Make logs have the same format by using the macros everywhere. Currently 
some logs use the macros and others don't,
and their are formatted differently.
3. Make the error logs more informational by including sessionID, database 
error code and error message in them.

* Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
(WebKit::ResourceLoadStatisticsStore::ResourceLoadStatisticsStore):
(WebKit::ResourceLoadStatisticsStore::removeDataRecords):
(WebKit::ResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
(WebKit::ResourceLoadStatisticsStore::debugLogDomainsInBatches):
(WebKit::ResourceLoadStatisticsStore::tableExists):
(WebKit::ResourceLoadStatisticsStore::deleteTable):
(WebKit::ResourceLoadStatisticsStore::missingUniqueIndices):
(WebKit::ResourceLoadStatisticsStore::migrateDataToPCMDatabaseIfNecessary):
(WebKit::ResourceLoadStatisticsStore::addMissingTablesIfNecessary):
(WebKit::ResourceLoadStatisticsStore::openAndUpdateSchemaIfNecessary):
(WebKit::ResourceLoadStatisticsStore::isEmpty const):
(WebKit::ResourceLoadStatisticsStore::createUniqueIndices):
(WebKit::ResourceLoadStatisticsStore::createSchema):
(WebKit::ResourceLoadStatisticsStore::insertObservedDomain):
(WebKit::ResourceLoadStatisticsStore::relationshipExists const):
(WebKit::ResourceLoadStatisticsStore::domainID const):
(WebKit::ResourceLoadStatisticsStore::ensureAndMakeDomainList):
(WebKit::ResourceLoadStatisticsStore::insertDomainRelationshipList):
(WebKit::ResourceLoadStatisticsStore::mergeStatistic):
(WebKit::ResourceLoadStatisticsStore::mergeStatistics):
(WebKit::ResourceLoadStatisticsStore::getThirdPartyDataForSpecificFirstPartyDomains
 const):
(WebKit::ResourceLoadStatisticsStore::aggregatedThirdPartyData const):
(WebKit::ResourceLoadStatisticsStore::incrementRecordsDeletedCountForDomains):
(WebKit::ResourceLoadStatisticsStore::recursivelyFindNonPrevalentDomainsThatRedirectedToThisDomain):
(WebKit::ResourceLoadStatisticsStore::markAsPrevalentIfHasRedirectedToPrevalent):
(WebKit::ResourceLoadStatisticsStore::hasStorageAccess):
(WebKit::ResourceLoadStatisticsStore::requestStorageAccess):
(WebKit::ResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
(WebKit::ResourceLoadStatisticsStore::grantStorageAccess):
(WebKit::ResourceLoadStatisticsStore::grantStorageAccessInternal):
(WebKit::ResourceLoadStatisticsStore::grandfatherDataForDomains):
(WebKit::ResourceLoadStatisticsStore::ensurePrevalentResourcesForDebugMode):
(WebKit::ResourceLoadStatisticsStore::logFrameNavigation):
(WebKit::ResourceLoadStatisticsStore::logCrossSiteLoadWithLinkDecoration):
(WebKit::ResourceLoadStatisticsStore::clearTopFrameUniqueRedirectsToSinceSameSiteStrictEnforcement):
(WebKit::ResourceLoadStatisticsStore::setUserInteraction):
(WebKit::ResourceLoadStatisticsStore::logUserInteraction):
(WebKit::ResourceLoadStatisticsStore::clearUserInteraction):
(WebKit::ResourceLoadStatisticsStore::hasHadUserInteraction):
(WebKit::ResourceLoadStatisticsStore::setPrevalentResource):
(WebKit::ResourceLoadStatisticsStore::setDomainsAsPrevalent):
(WebKit::ResourceLoadStatisticsStore::predicateValueForDomain const):
(WebKit::ResourceLoadStatisticsStore::clearPrevalentResource):
(WebKit::ResourceLoadStatisticsStore::setGrandfathered):
(WebKit::ResourceLoadStatisticsStore::setIsScheduledForAllScriptWrittenStorageRemoval):
(WebKit::ResourceLoadStatisticsStore::setMostRecentWebPushInteractionTime):
(WebKit::ResourceLoadStatisticsStore::getMostRecentlyUpdatedTimestamp const):
(WebKit::ResourceLoadStatisticsStore::setSubframeUnderTopFrameDomain):
(WebKit::ResourceLoadStatisticsStore::setSubresourceUnderTopFrameDomain):
(WebKit::ResourceLoadStatisticsStore::setSubresourceUniqueRedirectTo):
(WebKit::ResourceLoadStatisticsStore::setSubresourceUniqueRedirectFrom):
(WebKit::ResourceLoadStatisticsStore::setTopFrameUniqueRedirectTo):
(WebKit::ResourceLoadStatisticsStore::setTopFrameUniqueRedirectFrom):
(WebKit::ResourceLoadStatisticsStore::ensureResourceStatisticsForRegistrableDomain):
(WebKit::ResourceLoadStatisticsStore::clearDatabaseContents):
(WebKit::ResourceLoadStatisticsStore::removeDataForDomain):
(WebKit::ResourceLoadStatisticsStore::cookieAccess):
(WebKit::ResourceLoadStatisticsStore::hasUserGrantedStorageAccessThroughPrompt):
(WebKit::ResourceLoadStatisticsStore::updateCookieBlocking):
(WebKit::ResourceLoadStatisticsStore::clearGrandfathering):
(WebKit::ResourceLoadStatisticsStore::registrableDomainsToDeleteOrRestrictWebsiteDataFor):
(WebKit::ResourceLoadStatisticsStore::pruneStatisticsIfNeeded):
(WebKit::ResourceLoadStatisticsStore::updateLastSeen):
(WebKit::ResourceLoadStatisticsStore::setLastSeen):
(WebKit::ResourceLoadStatisticsStore::setVeryPrevalentResource):
(WebKit::ResourceLoadStatisticsStore::updateDataRecordsRemoved):
(WebKit::ResourceLoadStatisticsStore::isCorrectSubStatisticsCount):
(WebKit::ResourceLoadStatisticsStore::getDomainStringFromDomainID const):
(WebKit::ResourceLoadStatisticsStore::appendSubStatisticList const):
(WebKit::ResourceLoadStatisticsStore::resourceToString const):
(WebKit::ResourceLoadStatisticsStore::domainIDExistsInDatabase):
(WebKit::ResourceLoadStatisticsStore::updateOperatingDatesParameters):
(WebKit::ResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary):
(WebKit::ResourceLoadStatisticsStore::insertExpiredStatisticForTesting):
* Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:

Canonical link: https://commits.webkit.org/276278@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to