Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(429)

Side by Side Diff: chrome/browser/prerender/prerender_histograms.h

Issue 2321083002: [NoStatePrefetch] Add performance histograms. (Closed)
Patch Set: Review comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 // Must not be called for prefetch loads (which are never rendered anyway).
126 // |is_no_store| must be true if the main resource has a "no-store" cache
127 // control HTTP header.
128 // |prefetch_age| must be zero if the page was not prefetched.
129 void RecordFirstContentfulPaint(Origin origin,
130 bool is_no_store,
131 base::TimeDelta time,
132 base::TimeDelta prefetch_age);
133
134 // Returns the name of the histogram used to record the time to first
135 // contentful paint.
136 // Exposed for testing.
137 static std::string GetFirstContentfulPaintHistogramName(
138 Origin origin,
139 bool is_wash,
140 bool is_no_store,
141 base::TimeDelta prefetch_age);
142
124 private: 143 private:
125 base::TimeTicks GetCurrentTimeTicks() const; 144 base::TimeTicks GetCurrentTimeTicks() const;
126 145
127 // Returns the time elapsed since the last prerender happened. 146 // Returns the time elapsed since the last prerender happened.
128 base::TimeDelta GetTimeSinceLastPrerender() const; 147 base::TimeDelta GetTimeSinceLastPrerender() const;
129 148
130 // Returns whether the PrerenderManager is currently within the prerender 149 // Returns whether the PrerenderManager is currently within the prerender
131 // window - effectively, up to 30 seconds after a prerender tag has been 150 // window - effectively, up to 30 seconds after a prerender tag has been
132 // observed. 151 // observed.
133 bool WithinWindow() const; 152 bool WithinWindow() const;
(...skipping 20 matching lines...) Expand all
154 bool seen_pageload_started_after_prerender_; 173 bool seen_pageload_started_after_prerender_;
155 174
156 base::ThreadChecker thread_checker_; 175 base::ThreadChecker thread_checker_;
157 176
158 DISALLOW_COPY_AND_ASSIGN(PrerenderHistograms); 177 DISALLOW_COPY_AND_ASSIGN(PrerenderHistograms);
159 }; 178 };
160 179
161 } // namespace prerender 180 } // namespace prerender
162 181
163 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_HISTOGRAMS_H_ 182 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_HISTOGRAMS_H_
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_contents.cc ('k') | chrome/browser/prerender/prerender_histograms.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698