| OLD | NEW |
| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 // Only cancel the old prerender after starting the new one, so if the URLs | 143 // Only cancel the old prerender after starting the new one, so if the URLs |
| 144 // are the same, the underlying prerender will be reused. | 144 // are the same, the underlying prerender will be reused. |
| 145 scoped_ptr<prerender::PrerenderHandle> old_prerender_handle( | 145 scoped_ptr<prerender::PrerenderHandle> old_prerender_handle( |
| 146 prerender_handle_.release()); | 146 prerender_handle_.release()); |
| 147 if (prerender::PrerenderManager* prerender_manager = | 147 if (prerender::PrerenderManager* prerender_manager = |
| 148 prerender::PrerenderManagerFactory::GetForProfile(profile_)) { | 148 prerender::PrerenderManagerFactory::GetForProfile(profile_)) { |
| 149 content::SessionStorageNamespace* session_storage_namespace = NULL; | 149 content::SessionStorageNamespace* session_storage_namespace = NULL; |
| 150 content::SessionStorageNamespaceMap::const_iterator it = | 150 content::SessionStorageNamespaceMap::const_iterator it = |
| 151 session_storage_namespace_map.find(""); | 151 session_storage_namespace_map.find(std::string()); |
| 152 if (it != session_storage_namespace_map.end()) | 152 if (it != session_storage_namespace_map.end()) |
| 153 session_storage_namespace = it->second; | 153 session_storage_namespace = it->second; |
| 154 prerender_handle_.reset( | 154 prerender_handle_.reset( |
| 155 prerender_manager->AddPrerenderFromOmnibox( | 155 prerender_manager->AddPrerenderFromOmnibox( |
| 156 url, session_storage_namespace, size)); | 156 url, session_storage_namespace, size)); |
| 157 } | 157 } |
| 158 if (old_prerender_handle) | 158 if (old_prerender_handle) |
| 159 old_prerender_handle->OnCancel(); | 159 old_prerender_handle->OnCancel(); |
| 160 } | 160 } |
| 161 | 161 |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 return number_of_hits / (number_of_hits + value.number_of_misses); | 577 return number_of_hits / (number_of_hits + value.number_of_misses); |
| 578 } | 578 } |
| 579 | 579 |
| 580 AutocompleteActionPredictor::TransitionalMatch::TransitionalMatch() { | 580 AutocompleteActionPredictor::TransitionalMatch::TransitionalMatch() { |
| 581 } | 581 } |
| 582 | 582 |
| 583 AutocompleteActionPredictor::TransitionalMatch::~TransitionalMatch() { | 583 AutocompleteActionPredictor::TransitionalMatch::~TransitionalMatch() { |
| 584 } | 584 } |
| 585 | 585 |
| 586 } // namespace predictors | 586 } // namespace predictors |
| OLD | NEW |