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

Unified Diff: chrome/browser/prerender/prerender_manager.h

Issue 160513002: Reports Prerender and Profile Total Bytes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing prerender UMA byte tracking. Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/prerender/prerender_histograms.cc ('k') | chrome/browser/prerender/prerender_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prerender/prerender_manager.h
diff --git a/chrome/browser/prerender/prerender_manager.h b/chrome/browser/prerender/prerender_manager.h
index 2ce7a4fd6deebd3fd84d957febd58d934423ea57..b79c66cf132c5ca253776653fa49c4fa87d3277d 100644
--- a/chrome/browser/prerender/prerender_manager.h
+++ b/chrome/browser/prerender/prerender_manager.h
@@ -345,6 +345,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> {
@@ -693,6 +701,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);
};
« no previous file with comments | « chrome/browser/prerender/prerender_histograms.cc ('k') | chrome/browser/prerender/prerender_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698