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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
908 DCHECK(prefs_); | 908 DCHECK(prefs_); |
909 if (!otr_prefs_) { | 909 if (!otr_prefs_) { |
910 // The new ExtensionPrefStore is ref_counted and the new PrefService | 910 // The new ExtensionPrefStore is ref_counted and the new PrefService |
911 // stores a reference so that we do not leak memory here. | 911 // stores a reference so that we do not leak memory here. |
912 otr_prefs_.reset(CreateIncognitoPrefServiceSyncable( | 912 otr_prefs_.reset(CreateIncognitoPrefServiceSyncable( |
913 prefs_.get(), CreateExtensionPrefStore(this, true))); | 913 prefs_.get(), CreateExtensionPrefStore(this, true))); |
914 } | 914 } |
915 return otr_prefs_.get(); | 915 return otr_prefs_.get(); |
916 } | 916 } |
917 | 917 |
| 918 net::URLRequestContextGetter* ProfileImpl::GetRequestContext() { |
| 919 return GetDefaultStoragePartition(this)->GetURLRequestContext(); |
| 920 } |
| 921 |
918 net::URLRequestContextGetter* ProfileImpl::GetMediaRequestContext() { | 922 net::URLRequestContextGetter* ProfileImpl::GetMediaRequestContext() { |
919 // Return the default media context. | 923 // Return the default media context. |
920 return io_data_.GetMediaRequestContextGetter().get(); | 924 return io_data_.GetMediaRequestContextGetter().get(); |
921 } | 925 } |
922 | 926 |
923 net::URLRequestContextGetter* | 927 net::URLRequestContextGetter* |
924 ProfileImpl::GetMediaRequestContextForRenderProcess( | 928 ProfileImpl::GetMediaRequestContextForRenderProcess( |
925 int renderer_child_id) { | 929 int renderer_child_id) { |
926 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( | 930 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( |
927 renderer_child_id); | 931 renderer_child_id); |
928 content::StoragePartition* storage_partition = rph->GetStoragePartition(); | 932 content::StoragePartition* storage_partition = rph->GetStoragePartition(); |
929 | 933 |
930 return storage_partition->GetMediaURLRequestContext(); | 934 return storage_partition->GetMediaURLRequestContext(); |
931 } | 935 } |
932 | 936 |
933 net::URLRequestContextGetter* | 937 net::URLRequestContextGetter* |
934 ProfileImpl::GetMediaRequestContextForStoragePartition( | 938 ProfileImpl::GetMediaRequestContextForStoragePartition( |
935 const base::FilePath& partition_path, | 939 const base::FilePath& partition_path, |
936 bool in_memory) { | 940 bool in_memory) { |
937 return io_data_ | 941 return io_data_ |
938 .GetIsolatedMediaRequestContextGetter(partition_path, in_memory).get(); | 942 .GetIsolatedMediaRequestContextGetter(partition_path, in_memory).get(); |
939 } | 943 } |
940 | 944 |
941 content::ResourceContext* ProfileImpl::GetResourceContext() { | 945 content::ResourceContext* ProfileImpl::GetResourceContext() { |
942 return io_data_.GetResourceContext(); | 946 return io_data_.GetResourceContext(); |
943 } | 947 } |
944 | 948 |
945 net::URLRequestContextGetter* ProfileImpl::GetRequestContext() { | |
946 return GetDefaultStoragePartition(this)->GetURLRequestContext(); | |
947 } | |
948 | |
949 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForExtensions() { | 949 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForExtensions() { |
950 return io_data_.GetExtensionsRequestContextGetter().get(); | 950 return io_data_.GetExtensionsRequestContextGetter().get(); |
951 } | 951 } |
952 | 952 |
953 net::SSLConfigService* ProfileImpl::GetSSLConfigService() { | 953 net::SSLConfigService* ProfileImpl::GetSSLConfigService() { |
954 // If ssl_config_service_manager_ is null, this typically means that some | 954 // If ssl_config_service_manager_ is null, this typically means that some |
955 // KeyedService is trying to create a RequestContext at startup, | 955 // KeyedService is trying to create a RequestContext at startup, |
956 // but SSLConfigServiceManager is not initialized until DoFinalInit() which is | 956 // but SSLConfigServiceManager is not initialized until DoFinalInit() which is |
957 // invoked after all KeyedServices have been initialized (see | 957 // invoked after all KeyedServices have been initialized (see |
958 // http://crbug.com/171406). | 958 // http://crbug.com/171406). |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1271 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { | 1271 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { |
1272 domain_reliability::DomainReliabilityService* service = | 1272 domain_reliability::DomainReliabilityService* service = |
1273 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> | 1273 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> |
1274 GetForBrowserContext(this); | 1274 GetForBrowserContext(this); |
1275 if (!service) | 1275 if (!service) |
1276 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1276 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>(); |
1277 | 1277 |
1278 return service->CreateMonitor( | 1278 return service->CreateMonitor( |
1279 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 1279 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
1280 } | 1280 } |
OLD | NEW |