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

Side by Side Diff: chrome/browser/page_load_metrics/observers/stale_while_revalidate_metrics_observer.h

Issue 1473153002: PageLoadMetricsObservers observe individual page loads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: destroy order Created 5 years 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_OBSERVERS_STALE_WHILE_REVALIDATE_METRIC S_OBSERVER_H_ 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_STALE_WHILE_REVALIDATE_METRIC S_OBSERVER_H_
6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_STALE_WHILE_REVALIDATE_METRIC S_OBSERVER_H_ 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_STALE_WHILE_REVALIDATE_METRIC S_OBSERVER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "components/page_load_metrics/browser/page_load_metrics_observer.h" 9 #include "components/page_load_metrics/browser/page_load_metrics_observer.h"
10 10
11 namespace chrome { 11 namespace chrome {
12 12
13 class StaleWhileRevalidateMetricsObserver 13 class StaleWhileRevalidateMetricsObserver
14 : public page_load_metrics::PageLoadMetricsObserver { 14 : public page_load_metrics::PageLoadMetricsObserver {
15 public: 15 public:
16 explicit StaleWhileRevalidateMetricsObserver( 16 StaleWhileRevalidateMetricsObserver();
17 page_load_metrics::PageLoadMetricsObservable* metrics);
18 // page_load_metrics::PageLoadMetricsObserver implementation: 17 // page_load_metrics::PageLoadMetricsObserver implementation:
19 void OnCommit(content::NavigationHandle* navigation_handle) override; 18 void OnCommit(content::NavigationHandle* navigation_handle) override;
20 void OnComplete( 19 void OnComplete(
21 const page_load_metrics::PageLoadTiming& timing, 20 const page_load_metrics::PageLoadTiming& timing,
22 const page_load_metrics::PageLoadExtraInfo& extra_info) override; 21 const page_load_metrics::PageLoadExtraInfo& extra_info) override;
23 void OnPageLoadMetricsGoingAway() override;
24 22
25 private: 23 private:
26 // True if the committed URL is one of the domains of interest to the 24 // True if the committed URL is one of the domains of interest to the
27 // stale-while-revalidate experiment. 25 // stale-while-revalidate experiment.
28 bool is_interesting_domain_; 26 bool is_interesting_domain_;
29 page_load_metrics::PageLoadMetricsObservable* const metrics_;
30 27
31 DISALLOW_COPY_AND_ASSIGN(StaleWhileRevalidateMetricsObserver); 28 DISALLOW_COPY_AND_ASSIGN(StaleWhileRevalidateMetricsObserver);
32 }; 29 };
33 30
34 } // namespace chrome 31 } // namespace chrome
35 32
36 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_STALE_WHILE_REVALIDATE_MET RICS_OBSERVER_H_ 33 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_STALE_WHILE_REVALIDATE_MET RICS_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698