| 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 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 FrameTreeNode* frame_tree_node) { | 744 FrameTreeNode* frame_tree_node) { |
| 745 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | 745 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 746 switches::kEnableBrowserSideNavigation)); | 746 switches::kEnableBrowserSideNavigation)); |
| 747 NavigationRequest* request = | 747 NavigationRequest* request = |
| 748 navigation_request_map_.get(frame_tree_node->frame_tree_node_id()); | 748 navigation_request_map_.get(frame_tree_node->frame_tree_node_id()); |
| 749 if (!request) | 749 if (!request) |
| 750 return false; | 750 return false; |
| 751 return request->state() == NavigationRequest::WAITING_FOR_RENDERER_RESPONSE; | 751 return request->state() == NavigationRequest::WAITING_FOR_RENDERER_RESPONSE; |
| 752 } | 752 } |
| 753 | 753 |
| 754 NavigatorDelegate* NavigatorImpl::GetDelegate() { |
| 755 return delegate_; |
| 756 } |
| 757 |
| 754 void NavigatorImpl::LogResourceRequestTime( | 758 void NavigatorImpl::LogResourceRequestTime( |
| 755 base::TimeTicks timestamp, const GURL& url) { | 759 base::TimeTicks timestamp, const GURL& url) { |
| 756 if (navigation_data_ && navigation_data_->url_ == url) { | 760 if (navigation_data_ && navigation_data_->url_ == url) { |
| 757 navigation_data_->url_job_start_time_ = timestamp; | 761 navigation_data_->url_job_start_time_ = timestamp; |
| 758 UMA_HISTOGRAM_TIMES( | 762 UMA_HISTOGRAM_TIMES( |
| 759 "Navigation.TimeToURLJobStart", | 763 "Navigation.TimeToURLJobStart", |
| 760 navigation_data_->url_job_start_time_ - navigation_data_->start_time_); | 764 navigation_data_->url_job_start_time_ - navigation_data_->start_time_); |
| 761 } | 765 } |
| 762 } | 766 } |
| 763 | 767 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 891 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", | 895 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", |
| 892 time_to_commit); | 896 time_to_commit); |
| 893 UMA_HISTOGRAM_TIMES( | 897 UMA_HISTOGRAM_TIMES( |
| 894 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", | 898 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", |
| 895 time_to_network); | 899 time_to_network); |
| 896 } | 900 } |
| 897 navigation_data_.reset(); | 901 navigation_data_.reset(); |
| 898 } | 902 } |
| 899 | 903 |
| 900 } // namespace content | 904 } // namespace content |
| OLD | NEW |