Changeset 259693 in webkit


Ignore:
Timestamp:
Apr 7, 2020 5:34:20 PM (4 years ago)
Author:
wilander@apple.com
Message:

ITP Debug Mode logs should be more generic now that it blocks all third-party cookies by default
https://bugs.webkit.org/show_bug.cgi?id=210133
<rdar://problem/61399686>

Reviewed by Brent Fulgham.

No new tests. Just a change of logging.

  • NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:

(WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):

Now logs if either vector has entries and uses more generic language.

  • NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:

(WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):

Now logs if either vector has entries and uses more generic language.

  • NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:

(WebKit::ResourceLoadStatisticsStore::debugLogDomainsInBatches):

Removed hard-coded references to third-party cookie blocking and parameterized it instead.

Location:
trunk/Source/WebKit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r259688 r259693  
     12020-04-07  John Wilander  <wilander@apple.com>
     2
     3        ITP Debug Mode logs should be more generic now that it blocks all third-party cookies by default
     4        https://bugs.webkit.org/show_bug.cgi?id=210133
     5        <rdar://problem/61399686>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        No new tests. Just a change of logging.
     10
     11        * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
     12        (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
     13            Now logs if either vector has entries and uses more generic language.
     14        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
     15        (WebKit::ResourceLoadStatisticsMemoryStore::updateCookieBlocking):
     16            Now logs if either vector has entries and uses more generic language.
     17        * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
     18        (WebKit::ResourceLoadStatisticsStore::debugLogDomainsInBatches):
     19            Removed hard-coded references to third-party cookie blocking and parameterized it instead.
     20
    1212020-04-07  Joonghun Park  <jh718.park@samsung.com>
    222
  • trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp

    r259516 r259693  
    22732273    RegistrableDomainsToBlockCookiesFor domainsToBlock { domainsToBlockAndDeleteCookiesFor, domainsToBlockButKeepCookiesFor, domainsWithUserInteractionAsFirstParty };
    22742274
    2275     if (debugLoggingEnabled() && !domainsToBlockAndDeleteCookiesFor.isEmpty() && !domainsToBlockButKeepCookiesFor.isEmpty())
    2276         debugLogDomainsInBatches("block", domainsToBlock);
     2275    if (debugLoggingEnabled() && (!domainsToBlockAndDeleteCookiesFor.isEmpty() || !domainsToBlockButKeepCookiesFor.isEmpty()))
     2276        debugLogDomainsInBatches("Applying cross-site tracking restrictions", domainsToBlock);
    22772277
    22782278    RunLoop::main().dispatch([weakThis = makeWeakPtr(*this), store = makeRef(store()), domainsToBlock = crossThreadCopy(domainsToBlock), completionHandler = WTFMove(completionHandler)] () mutable {
     
    22852285
    22862286                if (UNLIKELY(weakThis->debugLoggingEnabled())) {
    2287                     RELEASE_LOG_INFO(ITPDebug, "Done updating cookie blocking.");
    2288                     weakThis->debugBroadcastConsoleMessage(MessageSource::ITPDebug, MessageLevel::Info, "[ITP] Done updating cookie blocking."_s);
     2287                    RELEASE_LOG_INFO(ITPDebug, "Done applying cross-site tracking restrictions.");
     2288                    weakThis->debugBroadcastConsoleMessage(MessageSource::ITPDebug, MessageLevel::Info, "[ITP] Done applying cross-site tracking restrictions."_s);
    22892289                }
    22902290            });
  • trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp

    r259516 r259693  
    873873    RegistrableDomainsToBlockCookiesFor domainsToBlock { domainsToBlockAndDeleteCookiesFor, domainsToBlockButKeepCookiesFor, domainsWithUserInteractionAsFirstParty };
    874874
    875     if (debugLoggingEnabled() && !domainsToBlockAndDeleteCookiesFor.isEmpty() && !domainsToBlockButKeepCookiesFor.isEmpty())
    876         debugLogDomainsInBatches("block", domainsToBlock);
     875    if (debugLoggingEnabled() && (!domainsToBlockAndDeleteCookiesFor.isEmpty() || !domainsToBlockButKeepCookiesFor.isEmpty()))
     876        debugLogDomainsInBatches("Applying cross-site tracking restrictions", domainsToBlock);
    877877
    878878    RunLoop::main().dispatch([weakThis = makeWeakPtr(*this), store = makeRef(store()), domainsToBlock = crossThreadCopy(domainsToBlock), completionHandler = WTFMove(completionHandler)] () mutable {
     
    885885
    886886                if (UNLIKELY(weakThis->debugLoggingEnabled())) {
    887                     RELEASE_LOG_INFO(ITPDebug, "Done updating cookie blocking.");
    888                     weakThis->debugBroadcastConsoleMessage(MessageSource::ITPDebug, MessageLevel::Info, "[ITP] Done updating cookie blocking."_s);
     887                    RELEASE_LOG_INFO(ITPDebug, "Done applying cross-site tracking restrictions.");
     888                    weakThis->debugBroadcastConsoleMessage(MessageSource::ITPDebug, MessageLevel::Info, "[ITP] Done applying cross-site tracking restrictions."_s);
    889889                }
    890890            });
  • trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp

    r259293 r259693  
    605605void ResourceLoadStatisticsStore::debugLogDomainsInBatches(const char* action, const RegistrableDomainsToBlockCookiesFor& domainsToBlock)
    606606{
     607    ASSERT(debugLoggingEnabled());
     608
    607609    Vector<RegistrableDomain> domains;
    608610    domains.appendVector(domainsToBlock.domainsToBlockAndDeleteCookiesFor);
     
    611613        return;
    612614
    613     debugBroadcastConsoleMessage(MessageSource::ITPDebug, MessageLevel::Info, makeString("[ITP] About to "_s, action, "cookies in third-party contexts for: ["_s, domainsToString(domains), "]."_s));
     615    debugBroadcastConsoleMessage(MessageSource::ITPDebug, MessageLevel::Info, makeString("[ITP] "_s, action, " to: ["_s, domainsToString(domains), "]."_s));
    614616
    615617    static const auto maxNumberOfDomainsInOneLogStatement = 50;
    616618
    617619    if (domains.size() <= maxNumberOfDomainsInOneLogStatement) {
    618         RELEASE_LOG_INFO(ITPDebug, "About to %" PUBLIC_LOG_STRING " cookies in third-party contexts for: %" PUBLIC_LOG_STRING ".", action, domainsToString(domains).utf8().data());
     620        RELEASE_LOG_INFO(ITPDebug, "%" PUBLIC_LOG_STRING " to: %" PUBLIC_LOG_STRING ".", action, domainsToString(domains).utf8().data());
    619621        return;
    620622    }
     
    627629    for (auto& domain : domains) {
    628630        if (batch.size() == maxNumberOfDomainsInOneLogStatement) {
    629             RELEASE_LOG_INFO(ITPDebug, "About to %" PUBLIC_LOG_STRING " cookies in third-party contexts for (%{public}d of %u): %" PUBLIC_LOG_STRING ".", action, batchNumber, numberOfBatches, domainsToString(batch).utf8().data());
     631            RELEASE_LOG_INFO(ITPDebug, "%" PUBLIC_LOG_STRING " to (%{public}d of %u): %" PUBLIC_LOG_STRING ".", action, batchNumber, numberOfBatches, domainsToString(batch).utf8().data());
    630632            batch.shrink(0);
    631633            ++batchNumber;
     
    634636    }
    635637    if (!batch.isEmpty())
    636         RELEASE_LOG_INFO(ITPDebug, "About to %" PUBLIC_LOG_STRING " cookies in third-party contexts for (%{public}d of %u): %" PUBLIC_LOG_STRING ".", action, batchNumber, numberOfBatches, domainsToString(batch).utf8().data());
     638        RELEASE_LOG_INFO(ITPDebug, "%" PUBLIC_LOG_STRING " to (%{public}d of %u): %" PUBLIC_LOG_STRING ".", action, batchNumber, numberOfBatches, domainsToString(batch).utf8().data());
    637639}
    638640
Note: See TracChangeset for help on using the changeset viewer.