| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 // Record the time since a page was recently visited. | 83 // Record the time since a page was recently visited. |
| 84 void RecordTimeSinceLastRecentVisit(Origin origin, | 84 void RecordTimeSinceLastRecentVisit(Origin origin, |
| 85 base::TimeDelta time) const; | 85 base::TimeDelta time) const; |
| 86 | 86 |
| 87 // Record a percentage of pixels of the final page already in place at | 87 // Record a percentage of pixels of the final page already in place at |
| 88 // swap-in. | 88 // swap-in. |
| 89 void RecordFractionPixelsFinalAtSwapin(Origin origin, double fraction) const; | 89 void RecordFractionPixelsFinalAtSwapin(Origin origin, double fraction) const; |
| 90 | 90 |
| 91 // Records a prerender event. | 91 // Records a prerender event. |
| 92 void RecordEvent(PrerenderEvent event) const; | 92 void RecordEvent(Origin origin, uint8 experiment_id, PrerenderEvent event) |
| 93 const; |
| 93 | 94 |
| 94 private: | 95 private: |
| 95 base::TimeTicks GetCurrentTimeTicks() const; | 96 base::TimeTicks GetCurrentTimeTicks() const; |
| 96 | 97 |
| 97 // Returns the time elapsed since the last prerender happened. | 98 // Returns the time elapsed since the last prerender happened. |
| 98 base::TimeDelta GetTimeSinceLastPrerender() const; | 99 base::TimeDelta GetTimeSinceLastPrerender() const; |
| 99 | 100 |
| 100 // Returns whether the PrerenderManager is currently within the prerender | 101 // Returns whether the PrerenderManager is currently within the prerender |
| 101 // window - effectively, up to 30 seconds after a prerender tag has been | 102 // window - effectively, up to 30 seconds after a prerender tag has been |
| 102 // observed. | 103 // observed. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 130 // start recording events before the first prerender occurs. | 131 // start recording events before the first prerender occurs. |
| 131 bool seen_any_pageload_; | 132 bool seen_any_pageload_; |
| 132 bool seen_pageload_started_after_prerender_; | 133 bool seen_pageload_started_after_prerender_; |
| 133 | 134 |
| 134 DISALLOW_COPY_AND_ASSIGN(PrerenderHistograms); | 135 DISALLOW_COPY_AND_ASSIGN(PrerenderHistograms); |
| 135 }; | 136 }; |
| 136 | 137 |
| 137 } // namespace prerender | 138 } // namespace prerender |
| 138 | 139 |
| 139 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_HISTOGRAMS_H_ | 140 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_HISTOGRAMS_H_ |
| OLD | NEW |