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

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

Issue 2936723002: Report frequency of single page app navigations to UMA (Closed)
Patch Set: Update SPA categories Created 3 years, 6 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/web/tests/WebFrameTest.cpp » ('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 23b058dc70155aed38401d5d15f0860ebd8d6adb..a99a75e90d185f7aaa0a7df98d4877b91cb92ec1 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,35 @@ void FrameLoader::UpdateForSameDocumentNavigation(
HistoryScrollRestorationType scroll_restoration_type,
FrameLoadType type,
Document* initiating_document) {
+ // This enum is used to index different kinds of single-page-application
+ // navigations for UMA enum histogram. New enum values can be added, but
+ // existing enums must never be renumbered or deleted and reused.
+ // This enum should be consistent with SinglePageAppNavigationType in
+ // tools/metrics/histograms/enums.
+ enum SinglePageAppNavigationType {
+ kSPANavTypeHistoryPushStateOrReplaceState = 0,
+ kSPANavTypeSameDocumentBackwardOrForward = 1,
+ kSPANavTypeOtherFragmentNavigation = 2,
+ kSPANavTypeCount = kSPANavTypeOtherFragmentNavigation + 1,
+ };
+ const char* histogramName =
+ "RendererScheduler.UpdateForSameDocumentNavigationCount";
+ if (same_document_navigation_source == kSameDocumentNavigationHistoryApi) {
Liquan (Max) Gu 2017/06/16 17:37:35 Can I assume that these three conditions are exclu
+ UMA_HISTOGRAM_ENUMERATION(histogramName,
+ kSPANavTypeHistoryPushStateOrReplaceState,
+ kSPANavTypeCount);
+ }
+ if (type == kFrameLoadTypeBackForward) {
+ UMA_HISTOGRAM_ENUMERATION(histogramName,
+ kSPANavTypeSameDocumentBackwardOrForward,
+ kSPANavTypeCount);
+ }
+ if (same_document_navigation_source == kSameDocumentNavigationDefault &&
+ type != kFrameLoadTypeBackForward) {
+ UMA_HISTOGRAM_ENUMERATION(histogramName, kSPANavTypeOtherFragmentNavigation,
+ kSPANavTypeCount);
+ }
+
TRACE_EVENT1("blink", "FrameLoader::updateForSameDocumentNavigation", "url",
new_url.GetString().Ascii().data());
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698