| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 struct PageLoadExtraInfo { | 53 struct PageLoadExtraInfo { |
| 54 PageLoadExtraInfo(base::TimeDelta first_background_time, | 54 PageLoadExtraInfo(base::TimeDelta first_background_time, |
| 55 base::TimeDelta first_foreground_time, | 55 base::TimeDelta first_foreground_time, |
| 56 bool started_in_foreground, | 56 bool started_in_foreground, |
| 57 const GURL& committed_url, | 57 const GURL& committed_url, |
| 58 base::TimeDelta time_to_commit, | 58 base::TimeDelta time_to_commit, |
| 59 UserAbortType abort_type, | 59 UserAbortType abort_type, |
| 60 base::TimeDelta time_to_abort); | 60 base::TimeDelta time_to_abort); |
| 61 | 61 |
| 62 // Returns the time to first background if the page load started in the | 62 // The first time that the page was backgrounded since the navigation started. |
| 63 // foreground. If the page has not been backgrounded, or the page started in | 63 // If the page has not been backgrounded this will be base::TimeDelta(). |
| 64 // the background, this will be base::TimeDelta(). | |
| 65 const base::TimeDelta first_background_time; | 64 const base::TimeDelta first_background_time; |
| 66 | 65 |
| 67 // Returns the time to first foreground if the page load started in the | 66 // The first time that the page was foregrounded since the navigation started. |
| 68 // background. If the page has not been foregrounded, or the page started in | 67 // If the page has not been foregrounded this will be base::TimeDelta(). |
| 69 // the foreground, this will be base::TimeDelta(). | |
| 70 const base::TimeDelta first_foreground_time; | 68 const base::TimeDelta first_foreground_time; |
| 71 | 69 |
| 72 // True if the page load started in the foreground. | 70 // True if the page load started in the foreground. |
| 73 const bool started_in_foreground; | 71 const bool started_in_foreground; |
| 74 | 72 |
| 75 // Committed URL. If the page load did not commit, |committed_url| will be | 73 // Committed URL. If the page load did not commit, |committed_url| will be |
| 76 // empty. | 74 // empty. |
| 77 const GURL committed_url; | 75 const GURL committed_url; |
| 78 | 76 |
| 79 // Time from navigation start until commit. If the page load did not commit, | 77 // 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... |
| 122 // data collected over the course of the page load. If the load did not | 120 // data collected over the course of the page load. If the load did not |
| 123 // receive any timing information, |timing.IsEmpty()| will be true. | 121 // receive any timing information, |timing.IsEmpty()| will be true. |
| 124 // After this call, the object will be deleted. | 122 // After this call, the object will be deleted. |
| 125 virtual void OnComplete(const PageLoadTiming& timing, | 123 virtual void OnComplete(const PageLoadTiming& timing, |
| 126 const PageLoadExtraInfo& extra_info) {} | 124 const PageLoadExtraInfo& extra_info) {} |
| 127 }; | 125 }; |
| 128 | 126 |
| 129 } // namespace page_load_metrics | 127 } // namespace page_load_metrics |
| 130 | 128 |
| 131 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_OBSERVER_H_ | 129 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_OBSERVER_H_ |
| OLD | NEW |