Changeset 211301 in webkit


Ignore:
Timestamp:
Jan 27, 2017 1:07:57 PM (7 years ago)
Author:
Chris Dumez
Message:

Fix diagnostic logging under loader/
https://bugs.webkit.org/show_bug.cgi?id=167512

Reviewed by Alex Christensen.

Fix diagnostic logging under loader/. We should not be using logDiagnosticLoggingWithValue()
without a numeric value.

  • loader/ResourceLoader.cpp:

(WebCore::logResourceResponseSource):

  • loader/SubresourceLoader.cpp:

(WebCore::logResourceLoaded):

  • loader/cache/CachedResourceLoader.cpp:

(WebCore::logMemoryCacheResourceRequest):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::logRevalidation):

  • page/DiagnosticLoggingKeys.cpp:

(WebCore::DiagnosticLoggingKeys::memoryCacheEntryDecisionKey):
(WebCore::DiagnosticLoggingKeys::memoryCacheUsageKey):
(WebCore::DiagnosticLoggingKeys::cachedResourceRevalidationReasonKey):
(WebCore::DiagnosticLoggingKeys::resourceLoadedKey):
(WebCore::DiagnosticLoggingKeys::resourceResponseSourceKey):

  • page/DiagnosticLoggingKeys.h:
Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r211298 r211301  
     12017-01-27  Chris Dumez  <cdumez@apple.com>
     2
     3        Fix diagnostic logging under loader/
     4        https://bugs.webkit.org/show_bug.cgi?id=167512
     5
     6        Reviewed by Alex Christensen.
     7
     8        Fix diagnostic logging under loader/. We should not be using logDiagnosticLoggingWithValue()
     9        without a numeric value.
     10
     11        * loader/ResourceLoader.cpp:
     12        (WebCore::logResourceResponseSource):
     13        * loader/SubresourceLoader.cpp:
     14        (WebCore::logResourceLoaded):
     15        * loader/cache/CachedResourceLoader.cpp:
     16        (WebCore::logMemoryCacheResourceRequest):
     17        (WebCore::CachedResourceLoader::requestResource):
     18        (WebCore::logRevalidation):
     19        * page/DiagnosticLoggingKeys.cpp:
     20        (WebCore::DiagnosticLoggingKeys::memoryCacheEntryDecisionKey):
     21        (WebCore::DiagnosticLoggingKeys::memoryCacheUsageKey):
     22        (WebCore::DiagnosticLoggingKeys::cachedResourceRevalidationReasonKey):
     23        (WebCore::DiagnosticLoggingKeys::resourceLoadedKey):
     24        (WebCore::DiagnosticLoggingKeys::resourceResponseSourceKey):
     25        * page/DiagnosticLoggingKeys.h:
     26
    1272017-01-27  Chris Dumez  <cdumez@apple.com>
    228
  • trunk/Source/WebCore/loader/ResourceLoader.cpp

    r211248 r211301  
    432432    }
    433433
    434     frame->page()->diagnosticLoggingClient().logDiagnosticMessageWithValue(DiagnosticLoggingKeys::resourceResponseKey(), DiagnosticLoggingKeys::sourceKey(), sourceKey, ShouldSample::Yes);
     434    frame->page()->diagnosticLoggingClient().logDiagnosticMessage(DiagnosticLoggingKeys::resourceResponseSourceKey(), sourceKey, ShouldSample::Yes);
    435435}
    436436
  • trunk/Source/WebCore/loader/SubresourceLoader.cpp

    r211074 r211301  
    456456        break;
    457457    }
    458     frame->page()->diagnosticLoggingClient().logDiagnosticMessageWithValue(DiagnosticLoggingKeys::resourceKey(), DiagnosticLoggingKeys::loadedKey(), resourceType, ShouldSample::Yes);
     458    frame->page()->diagnosticLoggingClient().logDiagnosticMessage(DiagnosticLoggingKeys::resourceLoadedKey(), resourceType, ShouldSample::Yes);
    459459}
    460460
  • trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp

    r210859 r211301  
    632632}
    633633
    634 static inline void logMemoryCacheResourceRequest(Frame* frame, const String& description, const String& value = String())
     634static inline void logMemoryCacheResourceRequest(Frame* frame, const String& key, const String& description)
    635635{
    636636    if (!frame || !frame->page())
    637637        return;
    638     if (value.isNull())
    639         frame->page()->diagnosticLoggingClient().logDiagnosticMessage(DiagnosticLoggingKeys::resourceRequestKey(), description, ShouldSample::Yes);
    640     else
    641         frame->page()->diagnosticLoggingClient().logDiagnosticMessageWithValue(DiagnosticLoggingKeys::resourceRequestKey(), description, value, ShouldSample::Yes);
     638    frame->page()->diagnosticLoggingClient().logDiagnosticMessage(key, description, ShouldSample::Yes);
    642639}
    643640
     
    746743        resource = memoryCache.resourceForRequest(request.resourceRequest(), sessionID());
    747744
    748     logMemoryCacheResourceRequest(frame(), resource ? DiagnosticLoggingKeys::inMemoryCacheKey() : DiagnosticLoggingKeys::notInMemoryCacheKey());
     745    logMemoryCacheResourceRequest(frame(), DiagnosticLoggingKeys::memoryCacheUsageKey(), resource ? DiagnosticLoggingKeys::inMemoryCacheKey() : DiagnosticLoggingKeys::notInMemoryCacheKey());
    749746
    750747    RevalidationPolicy policy = determineRevalidationPolicy(type, request, resource.get(), forPreload, defer);
     
    755752    case Load:
    756753        if (resource)
    757             logMemoryCacheResourceRequest(frame(), DiagnosticLoggingKeys::inMemoryCacheKey(), DiagnosticLoggingKeys::unusedKey());
     754            logMemoryCacheResourceRequest(frame(), DiagnosticLoggingKeys::memoryCacheEntryDecisionKey(), DiagnosticLoggingKeys::unusedKey());
    758755        resource = loadResource(type, WTFMove(request));
    759756        break;
    760757    case Revalidate:
    761758        if (resource)
    762             logMemoryCacheResourceRequest(frame(), DiagnosticLoggingKeys::inMemoryCacheKey(), DiagnosticLoggingKeys::revalidatingKey());
     759            logMemoryCacheResourceRequest(frame(), DiagnosticLoggingKeys::memoryCacheEntryDecisionKey(), DiagnosticLoggingKeys::revalidatingKey());
    763760        resource = revalidateResource(WTFMove(request), *resource);
    764761        break;
     
    772769            if (!shouldContinueAfterNotifyingLoadedFromMemoryCache(request, resource.get()))
    773770                return nullptr;
    774             logMemoryCacheResourceRequest(frame(), DiagnosticLoggingKeys::inMemoryCacheKey(), DiagnosticLoggingKeys::usedKey());
     771            logMemoryCacheResourceRequest(frame(), DiagnosticLoggingKeys::memoryCacheEntryDecisionKey(), DiagnosticLoggingKeys::usedKey());
    775772            memoryCache.resourceAccessed(*resource);
    776773#if ENABLE(WEB_TIMING)
     
    872869static void logRevalidation(const String& reason, DiagnosticLoggingClient& logClient)
    873870{
    874     logClient.logDiagnosticMessageWithValue(DiagnosticLoggingKeys::cachedResourceRevalidationKey(), DiagnosticLoggingKeys::reasonKey(), reason, ShouldSample::Yes);
     871    logClient.logDiagnosticMessage(DiagnosticLoggingKeys::cachedResourceRevalidationReasonKey(), reason, ShouldSample::Yes);
    875872}
    876873
  • trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp

    r211298 r211301  
    3939}
    4040
     41String DiagnosticLoggingKeys::memoryCacheEntryDecisionKey()
     42{
     43    return ASCIILiteral("memoryCacheEntryDecision");
     44}
     45
     46String DiagnosticLoggingKeys::memoryCacheUsageKey()
     47{
     48    return ASCIILiteral("memoryCacheUsage");
     49}
     50
    4151String DiagnosticLoggingKeys::missingValidatorFieldsKey()
    4252{
     
    234244}
    235245
    236 String DiagnosticLoggingKeys::loadedKey()
    237 {
    238     return ASCIILiteral("loaded");
    239 }
    240 
    241246String DiagnosticLoggingKeys::loadingKey()
    242247{
     
    309314}
    310315
    311 String DiagnosticLoggingKeys::reasonKey()
    312 {
    313     return ASCIILiteral("reason");
    314 }
    315 
    316316String DiagnosticLoggingKeys::redirectKey()
    317317{
     
    389389}
    390390
     391String DiagnosticLoggingKeys::cachedResourceRevalidationReasonKey()
     392{
     393    return ASCIILiteral("cachedResourceRevalidationReason");
     394}
     395
    391396String DiagnosticLoggingKeys::deniedByClientKey()
    392397{
     
    439444}
    440445
    441 String DiagnosticLoggingKeys::resourceKey()
    442 {
    443     return ASCIILiteral("resource");
    444 }
    445 
    446 String DiagnosticLoggingKeys::resourceRequestKey()
    447 {
    448     return ASCIILiteral("resourceRequest");
    449 }
    450 
    451 String DiagnosticLoggingKeys::resourceResponseKey()
    452 {
    453     return ASCIILiteral("resourceResponse");
     446String DiagnosticLoggingKeys::resourceLoadedKey()
     447{
     448    return ASCIILiteral("resourceLoaded");
     449}
     450
     451String DiagnosticLoggingKeys::resourceResponseSourceKey()
     452{
     453    return ASCIILiteral("resourceResponseSource");
    454454}
    455455
     
    477477{
    478478    return ASCIILiteral("script");
    479 }
    480 
    481 String DiagnosticLoggingKeys::sourceKey()
    482 {
    483     return ASCIILiteral("source");
    484479}
    485480
  • trunk/Source/WebCore/page/DiagnosticLoggingKeys.h

    r211298 r211301  
    3939    WEBCORE_EXPORT static String cacheControlNoStoreKey();
    4040    static String cachedResourceRevalidationKey();
     41    static String cachedResourceRevalidationReasonKey();
    4142    static String canCacheKey();
    4243    static String cannotSuspendActiveDOMObjectsKey();
     
    7172    static String isExpiredKey();
    7273    WEBCORE_EXPORT static String isReloadIgnoringCacheDataKey();
    73     static String loadedKey();
    7474    static String loadingKey();
    7575    static String isLoadingKey();
     
    7878    static String mediaLoadedKey();
    7979    static String mediaLoadingFailedKey();
     80    static String memoryCacheEntryDecisionKey();
     81    static String memoryCacheUsageKey();
    8082    WEBCORE_EXPORT static String missingValidatorFieldsKey();
    8183    static String navigationKey();
     
    117119    static String quirkRedirectComingKey();
    118120    static String rawKey();
    119     static String reasonKey();
    120121    static String redirectKey();
    121122    static String reloadFromOriginKey();
     
    123124    static String replaceKey();
    124125    WEBCORE_EXPORT static String requestKey();
    125     static String resourceKey();
    126     static String resourceRequestKey();
    127     static String resourceResponseKey();
     126    static String resourceLoadedKey();
     127    static String resourceResponseSourceKey();
    128128    WEBCORE_EXPORT static String retrievalKey();
    129129    WEBCORE_EXPORT static String retrievalRequestKey();
     
    131131    static String sameLoadKey();
    132132    static String scriptKey();
    133     static String sourceKey();
    134133    WEBCORE_EXPORT static String streamingMedia();
    135134    static String styleSheetKey();
Note: See TracChangeset for help on using the changeset viewer.