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

Side by Side Diff: chrome/browser/predictors/autocomplete_action_predictor.cc

Issue 11551003: Change multi-prerender API to include per launcher slots. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clear to land Created 7 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
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/predictors/autocomplete_action_predictor.h" 5 #include "chrome/browser/predictors/autocomplete_action_predictor.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 } 133 }
134 134
135 void AutocompleteActionPredictor::ClearTransitionalMatches() { 135 void AutocompleteActionPredictor::ClearTransitionalMatches() {
136 transitional_matches_.clear(); 136 transitional_matches_.clear();
137 } 137 }
138 138
139 void AutocompleteActionPredictor::StartPrerendering( 139 void AutocompleteActionPredictor::StartPrerendering(
140 const GURL& url, 140 const GURL& url,
141 const content::SessionStorageNamespaceMap& session_storage_namespace_map, 141 const content::SessionStorageNamespaceMap& session_storage_namespace_map,
142 const gfx::Size& size) { 142 const gfx::Size& size) {
143 if (prerender_handle_.get()) 143 if (prerender_handle_)
144 prerender_handle_->OnNavigateAway(); 144 prerender_handle_->OnCancel();
145 if (prerender::PrerenderManager* prerender_manager = 145 if (prerender::PrerenderManager* prerender_manager =
146 prerender::PrerenderManagerFactory::GetForProfile(profile_)) { 146 prerender::PrerenderManagerFactory::GetForProfile(profile_)) {
147 content::SessionStorageNamespace* session_storage_namespace = NULL; 147 content::SessionStorageNamespace* session_storage_namespace = NULL;
148 content::SessionStorageNamespaceMap::const_iterator it = 148 content::SessionStorageNamespaceMap::const_iterator it =
149 session_storage_namespace_map.find(""); 149 session_storage_namespace_map.find("");
150 if (it != session_storage_namespace_map.end()) 150 if (it != session_storage_namespace_map.end())
151 session_storage_namespace = it->second; 151 session_storage_namespace = it->second;
152 prerender_handle_.reset( 152 prerender_handle_.reset(
153 prerender_manager->AddPrerenderFromOmnibox( 153 prerender_manager->AddPrerenderFromOmnibox(
154 url, session_storage_namespace, size)); 154 url, session_storage_namespace, size));
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 return number_of_hits / (number_of_hits + value.number_of_misses); 575 return number_of_hits / (number_of_hits + value.number_of_misses);
576 } 576 }
577 577
578 AutocompleteActionPredictor::TransitionalMatch::TransitionalMatch() { 578 AutocompleteActionPredictor::TransitionalMatch::TransitionalMatch() {
579 } 579 }
580 580
581 AutocompleteActionPredictor::TransitionalMatch::~TransitionalMatch() { 581 AutocompleteActionPredictor::TransitionalMatch::~TransitionalMatch() {
582 } 582 }
583 583
584 } // namespace predictors 584 } // namespace predictors
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698