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

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

Issue 2780003003: Send an event to the page load metrics to track resource starting. (Closed)
Patch Set: FREEZE.unindexed - took merge and fixed it up Created 3 years, 8 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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_TAB_RESTORE_PAGE_LOAD_METRICS _OBSERVER_H_ 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_TAB_RESTORE_PAGE_LOAD_METRICS _OBSERVER_H_
6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_TAB_RESTORE_PAGE_LOAD_METRICS _OBSERVER_H_ 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_TAB_RESTORE_PAGE_LOAD_METRICS _OBSERVER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 16 matching lines...) Expand all
27 TabRestorePageLoadMetricsObserver(); 27 TabRestorePageLoadMetricsObserver();
28 ~TabRestorePageLoadMetricsObserver() override; 28 ~TabRestorePageLoadMetricsObserver() override;
29 29
30 // page_load_metrics::PageLoadMetricsObserver: 30 // page_load_metrics::PageLoadMetricsObserver:
31 void OnComplete(const page_load_metrics::PageLoadTiming& timing, 31 void OnComplete(const page_load_metrics::PageLoadTiming& timing,
32 const page_load_metrics::PageLoadExtraInfo& info) override; 32 const page_load_metrics::PageLoadExtraInfo& info) override;
33 page_load_metrics::PageLoadMetricsObserver::ObservePolicy OnStart( 33 page_load_metrics::PageLoadMetricsObserver::ObservePolicy OnStart(
34 content::NavigationHandle* navigation_handle, 34 content::NavigationHandle* navigation_handle,
35 const GURL& currently_committed_url, 35 const GURL& currently_committed_url,
36 bool started_in_foreground) override; 36 bool started_in_foreground) override;
37 void OnLoadedResource( 37 void OnLoadedResource(const page_load_metrics::ExtraRequestCompleteInfo&
38 const page_load_metrics::ExtraRequestInfo& extra_request_info) override; 38 extra_request_complete_info) override;
39 page_load_metrics::PageLoadMetricsObserver::ObservePolicy 39 page_load_metrics::PageLoadMetricsObserver::ObservePolicy
40 FlushMetricsOnAppEnterBackground( 40 FlushMetricsOnAppEnterBackground(
41 const page_load_metrics::PageLoadTiming& timing, 41 const page_load_metrics::PageLoadTiming& timing,
42 const page_load_metrics::PageLoadExtraInfo& info) override; 42 const page_load_metrics::PageLoadExtraInfo& info) override;
43 43
44 protected: 44 protected:
45 // Whether the navigation handle is a tab restore. 45 // Whether the navigation handle is a tab restore.
46 // Overridden in testing. 46 // Overridden in testing.
47 virtual bool IsTabRestore(content::NavigationHandle* navigation_handle); 47 virtual bool IsTabRestore(content::NavigationHandle* navigation_handle);
48 48
49 private: 49 private:
50 // Records histograms for byte information. 50 // Records histograms for byte information.
51 void RecordByteHistograms(); 51 void RecordByteHistograms();
52 52
53 // The number of body (not header) prefilter bytes consumed by requests for 53 // The number of body (not header) prefilter bytes consumed by requests for
54 // the page. 54 // the page.
55 int64_t cache_bytes_; 55 int64_t cache_bytes_;
56 int64_t network_bytes_; 56 int64_t network_bytes_;
57 57
58 DISALLOW_COPY_AND_ASSIGN(TabRestorePageLoadMetricsObserver); 58 DISALLOW_COPY_AND_ASSIGN(TabRestorePageLoadMetricsObserver);
59 }; 59 };
60 60
61 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_TAB_RESTORE_PAGE_LOAD_METR ICS_OBSERVER_H_ 61 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_TAB_RESTORE_PAGE_LOAD_METR ICS_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698