diff options
Diffstat (limited to 'chrome/browser/profiles')
-rw-r--r-- | chrome/browser/profiles/profile_impl.cc | 8 | ||||
-rw-r--r-- | chrome/browser/profiles/profile_impl.h | 2 | ||||
-rw-r--r-- | chrome/browser/profiles/profile_io_data.cc | 8 | ||||
-rw-r--r-- | chrome/browser/profiles/profile_io_data.h | 3 |
4 files changed, 13 insertions, 8 deletions
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc index 3fb658d..0b18cc2 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc @@ -1553,8 +1553,8 @@ PrefProxyConfigTracker* ProfileImpl::GetProxyConfigTracker() { prerender::PrerenderManager* ProfileImpl::GetPrerenderManager() { if (!prerender::PrerenderManager::IsPrerenderingPossible()) - return NULL; - if (!prerender_manager_) - prerender_manager_ = new prerender::PrerenderManager(this); - return prerender_manager_; + return base::WeakPtr<prerender::PrerenderManager>(); + if (!prerender_manager_.get()) + prerender_manager_.reset(new prerender::PrerenderManager(this)); + return prerender_manager_.get(); } diff --git a/chrome/browser/profiles/profile_impl.h b/chrome/browser/profiles/profile_impl.h index 8892080..c28204f 100644 --- a/chrome/browser/profiles/profile_impl.h +++ b/chrome/browser/profiles/profile_impl.h @@ -214,7 +214,7 @@ class ProfileImpl : public Profile, scoped_refptr<TransportSecurityPersister> transport_security_persister_; scoped_ptr<policy::ProfilePolicyConnector> profile_policy_connector_; - scoped_refptr<prerender::PrerenderManager> prerender_manager_; + scoped_ptr<prerender::PrerenderManager> prerender_manager_; scoped_ptr<NetPrefObserver> net_pref_observer_; scoped_ptr<TemplateURLFetcher> template_url_fetcher_; scoped_ptr<TemplateURLModel> template_url_model_; diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc index 3419efb..16c3c88 100644 --- a/chrome/browser/profiles/profile_io_data.cc +++ b/chrome/browser/profiles/profile_io_data.cc @@ -24,6 +24,7 @@ #include "chrome/browser/net/pref_proxy_config_service.h" #include "chrome/browser/net/proxy_service_factory.h" #include "chrome/browser/prefs/pref_service.h" +#include "chrome/browser/prerender/prerender_manager.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" @@ -58,7 +59,7 @@ class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate { NewRunnableMethod(this, &ChromeCookieMonsterDelegate::OnCookieChangedAsyncHelper, cookie, - removed, + removed, cause)); } @@ -178,7 +179,10 @@ void ProfileIOData::InitializeProfileParams(Profile* profile) { params->blob_storage_context = profile->GetBlobStorageContext(); params->file_system_context = profile->GetFileSystemContext(); params->extension_info_map = profile->GetExtensionInfoMap(); - params->prerender_manager = profile->GetPrerenderManager(); + prerender::PrerenderManager* prerender_manager = + profile->GetPrerenderManager(); + if (prerender_manager) + params->prerender_manager = prerender_manager->AsWeakPtr(); params->protocol_handler_registry = profile->GetProtocolHandlerRegistry(); params->proxy_config_service.reset( diff --git a/chrome/browser/profiles/profile_io_data.h b/chrome/browser/profiles/profile_io_data.h index ab4c252..ce5f954 100644 --- a/chrome/browser/profiles/profile_io_data.h +++ b/chrome/browser/profiles/profile_io_data.h @@ -12,6 +12,7 @@ #include "base/file_path.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" +#include "base/memory/weak_ptr.h" #include "base/synchronization/lock.h" #include "chrome/browser/net/chrome_url_request_context.h" #include "chrome/browser/prefs/pref_member.h" @@ -111,7 +112,7 @@ class ProfileIOData : public base::RefCountedThreadSafe<ProfileIOData> { scoped_refptr<ChromeBlobStorageContext> blob_storage_context; scoped_refptr<fileapi::FileSystemContext> file_system_context; scoped_refptr<ExtensionInfoMap> extension_info_map; - scoped_refptr<prerender::PrerenderManager> prerender_manager; + base::WeakPtr<prerender::PrerenderManager> prerender_manager; scoped_refptr<ProtocolHandlerRegistry> protocol_handler_registry; // We need to initialize the ProxyConfigService from the UI thread // because on linux it relies on initializing things through gconf, |