Index: third_party/WebKit/Source/core/loader/FrameLoader.cpp |
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp |
index 23b058dc70155aed38401d5d15f0860ebd8d6adb..0b4a7d5f802e705c67221735984e7c20c11aee69 100644 |
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp |
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp |
@@ -79,6 +79,7 @@ |
#include "core/probe/CoreProbes.h" |
#include "core/svg/graphics/SVGImage.h" |
#include "core/xml/parser/XMLDocumentParser.h" |
+#include "platform/Histogram.h" |
#include "platform/InstanceCounters.h" |
#include "platform/PluginScriptForbiddenScope.h" |
#include "platform/ScriptForbiddenScope.h" |
@@ -484,6 +485,33 @@ void FrameLoader::UpdateForSameDocumentNavigation( |
HistoryScrollRestorationType scroll_restoration_type, |
FrameLoadType type, |
Document* initiating_document) { |
+ // |SinglePageAppNavigationType| falls into this grid according to different |
+ // combinations of |FrameLoadType| and |SameDocumentNavigationSource|: |
+ // |
+ // HistoryApi Default |
+ // kFrameLoadTypeBackForward illegal otherFragmentNav |
+ // !kFrameLoadTypeBackForward sameDocBack/Forward historyPushOrReplace |
+ SinglePageAppNavigationType single_page_app_navigation_type; |
+ switch (same_document_navigation_source) { |
+ case kSameDocumentNavigationDefault: |
+ if (type == kFrameLoadTypeBackForward) { |
+ single_page_app_navigation_type = |
+ kSPANavTypeSameDocumentBackwardOrForward; |
+ } else { |
+ single_page_app_navigation_type = kSPANavTypeOtherFragmentNavigation; |
+ } |
+ break; |
+ case kSameDocumentNavigationHistoryApi: |
+ // It's illegal to have both kSameDocumentNavigationHistoryApi and |
+ // kFrameLoadTypeBackForward. |
+ DCHECK(type != kFrameLoadTypeBackForward); |
+ single_page_app_navigation_type = |
+ kSPANavTypeHistoryPushStateOrReplaceState; |
+ } |
+ UMA_HISTOGRAM_ENUMERATION( |
+ "RendererScheduler.UpdateForSameDocumentNavigationCount", |
+ single_page_app_navigation_type, kSPANavTypeCount); |
+ |
TRACE_EVENT1("blink", "FrameLoader::updateForSameDocumentNavigation", "url", |
new_url.GetString().Ascii().data()); |