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

Unified Diff: content/browser/frame_host/navigator_impl.cc

Issue 874353003: New TimeToFirstURLJob* navigation metrics now work with PlzNavigate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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/navigator_impl.cc
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index ebd10e9739d85a3dbb38636447002fd1893e0df6..2df8f4f252c735bcd5b3e29bec5b9e8ff4b054a5 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -772,6 +772,9 @@ void NavigatorImpl::OnBeginNavigation(
navigation_request = scoped_request.get();
navigation_request_map_.set(
frame_tree_node->frame_tree_node_id(), scoped_request.Pass());
+ // TODO(carlosk): begin tracking metrics fort renderer initiated navigations
+ // once the renderer correctly provides its request start time.
clamy 2015/01/27 12:35:04 I don't think we ever want to track renderer initi
carlosk 2015/01/27 17:12:03 Agreed and removed the comment. I didn't realize
+ navigation_data_.reset();
carlosk 2015/01/26 19:54:01 Added a couple metrics-reset-points (here and belo
}
DCHECK(navigation_request);
@@ -833,6 +836,7 @@ void NavigatorImpl::CancelNavigation(FrameTreeNode* frame_tree_node) {
CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableBrowserSideNavigation));
navigation_request_map_.erase(frame_tree_node->frame_tree_node_id());
+ navigation_data_.reset();
carlosk 2015/01/26 19:54:01 Also resetting when cancelling the navigation. No
// TODO(carlosk): move this cleanup into the NavigationRequest destructor once
// we properly cancel ongoing navigations.
frame_tree_node->render_manager()->CleanUpNavigation();
@@ -857,6 +861,8 @@ bool NavigatorImpl::IsWaitingForBeforeUnloadACK(
void NavigatorImpl::LogResourceRequestTime(
base::TimeTicks timestamp, const GURL& url) {
+ DCHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableBrowserSideNavigation));
carlosk 2015/01/26 19:54:01 Now this method is called only for non-PlzNavigate
clamy 2015/01/27 12:35:04 I think they are very similar and we should just h
carlosk 2015/01/27 17:12:03 I didn't think it would be so bad to have them sep
clamy 2015/01/28 13:44:21 Or you can just call LogResourceRequestTime with t
carlosk 2015/01/28 15:21:08 Done. Also added a TODO to rename it later.
if (navigation_data_ && navigation_data_->url_ == url) {
navigation_data_->url_job_start_time_ = timestamp;
UMA_HISTOGRAM_TIMES(
@@ -865,6 +871,17 @@ void NavigatorImpl::LogResourceRequestTime(
}
}
+void NavigatorImpl::LogAboutToBeginNavigation(base::TimeTicks timestamp) {
+ DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableBrowserSideNavigation));
+ if (navigation_data_) {
carlosk 2015/01/26 19:54:01 Note that we don't do URL checks here because they
clamy 2015/01/27 12:35:04 Acknowledged.
+ navigation_data_->url_job_start_time_ = timestamp;
+ UMA_HISTOGRAM_TIMES(
+ "Navigation.TimeToURLJobStart",
+ navigation_data_->url_job_start_time_ - navigation_data_->start_time_);
+ }
+}
+
void NavigatorImpl::LogBeforeUnloadTime(
const base::TimeTicks& renderer_before_unload_start_time,
const base::TimeTicks& renderer_before_unload_end_time) {

Powered by Google App Engine
This is Rietveld 408576698