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

Unified Diff: content/browser/frame_host/navigation_handle_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
Index: content/browser/frame_host/navigation_handle_impl.cc
diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc
index d4fc5c0f874308741dc69a8e6ce9653f4d89c935..40037d201e0217d74bffc65939d087b25060b436 100644
--- a/content/browser/frame_host/navigation_handle_impl.cc
+++ b/content/browser/frame_host/navigation_handle_impl.cc
@@ -7,6 +7,7 @@
#include <iterator>
#include "base/logging.h"
+#include "base/metrics/histogram_macros.h"
#include "content/browser/appcache/appcache_navigation_handle.h"
#include "content/browser/appcache/appcache_service_impl.h"
#include "content/browser/child_process_security_policy_impl.h"
@@ -706,6 +707,18 @@ void NavigationHandleImpl::ReadyToCommitNavigation(
DCHECK(!render_frame_host_ || render_frame_host_ == render_frame_host);
render_frame_host_ = render_frame_host;
state_ = READY_TO_COMMIT;
+ ready_to_commit_time_ = base::TimeTicks::Now();
+
+ // For back-forward navigations, record metrics.
+ if (transition_ & ui::PAGE_TRANSITION_FORWARD_BACK) {
+ bool is_same_process =
+ render_frame_host_->GetProcess()->GetID() ==
+ frame_tree_node_->current_frame_host()->GetProcess()->GetID();
+ UMA_HISTOGRAM_BOOLEAN("Navigation.BackForward.IsSameProcess",
+ is_same_process);
+ UMA_HISTOGRAM_TIMES("Navigation.BackForward.TimeToReadyToCommit",
+ ready_to_commit_time_ - navigation_start_);
+ }
if (IsBrowserSideNavigationEnabled())
SetExpectedProcess(render_frame_host->GetProcess());
@@ -736,6 +749,13 @@ void NavigationHandleImpl::DidCommitNavigation(
socket_address_ = params.socket_address;
navigation_type_ = navigation_type;
+ // For back-forward navigations, record metrics.
+ if ((transition_ & ui::PAGE_TRANSITION_FORWARD_BACK) &&
+ !ready_to_commit_time_.is_null()) {
+ UMA_HISTOGRAM_TIMES("Navigation.BackForward.ReadyToCommitUntilCommit",
+ base::TimeTicks::Now() - ready_to_commit_time_);
+ }
+
DCHECK(!IsInMainFrame() || navigation_entry_committed)
<< "Only subframe navigations can get here without changing the "
<< "NavigationEntry";
« no previous file with comments | « content/browser/frame_host/navigation_handle_impl.h ('k') | content/browser/loader/resource_dispatcher_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698