Changeset 211301 in webkit
- Timestamp:
- Jan 27, 2017 1:07:57 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r211298 r211301 1 2017-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 1 27 2017-01-27 Chris Dumez <cdumez@apple.com> 2 28 -
trunk/Source/WebCore/loader/ResourceLoader.cpp
r211248 r211301 432 432 } 433 433 434 frame->page()->diagnosticLoggingClient().logDiagnosticMessage WithValue(DiagnosticLoggingKeys::resourceResponseKey(), DiagnosticLoggingKeys::sourceKey(), sourceKey, ShouldSample::Yes);434 frame->page()->diagnosticLoggingClient().logDiagnosticMessage(DiagnosticLoggingKeys::resourceResponseSourceKey(), sourceKey, ShouldSample::Yes); 435 435 } 436 436 -
trunk/Source/WebCore/loader/SubresourceLoader.cpp
r211074 r211301 456 456 break; 457 457 } 458 frame->page()->diagnosticLoggingClient().logDiagnosticMessage WithValue(DiagnosticLoggingKeys::resourceKey(), DiagnosticLoggingKeys::loadedKey(), resourceType, ShouldSample::Yes);458 frame->page()->diagnosticLoggingClient().logDiagnosticMessage(DiagnosticLoggingKeys::resourceLoadedKey(), resourceType, ShouldSample::Yes); 459 459 } 460 460 -
trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp
r210859 r211301 632 632 } 633 633 634 static inline void logMemoryCacheResourceRequest(Frame* frame, const String& description, const String& value = String())634 static inline void logMemoryCacheResourceRequest(Frame* frame, const String& key, const String& description) 635 635 { 636 636 if (!frame || !frame->page()) 637 637 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); 642 639 } 643 640 … … 746 743 resource = memoryCache.resourceForRequest(request.resourceRequest(), sessionID()); 747 744 748 logMemoryCacheResourceRequest(frame(), resource ? DiagnosticLoggingKeys::inMemoryCacheKey() : DiagnosticLoggingKeys::notInMemoryCacheKey());745 logMemoryCacheResourceRequest(frame(), DiagnosticLoggingKeys::memoryCacheUsageKey(), resource ? DiagnosticLoggingKeys::inMemoryCacheKey() : DiagnosticLoggingKeys::notInMemoryCacheKey()); 749 746 750 747 RevalidationPolicy policy = determineRevalidationPolicy(type, request, resource.get(), forPreload, defer); … … 755 752 case Load: 756 753 if (resource) 757 logMemoryCacheResourceRequest(frame(), DiagnosticLoggingKeys:: inMemoryCacheKey(), DiagnosticLoggingKeys::unusedKey());754 logMemoryCacheResourceRequest(frame(), DiagnosticLoggingKeys::memoryCacheEntryDecisionKey(), DiagnosticLoggingKeys::unusedKey()); 758 755 resource = loadResource(type, WTFMove(request)); 759 756 break; 760 757 case Revalidate: 761 758 if (resource) 762 logMemoryCacheResourceRequest(frame(), DiagnosticLoggingKeys:: inMemoryCacheKey(), DiagnosticLoggingKeys::revalidatingKey());759 logMemoryCacheResourceRequest(frame(), DiagnosticLoggingKeys::memoryCacheEntryDecisionKey(), DiagnosticLoggingKeys::revalidatingKey()); 763 760 resource = revalidateResource(WTFMove(request), *resource); 764 761 break; … … 772 769 if (!shouldContinueAfterNotifyingLoadedFromMemoryCache(request, resource.get())) 773 770 return nullptr; 774 logMemoryCacheResourceRequest(frame(), DiagnosticLoggingKeys:: inMemoryCacheKey(), DiagnosticLoggingKeys::usedKey());771 logMemoryCacheResourceRequest(frame(), DiagnosticLoggingKeys::memoryCacheEntryDecisionKey(), DiagnosticLoggingKeys::usedKey()); 775 772 memoryCache.resourceAccessed(*resource); 776 773 #if ENABLE(WEB_TIMING) … … 872 869 static void logRevalidation(const String& reason, DiagnosticLoggingClient& logClient) 873 870 { 874 logClient.logDiagnosticMessage WithValue(DiagnosticLoggingKeys::cachedResourceRevalidationKey(), DiagnosticLoggingKeys::reasonKey(), reason, ShouldSample::Yes);871 logClient.logDiagnosticMessage(DiagnosticLoggingKeys::cachedResourceRevalidationReasonKey(), reason, ShouldSample::Yes); 875 872 } 876 873 -
trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp
r211298 r211301 39 39 } 40 40 41 String DiagnosticLoggingKeys::memoryCacheEntryDecisionKey() 42 { 43 return ASCIILiteral("memoryCacheEntryDecision"); 44 } 45 46 String DiagnosticLoggingKeys::memoryCacheUsageKey() 47 { 48 return ASCIILiteral("memoryCacheUsage"); 49 } 50 41 51 String DiagnosticLoggingKeys::missingValidatorFieldsKey() 42 52 { … … 234 244 } 235 245 236 String DiagnosticLoggingKeys::loadedKey()237 {238 return ASCIILiteral("loaded");239 }240 241 246 String DiagnosticLoggingKeys::loadingKey() 242 247 { … … 309 314 } 310 315 311 String DiagnosticLoggingKeys::reasonKey()312 {313 return ASCIILiteral("reason");314 }315 316 316 String DiagnosticLoggingKeys::redirectKey() 317 317 { … … 389 389 } 390 390 391 String DiagnosticLoggingKeys::cachedResourceRevalidationReasonKey() 392 { 393 return ASCIILiteral("cachedResourceRevalidationReason"); 394 } 395 391 396 String DiagnosticLoggingKeys::deniedByClientKey() 392 397 { … … 439 444 } 440 445 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"); 446 String DiagnosticLoggingKeys::resourceLoadedKey() 447 { 448 return ASCIILiteral("resourceLoaded"); 449 } 450 451 String DiagnosticLoggingKeys::resourceResponseSourceKey() 452 { 453 return ASCIILiteral("resourceResponseSource"); 454 454 } 455 455 … … 477 477 { 478 478 return ASCIILiteral("script"); 479 }480 481 String DiagnosticLoggingKeys::sourceKey()482 {483 return ASCIILiteral("source");484 479 } 485 480 -
trunk/Source/WebCore/page/DiagnosticLoggingKeys.h
r211298 r211301 39 39 WEBCORE_EXPORT static String cacheControlNoStoreKey(); 40 40 static String cachedResourceRevalidationKey(); 41 static String cachedResourceRevalidationReasonKey(); 41 42 static String canCacheKey(); 42 43 static String cannotSuspendActiveDOMObjectsKey(); … … 71 72 static String isExpiredKey(); 72 73 WEBCORE_EXPORT static String isReloadIgnoringCacheDataKey(); 73 static String loadedKey();74 74 static String loadingKey(); 75 75 static String isLoadingKey(); … … 78 78 static String mediaLoadedKey(); 79 79 static String mediaLoadingFailedKey(); 80 static String memoryCacheEntryDecisionKey(); 81 static String memoryCacheUsageKey(); 80 82 WEBCORE_EXPORT static String missingValidatorFieldsKey(); 81 83 static String navigationKey(); … … 117 119 static String quirkRedirectComingKey(); 118 120 static String rawKey(); 119 static String reasonKey();120 121 static String redirectKey(); 121 122 static String reloadFromOriginKey(); … … 123 124 static String replaceKey(); 124 125 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(); 128 128 WEBCORE_EXPORT static String retrievalKey(); 129 129 WEBCORE_EXPORT static String retrievalRequestKey(); … … 131 131 static String sameLoadKey(); 132 132 static String scriptKey(); 133 static String sourceKey();134 133 WEBCORE_EXPORT static String streamingMedia(); 135 134 static String styleSheetKey();
Note: See TracChangeset
for help on using the changeset viewer.