| Index: chrome/browser/profiles/profile_impl.cc
|
| ===================================================================
|
| --- chrome/browser/profiles/profile_impl.cc (revision 100345)
|
| +++ chrome/browser/profiles/profile_impl.cc (working copy)
|
| @@ -47,6 +47,7 @@
|
| #include "chrome/browser/net/chrome_url_request_context.h"
|
| #include "chrome/browser/net/gaia/token_service.h"
|
| #include "chrome/browser/net/net_pref_observer.h"
|
| +#include "chrome/browser/net/predictor.h"
|
| #include "chrome/browser/net/pref_proxy_config_service.h"
|
| #include "chrome/browser/net/ssl_config_service_manager.h"
|
| #include "chrome/browser/password_manager/password_store_default.h"
|
| @@ -308,7 +309,8 @@
|
| #if defined(OS_WIN)
|
| checked_instant_promo_(false),
|
| #endif
|
| - delegate_(delegate) {
|
| + delegate_(delegate),
|
| + predictor_(NULL) {
|
| DCHECK(!path.empty()) << "Using an empty path will attempt to write " <<
|
| "profile files to the root directory!";
|
|
|
| @@ -316,6 +318,13 @@
|
| TimeDelta::FromMilliseconds(kCreateSessionServiceDelayMS), this,
|
| &ProfileImpl::EnsureSessionServiceCreated);
|
|
|
| + // Determine if prefetch is enabled for this profile.
|
| + // If not profile_manager is present, it means we are in a unittest.
|
| + const CommandLine* command_line = CommandLine::ForCurrentProcess();
|
| + predictor_ = chrome_browser_net::Predictor::CreatePredictor(
|
| + !command_line->HasSwitch(switches::kDisablePreconnect),
|
| + g_browser_process->profile_manager() == NULL);
|
| +
|
| if (delegate_) {
|
| prefs_.reset(PrefService::CreatePrefService(
|
| GetPrefFilePath(),
|
| @@ -436,9 +445,12 @@
|
|
|
| // Make sure we initialize the ProfileIOData after everything else has been
|
| // initialized that we might be reading from the IO thread.
|
| +
|
| io_data_.Init(cookie_path, origin_bound_cert_path, cache_path,
|
| cache_max_size, media_cache_path, media_cache_max_size,
|
| - extensions_cookie_path, app_path);
|
| + extensions_cookie_path, app_path, predictor_,
|
| + g_browser_process->local_state(),
|
| + g_browser_process->io_thread());
|
|
|
| ChromePluginServiceFilter::GetInstance()->RegisterResourceContext(
|
| PluginPrefs::GetForProfile(this), &GetResourceContext());
|
| @@ -921,7 +933,7 @@
|
|
|
| DCHECK(!net_pref_observer_.get());
|
| net_pref_observer_.reset(
|
| - new NetPrefObserver(prefs_.get(), GetPrerenderManager()));
|
| + new NetPrefObserver(prefs_.get(), GetPrerenderManager(), predictor_));
|
|
|
| DoFinalInit();
|
| }
|
| @@ -1738,6 +1750,10 @@
|
| return prerender_manager_.get();
|
| }
|
|
|
| +chrome_browser_net::Predictor* ProfileImpl::GetNetworkPredictor() {
|
| + return predictor_;
|
| +}
|
| +
|
| SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() {
|
| if (!spellcheck_profile_.get())
|
| spellcheck_profile_.reset(new SpellCheckProfile());
|
|
|