| 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 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 return otr_prefs_.get(); | 810 return otr_prefs_.get(); |
| 811 } | 811 } |
| 812 | 812 |
| 813 base::FilePath ProfileImpl::GetPrefFilePath() { | 813 base::FilePath ProfileImpl::GetPrefFilePath() { |
| 814 base::FilePath pref_file_path = path_; | 814 base::FilePath pref_file_path = path_; |
| 815 pref_file_path = pref_file_path.Append(chrome::kPreferencesFilename); | 815 pref_file_path = pref_file_path.Append(chrome::kPreferencesFilename); |
| 816 return pref_file_path; | 816 return pref_file_path; |
| 817 } | 817 } |
| 818 | 818 |
| 819 net::URLRequestContextGetter* ProfileImpl::CreateRequestContext( | 819 net::URLRequestContextGetter* ProfileImpl::CreateRequestContext( |
| 820 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 820 content::ProtocolHandlerMap* protocol_handlers) { |
| 821 blob_protocol_handler, | |
| 822 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 823 file_system_protocol_handler, | |
| 824 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 825 developer_protocol_handler, | |
| 826 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 827 chrome_protocol_handler, | |
| 828 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 829 chrome_devtools_protocol_handler) { | |
| 830 return io_data_.CreateMainRequestContextGetter( | 821 return io_data_.CreateMainRequestContextGetter( |
| 831 blob_protocol_handler.Pass(), | 822 protocol_handlers, |
| 832 file_system_protocol_handler.Pass(), | |
| 833 developer_protocol_handler.Pass(), | |
| 834 chrome_protocol_handler.Pass(), | |
| 835 chrome_devtools_protocol_handler.Pass(), | |
| 836 g_browser_process->local_state(), | 823 g_browser_process->local_state(), |
| 837 g_browser_process->io_thread()); | 824 g_browser_process->io_thread()); |
| 838 } | 825 } |
| 839 | 826 |
| 840 net::URLRequestContextGetter* ProfileImpl::GetRequestContext() { | 827 net::URLRequestContextGetter* ProfileImpl::GetRequestContext() { |
| 841 return GetDefaultStoragePartition(this)->GetURLRequestContext(); | 828 return GetDefaultStoragePartition(this)->GetURLRequestContext(); |
| 842 } | 829 } |
| 843 | 830 |
| 844 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForRenderProcess( | 831 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForRenderProcess( |
| 845 int renderer_child_id) { | 832 int renderer_child_id) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 } | 864 } |
| 878 | 865 |
| 879 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForExtensions() { | 866 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForExtensions() { |
| 880 return io_data_.GetExtensionsRequestContextGetter(); | 867 return io_data_.GetExtensionsRequestContextGetter(); |
| 881 } | 868 } |
| 882 | 869 |
| 883 net::URLRequestContextGetter* | 870 net::URLRequestContextGetter* |
| 884 ProfileImpl::CreateRequestContextForStoragePartition( | 871 ProfileImpl::CreateRequestContextForStoragePartition( |
| 885 const base::FilePath& partition_path, | 872 const base::FilePath& partition_path, |
| 886 bool in_memory, | 873 bool in_memory, |
| 887 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 874 content::ProtocolHandlerMap* protocol_handlers) { |
| 888 blob_protocol_handler, | |
| 889 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 890 file_system_protocol_handler, | |
| 891 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 892 developer_protocol_handler, | |
| 893 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 894 chrome_protocol_handler, | |
| 895 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 896 chrome_devtools_protocol_handler) { | |
| 897 return io_data_.CreateIsolatedAppRequestContextGetter( | 875 return io_data_.CreateIsolatedAppRequestContextGetter( |
| 898 partition_path, in_memory, blob_protocol_handler.Pass(), | 876 partition_path, in_memory, protocol_handlers); |
| 899 file_system_protocol_handler.Pass(), developer_protocol_handler.Pass(), | |
| 900 chrome_protocol_handler.Pass(), chrome_devtools_protocol_handler.Pass()); | |
| 901 } | 877 } |
| 902 | 878 |
| 903 net::SSLConfigService* ProfileImpl::GetSSLConfigService() { | 879 net::SSLConfigService* ProfileImpl::GetSSLConfigService() { |
| 904 // If ssl_config_service_manager_ is null, this typically means that some | 880 // If ssl_config_service_manager_ is null, this typically means that some |
| 905 // ProfileKeyedService is trying to create a RequestContext at startup, but | 881 // ProfileKeyedService is trying to create a RequestContext at startup, but |
| 906 // SSLConfigServiceManager is not initialized until DoFinalInit() which is | 882 // SSLConfigServiceManager is not initialized until DoFinalInit() which is |
| 907 // invoked after all ProfileKeyedServices have been initialized (see | 883 // invoked after all ProfileKeyedServices have been initialized (see |
| 908 // http://crbug.com/171406). | 884 // http://crbug.com/171406). |
| 909 DCHECK(ssl_config_service_manager_.get()) << | 885 DCHECK(ssl_config_service_manager_.get()) << |
| 910 "SSLConfigServiceManager is not initialized yet"; | 886 "SSLConfigServiceManager is not initialized yet"; |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1182 base::FilePath* cache_path, | 1158 base::FilePath* cache_path, |
| 1183 int* max_size) { | 1159 int* max_size) { |
| 1184 DCHECK(cache_path); | 1160 DCHECK(cache_path); |
| 1185 DCHECK(max_size); | 1161 DCHECK(max_size); |
| 1186 base::FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); | 1162 base::FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); |
| 1187 if (!path.empty()) | 1163 if (!path.empty()) |
| 1188 *cache_path = path; | 1164 *cache_path = path; |
| 1189 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1165 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
| 1190 prefs_->GetInteger(prefs::kDiskCacheSize); | 1166 prefs_->GetInteger(prefs::kDiskCacheSize); |
| 1191 } | 1167 } |
| OLD | NEW |