Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(580)

Unified Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 2936723002: Report frequency of single page app navigations to UMA (Closed)
Patch Set: NOTREACHED Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/FrameLoaderTypes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b9b284ad85fca22a9c6ddade1ef81118e9047046..12c65ef4f5a9251e2039690421fcd5721f699173 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -78,6 +78,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"
@@ -195,6 +196,31 @@ static NavigationPolicy MaybeCheckCSP(
return policy;
}
+static SinglePageAppNavigationType CategorizeSinglePageAppNavigation(
+ SameDocumentNavigationSource same_document_navigation_source,
+ FrameLoadType frame_load_type) {
+ // |SinglePageAppNavigationType| falls into this grid according to different
+ // combinations of |FrameLoadType| and |SameDocumentNavigationSource|:
+ //
+ // HistoryApi Default
+ // kFrameLoadTypeBackForward illegal otherFragmentNav
+ // !kFrameLoadTypeBackForward sameDocBack/Forward historyPushOrReplace
+ switch (same_document_navigation_source) {
+ case kSameDocumentNavigationDefault:
+ if (frame_load_type == kFrameLoadTypeBackForward) {
+ return kSPANavTypeSameDocumentBackwardOrForward;
+ }
+ return kSPANavTypeOtherFragmentNavigation;
+ case kSameDocumentNavigationHistoryApi:
+ // It's illegal to have both kSameDocumentNavigationHistoryApi and
+ // kFrameLoadTypeBackForward.
+ DCHECK(frame_load_type != kFrameLoadTypeBackForward);
+ return kSPANavTypeHistoryPushStateOrReplaceState;
+ }
+ NOTREACHED();
+ return kSPANavTypeSameDocumentBackwardOrForward;
+}
+
ResourceRequest FrameLoader::ResourceRequestForReload(
FrameLoadType frame_load_type,
const KURL& override_url,
@@ -491,6 +517,12 @@ void FrameLoader::UpdateForSameDocumentNavigation(
HistoryScrollRestorationType scroll_restoration_type,
FrameLoadType type,
Document* initiating_document) {
+ SinglePageAppNavigationType single_page_app_navigation_type =
+ CategorizeSinglePageAppNavigation(same_document_navigation_source, type);
+ UMA_HISTOGRAM_ENUMERATION(
+ "RendererScheduler.UpdateForSameDocumentNavigationCount",
+ single_page_app_navigation_type, kSPANavTypeCount);
+
TRACE_EVENT1("blink", "FrameLoader::updateForSameDocumentNavigation", "url",
new_url.GetString().Ascii().data());
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/FrameLoaderTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698