| 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 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 navigation_request->commit_params()); | 777 navigation_request->commit_params()); |
| 778 } | 778 } |
| 779 | 779 |
| 780 // PlzNavigate | 780 // PlzNavigate |
| 781 void NavigatorImpl::CancelNavigation(FrameTreeNode* frame_tree_node) { | 781 void NavigatorImpl::CancelNavigation(FrameTreeNode* frame_tree_node) { |
| 782 CHECK(CommandLine::ForCurrentProcess()->HasSwitch( | 782 CHECK(CommandLine::ForCurrentProcess()->HasSwitch( |
| 783 switches::kEnableBrowserSideNavigation)); | 783 switches::kEnableBrowserSideNavigation)); |
| 784 navigation_request_map_.erase(frame_tree_node->frame_tree_node_id()); | 784 navigation_request_map_.erase(frame_tree_node->frame_tree_node_id()); |
| 785 } | 785 } |
| 786 | 786 |
| 787 // PlzNavigate |
| 788 NavigationRequest* NavigatorImpl::GetNavigationRequestForNodeForTesting( |
| 789 FrameTreeNode* frame_tree_node) { |
| 790 return navigation_request_map_.get(frame_tree_node->frame_tree_node_id()); |
| 791 } |
| 792 |
| 787 void NavigatorImpl::LogResourceRequestTime( | 793 void NavigatorImpl::LogResourceRequestTime( |
| 788 base::TimeTicks timestamp, const GURL& url) { | 794 base::TimeTicks timestamp, const GURL& url) { |
| 789 if (navigation_data_ && navigation_data_->url_ == url) { | 795 if (navigation_data_ && navigation_data_->url_ == url) { |
| 790 navigation_data_->url_job_start_time_ = timestamp; | 796 navigation_data_->url_job_start_time_ = timestamp; |
| 791 UMA_HISTOGRAM_TIMES( | 797 UMA_HISTOGRAM_TIMES( |
| 792 "Navigation.TimeToURLJobStart", | 798 "Navigation.TimeToURLJobStart", |
| 793 navigation_data_->url_job_start_time_ - navigation_data_->start_time_); | 799 navigation_data_->url_job_start_time_ - navigation_data_->start_time_); |
| 794 } | 800 } |
| 795 } | 801 } |
| 796 | 802 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 916 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", | 922 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", |
| 917 time_to_commit); | 923 time_to_commit); |
| 918 UMA_HISTOGRAM_TIMES( | 924 UMA_HISTOGRAM_TIMES( |
| 919 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", | 925 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", |
| 920 time_to_network); | 926 time_to_network); |
| 921 } | 927 } |
| 922 navigation_data_.reset(); | 928 navigation_data_.reset(); |
| 923 } | 929 } |
| 924 | 930 |
| 925 } // namespace content | 931 } // namespace content |
| OLD | NEW |