Index: chrome/browser/page_load_metrics/page_load_metrics_observer.h |
diff --git a/chrome/browser/page_load_metrics/page_load_metrics_observer.h b/chrome/browser/page_load_metrics/page_load_metrics_observer.h |
index 9262a358aa96cea00330c86a143f83aa89708c66..9620c2b236c6340192ba1c4173e7f25a2b0eb76e 100644 |
--- a/chrome/browser/page_load_metrics/page_load_metrics_observer.h |
+++ b/chrome/browser/page_load_metrics/page_load_metrics_observer.h |
@@ -124,12 +124,22 @@ struct PageLoadExtraInfo { |
const PageLoadMetadata metadata; |
}; |
+enum TrackingPolicy { |
+ TRACK, |
+ IGNORE, |
+}; |
+ |
// Interface for PageLoadMetrics observers. All instances of this class are |
// owned by the PageLoadTracker tracking a page load. |
class PageLoadMetricsObserver { |
public: |
virtual ~PageLoadMetricsObserver() {} |
+ // Called before OnStart and OnCommit. If the method returns false, no further |
+ // callbacks will occur in the observer. |
+ virtual TrackingPolicy ShouldTrackLoad( |
+ content::NavigationHandle* navigation_handle); |
+ |
// The page load started, with the given navigation handle. Note that OnStart |
// is called for same-page navigations. Implementers of OnStart that only want |
// to process non-same-page navigations should also check to see that the page |