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

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

Issue 2888673002: Add support for counting same-document AMP loads. (Closed)
Patch Set: address comment 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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 // Observers that return STOP_OBSERVING will not receive any additional 297 // Observers that return STOP_OBSERVING will not receive any additional
298 // callbacks, and will be deleted after invocation of this method returns. 298 // callbacks, and will be deleted after invocation of this method returns.
299 virtual ObservePolicy OnCommit(content::NavigationHandle* navigation_handle); 299 virtual ObservePolicy OnCommit(content::NavigationHandle* navigation_handle);
300 300
301 // OnDidFinishSubFrameNavigation is triggered when a sub-frame of the 301 // OnDidFinishSubFrameNavigation is triggered when a sub-frame of the
302 // committed page has finished navigating. It has either committed, aborted, 302 // committed page has finished navigating. It has either committed, aborted,
303 // was a same document navigation, or has been replaced. It is up to the 303 // was a same document navigation, or has been replaced. It is up to the
304 // observer to query |navigation_handle| to determine which happened. Note 304 // observer to query |navigation_handle| to determine which happened. Note
305 // that |navigation_handle| will be destroyed soon after this call. Don't 305 // that |navigation_handle| will be destroyed soon after this call. Don't
306 // hold a reference to it. 306 // hold a reference to it.
307 virtual ObservePolicy OnDidFinishSubFrameNavigation( 307 virtual void OnDidFinishSubFrameNavigation(
308 content::NavigationHandle* navigation_handle); 308 content::NavigationHandle* navigation_handle) {}
309
310 // OnCommitSameDocumentNavigation is triggered when a same-document navigation
311 // commits within the main frame of the current page. Note that
312 // |navigation_handle| will be destroyed soon after this call. Don't hold a
313 // reference to it.
314 virtual void OnCommitSameDocumentNavigation(
315 content::NavigationHandle* navigation_handle) {}
309 316
310 // OnHidden is triggered when a page leaves the foreground. It does not fire 317 // OnHidden is triggered when a page leaves the foreground. It does not fire
311 // when a foreground page is permanently closed; for that, listen to 318 // when a foreground page is permanently closed; for that, listen to
312 // OnComplete instead. 319 // OnComplete instead.
313 virtual ObservePolicy OnHidden(const PageLoadTiming& timing, 320 virtual ObservePolicy OnHidden(const PageLoadTiming& timing,
314 const PageLoadExtraInfo& extra_info); 321 const PageLoadExtraInfo& extra_info);
315 322
316 // OnShown is triggered when a page is brought to the foreground. It does not 323 // OnShown is triggered when a page is brought to the foreground. It does not
317 // fire when the page first loads; for that, listen for OnStart instead. 324 // fire when the page first loads; for that, listen for OnStart instead.
318 virtual ObservePolicy OnShown(); 325 virtual ObservePolicy OnShown();
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 // Called whenever a request is loaded for this page load. This comes 444 // Called whenever a request is loaded for this page load. This comes
438 // unfiltered from the ResourceDispatcherHost and may include blob requests 445 // unfiltered from the ResourceDispatcherHost and may include blob requests
439 // and data uris. 446 // and data uris.
440 virtual void OnLoadedResource( 447 virtual void OnLoadedResource(
441 const ExtraRequestCompleteInfo& extra_request_complete_info) {} 448 const ExtraRequestCompleteInfo& extra_request_complete_info) {}
442 }; 449 };
443 450
444 } // namespace page_load_metrics 451 } // namespace page_load_metrics
445 452
446 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ 453 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698