| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/browser/page_load_metrics/page_load_tracker.h" | 5 #include "chrome/browser/page_load_metrics/page_load_tracker.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <ostream> | 8 #include <ostream> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 } | 194 } |
| 195 | 195 |
| 196 PageLoadTracker::~PageLoadTracker() { | 196 PageLoadTracker::~PageLoadTracker() { |
| 197 if (app_entered_background_) { | 197 if (app_entered_background_) { |
| 198 RecordAppBackgroundPageLoadCompleted(true); | 198 RecordAppBackgroundPageLoadCompleted(true); |
| 199 } | 199 } |
| 200 | 200 |
| 201 if (did_stop_tracking_) | 201 if (did_stop_tracking_) |
| 202 return; | 202 return; |
| 203 | 203 |
| 204 metrics_update_dispatcher_.ShutDown(); |
| 205 |
| 204 if (page_end_time_.is_null()) { | 206 if (page_end_time_.is_null()) { |
| 205 // page_end_time_ can be unset in some cases, such as when a navigation is | 207 // page_end_time_ can be unset in some cases, such as when a navigation is |
| 206 // aborted by a navigation that started before it. In these cases, set the | 208 // aborted by a navigation that started before it. In these cases, set the |
| 207 // end time to the current time. | 209 // end time to the current time. |
| 208 RecordInternalError(ERR_NO_PAGE_LOAD_END_TIME); | 210 RecordInternalError(ERR_NO_PAGE_LOAD_END_TIME); |
| 209 NotifyPageEnd(END_OTHER, UserInitiatedInfo::NotUserInitiated(), | 211 NotifyPageEnd(END_OTHER, UserInitiatedInfo::NotUserInitiated(), |
| 210 base::TimeTicks::Now(), true); | 212 base::TimeTicks::Now(), true); |
| 211 } | 213 } |
| 212 | 214 |
| 213 if (!did_commit_) { | 215 if (!did_commit_) { |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 } | 640 } |
| 639 | 641 |
| 640 void PageLoadTracker::OnSubframeMetadataChanged() { | 642 void PageLoadTracker::OnSubframeMetadataChanged() { |
| 641 PageLoadExtraInfo extra_info(ComputePageLoadExtraInfo()); | 643 PageLoadExtraInfo extra_info(ComputePageLoadExtraInfo()); |
| 642 for (const auto& observer : observers_) { | 644 for (const auto& observer : observers_) { |
| 643 observer->OnLoadingBehaviorObserved(extra_info); | 645 observer->OnLoadingBehaviorObserved(extra_info); |
| 644 } | 646 } |
| 645 } | 647 } |
| 646 | 648 |
| 647 } // namespace page_load_metrics | 649 } // namespace page_load_metrics |
| OLD | NEW |