diff options
author | jkarlin@chromium.org <jkarlin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-14 14:59:01 +0000 |
---|---|---|
committer | jkarlin@chromium.org <jkarlin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-14 14:59:01 +0000 |
commit | 3adcb41365be2ef2742678486cc3e7170b3f9e6b (patch) | |
tree | 0ddbe1836b5aed29b9bbf2027885d8b3499254ec /chrome/browser/prerender/prerender_manager.h | |
parent | 7d5289ea56fd78ba53cde604f3e12784f7952626 (diff) | |
download | chromium_src-3adcb41365be2ef2742678486cc3e7170b3f9e6b.zip chromium_src-3adcb41365be2ef2742678486cc3e7170b3f9e6b.tar.gz chromium_src-3adcb41365be2ef2742678486cc3e7170b3f9e6b.tar.bz2 |
Reports UMA data for bytes fetched over the network for used and
unused prerenders. It also reports on the total number of bytes
fetched for that profile since the last prerender report.
This gives us insight into the balance of used vs wasted prerenders.
Understanding the ratio of wasted prerender bytes to total bytes gives
us a better understanding of whether we need an option to disable
prerender on mobile networks.
BUG=334602
Review URL: https://codereview.chromium.org/160513002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251316 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/prerender/prerender_manager.h')
-rw-r--r-- | chrome/browser/prerender/prerender_manager.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/chrome/browser/prerender/prerender_manager.h b/chrome/browser/prerender/prerender_manager.h index 8fe6a49..f0afe08 100644 --- a/chrome/browser/prerender/prerender_manager.h +++ b/chrome/browser/prerender/prerender_manager.h @@ -346,6 +346,14 @@ class PrerenderManager : public base::SupportsWeakPtr<PrerenderManager>, // to reliably test various swap abort cases. static void HangSessionStorageMergesForTesting(); + // Notification that a prerender has completed and its bytes should be + // recorded. + void RecordNetworkBytes(bool used, int64 prerender_bytes); + + // Add to the running tally of bytes transferred over the network for this + // profile if prerendering is currently enabled. + void AddProfileNetworkBytesIfEnabled(int64 bytes); + protected: class PendingSwap; class PrerenderData : public base::SupportsWeakPtr<PrerenderData> { @@ -694,6 +702,13 @@ class PrerenderManager : public base::SupportsWeakPtr<PrerenderManager>, CancelableRequestConsumer query_url_consumer_; + // The number of bytes transferred over the network for the profile this + // PrerenderManager is attached to. + int64 profile_network_bytes_; + + // The value of profile_network_bytes_ that was last recorded. + int64 last_recorded_profile_network_bytes_; + DISALLOW_COPY_AND_ASSIGN(PrerenderManager); }; |