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

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

Issue 7210020: Added prerendering to omnibox. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove TODO Created 9 years, 6 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) 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 #include "chrome/browser/prerender/prerender_manager.h" 5 #include "chrome/browser/prerender/prerender_manager.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 } 357 }
358 while (prerender_list_.size() > max_elements_) { 358 while (prerender_list_.size() > max_elements_) {
359 data = prerender_list_.front(); 359 data = prerender_list_.front();
360 prerender_list_.pop_front(); 360 prerender_list_.pop_front();
361 data.contents_->Destroy(FINAL_STATUS_EVICTED); 361 data.contents_->Destroy(FINAL_STATUS_EVICTED);
362 } 362 }
363 StartSchedulingPeriodicCleanups(); 363 StartSchedulingPeriodicCleanups();
364 return true; 364 return true;
365 } 365 }
366 366
367 bool PrerenderManager::AddPrerenderWithNoTag(const GURL& url) {
368 return AddPreload(std::make_pair(-1, -1), url, GURL());
369 }
370
367 void PrerenderManager::AddPendingPreload( 371 void PrerenderManager::AddPendingPreload(
368 const std::pair<int, int>& child_route_id_pair, 372 const std::pair<int, int>& child_route_id_pair,
369 const GURL& url, 373 const GURL& url,
370 const GURL& referrer) { 374 const GURL& referrer) {
371 DCHECK(FindPrerenderContentsForChildRouteIdPair(child_route_id_pair) != 375 DCHECK(FindPrerenderContentsForChildRouteIdPair(child_route_id_pair) !=
372 prerender_list_.end()); 376 prerender_list_.end());
373 PendingPrerenderList::iterator it = 377 PendingPrerenderList::iterator it =
374 pending_prerender_list_.find(child_route_id_pair); 378 pending_prerender_list_.find(child_route_id_pair);
375 if (it == pending_prerender_list_.end()) { 379 if (it == pending_prerender_list_.end()) {
376 PendingPrerenderList::value_type el = std::make_pair(child_route_id_pair, 380 PendingPrerenderList::value_type el = std::make_pair(child_route_id_pair,
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 ScopedVector<OnCloseTabContentsDeleter>::iterator i = std::find( 981 ScopedVector<OnCloseTabContentsDeleter>::iterator i = std::find(
978 on_close_tab_contents_deleters_.begin(), 982 on_close_tab_contents_deleters_.begin(),
979 on_close_tab_contents_deleters_.end(), 983 on_close_tab_contents_deleters_.end(),
980 deleter); 984 deleter);
981 DCHECK(i != on_close_tab_contents_deleters_.end()); 985 DCHECK(i != on_close_tab_contents_deleters_.end());
982 on_close_tab_contents_deleters_.erase(i); 986 on_close_tab_contents_deleters_.erase(i);
983 } 987 }
984 } 988 }
985 989
986 } // namespace prerender 990 } // namespace prerender
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698