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

Side by Side Diff: content/browser/frame_host/navigator_impl.cc

Issue 789643005: PlzNavigate: make content unit tests work with browser side navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cancel-navigations
Patch Set: Now addressing failures due to speculative RFH 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/frame_host/navigator_impl.h" 5 #include "content/browser/frame_host/navigator_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "content/browser/frame_host/frame_tree.h" 10 #include "content/browser/frame_host/frame_tree.h"
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 // we properly cancel ongoing navigations. 828 // we properly cancel ongoing navigations.
829 frame_tree_node->render_manager()->CleanUpNavigation(); 829 frame_tree_node->render_manager()->CleanUpNavigation();
830 } 830 }
831 831
832 // PlzNavigate 832 // PlzNavigate
833 NavigationRequest* NavigatorImpl::GetNavigationRequestForNodeForTesting( 833 NavigationRequest* NavigatorImpl::GetNavigationRequestForNodeForTesting(
834 FrameTreeNode* frame_tree_node) { 834 FrameTreeNode* frame_tree_node) {
835 return navigation_request_map_.get(frame_tree_node->frame_tree_node_id()); 835 return navigation_request_map_.get(frame_tree_node->frame_tree_node_id());
836 } 836 }
837 837
838 bool NavigatorImpl::IsWaitingForBeforeUnloadACK(
839 FrameTreeNode* frame_tree_node) {
840 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
841 switches::kEnableBrowserSideNavigation));
842 NavigationRequest* request =
843 navigation_request_map_.get(frame_tree_node->frame_tree_node_id());
844 if (!request)
845 return false;
846 return request->state() == NavigationRequest::WAITING_FOR_RENDERER_RESPONSE;
847 }
848
838 void NavigatorImpl::LogResourceRequestTime( 849 void NavigatorImpl::LogResourceRequestTime(
839 base::TimeTicks timestamp, const GURL& url) { 850 base::TimeTicks timestamp, const GURL& url) {
840 if (navigation_data_ && navigation_data_->url_ == url) { 851 if (navigation_data_ && navigation_data_->url_ == url) {
841 navigation_data_->url_job_start_time_ = timestamp; 852 navigation_data_->url_job_start_time_ = timestamp;
842 UMA_HISTOGRAM_TIMES( 853 UMA_HISTOGRAM_TIMES(
843 "Navigation.TimeToURLJobStart", 854 "Navigation.TimeToURLJobStart",
844 navigation_data_->url_job_start_time_ - navigation_data_->start_time_); 855 navigation_data_->url_job_start_time_ - navigation_data_->start_time_);
845 } 856 }
846 } 857 }
847 858
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", 980 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted",
970 time_to_commit); 981 time_to_commit);
971 UMA_HISTOGRAM_TIMES( 982 UMA_HISTOGRAM_TIMES(
972 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", 983 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted",
973 time_to_network); 984 time_to_network);
974 } 985 }
975 navigation_data_.reset(); 986 navigation_data_.reset();
976 } 987 }
977 988
978 } // namespace content 989 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698