Fix PageCache diagnostic logging
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Jan 2017 19:14:57 +0000 (19:14 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Jan 2017 19:14:57 +0000 (19:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=167508

Reviewed by Sam Weinig.

Fix PageCache diagnostic logging. It should not call logDiagnosticMessageWithValue()
with a non-numeric value. Use logDiagnosticMessage() instead.

* history/PageCache.cpp:
(WebCore::logPageCacheFailureDiagnosticMessage):
(WebCore::canCacheFrame):
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::pageCacheFailureKey):
(WebCore::DiagnosticLoggingKeys::successKey): Deleted.
(WebCore::DiagnosticLoggingKeys::failureKey): Deleted.
* page/DiagnosticLoggingKeys.h:

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

Source/WebCore/ChangeLog
Source/WebCore/history/PageCache.cpp
Source/WebCore/page/DiagnosticLoggingKeys.cpp
Source/WebCore/page/DiagnosticLoggingKeys.h

index b04c5cc..083261d 100644 (file)
@@ -1,3 +1,22 @@
+2017-01-27  Chris Dumez  <cdumez@apple.com>
+
+        Fix PageCache diagnostic logging
+        https://bugs.webkit.org/show_bug.cgi?id=167508
+
+        Reviewed by Sam Weinig.
+
+        Fix PageCache diagnostic logging. It should not call logDiagnosticMessageWithValue()
+        with a non-numeric value. Use logDiagnosticMessage() instead.
+
+        * history/PageCache.cpp:
+        (WebCore::logPageCacheFailureDiagnosticMessage):
+        (WebCore::canCacheFrame):
+        * page/DiagnosticLoggingKeys.cpp:
+        (WebCore::DiagnosticLoggingKeys::pageCacheFailureKey):
+        (WebCore::DiagnosticLoggingKeys::successKey): Deleted.
+        (WebCore::DiagnosticLoggingKeys::failureKey): Deleted.
+        * page/DiagnosticLoggingKeys.h:
+
 2017-01-27  Devin Rousso  <dcrousso+webkit@gmail.com>
 
         Styles should not show background-repeat-x/y, or -webkit-mask-repeat-x/y
index becae26..82ee0d8 100644 (file)
@@ -64,7 +64,7 @@ namespace WebCore {
 
 static inline void logPageCacheFailureDiagnosticMessage(DiagnosticLoggingClient& client, const String& reason)
 {
-    client.logDiagnosticMessageWithValue(DiagnosticLoggingKeys::pageCacheKey(), DiagnosticLoggingKeys::failureKey(), reason, ShouldSample::Yes);
+    client.logDiagnosticMessage(DiagnosticLoggingKeys::pageCacheFailureKey(), reason, ShouldSample::Yes);
 }
 
 static inline void logPageCacheFailureDiagnosticMessage(Page* page, const String& reason)
@@ -154,7 +154,7 @@ static bool canCacheFrame(Frame& frame, DiagnosticLoggingClient& diagnosticLoggi
         PCLOG("   -The document cannot suspend its active DOM Objects");
         for (auto* activeDOMObject : unsuspendableObjects) {
             PCLOG("    - Unsuspendable: ", activeDOMObject->activeDOMObjectName());
-            diagnosticLoggingClient.logDiagnosticMessageWithValue(DiagnosticLoggingKeys::pageCacheKey(), DiagnosticLoggingKeys::unsuspendableDOMObjectKey(), activeDOMObject->activeDOMObjectName(), ShouldSample::Yes);
+            diagnosticLoggingClient.logDiagnosticMessage(DiagnosticLoggingKeys::unsuspendableDOMObjectKey(), activeDOMObject->activeDOMObjectName(), ShouldSample::Yes);
             UNUSED_PARAM(activeDOMObject);
         }
         logPageCacheFailureDiagnosticMessage(diagnosticLoggingClient, DiagnosticLoggingKeys::cannotSuspendActiveDOMObjectsKey());
index 25efddd..0f8631a 100644 (file)
@@ -103,16 +103,6 @@ String DiagnosticLoggingKeys::pageContainsAtLeastOneMediaEngineKey()
     return ASCIILiteral("pageContainsAtLeastOneMediaEngine");
 }
 
-String DiagnosticLoggingKeys::successKey()
-{
-    return ASCIILiteral("success");
-}
-
-String DiagnosticLoggingKeys::failureKey()
-{
-    return ASCIILiteral("failure");
-}
-
 String DiagnosticLoggingKeys::pageLoadedKey()
 {
     return ASCIILiteral("pageLoaded");
@@ -198,6 +188,11 @@ String DiagnosticLoggingKeys::pageCacheKey()
     return ASCIILiteral("pageCache");
 }
 
+String DiagnosticLoggingKeys::pageCacheFailureKey()
+{
+    return ASCIILiteral("pageCacheFailure");
+}
+
 String DiagnosticLoggingKeys::noDocumentLoaderKey()
 {
     return ASCIILiteral("noDocumentLoader");
index 53d0da4..4767d1b 100644 (file)
@@ -97,6 +97,7 @@ public:
     static String notInMemoryCacheKey();
     WEBCORE_EXPORT static String otherKey();
     static String pageCacheKey();
+    static String pageCacheFailureKey();
     static String pageContainsAtLeastOneMediaEngineKey();
     static String pageContainsAtLeastOnePluginKey();
     static String pageContainsMediaEngineKey();
@@ -168,10 +169,6 @@ public:
     WEBCORE_EXPORT static String memoryUsageToDiagnosticLoggingKey(uint64_t memoryUsage);
     WEBCORE_EXPORT static String foregroundCPUUsageToDiagnosticLoggingKey(double cpuUsage);
     WEBCORE_EXPORT static String backgroundCPUUsageToDiagnosticLoggingKey(double cpuUsage);
-
-    // Success / Failure keys.
-    static String successKey();
-    static String failureKey();
 };
 
 } // namespace WebCore