OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |