Fix remaining bad uses of logDiagnosticMessageWithValue()
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Jan 2017 23:11:17 +0000 (23:11 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Jan 2017 23:11:17 +0000 (23:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=167526

Reviewed by Alex Christensen.

Source/WebCore:

Drop unused keys, add new ones.

* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::networkCacheFailureReasonKey):
(WebCore::DiagnosticLoggingKeys::networkCacheUnusedReasonKey):
(WebCore::DiagnosticLoggingKeys::networkCacheReuseFailureKey):
(WebCore::DiagnosticLoggingKeys::backNavigationDeltaKey):
(WebCore::DiagnosticLoggingKeys::userZoomActionKey):
(WebCore::DiagnosticLoggingKeys::deltaKey): Deleted.
(WebCore::DiagnosticLoggingKeys::backNavigationKey): Deleted.
(WebCore::DiagnosticLoggingKeys::requestKey): Deleted.
(WebCore::DiagnosticLoggingKeys::unusableCachedEntryKey): Deleted.
(WebCore::DiagnosticLoggingKeys::userKey): Deleted.
(WebCore::DiagnosticLoggingKeys::zoomedKey): Deleted.
(WebCore::DiagnosticLoggingKeys::notInCacheKey): Deleted.
* page/DiagnosticLoggingKeys.h:

Source/WebKit2:

Fix remaining bad uses of logDiagnosticMessageWithValue(). It can only
be called with numeric values.

* NetworkProcess/cache/NetworkCacheStatistics.cpp:
(WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
(WebKit::NetworkCache::Statistics::recordRetrievalFailure):
(WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::goToItem):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::willStartUserTriggeredZooming):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211304 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/page/DiagnosticLoggingKeys.cpp
Source/WebCore/page/DiagnosticLoggingKeys.h
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/cache/NetworkCacheStatistics.cpp
Source/WebKit2/UIProcess/WebBackForwardList.cpp
Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm

index eb60938..32a268e 100644 (file)
@@ -1,3 +1,27 @@
+2017-01-27  Chris Dumez  <cdumez@apple.com>
+
+        Fix remaining bad uses of logDiagnosticMessageWithValue()
+        https://bugs.webkit.org/show_bug.cgi?id=167526
+
+        Reviewed by Alex Christensen.
+
+        Drop unused keys, add new ones.
+
+        * page/DiagnosticLoggingKeys.cpp:
+        (WebCore::DiagnosticLoggingKeys::networkCacheFailureReasonKey):
+        (WebCore::DiagnosticLoggingKeys::networkCacheUnusedReasonKey):
+        (WebCore::DiagnosticLoggingKeys::networkCacheReuseFailureKey):
+        (WebCore::DiagnosticLoggingKeys::backNavigationDeltaKey):
+        (WebCore::DiagnosticLoggingKeys::userZoomActionKey):
+        (WebCore::DiagnosticLoggingKeys::deltaKey): Deleted.
+        (WebCore::DiagnosticLoggingKeys::backNavigationKey): Deleted.
+        (WebCore::DiagnosticLoggingKeys::requestKey): Deleted.
+        (WebCore::DiagnosticLoggingKeys::unusableCachedEntryKey): Deleted.
+        (WebCore::DiagnosticLoggingKeys::userKey): Deleted.
+        (WebCore::DiagnosticLoggingKeys::zoomedKey): Deleted.
+        (WebCore::DiagnosticLoggingKeys::notInCacheKey): Deleted.
+        * page/DiagnosticLoggingKeys.h:
+
 2017-01-27  Myles C. Maxfield  <mmaxfield@apple.com>
 
         Proclaim that we are considering font-display, rhythmic sizing, and text decoration level 4
index e2194fd..104fd05 100644 (file)
@@ -153,6 +153,21 @@ String DiagnosticLoggingKeys::networkCacheKey()
     return ASCIILiteral("networkCache");
 }
 
+String DiagnosticLoggingKeys::networkCacheFailureReasonKey()
+{
+    return ASCIILiteral("networkCacheFailureReason");
+}
+
+String DiagnosticLoggingKeys::networkCacheUnusedReasonKey()
+{
+    return ASCIILiteral("networkCacheUnusedReason");
+}
+
+String DiagnosticLoggingKeys::networkCacheReuseFailureKey()
+{
+    return ASCIILiteral("networkCacheReuseFailure");
+}
+
 String DiagnosticLoggingKeys::networkKey()
 {
     return ASCIILiteral("network");
@@ -343,11 +358,6 @@ String DiagnosticLoggingKeys::createSharedBufferFailedKey()
     return ASCIILiteral("createSharedBufferFailed");
 }
 
-String DiagnosticLoggingKeys::deltaKey()
-{
-    return ASCIILiteral("delta");
-}
-
 String DiagnosticLoggingKeys::activeInForegroundTabKey()
 {
     return ASCIILiteral("activeInForegroundTab");
@@ -368,9 +378,9 @@ String DiagnosticLoggingKeys::audioKey()
     return ASCIILiteral("audio");
 }
 
-String DiagnosticLoggingKeys::backNavigationKey()
+String DiagnosticLoggingKeys::backNavigationDeltaKey()
 {
-    return ASCIILiteral("backNavigation");
+    return ASCIILiteral("backNavigationDelta");
 }
 
 String DiagnosticLoggingKeys::canCacheKey()
@@ -433,11 +443,6 @@ String DiagnosticLoggingKeys::replaceKey()
     return ASCIILiteral("replace");
 }
 
-String DiagnosticLoggingKeys::requestKey()
-{
-    return ASCIILiteral("request");
-}
-
 String DiagnosticLoggingKeys::retrievalRequestKey()
 {
     return ASCIILiteral("retrievalRequest");
@@ -538,11 +543,6 @@ String DiagnosticLoggingKeys::unsuspendableDOMObjectKey()
     return ASCIILiteral("unsuspendableDOMObject");
 }
 
-String DiagnosticLoggingKeys::unusableCachedEntryKey()
-{
-    return ASCIILiteral("unusableCachedEntry");
-}
-
 String DiagnosticLoggingKeys::unusedKey()
 {
     return ASCIILiteral("unused");
@@ -588,9 +588,9 @@ String DiagnosticLoggingKeys::usedKey()
     return ASCIILiteral("used");
 }
 
-String DiagnosticLoggingKeys::userKey()
+String DiagnosticLoggingKeys::userZoomActionKey()
 {
-    return ASCIILiteral("user");
+    return ASCIILiteral("userZoomAction");
 }
 
 String DiagnosticLoggingKeys::varyingHeaderMismatchKey()
@@ -633,11 +633,6 @@ String DiagnosticLoggingKeys::yesKey()
     return ASCIILiteral("yes");
 }
 
-String DiagnosticLoggingKeys::zoomedKey()
-{
-    return ASCIILiteral("zoomed");
-}
-
 String DiagnosticLoggingKeys::expiredKey()
 {
     return ASCIILiteral("expired");
@@ -678,11 +673,6 @@ String WebCore::DiagnosticLoggingKeys::notHTTPFamilyKey()
     return ASCIILiteral("notHTTPFamily");
 }
 
-String DiagnosticLoggingKeys::notInCacheKey()
-{
-    return ASCIILiteral("notInCache");
-}
-
 String WebCore::DiagnosticLoggingKeys::webGLStateKey()
 {
     return ASCIILiteral("webGLState");
index 669938c..319f6d9 100644 (file)
@@ -35,7 +35,7 @@ public:
     WEBCORE_EXPORT static String activeInBackgroundTabOnlyKey();
     static String applicationCacheKey();
     static String audioKey();
-    WEBCORE_EXPORT static String backNavigationKey();
+    WEBCORE_EXPORT static String backNavigationDeltaKey();
     WEBCORE_EXPORT static String cacheControlNoStoreKey();
     static String cachedResourceRevalidationKey();
     static String cachedResourceRevalidationReasonKey();
@@ -43,7 +43,6 @@ public:
     static String cannotSuspendActiveDOMObjectsKey();
     WEBCORE_EXPORT static String cpuUsageKey();
     WEBCORE_EXPORT static String createSharedBufferFailedKey();
-    WEBCORE_EXPORT static String deltaKey();
     static String deniedByClientKey();
     static String deviceMotionKey();
     static String deviceOrientationKey();
@@ -83,6 +82,9 @@ public:
     static String navigationKey();
     WEBCORE_EXPORT static String needsRevalidationKey();
     WEBCORE_EXPORT static String networkCacheKey();
+    WEBCORE_EXPORT static String networkCacheFailureReasonKey();
+    WEBCORE_EXPORT static String networkCacheUnusedReasonKey();
+    WEBCORE_EXPORT static String networkCacheReuseFailureKey();
     static String networkKey();
     WEBCORE_EXPORT static String networkProcessCrashedKey();
     WEBCORE_EXPORT static String neverSeenBeforeKey();
@@ -94,7 +96,6 @@ public:
     static String noStoreKey();
     WEBCORE_EXPORT static String nonVisibleStateKey();
     WEBCORE_EXPORT static String notHTTPFamilyKey();
-    WEBCORE_EXPORT static String notInCacheKey();
     static String notInMemoryCacheKey();
     WEBCORE_EXPORT static String otherKey();
     static String pageCacheKey();
@@ -122,7 +123,6 @@ public:
     static String reloadFromOriginKey();
     static String reloadKey();
     static String replaceKey();
-    WEBCORE_EXPORT static String requestKey();
     static String resourceLoadedKey();
     static String resourceResponseSourceKey();
     WEBCORE_EXPORT static String retrievalKey();
@@ -142,7 +142,6 @@ public:
     WEBCORE_EXPORT static String unlikelyToReuseKey();
     WEBCORE_EXPORT static String unsupportedHTTPMethodKey();
     static String unsuspendableDOMObjectKey();
-    WEBCORE_EXPORT static String unusableCachedEntryKey();
     WEBCORE_EXPORT static String unusedKey();
     static String unusedReasonCredentialSettingsKey();
     static String unusedReasonErrorKey();
@@ -152,7 +151,7 @@ public:
     static String unusedReasonReloadKey();
     static String unusedReasonTypeMismatchKey();
     static String usedKey();
-    WEBCORE_EXPORT static String userKey();
+    WEBCORE_EXPORT static String userZoomActionKey();
     WEBCORE_EXPORT static String varyingHeaderMismatchKey();
     static String videoKey();
     WEBCORE_EXPORT static String visibleNonActiveStateKey();
@@ -162,7 +161,6 @@ public:
     WEBCORE_EXPORT static String webGLStateKey();
     WEBCORE_EXPORT static String webViewKey();
     static String yesKey();
-    WEBCORE_EXPORT static String zoomedKey();
 
     WEBCORE_EXPORT static String memoryUsageToDiagnosticLoggingKey(uint64_t memoryUsage);
     WEBCORE_EXPORT static String foregroundCPUUsageToDiagnosticLoggingKey(double cpuUsage);
index 1eee6f0..026b97e 100644 (file)
@@ -1,5 +1,24 @@
 2017-01-27  Chris Dumez  <cdumez@apple.com>
 
+        Fix remaining bad uses of logDiagnosticMessageWithValue()
+        https://bugs.webkit.org/show_bug.cgi?id=167526
+
+        Reviewed by Alex Christensen.
+
+        Fix remaining bad uses of logDiagnosticMessageWithValue(). It can only
+        be called with numeric values.
+
+        * NetworkProcess/cache/NetworkCacheStatistics.cpp:
+        (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
+        (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
+        (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
+        * UIProcess/WebBackForwardList.cpp:
+        (WebKit::WebBackForwardList::goToItem):
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::willStartUserTriggeredZooming):
+
+2017-01-27  Chris Dumez  <cdumez@apple.com>
+
         Round CPU Usage diagnostic logging to 2 significant digits
         https://bugs.webkit.org/show_bug.cgi?id=167515
         <rdar://problem/30236297>
index 10a5203..0fc8d1d 100644 (file)
@@ -220,9 +220,9 @@ void Statistics::recordNotUsingCacheForRequest(uint64_t webPageID, const Key& ke
         if (wasEverRequested) {
             String diagnosticKey = retrieveDecisionToDiagnosticKey(retrieveDecision);
             LOG(NetworkCache, "(NetworkProcess) webPageID %" PRIu64 ": %s was previously requested but we are not using the cache, reason: %s", webPageID, requestURL.string().ascii().data(), diagnosticKey.utf8().data());
-            NetworkProcess::singleton().logDiagnosticMessageWithValue(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheKey(), WebCore::DiagnosticLoggingKeys::unusedKey(), diagnosticKey, WebCore::ShouldSample::Yes);
+            NetworkProcess::singleton().logDiagnosticMessage(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheUnusedReasonKey(), diagnosticKey, WebCore::ShouldSample::Yes);
         } else {
-            NetworkProcess::singleton().logDiagnosticMessageWithValue(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheKey(), WebCore::DiagnosticLoggingKeys::requestKey(), WebCore::DiagnosticLoggingKeys::neverSeenBeforeKey(), WebCore::ShouldSample::Yes);
+            NetworkProcess::singleton().logDiagnosticMessage(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheUnusedReasonKey(), WebCore::DiagnosticLoggingKeys::neverSeenBeforeKey(), WebCore::ShouldSample::Yes);
             markAsRequested(hash);
         }
     });
@@ -260,9 +260,9 @@ void Statistics::recordRetrievalFailure(uint64_t webPageID, const Key& key, cons
         if (wasPreviouslyRequested) {
             String diagnosticKey = storeDecisionToDiagnosticKey(storeDecision.value());
             LOG(NetworkCache, "(NetworkProcess) webPageID %" PRIu64 ": %s was previously request but is not in the cache, reason: %s", webPageID, requestURL.string().ascii().data(), diagnosticKey.utf8().data());
-            NetworkProcess::singleton().logDiagnosticMessageWithValue(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheKey(), WebCore::DiagnosticLoggingKeys::notInCacheKey(), diagnosticKey, WebCore::ShouldSample::Yes);
+            NetworkProcess::singleton().logDiagnosticMessage(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheFailureReasonKey(), diagnosticKey, WebCore::ShouldSample::Yes);
         } else {
-            NetworkProcess::singleton().logDiagnosticMessageWithValue(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheKey(), WebCore::DiagnosticLoggingKeys::requestKey(), WebCore::DiagnosticLoggingKeys::neverSeenBeforeKey(), WebCore::ShouldSample::Yes);
+            NetworkProcess::singleton().logDiagnosticMessage(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheFailureReasonKey(), WebCore::DiagnosticLoggingKeys::neverSeenBeforeKey(), WebCore::ShouldSample::Yes);
             markAsRequested(hash);
         }
     });
@@ -297,13 +297,13 @@ void Statistics::recordRetrievedCachedEntry(uint64_t webPageID, const Key& key,
 
     if (decision == UseDecision::Validate) {
         LOG(NetworkCache, "(NetworkProcess) webPageID %" PRIu64 ": %s is in the cache but needs revalidation", webPageID, requestURL.string().ascii().data());
-        NetworkProcess::singleton().logDiagnosticMessageWithValue(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheKey(), WebCore::DiagnosticLoggingKeys::retrievalKey(), WebCore::DiagnosticLoggingKeys::needsRevalidationKey(), WebCore::ShouldSample::Yes);
+        NetworkProcess::singleton().logDiagnosticMessage(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheKey(), WebCore::DiagnosticLoggingKeys::needsRevalidationKey(), WebCore::ShouldSample::Yes);
         return;
     }
 
     String diagnosticKey = cachedEntryReuseFailureToDiagnosticKey(decision);
     LOG(NetworkCache, "(NetworkProcess) webPageID %" PRIu64 ": %s is in the cache but wasn't used, reason: %s", webPageID, requestURL.string().ascii().data(), diagnosticKey.utf8().data());
-    NetworkProcess::singleton().logDiagnosticMessageWithValue(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheKey(), WebCore::DiagnosticLoggingKeys::unusableCachedEntryKey(), diagnosticKey, WebCore::ShouldSample::Yes);
+    NetworkProcess::singleton().logDiagnosticMessage(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheReuseFailureKey(), diagnosticKey, WebCore::ShouldSample::Yes);
 }
 
 void Statistics::recordRevalidationSuccess(uint64_t webPageID, const Key& key, const WebCore::ResourceRequest& request)
index 368d92a..64685f9 100644 (file)
@@ -179,7 +179,7 @@ void WebBackForwardList::goToItem(WebBackForwardListItem* item)
     if (targetIndex < m_currentIndex) {
         unsigned delta = m_entries.size() - targetIndex - 1;
         String deltaValue = delta > 10 ? ASCIILiteral("over10") : String::number(delta);
-        m_page->logDiagnosticMessageWithValue(WebCore::DiagnosticLoggingKeys::backNavigationKey(), WebCore::DiagnosticLoggingKeys::deltaKey(), deltaValue, false /* shouldSample */);
+        m_page->logDiagnosticMessage(WebCore::DiagnosticLoggingKeys::backNavigationDeltaKey(), deltaValue, false /* shouldSample */);
     }
 
     // If we're going to an item different from the current item, ask the client if the current
index 1e3d590..2bf769e 100644 (file)
@@ -3127,7 +3127,7 @@ void WebPage::updateVisibleContentRects(const VisibleContentRectUpdateInfo& visi
 
 void WebPage::willStartUserTriggeredZooming()
 {
-    m_page->diagnosticLoggingClient().logDiagnosticMessageWithValue(DiagnosticLoggingKeys::webViewKey(), DiagnosticLoggingKeys::userKey(), DiagnosticLoggingKeys::zoomedKey(), ShouldSample::No);
+    m_page->diagnosticLoggingClient().logDiagnosticMessage(DiagnosticLoggingKeys::webViewKey(), DiagnosticLoggingKeys::userZoomActionKey(), ShouldSample::No);
     m_userHasChangedPageScaleFactor = true;
 }