OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 class PrerenderHistograms { | 24 class PrerenderHistograms { |
25 public: | 25 public: |
26 // Owned by a PrerenderManager object for the lifetime of the | 26 // Owned by a PrerenderManager object for the lifetime of the |
27 // PrerenderManager. | 27 // PrerenderManager. |
28 PrerenderHistograms(); | 28 PrerenderHistograms(); |
29 | 29 |
30 // Records the perceived page load time for a page - effectively the time from | 30 // Records the perceived page load time for a page - effectively the time from |
31 // when the user navigates to a page to when it finishes loading. The actual | 31 // when the user navigates to a page to when it finishes loading. The actual |
32 // load may have started prior to navigation due to prerender hints. | 32 // load may have started prior to navigation due to prerender hints. |
33 void RecordPerceivedPageLoadTime(base::TimeDelta perceived_page_load_time, | 33 void RecordPerceivedPageLoadTime(base::TimeDelta perceived_page_load_time, |
34 bool was_prerender, | 34 bool was_prerender, const GURL& url); |
35 bool was_complete_prerender, | |
36 const GURL& url); | |
37 | 35 |
38 // Records the time from when a page starts prerendering to when the user | 36 // Records the time from when a page starts prerendering to when the user |
39 // navigates to it. This must be called on the UI thread. | 37 // navigates to it. This must be called on the UI thread. |
40 void RecordTimeUntilUsed(base::TimeDelta time_until_used, | 38 void RecordTimeUntilUsed(base::TimeDelta time_until_used, |
41 base::TimeDelta max_age) const; | 39 base::TimeDelta max_age) const; |
42 | 40 |
43 // Record a PerSessionCount data point. | 41 // Record a PerSessionCount data point. |
44 void RecordPerSessionCount(int count) const; | 42 void RecordPerSessionCount(int count) const; |
45 | 43 |
46 // Record time between two prerender requests. | 44 // Record time between two prerender requests. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 // start recording events before the first prerender occurs. | 93 // start recording events before the first prerender occurs. |
96 bool seen_any_pageload_; | 94 bool seen_any_pageload_; |
97 bool seen_pageload_started_after_prerender_; | 95 bool seen_pageload_started_after_prerender_; |
98 | 96 |
99 DISALLOW_COPY_AND_ASSIGN(PrerenderHistograms); | 97 DISALLOW_COPY_AND_ASSIGN(PrerenderHistograms); |
100 }; | 98 }; |
101 | 99 |
102 } // namespace prerender | 100 } // namespace prerender |
103 | 101 |
104 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_HISTOGRAMS_H_ | 102 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_HISTOGRAMS_H_ |
OLD | NEW |