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 CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ |
6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ | 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/optional.h" | 9 #include "base/optional.h" |
10 #include "chrome/common/page_load_metrics/page_load_timing.h" | 10 #include "chrome/common/page_load_metrics/page_load_timing.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 virtual ~PageLoadMetricsObserver() {} | 142 virtual ~PageLoadMetricsObserver() {} |
143 | 143 |
144 // The page load started, with the given navigation handle. Note that OnStart | 144 // The page load started, with the given navigation handle. Note that OnStart |
145 // is called for same-page navigations. Implementers of OnStart that only want | 145 // is called for same-page navigations. Implementers of OnStart that only want |
146 // to process non-same-page navigations should also check to see that the page | 146 // to process non-same-page navigations should also check to see that the page |
147 // load committed via OnCommit or committed_url in | 147 // load committed via OnCommit or committed_url in |
148 // PageLoadExtraInfo. currently_committed_url contains the URL of the | 148 // PageLoadExtraInfo. currently_committed_url contains the URL of the |
149 // committed page load at the time the navigation for navigation_handle was | 149 // committed page load at the time the navigation for navigation_handle was |
150 // initiated, or the empty URL if there was no committed page load at the time | 150 // initiated, or the empty URL if there was no committed page load at the time |
151 // the navigation was initiated. | 151 // the navigation was initiated. |
152 virtual void OnStart(content::NavigationHandle* navigation_handle, | 152 virtual ObservePolicy OnStart(content::NavigationHandle* navigation_handle, |
153 const GURL& currently_committed_url, | 153 const GURL& currently_committed_url, |
154 bool started_in_foreground) {} | 154 bool started_in_foreground); |
155 | 155 |
156 // OnRedirect is triggered when a page load redirects to another URL. | 156 // OnRedirect is triggered when a page load redirects to another URL. |
157 // The navigation handle holds relevant data for the navigation, but will | 157 // The navigation handle holds relevant data for the navigation, but will |
158 // be destroyed soon after this call. Don't hold a reference to it. This can | 158 // be destroyed soon after this call. Don't hold a reference to it. This can |
159 // be called multiple times. | 159 // be called multiple times. |
160 virtual void OnRedirect(content::NavigationHandle* navigation_handle) {} | 160 virtual void OnRedirect(content::NavigationHandle* navigation_handle) {} |
161 | 161 |
162 // OnCommit is triggered when a page load commits, i.e. when we receive the | 162 // OnCommit is triggered when a page load commits, i.e. when we receive the |
163 // first data for the request. The navigation handle holds relevant data for | 163 // first data for the request. The navigation handle holds relevant data for |
164 // the navigation, but will be destroyed soon after this call. Don't hold a | 164 // the navigation, but will be destroyed soon after this call. Don't hold a |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 // loads that result in downloads or 204s are aborted by the system, and are | 258 // loads that result in downloads or 204s are aborted by the system, and are |
259 // also included as failed provisional loads. | 259 // also included as failed provisional loads. |
260 virtual void OnFailedProvisionalLoad( | 260 virtual void OnFailedProvisionalLoad( |
261 const FailedProvisionalLoadInfo& failed_provisional_load_info, | 261 const FailedProvisionalLoadInfo& failed_provisional_load_info, |
262 const PageLoadExtraInfo& extra_info) {} | 262 const PageLoadExtraInfo& extra_info) {} |
263 }; | 263 }; |
264 | 264 |
265 } // namespace page_load_metrics | 265 } // namespace page_load_metrics |
266 | 266 |
267 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ | 267 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ |
OLD | NEW |