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