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

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

Issue 11348357: Add observer interface to PrerenderContents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remediate to review Created 8 years 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 #include "chrome/browser/prerender/prerender_manager.h" 5 #include "chrome/browser/prerender/prerender_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after
1161 return base::TimeTicks::Now(); 1161 return base::TimeTicks::Now();
1162 } 1162 }
1163 1163
1164 PrerenderContents* PrerenderManager::CreatePrerenderContents( 1164 PrerenderContents* PrerenderManager::CreatePrerenderContents(
1165 const GURL& url, 1165 const GURL& url,
1166 const content::Referrer& referrer, 1166 const content::Referrer& referrer,
1167 Origin origin, 1167 Origin origin,
1168 uint8 experiment_id) { 1168 uint8 experiment_id) {
1169 DCHECK(CalledOnValidThread()); 1169 DCHECK(CalledOnValidThread());
1170 return prerender_contents_factory_->CreatePrerenderContents( 1170 return prerender_contents_factory_->CreatePrerenderContents(
1171 this, prerender_tracker_, profile_, url, referrer, origin, experiment_id); 1171 this, profile_, url, referrer, origin, experiment_id);
1172 } 1172 }
1173 1173
1174 void PrerenderManager::SortActivePrerenders() { 1174 void PrerenderManager::SortActivePrerenders() {
1175 std::sort(active_prerenders_.begin(), active_prerenders_.end(), 1175 std::sort(active_prerenders_.begin(), active_prerenders_.end(),
1176 PrerenderData::OrderByExpiryTime()); 1176 PrerenderData::OrderByExpiryTime());
1177 } 1177 }
1178 1178
1179 PrerenderManager::PrerenderData* PrerenderManager::FindPrerenderData( 1179 PrerenderManager::PrerenderData* PrerenderManager::FindPrerenderData(
1180 const GURL& url, 1180 const GURL& url,
1181 const SessionStorageNamespace* session_storage_namespace) { 1181 const SessionStorageNamespace* session_storage_namespace) {
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
1342 if (!render_process_host || !render_process_host->GetBrowserContext()) 1342 if (!render_process_host || !render_process_host->GetBrowserContext())
1343 return NULL; 1343 return NULL;
1344 Profile* profile = Profile::FromBrowserContext( 1344 Profile* profile = Profile::FromBrowserContext(
1345 render_process_host->GetBrowserContext()); 1345 render_process_host->GetBrowserContext());
1346 if (!profile) 1346 if (!profile)
1347 return NULL; 1347 return NULL;
1348 return PrerenderManagerFactory::GetInstance()->GetForProfile(profile); 1348 return PrerenderManagerFactory::GetInstance()->GetForProfile(profile);
1349 } 1349 }
1350 1350
1351 } // namespace prerender 1351 } // namespace prerender
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698