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

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

Issue 2930353005: PlzNavigate: Add metrics to understand bf navigations PLT regression (Closed)
Patch Set: Addressed comments 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 | « content/browser/frame_host/navigation_handle_impl.cc ('k') | content/browser/loader/resource_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..39108877eb551027f55ebfd7e6d29a13dc89690d 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -272,6 +272,42 @@ void HandleSyncLoadResult(base::WeakPtr<ResourceMessageFilter> filter,
filter->Send(sync_result.release());
}
+// Used to log the cache flags for back-forward navigation requests.
+// Because this enum is used to back a histogrma, DO NOT REMOVE OR RENAME VALUES
+// in this enum. Instead, add a new one at the end.
+// 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 RecordCacheFlags(HistogramCacheFlag flag) {
+ UMA_HISTOGRAM_ENUMERATION("Navigation.BackForward.CacheFlags", flag,
+ HISTOGRAM_CACHE_FLAG_MAX);
+}
+
+void LogBackForwardNavigationFlagsHistogram(int load_flags) {
+ if (load_flags & net::LOAD_VALIDATE_CACHE)
+ RecordCacheFlags(HISTOGRAM_VALIDATE_CACHE);
+
+ if (load_flags & net::LOAD_BYPASS_CACHE)
+ RecordCacheFlags(HISTOGRAM_BYPASS_CACHE);
+
+ if (load_flags & net::LOAD_SKIP_CACHE_VALIDATION)
+ RecordCacheFlags(HISTOGRAM_SKIP_CACHE_VALIDATION);
+
+ if (load_flags & net::LOAD_ONLY_FROM_CACHE)
+ RecordCacheFlags(HISTOGRAM_ONLY_FROM_CACHE);
+
+ if (load_flags & net::LOAD_DISABLE_CACHE)
+ RecordCacheFlags(HISTOGRAM_DISABLE_CACHE);
+}
+
} // namespace
ResourceDispatcherHostImpl::LoadInfo::LoadInfo() {}
@@ -2200,6 +2236,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())) {
+ LogBackForwardNavigationFlagsHistogram(request->load_flags());
+ }
+
if ((TimeTicks::Now() - last_user_gesture_time_) <
TimeDelta::FromMilliseconds(kUserGestureWindowMs)) {
request->SetLoadFlags(request->load_flags() | net::LOAD_MAYBE_USER_GESTURE);
« no previous file with comments | « content/browser/frame_host/navigation_handle_impl.cc ('k') | content/browser/loader/resource_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698