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/profiles/profile_impl.h" | 5 #include "chrome/browser/profiles/profile_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 // The new ExtensionPrefStore is ref_counted and the new PrefService | 857 // The new ExtensionPrefStore is ref_counted and the new PrefService |
858 // stores a reference so that we do not leak memory here. | 858 // stores a reference so that we do not leak memory here. |
859 otr_prefs_.reset(prefs_->CreateIncognitoPrefService( | 859 otr_prefs_.reset(prefs_->CreateIncognitoPrefService( |
860 new ExtensionPrefStore( | 860 new ExtensionPrefStore( |
861 ExtensionPrefValueMapFactory::GetForBrowserContext(this), true))); | 861 ExtensionPrefValueMapFactory::GetForBrowserContext(this), true))); |
862 } | 862 } |
863 return otr_prefs_.get(); | 863 return otr_prefs_.get(); |
864 } | 864 } |
865 | 865 |
866 net::URLRequestContextGetter* ProfileImpl::CreateRequestContext( | 866 net::URLRequestContextGetter* ProfileImpl::CreateRequestContext( |
867 content::ProtocolHandlerMap* protocol_handlers) { | 867 content::ProtocolHandlerMap* protocol_handlers, |
868 return io_data_ | 868 content::ProtocolHandlerScopedVector protocol_interceptors) { |
869 .CreateMainRequestContextGetter(protocol_handlers, | 869 return io_data_.CreateMainRequestContextGetter( |
870 g_browser_process->local_state(), | 870 protocol_handlers, |
871 g_browser_process->io_thread()).get(); | 871 protocol_interceptors.Pass(), |
| 872 g_browser_process->local_state(), |
| 873 g_browser_process->io_thread()).get(); |
872 } | 874 } |
873 | 875 |
874 net::URLRequestContextGetter* ProfileImpl::GetRequestContext() { | 876 net::URLRequestContextGetter* ProfileImpl::GetRequestContext() { |
875 return GetDefaultStoragePartition(this)->GetURLRequestContext(); | 877 return GetDefaultStoragePartition(this)->GetURLRequestContext(); |
876 } | 878 } |
877 | 879 |
878 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForRenderProcess( | 880 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForRenderProcess( |
879 int renderer_child_id) { | 881 int renderer_child_id) { |
880 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( | 882 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( |
881 renderer_child_id); | 883 renderer_child_id); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
970 } | 972 } |
971 | 973 |
972 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForExtensions() { | 974 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForExtensions() { |
973 return io_data_.GetExtensionsRequestContextGetter().get(); | 975 return io_data_.GetExtensionsRequestContextGetter().get(); |
974 } | 976 } |
975 | 977 |
976 net::URLRequestContextGetter* | 978 net::URLRequestContextGetter* |
977 ProfileImpl::CreateRequestContextForStoragePartition( | 979 ProfileImpl::CreateRequestContextForStoragePartition( |
978 const base::FilePath& partition_path, | 980 const base::FilePath& partition_path, |
979 bool in_memory, | 981 bool in_memory, |
980 content::ProtocolHandlerMap* protocol_handlers) { | 982 content::ProtocolHandlerMap* protocol_handlers, |
| 983 content::ProtocolHandlerScopedVector protocol_interceptors) { |
981 return io_data_.CreateIsolatedAppRequestContextGetter( | 984 return io_data_.CreateIsolatedAppRequestContextGetter( |
982 partition_path, in_memory, protocol_handlers).get(); | 985 partition_path, |
| 986 in_memory, |
| 987 protocol_handlers, |
| 988 protocol_interceptors.Pass()).get(); |
983 } | 989 } |
984 | 990 |
985 net::SSLConfigService* ProfileImpl::GetSSLConfigService() { | 991 net::SSLConfigService* ProfileImpl::GetSSLConfigService() { |
986 // If ssl_config_service_manager_ is null, this typically means that some | 992 // If ssl_config_service_manager_ is null, this typically means that some |
987 // BrowserContextKeyedService is trying to create a RequestContext at startup, | 993 // BrowserContextKeyedService is trying to create a RequestContext at startup, |
988 // but SSLConfigServiceManager is not initialized until DoFinalInit() which is | 994 // but SSLConfigServiceManager is not initialized until DoFinalInit() which is |
989 // invoked after all BrowserContextKeyedServices have been initialized (see | 995 // invoked after all BrowserContextKeyedServices have been initialized (see |
990 // http://crbug.com/171406). | 996 // http://crbug.com/171406). |
991 DCHECK(ssl_config_service_manager_) << | 997 DCHECK(ssl_config_service_manager_) << |
992 "SSLConfigServiceManager is not initialized yet"; | 998 "SSLConfigServiceManager is not initialized yet"; |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1269 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { | 1275 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { |
1270 #if defined(OS_CHROMEOS) | 1276 #if defined(OS_CHROMEOS) |
1271 if (chromeos::ProfileHelper::IsSigninProfile(this)) { | 1277 if (chromeos::ProfileHelper::IsSigninProfile(this)) { |
1272 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( | 1278 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( |
1273 g_browser_process->local_state()); | 1279 g_browser_process->local_state()); |
1274 } | 1280 } |
1275 #endif // defined(OS_CHROMEOS) | 1281 #endif // defined(OS_CHROMEOS) |
1276 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 1282 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
1277 GetPrefs(), g_browser_process->local_state()); | 1283 GetPrefs(), g_browser_process->local_state()); |
1278 } | 1284 } |
OLD | NEW |