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

Unified Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 2930353005: PlzNavigate: Add metrics to understand bf navigations PLT regression (Closed)
Patch Set: 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
Index: content/browser/loader/resource_dispatcher_host_impl.cc
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index 300a222f6acc42fbebe46bb6efe44d9f17e486ca..1807e9174956d92c5df6ba65a107ef1566fca6ed 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -272,6 +272,45 @@ void HandleSyncLoadResult(base::WeakPtr<ResourceMessageFilter> filter,
filter->Send(sync_result.release());
}
+// Used to log the cache flags for back-forward navigation requests.
Ilya Sherman 2017/06/13 21:38:00 Please document that this is used to back an UMA h
clamy 2017/06/14 13:26:50 Done.
+// TODO(clamy): Remove this once we know the reason behind PlzNavigate's
+// regression on PLT for back forward navigations.
+enum HistogramCacheFlag {
+ HISTOGRAM_VALIDATE_CACHE,
+ HISTOGRAM_BYPASS_CACHE,
+ HISTOGRAM_SKIP_CACHE_VALIDATION,
+ HISTOGRAM_ONLY_FROM_CACHE,
+ HISTOGRAM_DISABLE_CACHE,
+ HISTOGRAM_CACHE_FLAG_MAX = HISTOGRAM_DISABLE_CACHE,
+};
+
+void LogBackForwardNavigationFlagsHistogram(int load_flags) {
+ if (load_flags & net::LOAD_VALIDATE_CACHE) {
+ UMA_HISTOGRAM_ENUMERATION("Navigation.BackForward.CacheFlags",
+ HISTOGRAM_VALIDATE_CACHE,
+ HISTOGRAM_CACHE_FLAG_MAX);
Ilya Sherman 2017/06/13 21:38:00 nit: Please create a small wrapper function, that
clamy 2017/06/14 13:26:50 Done.
+ }
+ if (load_flags & net::LOAD_BYPASS_CACHE) {
+ UMA_HISTOGRAM_ENUMERATION("Navigation.BackForward.CacheFlags",
+ HISTOGRAM_BYPASS_CACHE, HISTOGRAM_CACHE_FLAG_MAX);
+ }
+ if (load_flags & net::LOAD_SKIP_CACHE_VALIDATION) {
+ UMA_HISTOGRAM_ENUMERATION("Navigation.BackForward.CacheFlags",
+ HISTOGRAM_SKIP_CACHE_VALIDATION,
+ HISTOGRAM_CACHE_FLAG_MAX);
+ }
+ if (load_flags & net::LOAD_ONLY_FROM_CACHE) {
+ UMA_HISTOGRAM_ENUMERATION("Navigation.BackForward.CacheFlags",
+ HISTOGRAM_ONLY_FROM_CACHE,
+ HISTOGRAM_CACHE_FLAG_MAX);
+ }
+ if (load_flags & net::LOAD_VALIDATE_CACHE) {
+ UMA_HISTOGRAM_ENUMERATION("Navigation.BackForward.CacheFlags",
+ HISTOGRAM_VALIDATE_CACHE,
+ HISTOGRAM_CACHE_FLAG_MAX);
+ }
+}
+
} // namespace
ResourceDispatcherHostImpl::LoadInfo::LoadInfo() {}
@@ -2200,6 +2239,14 @@ void ResourceDispatcherHostImpl::BeginRequestInternal(
ResourceRequestInfoImpl* info =
ResourceRequestInfoImpl::ForRequest(request.get());
+ // Log metrics for back-forward navigations.
+ // TODO(clamy): Remove this once we understand the reason behind the
+ // back-forward PLT regression with PlzNavigate
+ if ((info->GetPageTransition() & ui::PAGE_TRANSITION_FORWARD_BACK) &&
+ IsResourceTypeFrame(info->GetResourceType())) {
nasko 2017/06/13 23:50:08 Since we care only about main resources, shouldn't
clamy 2017/06/14 13:26:50 Yes the goal is to compare between PlzNavigate and
+ LogBackForwardNavigationFlagsHistogram(request->load_flags());
+ }
+
if ((TimeTicks::Now() - last_user_gesture_time_) <
TimeDelta::FromMilliseconds(kUserGestureWindowMs)) {
request->SetLoadFlags(request->load_flags() | net::LOAD_MAYBE_USER_GESTURE);

Powered by Google App Engine
This is Rietveld 408576698