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

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

Issue 1433893002: Add StaleWhileRevalidateExperiment histograms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@s-w-r-dafsa
Patch Set: Fix compile error. 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
« no previous file with comments | « no previous file | chrome/browser/page_load_metrics/observers/stale_while_revalidate_metrics_observer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_FROM_GWS_PAGE_LOAD_METRICS_OB SERVER_H_ 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_STALE_WHILE_REVALIDATE_METRIC S_OBSERVER_H_
6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_FROM_GWS_PAGE_LOAD_METRICS_OB SERVER_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 class FromGWSPageLoadMetricsObserver 11 namespace chrome {
12
13 class StaleWhileRevalidateMetricsObserver
12 : public page_load_metrics::PageLoadMetricsObserver { 14 : public page_load_metrics::PageLoadMetricsObserver {
13 public: 15 public:
14 explicit FromGWSPageLoadMetricsObserver( 16 explicit StaleWhileRevalidateMetricsObserver(
15 page_load_metrics::PageLoadMetricsObservable* metrics); 17 page_load_metrics::PageLoadMetricsObservable* metrics);
16 // page_load_metrics::PageLoadMetricsObserver implementation: 18 // page_load_metrics::PageLoadMetricsObserver implementation:
17 void OnCommit(content::NavigationHandle* navigation_handle) override; 19 void OnCommit(content::NavigationHandle* navigation_handle) override;
18 void OnComplete( 20 void OnComplete(
19 const page_load_metrics::PageLoadTiming& timing, 21 const page_load_metrics::PageLoadTiming& timing,
20 const page_load_metrics::PageLoadExtraInfo& extra_info) override; 22 const page_load_metrics::PageLoadExtraInfo& extra_info) override;
21 void OnPageLoadMetricsGoingAway() override; 23 void OnPageLoadMetricsGoingAway() override;
22 24
23 protected:
24 // Called in tests.
25 void SetCommittedURLAndReferrer(const GURL& url,
26 const content::Referrer& referrer);
27
28 private: 25 private:
29 bool navigation_from_gws_; 26 // True if the committed URL is one of the domains of interest to the
27 // stale-while-revalidate experiment.
28 bool is_interesting_domain_;
30 page_load_metrics::PageLoadMetricsObservable* const metrics_; 29 page_load_metrics::PageLoadMetricsObservable* const metrics_;
31 30
32 DISALLOW_COPY_AND_ASSIGN(FromGWSPageLoadMetricsObserver); 31 DISALLOW_COPY_AND_ASSIGN(StaleWhileRevalidateMetricsObserver);
33 }; 32 };
34 33
35 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_FROM_GWS_PAGE_LOAD_METRICS _OBSERVER_H_ 34 } // namespace chrome
35
36 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_STALE_WHILE_REVALIDATE_MET RICS_OBSERVER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/page_load_metrics/observers/stale_while_revalidate_metrics_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698