Chromium Code Reviews| Index: chrome/browser/predictors/autocomplete_action_predictor.h |
| diff --git a/chrome/browser/predictors/autocomplete_action_predictor.h b/chrome/browser/predictors/autocomplete_action_predictor.h |
| index afbba8354ca71bd138c8fd5d4b3a71a8e2c5abe4..d1ac1082baddcb7fe0fa49e1f8216892f9945b85 100644 |
| --- a/chrome/browser/predictors/autocomplete_action_predictor.h |
| +++ b/chrome/browser/predictors/autocomplete_action_predictor.h |
| @@ -10,6 +10,7 @@ |
| #include "base/gtest_prod_util.h" |
| #include "base/memory/ref_counted.h" |
| +#include "base/memory/scoped_ptr.h" |
| #include "base/memory/weak_ptr.h" |
| #include "base/string16.h" |
| #include "chrome/browser/history/history_types.h" |
| @@ -18,6 +19,7 @@ |
| #include "content/public/browser/notification_observer.h" |
| #include "content/public/browser/notification_registrar.h" |
| #include "googleurl/src/gurl.h" |
| +#include "ui/gfx/size.h" |
| struct AutocompleteLog; |
| struct AutocompleteMatch; |
| @@ -26,10 +28,18 @@ class HistoryService; |
| class PredictorsHandler; |
| class Profile; |
| +namespace content { |
| + class SessionStorageNamespace; |
|
mmenke
2012/07/09 18:06:57
nit: Don't indent.
gavinp
2012/07/11 17:04:00
Done.
|
| +} |
| + |
| namespace history { |
| class URLDatabase; |
| } |
| +namespace prerender { |
| +class PrerenderHandle; |
| +} |
| + |
| namespace predictors { |
| // This class is responsible for determining the correct predictive network |
| @@ -79,6 +89,15 @@ class AutocompleteActionPredictor |
| Action RecommendAction(const string16& user_text, |
| const AutocompleteMatch& match) const; |
| + // Begin prerendering |url| with |session_storage_namespace|. The |size| gives |
| + // the initial size for the target prerender. The predictor will run at most |
| + // one prerender at a time, so launching a prerender will cancel our previous |
| + // prerenders (if any). |
| + void StartPrerendering( |
| + const GURL& url, |
| + content::SessionStorageNamespace* session_storage_namespace, |
| + gfx::Size size); |
|
mmenke
2012/07/09 18:06:57
Hmm... size is passed by reference to prerender_l
dominich
2012/07/09 18:25:43
IIRC, it was done like this to show that it might
gavinp
2012/07/11 17:04:00
Done, I went with by reference everywhere.
|
| + |
| // Return true if the suggestion type warrants a TCP/IP preconnection. |
| // i.e., it is now quite likely that the user will select the related domain. |
| static bool IsPreconnectable(const AutocompleteMatch& match); |
| @@ -199,6 +218,8 @@ class AutocompleteActionPredictor |
| // This is cleared after every Omnibox navigation. |
| std::vector<TransitionalMatch> transitional_matches_; |
| + scoped_ptr<prerender::PrerenderHandle> prerender_handle_; |
| + |
| // This allows us to predict the effect of confidence threshold changes on |
| // accuracy. This is cleared after every omnibox navigation. |
| mutable std::vector<std::pair<GURL, double> > tracked_urls_; |