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 <stddef.h> |
| 9 #include <stdint.h> |
| 10 |
8 #include <string> | 11 #include <string> |
9 | 12 |
| 13 #include "base/macros.h" |
10 #include "base/time/time.h" | 14 #include "base/time/time.h" |
11 #include "chrome/browser/prerender/prerender_contents.h" | 15 #include "chrome/browser/prerender/prerender_contents.h" |
12 #include "chrome/browser/prerender/prerender_final_status.h" | 16 #include "chrome/browser/prerender/prerender_final_status.h" |
13 #include "chrome/browser/prerender/prerender_origin.h" | 17 #include "chrome/browser/prerender/prerender_origin.h" |
14 #include "url/gurl.h" | 18 #include "url/gurl.h" |
15 | 19 |
16 namespace prerender { | 20 namespace prerender { |
17 | 21 |
18 // Navigation type for histograms. | 22 // Navigation type for histograms. |
19 enum NavigationType { | 23 enum NavigationType { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 99 |
96 // Record the time since a page was recently visited. | 100 // Record the time since a page was recently visited. |
97 void RecordTimeSinceLastRecentVisit(Origin origin, | 101 void RecordTimeSinceLastRecentVisit(Origin origin, |
98 base::TimeDelta time) const; | 102 base::TimeDelta time) const; |
99 | 103 |
100 // Record the bytes in the prerender, whether it was used or not, and the | 104 // Record the bytes in the prerender, whether it was used or not, and the |
101 // total number of bytes fetched for this profile since the last call to | 105 // total number of bytes fetched for this profile since the last call to |
102 // RecordBytes. | 106 // RecordBytes. |
103 void RecordNetworkBytes(Origin origin, | 107 void RecordNetworkBytes(Origin origin, |
104 bool used, | 108 bool used, |
105 int64 prerender_bytes, | 109 int64_t prerender_bytes, |
106 int64 profile_bytes); | 110 int64_t profile_bytes); |
107 | 111 |
108 private: | 112 private: |
109 base::TimeTicks GetCurrentTimeTicks() const; | 113 base::TimeTicks GetCurrentTimeTicks() const; |
110 | 114 |
111 // Returns the time elapsed since the last prerender happened. | 115 // Returns the time elapsed since the last prerender happened. |
112 base::TimeDelta GetTimeSinceLastPrerender() const; | 116 base::TimeDelta GetTimeSinceLastPrerender() const; |
113 | 117 |
114 // Returns whether the PrerenderManager is currently within the prerender | 118 // Returns whether the PrerenderManager is currently within the prerender |
115 // window - effectively, up to 30 seconds after a prerender tag has been | 119 // window - effectively, up to 30 seconds after a prerender tag has been |
116 // observed. | 120 // observed. |
(...skipping 19 matching lines...) Expand all Loading... |
136 // start recording events before the first prerender occurs. | 140 // start recording events before the first prerender occurs. |
137 bool seen_any_pageload_; | 141 bool seen_any_pageload_; |
138 bool seen_pageload_started_after_prerender_; | 142 bool seen_pageload_started_after_prerender_; |
139 | 143 |
140 DISALLOW_COPY_AND_ASSIGN(PrerenderHistograms); | 144 DISALLOW_COPY_AND_ASSIGN(PrerenderHistograms); |
141 }; | 145 }; |
142 | 146 |
143 } // namespace prerender | 147 } // namespace prerender |
144 | 148 |
145 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_HISTOGRAMS_H_ | 149 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_HISTOGRAMS_H_ |
OLD | NEW |