| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_OBSERVER_H_ | 5 #ifndef COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_OBSERVER_H_ |
| 6 #define COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_OBSERVER_H_ | 6 #define COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_OBSERVER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "components/page_load_metrics/common/page_load_timing.h" | 9 #include "components/page_load_metrics/common/page_load_timing.h" |
| 10 #include "content/public/browser/navigation_handle.h" | 10 #include "content/public/browser/navigation_handle.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 struct PageLoadExtraInfo { | 49 struct PageLoadExtraInfo { |
| 50 PageLoadExtraInfo(const base::TimeDelta& first_background_time, | 50 PageLoadExtraInfo(const base::TimeDelta& first_background_time, |
| 51 const base::TimeDelta& first_foreground_time, | 51 const base::TimeDelta& first_foreground_time, |
| 52 bool started_in_foreground, | 52 bool started_in_foreground, |
| 53 const GURL& committed_url, | 53 const GURL& committed_url, |
| 54 const base::TimeDelta& time_to_commit, | 54 const base::TimeDelta& time_to_commit, |
| 55 UserAbortType abort_type, | 55 UserAbortType abort_type, |
| 56 const base::TimeDelta& time_to_abort); | 56 const base::TimeDelta& time_to_abort); |
| 57 | 57 |
| 58 // Returns the time to first background if the page load started in the | 58 // The first time that the page was backgrounded since the navigation started. |
| 59 // foreground. If the page has not been backgrounded, or the page started in | 59 // If the page has not been backgrounded this will be base::TimeDelta(). |
| 60 // the background, this will be base::TimeDelta(). | |
| 61 const base::TimeDelta first_background_time; | 60 const base::TimeDelta first_background_time; |
| 62 | 61 |
| 63 // Returns the time to first foreground if the page load started in the | 62 // The first time that the page was foregrounded since the navigation started. |
| 64 // background. If the page has not been foregrounded, or the page started in | 63 // If the page has not been foregrounded this will be base::TimeDelta(). |
| 65 // the foreground, this will be base::TimeDelta(). | |
| 66 const base::TimeDelta first_foreground_time; | 64 const base::TimeDelta first_foreground_time; |
| 67 | 65 |
| 68 // True if the page load started in the foreground. | 66 // True if the page load started in the foreground. |
| 69 const bool started_in_foreground; | 67 const bool started_in_foreground; |
| 70 | 68 |
| 71 // Committed URL. If the page load did not commit, |committed_url| will be | 69 // Committed URL. If the page load did not commit, |committed_url| will be |
| 72 // empty. | 70 // empty. |
| 73 const GURL committed_url; | 71 const GURL committed_url; |
| 74 | 72 |
| 75 // Time from navigation start until commit. If the page load did not commit, | 73 // Time from navigation start until commit. If the page load did not commit, |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 // data collected over the course of the page load. If the load did not | 116 // data collected over the course of the page load. If the load did not |
| 119 // receive any timing information, |timing.IsEmpty()| will be true. | 117 // receive any timing information, |timing.IsEmpty()| will be true. |
| 120 // After this call, the object will be deleted. | 118 // After this call, the object will be deleted. |
| 121 virtual void OnComplete(const PageLoadTiming& timing, | 119 virtual void OnComplete(const PageLoadTiming& timing, |
| 122 const PageLoadExtraInfo& extra_info) {} | 120 const PageLoadExtraInfo& extra_info) {} |
| 123 }; | 121 }; |
| 124 | 122 |
| 125 } // namespace page_load_metrics | 123 } // namespace page_load_metrics |
| 126 | 124 |
| 127 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_OBSERVER_H_ | 125 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_OBSERVER_H_ |
| OLD | NEW |