Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(472)

Side by Side Diff: chrome/browser/page_load_metrics/page_load_metrics_observer.h

Issue 2903693004: Make PageLoadMetricsWaiter more resilient (Closed)
Patch Set: rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 or subframe level. This method may be called multiple times over
Charlie Harrison 2017/05/25 19:35:34 Aside: It's weird to me to distinguish "page" vs "
Bryan McQuade 2017/05/25 19:54:06 Correct - page is essentially main frame + aggrega
341 // page load. This method is currently only intended for use in testing. Most 341 // the course of the page load. This method is currently only intended for use
342 // implementers should implement one of the On* callbacks, such as 342 // in testing. Most implementers should implement one of the On* callbacks,
343 // OnFirstContentfulPaint or OnDomContentLoadedEventStart. Please email 343 // such as OnFirstContentfulPaint or OnDomContentLoadedEventStart. Please
344 // loading-dev@chromium.org if you intend to override this method. 344 // email loading-dev@chromium.org if you intend to override this method.
345 virtual void OnTimingUpdate(const mojom::PageLoadTiming& timing, 345 virtual void OnTimingUpdate(bool is_subframe,
Charlie Harrison 2017/05/25 19:35:34 optional: For consistency would it make sense to h
Bryan McQuade 2017/05/25 19:54:06 I did this initially but decided that since this w
Charlie Harrison 2017/05/25 19:59:44 Makes sense to me
346 const mojom::PageLoadTiming& timing,
346 const PageLoadExtraInfo& extra_info) {} 347 const PageLoadExtraInfo& extra_info) {}
347 348
348 // OnUserInput is triggered when a new user input is passed in to 349 // OnUserInput is triggered when a new user input is passed in to
349 // web_contents. Contains a TimeDelta from navigation start. 350 // web_contents. Contains a TimeDelta from navigation start.
350 virtual void OnUserInput(const blink::WebInputEvent& event) {} 351 virtual void OnUserInput(const blink::WebInputEvent& event) {}
351 352
352 // The following methods are invoked at most once, when the timing for the 353 // The following methods are invoked at most once, when the timing for the
353 // associated event first becomes available. 354 // associated event first becomes available.
354 virtual void OnDomContentLoadedEventStart( 355 virtual void OnDomContentLoadedEventStart(
355 const mojom::PageLoadTiming& timing, 356 const mojom::PageLoadTiming& timing,
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 // Called whenever a request is loaded for this page load. This comes 445 // Called whenever a request is loaded for this page load. This comes
445 // unfiltered from the ResourceDispatcherHost and may include blob requests 446 // unfiltered from the ResourceDispatcherHost and may include blob requests
446 // and data uris. 447 // and data uris.
447 virtual void OnLoadedResource( 448 virtual void OnLoadedResource(
448 const ExtraRequestCompleteInfo& extra_request_complete_info) {} 449 const ExtraRequestCompleteInfo& extra_request_complete_info) {}
449 }; 450 };
450 451
451 } // namespace page_load_metrics 452 } // namespace page_load_metrics
452 453
453 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ 454 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698