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

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

Issue 6263014: Add Perceived PageLoad Time (PPLT) metrics for Prerender Experiments,... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include "chrome/browser/prerender/prerender_contents.h" 5 #include "chrome/browser/prerender/prerender_contents.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/background_contents_service.h" 8 #include "chrome/browser/background_contents_service.h"
9 #include "chrome/browser/browsing_instance.h" 9 #include "chrome/browser/browsing_instance.h"
10 #include "chrome/browser/prerender/prerender_manager.h" 10 #include "chrome/browser/prerender/prerender_manager.h"
(...skipping 19 matching lines...) Expand all
30 }; 30 };
31 31
32 PrerenderContents::PrerenderContents(PrerenderManager* prerender_manager, 32 PrerenderContents::PrerenderContents(PrerenderManager* prerender_manager,
33 Profile* profile, 33 Profile* profile,
34 const GURL& url, 34 const GURL& url,
35 const std::vector<GURL>& alias_urls) 35 const std::vector<GURL>& alias_urls)
36 : prerender_manager_(prerender_manager), 36 : prerender_manager_(prerender_manager),
37 render_view_host_(NULL), 37 render_view_host_(NULL),
38 prerender_url_(url), 38 prerender_url_(url),
39 profile_(profile), 39 profile_(profile),
40 page_id_(0) { 40 page_id_(0),
41 has_stopped_loading_(false) {
41 DCHECK(prerender_manager != NULL); 42 DCHECK(prerender_manager != NULL);
42 AddAliasURL(prerender_url_); 43 AddAliasURL(prerender_url_);
43 for (std::vector<GURL>::const_iterator it = alias_urls.begin(); 44 for (std::vector<GURL>::const_iterator it = alias_urls.begin();
44 it != alias_urls.end(); 45 it != alias_urls.end();
45 ++it) { 46 ++it) {
46 AddAliasURL(*it); 47 AddAliasURL(*it);
47 } 48 }
48 } 49 }
49 50
50 // static 51 // static
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 } 273 }
273 274
274 void PrerenderContents::AddAliasURL(const GURL& url) { 275 void PrerenderContents::AddAliasURL(const GURL& url) {
275 alias_urls_.push_back(url); 276 alias_urls_.push_back(url);
276 } 277 }
277 278
278 bool PrerenderContents::MatchesURL(const GURL& url) const { 279 bool PrerenderContents::MatchesURL(const GURL& url) const {
279 return std::find(alias_urls_.begin(), alias_urls_.end(), url) 280 return std::find(alias_urls_.begin(), alias_urls_.end(), url)
280 != alias_urls_.end(); 281 != alias_urls_.end();
281 } 282 }
283
284 void PrerenderContents::DidStopLoading() {
285 has_stopped_loading_ = true;
286 }
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_contents.h ('k') | chrome/browser/prerender/prerender_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698