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

Side by Side Diff: chrome/browser/prerender/prerender_histograms.h

Issue 160513002: Reports Prerender and Profile Total Bytes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_PRERENDER_PRERENDER_HISTOGRAMS_H_ 5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_HISTOGRAMS_H_
6 #define CHROME_BROWSER_PRERENDER_PRERENDER_HISTOGRAMS_H_ 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_HISTOGRAMS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // Record a prerender cookie status bitmap. Must be in the range 102 // Record a prerender cookie status bitmap. Must be in the range
103 // [0, PrerenderContents::kNumCookieStatuses). 103 // [0, PrerenderContents::kNumCookieStatuses).
104 void RecordCookieStatus(Origin origin, 104 void RecordCookieStatus(Origin origin,
105 uint8 experiment_id, 105 uint8 experiment_id,
106 int cookie_status) const; 106 int cookie_status) const;
107 107
108 void RecordPrerenderPageVisitedStatus(Origin origin, 108 void RecordPrerenderPageVisitedStatus(Origin origin,
109 uint8 experiment_id, 109 uint8 experiment_id,
110 bool visited_before) const; 110 bool visited_before) const;
111 111
112 // Record the bytes in the prerender, whether it was used or not, and the
113 // total number of bytes fetched for this profile since the last call to
114 // RecordBytes.
115 void RecordBytes(bool used, int64 prerender_bytes, int64 profile_bytes);
tburkard 2014/02/12 19:54:56 nit: Perhaps a more descriptive name, like RecordN
jkarlin 2014/02/13 13:24:49 Done.
116
112 private: 117 private:
113 base::TimeTicks GetCurrentTimeTicks() const; 118 base::TimeTicks GetCurrentTimeTicks() const;
114 119
115 // Returns the time elapsed since the last prerender happened. 120 // Returns the time elapsed since the last prerender happened.
116 base::TimeDelta GetTimeSinceLastPrerender() const; 121 base::TimeDelta GetTimeSinceLastPrerender() const;
117 122
118 // Returns whether the PrerenderManager is currently within the prerender 123 // Returns whether the PrerenderManager is currently within the prerender
119 // window - effectively, up to 30 seconds after a prerender tag has been 124 // window - effectively, up to 30 seconds after a prerender tag has been
120 // observed. 125 // observed.
121 bool WithinWindow() const; 126 bool WithinWindow() const;
(...skipping 20 matching lines...) Expand all
142 // This is used to record perceived PLT's for a certain amount of time 147 // This is used to record perceived PLT's for a certain amount of time
143 // from the point that we last saw a <link rel=prerender> tag. 148 // from the point that we last saw a <link rel=prerender> tag.
144 base::TimeTicks last_prerender_seen_time_; 149 base::TimeTicks last_prerender_seen_time_;
145 150
146 // Indicates whether we have recorded page load events after the most 151 // Indicates whether we have recorded page load events after the most
147 // recent prerender. These must be initialized to true, so that we don't 152 // recent prerender. These must be initialized to true, so that we don't
148 // start recording events before the first prerender occurs. 153 // start recording events before the first prerender occurs.
149 bool seen_any_pageload_; 154 bool seen_any_pageload_;
150 bool seen_pageload_started_after_prerender_; 155 bool seen_pageload_started_after_prerender_;
151 156
157 // The number of network bytes transferred for this profile that was
158 // previously reported to UMA.
159 int64 last_profile_network_bytes_;
160
152 DISALLOW_COPY_AND_ASSIGN(PrerenderHistograms); 161 DISALLOW_COPY_AND_ASSIGN(PrerenderHistograms);
153 }; 162 };
154 163
155 } // namespace prerender 164 } // namespace prerender
156 165
157 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_HISTOGRAMS_H_ 166 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_HISTOGRAMS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698