Diff
Modified: trunk/Source/WebCore/ChangeLog (211300 => 211301)
--- trunk/Source/WebCore/ChangeLog 2017-01-27 21:01:50 UTC (rev 211300)
+++ trunk/Source/WebCore/ChangeLog 2017-01-27 21:07:57 UTC (rev 211301)
@@ -1,5 +1,31 @@
2017-01-27 Chris Dumez <cdu...@apple.com>
+ 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:
+
+2017-01-27 Chris Dumez <cdu...@apple.com>
+
Fix diagnostic logging in media code
https://bugs.webkit.org/show_bug.cgi?id=167510
Modified: trunk/Source/WebCore/loader/ResourceLoader.cpp (211300 => 211301)
--- trunk/Source/WebCore/loader/ResourceLoader.cpp 2017-01-27 21:01:50 UTC (rev 211300)
+++ trunk/Source/WebCore/loader/ResourceLoader.cpp 2017-01-27 21:07:57 UTC (rev 211301)
@@ -431,7 +431,7 @@
return;
}
- frame->page()->diagnosticLoggingClient().logDiagnosticMessageWithValue(DiagnosticLoggingKeys::resourceResponseKey(), DiagnosticLoggingKeys::sourceKey(), sourceKey, ShouldSample::Yes);
+ frame->page()->diagnosticLoggingClient().logDiagnosticMessage(DiagnosticLoggingKeys::resourceResponseSourceKey(), sourceKey, ShouldSample::Yes);
}
void ResourceLoader::didReceiveResponse(const ResourceResponse& r)
Modified: trunk/Source/WebCore/loader/SubresourceLoader.cpp (211300 => 211301)
--- trunk/Source/WebCore/loader/SubresourceLoader.cpp 2017-01-27 21:01:50 UTC (rev 211300)
+++ trunk/Source/WebCore/loader/SubresourceLoader.cpp 2017-01-27 21:07:57 UTC (rev 211301)
@@ -455,7 +455,7 @@
resourceType = DiagnosticLoggingKeys::otherKey();
break;
}
- frame->page()->diagnosticLoggingClient().logDiagnosticMessageWithValue(DiagnosticLoggingKeys::resourceKey(), DiagnosticLoggingKeys::loadedKey(), resourceType, ShouldSample::Yes);
+ frame->page()->diagnosticLoggingClient().logDiagnosticMessage(DiagnosticLoggingKeys::resourceLoadedKey(), resourceType, ShouldSample::Yes);
}
bool SubresourceLoader::checkResponseCrossOriginAccessControl(const ResourceResponse& response, String& errorDescription)
Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp (211300 => 211301)
--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp 2017-01-27 21:01:50 UTC (rev 211300)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp 2017-01-27 21:07:57 UTC (rev 211301)
@@ -631,14 +631,11 @@
return resourceHandle;
}
-static inline void logMemoryCacheResourceRequest(Frame* frame, const String& description, const String& value = String())
+static inline void logMemoryCacheResourceRequest(Frame* frame, const String& key, const String& description)
{
if (!frame || !frame->page())
return;
- if (value.isNull())
- frame->page()->diagnosticLoggingClient().logDiagnosticMessage(DiagnosticLoggingKeys::resourceRequestKey(), description, ShouldSample::Yes);
- else
- frame->page()->diagnosticLoggingClient().logDiagnosticMessageWithValue(DiagnosticLoggingKeys::resourceRequestKey(), description, value, ShouldSample::Yes);
+ frame->page()->diagnosticLoggingClient().logDiagnosticMessage(key, description, ShouldSample::Yes);
}
void CachedResourceLoader::prepareFetch(CachedResource::Type type, CachedResourceRequest& request)
@@ -745,7 +742,7 @@
if (request.allowsCaching())
resource = memoryCache.resourceForRequest(request.resourceRequest(), sessionID());
- logMemoryCacheResourceRequest(frame(), resource ? DiagnosticLoggingKeys::inMemoryCacheKey() : DiagnosticLoggingKeys::notInMemoryCacheKey());
+ logMemoryCacheResourceRequest(frame(), DiagnosticLoggingKeys::memoryCacheUsageKey(), resource ? DiagnosticLoggingKeys::inMemoryCacheKey() : DiagnosticLoggingKeys::notInMemoryCacheKey());
RevalidationPolicy policy = determineRevalidationPolicy(type, request, resource.get(), forPreload, defer);
switch (policy) {
@@ -754,12 +751,12 @@
FALLTHROUGH;
case Load:
if (resource)
- logMemoryCacheResourceRequest(frame(), DiagnosticLoggingKeys::inMemoryCacheKey(), DiagnosticLoggingKeys::unusedKey());
+ logMemoryCacheResourceRequest(frame(), DiagnosticLoggingKeys::memoryCacheEntryDecisionKey(), DiagnosticLoggingKeys::unusedKey());
resource = loadResource(type, WTFMove(request));
break;
case Revalidate:
if (resource)
- logMemoryCacheResourceRequest(frame(), DiagnosticLoggingKeys::inMemoryCacheKey(), DiagnosticLoggingKeys::revalidatingKey());
+ logMemoryCacheResourceRequest(frame(), DiagnosticLoggingKeys::memoryCacheEntryDecisionKey(), DiagnosticLoggingKeys::revalidatingKey());
resource = revalidateResource(WTFMove(request), *resource);
break;
case Use:
@@ -771,7 +768,7 @@
} else {
if (!shouldContinueAfterNotifyingLoadedFromMemoryCache(request, resource.get()))
return nullptr;
- logMemoryCacheResourceRequest(frame(), DiagnosticLoggingKeys::inMemoryCacheKey(), DiagnosticLoggingKeys::usedKey());
+ logMemoryCacheResourceRequest(frame(), DiagnosticLoggingKeys::memoryCacheEntryDecisionKey(), DiagnosticLoggingKeys::usedKey());
memoryCache.resourceAccessed(*resource);
#if ENABLE(WEB_TIMING)
if (document() && RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled()) {
@@ -871,7 +868,7 @@
static void logRevalidation(const String& reason, DiagnosticLoggingClient& logClient)
{
- logClient.logDiagnosticMessageWithValue(DiagnosticLoggingKeys::cachedResourceRevalidationKey(), DiagnosticLoggingKeys::reasonKey(), reason, ShouldSample::Yes);
+ logClient.logDiagnosticMessage(DiagnosticLoggingKeys::cachedResourceRevalidationReasonKey(), reason, ShouldSample::Yes);
}
static void logResourceRevalidationDecision(CachedResource::RevalidationDecision reason, const Frame* frame)
Modified: trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp (211300 => 211301)
--- trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp 2017-01-27 21:01:50 UTC (rev 211300)
+++ trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp 2017-01-27 21:07:57 UTC (rev 211301)
@@ -38,6 +38,16 @@
return ASCIILiteral("mediaFailedLoading");
}
+String DiagnosticLoggingKeys::memoryCacheEntryDecisionKey()
+{
+ return ASCIILiteral("memoryCacheEntryDecision");
+}
+
+String DiagnosticLoggingKeys::memoryCacheUsageKey()
+{
+ return ASCIILiteral("memoryCacheUsage");
+}
+
String DiagnosticLoggingKeys::missingValidatorFieldsKey()
{
return ASCIILiteral("missingValidatorFields");
@@ -233,11 +243,6 @@
return ASCIILiteral("isReloadIgnoringCacheData");
}
-String DiagnosticLoggingKeys::loadedKey()
-{
- return ASCIILiteral("loaded");
-}
-
String DiagnosticLoggingKeys::loadingKey()
{
return ASCIILiteral("loading");
@@ -308,11 +313,6 @@
return ASCIILiteral("raw");
}
-String DiagnosticLoggingKeys::reasonKey()
-{
- return ASCIILiteral("reason");
-}
-
String DiagnosticLoggingKeys::redirectKey()
{
return ASCIILiteral("redirect");
@@ -388,6 +388,11 @@
return ASCIILiteral("cachedResourceRevalidation");
}
+String DiagnosticLoggingKeys::cachedResourceRevalidationReasonKey()
+{
+ return ASCIILiteral("cachedResourceRevalidationReason");
+}
+
String DiagnosticLoggingKeys::deniedByClientKey()
{
return ASCIILiteral("deniedByClient");
@@ -438,21 +443,16 @@
return ASCIILiteral("retrievalRequest");
}
-String DiagnosticLoggingKeys::resourceKey()
+String DiagnosticLoggingKeys::resourceLoadedKey()
{
- return ASCIILiteral("resource");
+ return ASCIILiteral("resourceLoaded");
}
-String DiagnosticLoggingKeys::resourceRequestKey()
+String DiagnosticLoggingKeys::resourceResponseSourceKey()
{
- return ASCIILiteral("resourceRequest");
+ return ASCIILiteral("resourceResponseSource");
}
-String DiagnosticLoggingKeys::resourceResponseKey()
-{
- return ASCIILiteral("resourceResponse");
-}
-
String DiagnosticLoggingKeys::retrievalKey()
{
return ASCIILiteral("retrieval");
@@ -478,11 +478,6 @@
return ASCIILiteral("script");
}
-String DiagnosticLoggingKeys::sourceKey()
-{
- return ASCIILiteral("source");
-}
-
String DiagnosticLoggingKeys::streamingMedia()
{
return ASCIILiteral("streamingMedia");
Modified: trunk/Source/WebCore/page/DiagnosticLoggingKeys.h (211300 => 211301)
--- trunk/Source/WebCore/page/DiagnosticLoggingKeys.h 2017-01-27 21:01:50 UTC (rev 211300)
+++ trunk/Source/WebCore/page/DiagnosticLoggingKeys.h 2017-01-27 21:07:57 UTC (rev 211301)
@@ -38,6 +38,7 @@
WEBCORE_EXPORT static String backNavigationKey();
WEBCORE_EXPORT static String cacheControlNoStoreKey();
static String cachedResourceRevalidationKey();
+ static String cachedResourceRevalidationReasonKey();
static String canCacheKey();
static String cannotSuspendActiveDOMObjectsKey();
WEBCORE_EXPORT static String cpuUsageKey();
@@ -70,7 +71,6 @@
static String isErrorPageKey();
static String isExpiredKey();
WEBCORE_EXPORT static String isReloadIgnoringCacheDataKey();
- static String loadedKey();
static String loadingKey();
static String isLoadingKey();
static String mainDocumentErrorKey();
@@ -77,6 +77,8 @@
static String mainResourceKey();
static String mediaLoadedKey();
static String mediaLoadingFailedKey();
+ static String memoryCacheEntryDecisionKey();
+ static String memoryCacheUsageKey();
WEBCORE_EXPORT static String missingValidatorFieldsKey();
static String navigationKey();
WEBCORE_EXPORT static String needsRevalidationKey();
@@ -116,21 +118,18 @@
static String prunedDueToProcessSuspended();
static String quirkRedirectComingKey();
static String rawKey();
- static String reasonKey();
static String redirectKey();
static String reloadFromOriginKey();
static String reloadKey();
static String replaceKey();
WEBCORE_EXPORT static String requestKey();
- static String resourceKey();
- static String resourceRequestKey();
- static String resourceResponseKey();
+ static String resourceLoadedKey();
+ static String resourceResponseSourceKey();
WEBCORE_EXPORT static String retrievalKey();
WEBCORE_EXPORT static String retrievalRequestKey();
WEBCORE_EXPORT static String revalidatingKey();
static String sameLoadKey();
static String scriptKey();
- static String sourceKey();
WEBCORE_EXPORT static String streamingMedia();
static String styleSheetKey();
WEBCORE_EXPORT static String successfulSpeculativeWarmupWithRevalidationKey();