OLD | NEW |
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 Loading... |
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 RecordNetworkBytes(bool used, |
| 116 int64 prerender_bytes, |
| 117 int64 profile_bytes); |
| 118 |
112 private: | 119 private: |
113 base::TimeTicks GetCurrentTimeTicks() const; | 120 base::TimeTicks GetCurrentTimeTicks() const; |
114 | 121 |
115 // Returns the time elapsed since the last prerender happened. | 122 // Returns the time elapsed since the last prerender happened. |
116 base::TimeDelta GetTimeSinceLastPrerender() const; | 123 base::TimeDelta GetTimeSinceLastPrerender() const; |
117 | 124 |
118 // Returns whether the PrerenderManager is currently within the prerender | 125 // Returns whether the PrerenderManager is currently within the prerender |
119 // window - effectively, up to 30 seconds after a prerender tag has been | 126 // window - effectively, up to 30 seconds after a prerender tag has been |
120 // observed. | 127 // observed. |
121 bool WithinWindow() const; | 128 bool WithinWindow() const; |
(...skipping 26 matching lines...) Expand all Loading... |
148 // start recording events before the first prerender occurs. | 155 // start recording events before the first prerender occurs. |
149 bool seen_any_pageload_; | 156 bool seen_any_pageload_; |
150 bool seen_pageload_started_after_prerender_; | 157 bool seen_pageload_started_after_prerender_; |
151 | 158 |
152 DISALLOW_COPY_AND_ASSIGN(PrerenderHistograms); | 159 DISALLOW_COPY_AND_ASSIGN(PrerenderHistograms); |
153 }; | 160 }; |
154 | 161 |
155 } // namespace prerender | 162 } // namespace prerender |
156 | 163 |
157 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_HISTOGRAMS_H_ | 164 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_HISTOGRAMS_H_ |
OLD | NEW |