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

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: Final method name change. Created 5 years, 10 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/navigator.h ('k') | content/browser/loader/navigation_url_loader_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d5f71346dc846787b629d7924704575790f35e6a 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());
+
+ if (frame_tree_node->IsMainFrame())
+ navigation_data_.reset();
}
DCHECK(navigation_request);
@@ -833,6 +836,8 @@ 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());
+ if (frame_tree_node->IsMainFrame())
+ navigation_data_.reset();
// TODO(carlosk): move this cleanup into the NavigationRequest destructor once
// we properly cancel ongoing navigations.
frame_tree_node->render_manager()->CleanUpNavigation();
@@ -944,6 +949,7 @@ void NavigatorImpl::RecordNavigationMetrics(
RecordAction(base::UserMetricsAction("FrameLoad"));
if (!details.is_main_frame || !navigation_data_ ||
+ navigation_data_->url_job_start_time_.is_null() ||
navigation_data_->url_ != params.original_request_url) {
return;
}
« no previous file with comments | « content/browser/frame_host/navigator.h ('k') | content/browser/loader/navigation_url_loader_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698