| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 // reference to it. | 118 // reference to it. |
| 119 // Note that this does not get called for same page navigations. | 119 // Note that this does not get called for same page navigations. |
| 120 virtual void OnCommit(content::NavigationHandle* navigation_handle) {} | 120 virtual void OnCommit(content::NavigationHandle* navigation_handle) {} |
| 121 | 121 |
| 122 // OnFailedProvisionalLoad is triggered when a provisional load failed and did | 122 // OnFailedProvisionalLoad is triggered when a provisional load failed and did |
| 123 // not commit. Note that provisional loads that result in downloads or 204s | 123 // not commit. Note that provisional loads that result in downloads or 204s |
| 124 // are aborted by the system, and thus considered failed provisional loads. | 124 // are aborted by the system, and thus considered failed provisional loads. |
| 125 virtual void OnFailedProvisionalLoad( | 125 virtual void OnFailedProvisionalLoad( |
| 126 content::NavigationHandle* navigation_handle) {} | 126 content::NavigationHandle* navigation_handle) {} |
| 127 | 127 |
| 128 // OnTimingUpdate is triggered when an updated PageLoadTiming is |
| 129 // available. This method may be called multiple times over the course of the |
| 130 // page load. Note that this is currently an experimental API which may be |
| 131 // removed in the future. Please email loading-dev@chromium.org if you intend |
| 132 // to override this method. |
| 133 virtual void OnTimingUpdate(const PageLoadTiming& timing, |
| 134 const PageLoadExtraInfo& extra_info) {} |
| 135 |
| 128 // OnComplete is triggered when we are ready to record metrics for this page | 136 // OnComplete is triggered when we are ready to record metrics for this page |
| 129 // load. This will happen some time after commit. The PageLoadTiming struct | 137 // load. This will happen some time after commit. The PageLoadTiming struct |
| 130 // contains timing data and the PageLoadExtraInfo struct contains other useful | 138 // contains timing data and the PageLoadExtraInfo struct contains other useful |
| 131 // data collected over the course of the page load. If the load did not | 139 // data collected over the course of the page load. If the load did not |
| 132 // receive any timing information, |timing.IsEmpty()| will be true. | 140 // receive any timing information, |timing.IsEmpty()| will be true. |
| 133 // After this call, the object will be deleted. | 141 // After this call, the object will be deleted. |
| 134 virtual void OnComplete(const PageLoadTiming& timing, | 142 virtual void OnComplete(const PageLoadTiming& timing, |
| 135 const PageLoadExtraInfo& extra_info) {} | 143 const PageLoadExtraInfo& extra_info) {} |
| 136 }; | 144 }; |
| 137 | 145 |
| 138 } // namespace page_load_metrics | 146 } // namespace page_load_metrics |
| 139 | 147 |
| 140 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_OBSERVER_H_ | 148 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_OBSERVER_H_ |
| OLD | NEW |