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 <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 // default is to observe HTML and XHTML only. Note that PageLoadTrackers only | 329 // default is to observe HTML and XHTML only. Note that PageLoadTrackers only |
330 // track XHTML, HTML, and MHTML (related/multipart). | 330 // track XHTML, HTML, and MHTML (related/multipart). |
331 virtual ObservePolicy ShouldObserveMimeType( | 331 virtual ObservePolicy ShouldObserveMimeType( |
332 const std::string& mime_type) const; | 332 const std::string& mime_type) const; |
333 | 333 |
334 // The callbacks below are only invoked after a navigation commits, for | 334 // The callbacks below are only invoked after a navigation commits, for |
335 // tracked page loads. Page loads that don't meet the criteria for being | 335 // tracked page loads. Page loads that don't meet the criteria for being |
336 // tracked at the time a navigation commits will not receive any of the | 336 // tracked at the time a navigation commits will not receive any of the |
337 // callbacks below. | 337 // callbacks below. |
338 | 338 |
339 // OnTimingUpdate is triggered when an updated PageLoadTiming is | 339 // OnTimingUpdate is triggered when an updated PageLoadTiming is available at |
340 // available. This method may be called multiple times over the course of the | 340 // the page (page is essentially main frame, with merged values across all |
341 // page load. This method is currently only intended for use in testing. Most | 341 // frames for some paint timing values) or subframe level. This method may be |
342 // implementers should implement one of the On* callbacks, such as | 342 // called multiple times over the course of the page load. This method is |
343 // OnFirstContentfulPaint or OnDomContentLoadedEventStart. Please email | 343 // currently only intended for use in testing. Most implementers should |
344 // loading-dev@chromium.org if you intend to override this method. | 344 // implement one of the On* callbacks, such as OnFirstContentfulPaint or |
345 virtual void OnTimingUpdate(const mojom::PageLoadTiming& timing, | 345 // OnDomContentLoadedEventStart. Please email loading-dev@chromium.org if you |
| 346 // intend to override this method. |
| 347 virtual void OnTimingUpdate(bool is_subframe, |
| 348 const mojom::PageLoadTiming& timing, |
346 const PageLoadExtraInfo& extra_info) {} | 349 const PageLoadExtraInfo& extra_info) {} |
347 | 350 |
348 // OnUserInput is triggered when a new user input is passed in to | 351 // OnUserInput is triggered when a new user input is passed in to |
349 // web_contents. Contains a TimeDelta from navigation start. | 352 // web_contents. Contains a TimeDelta from navigation start. |
350 virtual void OnUserInput(const blink::WebInputEvent& event) {} | 353 virtual void OnUserInput(const blink::WebInputEvent& event) {} |
351 | 354 |
352 // The following methods are invoked at most once, when the timing for the | 355 // The following methods are invoked at most once, when the timing for the |
353 // associated event first becomes available. | 356 // associated event first becomes available. |
354 virtual void OnDomContentLoadedEventStart( | 357 virtual void OnDomContentLoadedEventStart( |
355 const mojom::PageLoadTiming& timing, | 358 const mojom::PageLoadTiming& timing, |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 // Called whenever a request is loaded for this page load. This comes | 447 // Called whenever a request is loaded for this page load. This comes |
445 // unfiltered from the ResourceDispatcherHost and may include blob requests | 448 // unfiltered from the ResourceDispatcherHost and may include blob requests |
446 // and data uris. | 449 // and data uris. |
447 virtual void OnLoadedResource( | 450 virtual void OnLoadedResource( |
448 const ExtraRequestCompleteInfo& extra_request_complete_info) {} | 451 const ExtraRequestCompleteInfo& extra_request_complete_info) {} |
449 }; | 452 }; |
450 | 453 |
451 } // namespace page_load_metrics | 454 } // namespace page_load_metrics |
452 | 455 |
453 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ | 456 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ |
OLD | NEW |