| 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> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 bool is_main_resource, | 114 bool is_main_resource, |
| 115 bool is_redirect, | 115 bool is_redirect, |
| 116 bool is_no_store) const; | 116 bool is_no_store) const; |
| 117 | 117 |
| 118 // Called when a NoStatePrefetch resource has been loaded. This is called only | 118 // Called when a NoStatePrefetch resource has been loaded. This is called only |
| 119 // once per resource, when all redirects have been resolved. | 119 // once per resource, when all redirects have been resolved. |
| 120 void RecordPrefetchRedirectCount(Origin origin, | 120 void RecordPrefetchRedirectCount(Origin origin, |
| 121 bool is_main_resource, | 121 bool is_main_resource, |
| 122 int redirect_count) const; | 122 int redirect_count) const; |
| 123 | 123 |
| 124 // Records the time to first contentful paint. |
| 125 // |is_no_store| must be true if the main resource has a "no-store" cache |
| 126 // control HTTP header. |
| 127 // |prefetch_age| must be zero if the page was not prefetched. |
| 128 void RecordFirstContentfulPaint(Origin origin, |
| 129 bool is_no_store, |
| 130 base::TimeDelta time, |
| 131 base::TimeDelta prefetch_age); |
| 132 |
| 124 private: | 133 private: |
| 125 base::TimeTicks GetCurrentTimeTicks() const; | 134 base::TimeTicks GetCurrentTimeTicks() const; |
| 126 | 135 |
| 127 // Returns the time elapsed since the last prerender happened. | 136 // Returns the time elapsed since the last prerender happened. |
| 128 base::TimeDelta GetTimeSinceLastPrerender() const; | 137 base::TimeDelta GetTimeSinceLastPrerender() const; |
| 129 | 138 |
| 130 // Returns whether the PrerenderManager is currently within the prerender | 139 // Returns whether the PrerenderManager is currently within the prerender |
| 131 // window - effectively, up to 30 seconds after a prerender tag has been | 140 // window - effectively, up to 30 seconds after a prerender tag has been |
| 132 // observed. | 141 // observed. |
| 133 bool WithinWindow() const; | 142 bool WithinWindow() const; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 154 bool seen_pageload_started_after_prerender_; | 163 bool seen_pageload_started_after_prerender_; |
| 155 | 164 |
| 156 base::ThreadChecker thread_checker_; | 165 base::ThreadChecker thread_checker_; |
| 157 | 166 |
| 158 DISALLOW_COPY_AND_ASSIGN(PrerenderHistograms); | 167 DISALLOW_COPY_AND_ASSIGN(PrerenderHistograms); |
| 159 }; | 168 }; |
| 160 | 169 |
| 161 } // namespace prerender | 170 } // namespace prerender |
| 162 | 171 |
| 163 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_HISTOGRAMS_H_ | 172 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_HISTOGRAMS_H_ |
| OLD | NEW |