| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1053 navigation_request->BeginNavigation(); | 1053 navigation_request->BeginNavigation(); |
| 1054 } | 1054 } |
| 1055 } | 1055 } |
| 1056 | 1056 |
| 1057 void NavigatorImpl::RecordNavigationMetrics( | 1057 void NavigatorImpl::RecordNavigationMetrics( |
| 1058 const LoadCommittedDetails& details, | 1058 const LoadCommittedDetails& details, |
| 1059 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, | 1059 const FrameHostMsg_DidCommitProvisionalLoad_Params& params, |
| 1060 SiteInstance* site_instance) { | 1060 SiteInstance* site_instance) { |
| 1061 DCHECK(site_instance->HasProcess()); | 1061 DCHECK(site_instance->HasProcess()); |
| 1062 | 1062 |
| 1063 if (!details.is_in_page) | |
| 1064 RecordAction(base::UserMetricsAction("FrameLoad")); | |
| 1065 | |
| 1066 if (!details.is_main_frame || !navigation_data_ || | 1063 if (!details.is_main_frame || !navigation_data_ || |
| 1067 navigation_data_->url_job_start_time_.is_null() || | 1064 navigation_data_->url_job_start_time_.is_null() || |
| 1068 navigation_data_->url_ != params.original_request_url) { | 1065 navigation_data_->url_ != params.original_request_url) { |
| 1069 return; | 1066 return; |
| 1070 } | 1067 } |
| 1071 | 1068 |
| 1072 base::TimeDelta time_to_commit = | 1069 base::TimeDelta time_to_commit = |
| 1073 base::TimeTicks::Now() - navigation_data_->start_time_; | 1070 base::TimeTicks::Now() - navigation_data_->start_time_; |
| 1074 UMA_HISTOGRAM_TIMES("Navigation.TimeToCommit", time_to_commit); | 1071 UMA_HISTOGRAM_TIMES("Navigation.TimeToCommit", time_to_commit); |
| 1075 | 1072 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1190 if (pending_entry != controller_->GetVisibleEntry() || | 1187 if (pending_entry != controller_->GetVisibleEntry() || |
| 1191 !should_preserve_entry) { | 1188 !should_preserve_entry) { |
| 1192 controller_->DiscardPendingEntry(true); | 1189 controller_->DiscardPendingEntry(true); |
| 1193 | 1190 |
| 1194 // Also force the UI to refresh. | 1191 // Also force the UI to refresh. |
| 1195 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); | 1192 controller_->delegate()->NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); |
| 1196 } | 1193 } |
| 1197 } | 1194 } |
| 1198 | 1195 |
| 1199 } // namespace content | 1196 } // namespace content |
| OLD | NEW |