Title: [187592] trunk/Source/WebCore
Revision
187592
Author
simon.fra...@apple.com
Date
2015-07-30 11:31:01 -0700 (Thu, 30 Jul 2015)

Log Message

Improve the history logging output
https://bugs.webkit.org/show_bug.cgi?id=147429

Reviewed by Alexey Proskuryakov.

Improve the History log channel output to show which frame is navigating,
print the addresses of the HistoryController and Frame, and print URLs
for everything.

Remove the BackForward log channel which had just one calling location,
and log for pushState/replaceState.

* loader/HistoryController.cpp:
(WebCore::HistoryController::updateForBackForwardNavigation):
(WebCore::HistoryController::updateForReload):
(WebCore::HistoryController::updateForStandardLoad):
(WebCore::HistoryController::updateForRedirectWithLockedBackForwardList):
(WebCore::HistoryController::updateForClientRedirect):
(WebCore::HistoryController::updateForCommit):
(WebCore::HistoryController::updateBackForwardListClippedAtTarget):
(WebCore::HistoryController::pushState):
(WebCore::HistoryController::replaceState):
* platform/Logging.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (187591 => 187592)


--- trunk/Source/WebCore/ChangeLog	2015-07-30 18:29:18 UTC (rev 187591)
+++ trunk/Source/WebCore/ChangeLog	2015-07-30 18:31:01 UTC (rev 187592)
@@ -1,3 +1,29 @@
+2015-07-30  Simon Fraser  <simon.fra...@apple.com>
+
+        Improve the history logging output
+        https://bugs.webkit.org/show_bug.cgi?id=147429
+
+        Reviewed by Alexey Proskuryakov.
+
+        Improve the History log channel output to show which frame is navigating,
+        print the addresses of the HistoryController and Frame, and print URLs
+        for everything.
+        
+        Remove the BackForward log channel which had just one calling location,
+        and log for pushState/replaceState.
+
+        * loader/HistoryController.cpp:
+        (WebCore::HistoryController::updateForBackForwardNavigation):
+        (WebCore::HistoryController::updateForReload):
+        (WebCore::HistoryController::updateForStandardLoad):
+        (WebCore::HistoryController::updateForRedirectWithLockedBackForwardList):
+        (WebCore::HistoryController::updateForClientRedirect):
+        (WebCore::HistoryController::updateForCommit):
+        (WebCore::HistoryController::updateBackForwardListClippedAtTarget):
+        (WebCore::HistoryController::pushState):
+        (WebCore::HistoryController::replaceState):
+        * platform/Logging.h:
+
 2015-07-29  Matt Rajca  <mra...@apple.com>
 
         Media Session: add infrastructure for testing media control events

Modified: trunk/Source/WebCore/loader/HistoryController.cpp (187591 => 187592)


--- trunk/Source/WebCore/loader/HistoryController.cpp	2015-07-30 18:29:18 UTC (rev 187591)
+++ trunk/Source/WebCore/loader/HistoryController.cpp	2015-07-30 18:31:01 UTC (rev 187592)
@@ -316,10 +316,7 @@
 
 void HistoryController::updateForBackForwardNavigation()
 {
-#if !LOG_DISABLED
-    if (m_frame.loader().documentLoader())
-        LOG(History, "WebCoreHistory: Updating History for back/forward navigation in frame %s", m_frame.loader().documentLoader()->title().string().utf8().data());
-#endif
+    LOG(History, "HistoryController %p updateForBackForwardNavigation: Updating History for back/forward navigation in frame %p (main frame %d) %s", this, &m_frame, m_frame.isMainFrame(), m_frame.loader().documentLoader() ? m_frame.loader().documentLoader()->url().string().utf8().data() : "");
 
     // Must grab the current scroll position before disturbing it
     if (!m_frameLoadComplete)
@@ -332,10 +329,7 @@
 
 void HistoryController::updateForReload()
 {
-#if !LOG_DISABLED
-    if (m_frame.loader().documentLoader())
-        LOG(History, "WebCoreHistory: Updating History for reload in frame %s", m_frame.loader().documentLoader()->title().string().utf8().data());
-#endif
+    LOG(History, "HistoryController %p updateForBackForwardNavigation: Updating History for reload in frame %p (main frame %d) %s", this, &m_frame, m_frame.isMainFrame(), m_frame.loader().documentLoader() ? m_frame.loader().documentLoader()->url().string().utf8().data() : "");
 
     if (m_currentItem) {
         PageCache::singleton().remove(*m_currentItem);
@@ -360,7 +354,7 @@
 
 void HistoryController::updateForStandardLoad(HistoryUpdateType updateType)
 {
-    LOG(History, "WebCoreHistory: Updating History for Standard Load in frame %s", m_frame.loader().documentLoader()->url().string().ascii().data());
+    LOG(History, "HistoryController %p updateForStandardLoad: Updating History for standard load in frame %p (main frame %d) %s", this, &m_frame, m_frame.isMainFrame(), m_frame.loader().documentLoader()->url().string().ascii().data());
 
     FrameLoader& frameLoader = m_frame.loader();
 
@@ -396,10 +390,7 @@
 
 void HistoryController::updateForRedirectWithLockedBackForwardList()
 {
-#if !LOG_DISABLED
-    if (m_frame.loader().documentLoader())
-        LOG(History, "WebCoreHistory: Updating History for redirect load in frame %s", m_frame.loader().documentLoader()->title().string().utf8().data());
-#endif
+    LOG(History, "HistoryController %p updateForRedirectWithLockedBackForwardList: Updating History for redirect load in frame %p (main frame %d) %s", this, &m_frame, m_frame.isMainFrame(), m_frame.loader().documentLoader() ? m_frame.loader().documentLoader()->url().string().utf8().data() : "");
     
     bool needPrivacy = m_frame.page()->usesEphemeralSession();
     const URL& historyURL = m_frame.loader().documentLoader()->urlForHistory();
@@ -437,10 +428,7 @@
 
 void HistoryController::updateForClientRedirect()
 {
-#if !LOG_DISABLED
-    if (m_frame.loader().documentLoader())
-        LOG(History, "WebCoreHistory: Updating History for client redirect in frame %s", m_frame.loader().documentLoader()->title().string().utf8().data());
-#endif
+    LOG(History, "HistoryController %p updateForClientRedirect: Updating History for client redirect in frame %p (main frame %d) %s", this, &m_frame, m_frame.isMainFrame(), m_frame.loader().documentLoader() ? m_frame.loader().documentLoader()->url().string().utf8().data() : "");
 
     // Clear out form data so we don't try to restore it into the incoming page.  Must happen after
     // webcore has closed the URL and saved away the form state.
@@ -461,10 +449,8 @@
 void HistoryController::updateForCommit()
 {
     FrameLoader& frameLoader = m_frame.loader();
-#if !LOG_DISABLED
-    if (frameLoader.documentLoader())
-        LOG(History, "WebCoreHistory: Updating History for commit in frame %s", frameLoader.documentLoader()->title().string().utf8().data());
-#endif
+    LOG(History, "HistoryController %p updateForCommit: Updating History for commit in frame %p (main frame %d) %s", this, &m_frame, m_frame.isMainFrame(), m_frame.loader().documentLoader() ? m_frame.loader().documentLoader()->url().string().utf8().data() : "");
+
     FrameLoadType type = frameLoader.loadType();
     if (isBackForwardLoadType(type)
         || isReplaceLoadTypeWithProvisionalItem(type)
@@ -812,7 +798,8 @@
     FrameLoader& frameLoader = m_frame.mainFrame().loader();
 
     Ref<HistoryItem> topItem = frameLoader.history().createItemTree(m_frame, doClip);
-    LOG(BackForward, "WebCoreBackForward - Adding backforward item %p for frame %s", topItem.ptr(), m_frame.loader().documentLoader()->url().string().ascii().data());
+    LOG(History, "HistoryController %p updateBackForwardListClippedAtTarget: Adding backforward item %p in frame %p (main frame %d) %s", this, topItem.ptr(), &m_frame, m_frame.isMainFrame(), m_frame.loader().documentLoader()->url().string().utf8().data());
+
     page->backForward().addItem(WTF::move(topItem));
 }
 
@@ -858,6 +845,8 @@
     m_currentItem->setStateObject(stateObject);
     m_currentItem->setURLString(urlString);
 
+    LOG(History, "HistoryController %p pushState: Adding top item %p, setting url of current item %p to %s", this, topItem.ptr(), m_currentItem.get(), urlString.ascii().data());
+
     page->backForward().addItem(WTF::move(topItem));
 
     if (m_frame.page()->usesEphemeralSession())
@@ -872,6 +861,8 @@
     if (!m_currentItem)
         return;
 
+    LOG(History, "HistoryController %p replaceState: Setting url of current item %p to %s", this, m_currentItem.get(), urlString.ascii().data());
+
     if (!urlString.isEmpty())
         m_currentItem->setURLString(urlString);
     m_currentItem->setTitle(title);

Modified: trunk/Source/WebCore/platform/Logging.h (187591 => 187592)


--- trunk/Source/WebCore/platform/Logging.h	2015-07-30 18:29:18 UTC (rev 187591)
+++ trunk/Source/WebCore/platform/Logging.h	2015-07-30 18:31:01 UTC (rev 187592)
@@ -40,7 +40,6 @@
 #define WEBCORE_LOG_CHANNELS(M) \
     M(Animations) \
     M(Archives) \
-    M(BackForward) \
     M(Compositing) \
     M(ContentFiltering) \
     M(DOMTimers) \
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to