Title: [179897] branches/safari-600.5-branch/Source/WebCore

Diff

Modified: branches/safari-600.5-branch/Source/WebCore/ChangeLog (179896 => 179897)


--- branches/safari-600.5-branch/Source/WebCore/ChangeLog	2015-02-11 00:00:53 UTC (rev 179896)
+++ branches/safari-600.5-branch/Source/WebCore/ChangeLog	2015-02-11 00:05:05 UTC (rev 179897)
@@ -1,5 +1,28 @@
 2015-02-10  Lucas Forschler  <lforsch...@apple.com>
 
+        Merge r177504 & r178298
+
+    2015-01-12  Chris Dumez  <cdu...@apple.com>
+
+            Log navigation types using DiagnosticLoggingClient
+            https://bugs.webkit.org/show_bug.cgi?id=140323
+
+            Reviewed by Darin Adler.
+
+            Log navigation types using DiagnosticLoggingClient to help us understand
+            what types of navigations are common and give us an estimate on the
+            total number of navigations.
+
+            * loader/FrameLoader.cpp:
+            (WebCore::logNavigation):
+            (WebCore::FrameLoader::loadWithDocumentLoader):
+            (WebCore::logNavigationWithFeatureCounter): Deleted.
+            * page/DiagnosticLoggingKeys.cpp:
+            (WebCore::DiagnosticLoggingKeys::navigationKey):
+            * page/DiagnosticLoggingKeys.h:
+
+2015-02-10  Lucas Forschler  <lforsch...@apple.com>
+
         Merge r176899
 
     2014-12-05  Simon Fraser  <simon.fra...@apple.com>

Modified: branches/safari-600.5-branch/Source/WebCore/loader/FrameLoader.cpp (179896 => 179897)


--- branches/safari-600.5-branch/Source/WebCore/loader/FrameLoader.cpp	2015-02-11 00:00:53 UTC (rev 179896)
+++ branches/safari-600.5-branch/Source/WebCore/loader/FrameLoader.cpp	2015-02-11 00:05:05 UTC (rev 179897)
@@ -1424,6 +1424,44 @@
     loadWithDocumentLoader(newDocumentLoader, type, 0, AllowNavigationToInvalidURL::Yes);
 }
 
+static void logNavigation(MainFrame& frame, FrameLoadType type)
+{
+    String navigationDescription;
+    switch (type) {
+    case FrameLoadType::Standard:
+        navigationDescription = ASCIILiteral("standard");
+        break;
+    case FrameLoadType::Back:
+        navigationDescription = ASCIILiteral("back");
+        break;
+    case FrameLoadType::Forward:
+        navigationDescription = ASCIILiteral("forward");
+        break;
+    case FrameLoadType::IndexedBackForward:
+        navigationDescription = ASCIILiteral("indexedBackForward");
+        break;
+    case FrameLoadType::Reload:
+        navigationDescription = ASCIILiteral("reload");
+        break;
+    case FrameLoadType::Same:
+        navigationDescription = ASCIILiteral("same");
+        break;
+    case FrameLoadType::ReloadFromOrigin:
+        navigationDescription = ASCIILiteral("reloadFromOrigin");
+        break;
+    case FrameLoadType::Replace:
+    case FrameLoadType::RedirectWithLockedBackForwardList:
+        // Not logging those for now.
+        return;
+    }
+
+    if (frame.settings().diagnosticLoggingEnabled()) {
+        if (auto* client = frame.diagnosticLoggingClient())
+            client->logDiagnosticMessage(DiagnosticLoggingKeys::navigationKey(), navigationDescription);
+    }
+}
+
+
 void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType type, PassRefPtr<FormState> prpFormState, AllowNavigationToInvalidURL allowNavigationToInvalidURL)
 {
     // Retain because dispatchBeforeLoadEvent may release the last reference to it.
@@ -1442,6 +1480,10 @@
     if (m_frame.document())
         m_previousURL = m_frame.document()->url();
 
+    // Log main frame navigation types.
+    if (m_frame.isMainFrame())
+        logNavigation(static_cast<MainFrame&>(m_frame), type);
+
     policyChecker().setLoadType(type);
     RefPtr<FormState> formState = prpFormState;
     bool isFormSubmission = formState;

Modified: branches/safari-600.5-branch/Source/WebCore/page/DiagnosticLoggingKeys.cpp (179896 => 179897)


--- branches/safari-600.5-branch/Source/WebCore/page/DiagnosticLoggingKeys.cpp	2015-02-11 00:00:53 UTC (rev 179896)
+++ branches/safari-600.5-branch/Source/WebCore/page/DiagnosticLoggingKeys.cpp	2015-02-11 00:05:05 UTC (rev 179897)
@@ -88,4 +88,9 @@
     return WTF::ASCIILiteral("pageLoaded");
 }
 
+WTF::String DiagnosticLoggingKeys::navigationKey()
+{
+    return WTF::ASCIILiteral("navigation");
 }
+
+}

Modified: branches/safari-600.5-branch/Source/WebCore/page/DiagnosticLoggingKeys.h (179896 => 179897)


--- branches/safari-600.5-branch/Source/WebCore/page/DiagnosticLoggingKeys.h	2015-02-11 00:00:53 UTC (rev 179896)
+++ branches/safari-600.5-branch/Source/WebCore/page/DiagnosticLoggingKeys.h	2015-02-11 00:05:05 UTC (rev 179897)
@@ -42,6 +42,7 @@
     static String pageContainsMediaEngineKey();
     static String pageContainsAtLeastOneMediaEngineKey();
     static String pageLoadedKey();
+    static String navigationKey();
 
     // Success keys.
     static String passKey();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to