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

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

Issue 9270018: Make a separate histogram for MatchComplete Final Status'es and (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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 | Annotate | Revision Log
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_CONTENTS_H_ 5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_
6 #define CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_
7 #pragma once 7 #pragma once
8 8
9 #include <list> 9 #include <list>
10 #include <string> 10 #include <string>
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 PendingPrerenderData(Origin origin, 74 PendingPrerenderData(Origin origin,
75 const GURL& url, 75 const GURL& url,
76 const content::Referrer& referrer); 76 const content::Referrer& referrer);
77 77
78 Origin origin; 78 Origin origin;
79 GURL url; 79 GURL url;
80 content::Referrer referrer; 80 content::Referrer referrer;
81 }; 81 };
82 typedef std::list<PendingPrerenderData> PendingPrerenderList; 82 typedef std::list<PendingPrerenderData> PendingPrerenderList;
83 83
84 // Indicates how this PrerenderContents relates to MatchComplete.
85 // This is important to figure out in what histograms to record the
86 // FinalStatus in, as described below.
87 enum MatchCompleteStatus {
88 // A regular prerender which will be recorded both in Match and
89 // MatchComplete.
90 MATCH_COMPLETE_DEFAULT,
91 // A prerender that used to be a regular prerender, but has since
92 // been replaced by a MatchComplete dummy. Therefore, we will record
93 // this only for Match, but not for MatchComplete.
94 MATCH_COMPLETE_REPLACED,
95 // A prerender that is a MatchComplete dummy replacing a regular
96 // prerender. Therefore, we will record this only for MatchComplete,
97 // but not Match.
98 MATCH_COMPLETE_REPLACEMENT
99 };
100
84 virtual ~PrerenderContents(); 101 virtual ~PrerenderContents();
85 102
86 bool Init(); 103 bool Init();
87 104
88 static Factory* CreateFactory(); 105 static Factory* CreateFactory();
89 106
90 // |source_render_view_host| is the RenderViewHost that initiated 107 // |source_render_view_host| is the RenderViewHost that initiated
91 // prerendering. 108 // prerendering.
92 virtual void StartPrerendering( 109 virtual void StartPrerendering(
93 const RenderViewHost* source_render_view_host, 110 const RenderViewHost* source_render_view_host,
94 SessionStorageNamespace* session_storage_namespace); 111 SessionStorageNamespace* session_storage_namespace);
95 112
96 // Verifies that the prerendering is not using too many resources, and kills 113 // Verifies that the prerendering is not using too many resources, and kills
97 // it if not. 114 // it if not.
98 void DestroyWhenUsingTooManyResources(); 115 void DestroyWhenUsingTooManyResources();
99 116
100 RenderViewHost* render_view_host_mutable(); 117 RenderViewHost* render_view_host_mutable();
101 const RenderViewHost* render_view_host() const; 118 const RenderViewHost* render_view_host() const;
102 string16 title() const { return title_; } 119 string16 title() const { return title_; }
103 int32 page_id() const { return page_id_; } 120 int32 page_id() const { return page_id_; }
104 GURL icon_url() const { return icon_url_; } 121 GURL icon_url() const { return icon_url_; }
105 const GURL& prerender_url() const { return prerender_url_; } 122 const GURL& prerender_url() const { return prerender_url_; }
106 const content::Referrer& referrer() const { return referrer_; } 123 const content::Referrer& referrer() const { return referrer_; }
107 bool has_stopped_loading() const { return has_stopped_loading_; } 124 bool has_stopped_loading() const { return has_stopped_loading_; }
108 bool prerendering_has_started() const { return prerendering_has_started_; } 125 bool prerendering_has_started() const { return prerendering_has_started_; }
126 MatchCompleteStatus match_complete_status() const {
127 return match_complete_status_;
128 }
129 void set_match_complete_status(MatchCompleteStatus status) {
130 match_complete_status_ = status;
131 }
109 132
110 // Sets the parameter to the value of the associated RenderViewHost's child id 133 // Sets the parameter to the value of the associated RenderViewHost's child id
111 // and returns a boolean indicating the validity of that id. 134 // and returns a boolean indicating the validity of that id.
112 virtual bool GetChildId(int* child_id) const; 135 virtual bool GetChildId(int* child_id) const;
113 136
114 // Sets the parameter to the value of the associated RenderViewHost's route id 137 // Sets the parameter to the value of the associated RenderViewHost's route id
115 // and returns a boolean indicating the validity of that id. 138 // and returns a boolean indicating the validity of that id.
116 virtual bool GetRouteId(int* route_id) const; 139 virtual bool GetRouteId(int* route_id) const;
117 140
118 // Set the final status for how the PrerenderContents was used. This 141 // Set the final status for how the PrerenderContents was used. This
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 std::vector<GURL> alias_urls_; 285 std::vector<GURL> alias_urls_;
263 286
264 bool has_stopped_loading_; 287 bool has_stopped_loading_;
265 288
266 // This must be the same value as the PrerenderTracker has recorded for 289 // This must be the same value as the PrerenderTracker has recorded for
267 // |this|, when |this| has a RenderView. 290 // |this|, when |this| has a RenderView.
268 FinalStatus final_status_; 291 FinalStatus final_status_;
269 292
270 bool prerendering_has_started_; 293 bool prerendering_has_started_;
271 294
295 // The MatchComplete status of the prerender, indicating how it relates
296 // to being a MatchComplete dummy (see definition of MatchCompleteStatus
297 // above).
298 MatchCompleteStatus match_complete_status_;
299
272 // Tracks whether or not prerendering has been cancelled by calling Destroy. 300 // Tracks whether or not prerendering has been cancelled by calling Destroy.
273 // Used solely to prevent double deletion. 301 // Used solely to prevent double deletion.
274 bool prerendering_has_been_cancelled_; 302 bool prerendering_has_been_cancelled_;
275 303
276 // Time at which we started to load the URL. This is used to compute 304 // Time at which we started to load the URL. This is used to compute
277 // the time elapsed from initiating a prerender until the time the 305 // the time elapsed from initiating a prerender until the time the
278 // (potentially only partially) prerendered page is shown to the user. 306 // (potentially only partially) prerendered page is shown to the user.
279 base::TimeTicks load_start_time_; 307 base::TimeTicks load_start_time_;
280 308
281 // Process Metrics of the render process associated with the 309 // Process Metrics of the render process associated with the
(...skipping 19 matching lines...) Expand all
301 329
302 // List of all pages the prerendered page has tried to prerender. 330 // List of all pages the prerendered page has tried to prerender.
303 PendingPrerenderList pending_prerender_list_; 331 PendingPrerenderList pending_prerender_list_;
304 332
305 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); 333 DISALLOW_COPY_AND_ASSIGN(PrerenderContents);
306 }; 334 };
307 335
308 } // namespace prerender 336 } // namespace prerender
309 337
310 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ 338 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_browsertest.cc ('k') | chrome/browser/prerender/prerender_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698