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 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 } | 786 } |
787 return otr_prefs_.get(); | 787 return otr_prefs_.get(); |
788 } | 788 } |
789 | 789 |
790 FilePath ProfileImpl::GetPrefFilePath() { | 790 FilePath ProfileImpl::GetPrefFilePath() { |
791 FilePath pref_file_path = path_; | 791 FilePath pref_file_path = path_; |
792 pref_file_path = pref_file_path.Append(chrome::kPreferencesFilename); | 792 pref_file_path = pref_file_path.Append(chrome::kPreferencesFilename); |
793 return pref_file_path; | 793 return pref_file_path; |
794 } | 794 } |
795 | 795 |
| 796 net::URLRequestContextGetter* ProfileImpl::CreateRequestContext( |
| 797 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 798 blob_protocol_handler, |
| 799 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 800 file_system_protocol_handler, |
| 801 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
| 802 developer_protocol_handler) { |
| 803 return io_data_.CreateMainRequestContextGetter( |
| 804 blob_protocol_handler.Pass(), file_system_protocol_handler.Pass(), |
| 805 developer_protocol_handler.Pass()); |
| 806 } |
| 807 |
796 net::URLRequestContextGetter* ProfileImpl::GetRequestContext() { | 808 net::URLRequestContextGetter* ProfileImpl::GetRequestContext() { |
797 return io_data_.GetMainRequestContextGetter(); | 809 return io_data_.GetMainRequestContextGetter(); |
798 } | 810 } |
799 | 811 |
800 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForRenderProcess( | 812 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForRenderProcess( |
801 int renderer_child_id) { | 813 int renderer_child_id) { |
802 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( | 814 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( |
803 renderer_child_id); | 815 renderer_child_id); |
804 | 816 |
805 return rph->GetStoragePartition()->GetURLRequestContext(); | 817 return rph->GetStoragePartition()->GetURLRequestContext(); |
(...skipping 23 matching lines...) Expand all Loading... |
829 } | 841 } |
830 | 842 |
831 content::ResourceContext* ProfileImpl::GetResourceContext() { | 843 content::ResourceContext* ProfileImpl::GetResourceContext() { |
832 return io_data_.GetResourceContext(); | 844 return io_data_.GetResourceContext(); |
833 } | 845 } |
834 | 846 |
835 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForExtensions() { | 847 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForExtensions() { |
836 return io_data_.GetExtensionsRequestContextGetter(); | 848 return io_data_.GetExtensionsRequestContextGetter(); |
837 } | 849 } |
838 | 850 |
839 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForStoragePartition( | 851 net::URLRequestContextGetter* |
| 852 ProfileImpl::CreateRequestContextForStoragePartition( |
840 const FilePath& partition_path, | 853 const FilePath& partition_path, |
841 bool in_memory) { | 854 bool in_memory, |
842 return io_data_.GetIsolatedAppRequestContextGetter(partition_path, in_memory); | 855 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 856 blob_protocol_handler, |
| 857 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 858 file_system_protocol_handler, |
| 859 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
| 860 developer_protocol_handler) { |
| 861 return io_data_.CreateIsolatedAppRequestContextGetter( |
| 862 partition_path, in_memory, blob_protocol_handler.Pass(), |
| 863 file_system_protocol_handler.Pass(), developer_protocol_handler.Pass()); |
843 } | 864 } |
844 | 865 |
845 net::SSLConfigService* ProfileImpl::GetSSLConfigService() { | 866 net::SSLConfigService* ProfileImpl::GetSSLConfigService() { |
846 return ssl_config_service_manager_->Get(); | 867 return ssl_config_service_manager_->Get(); |
847 } | 868 } |
848 | 869 |
849 HostContentSettingsMap* ProfileImpl::GetHostContentSettingsMap() { | 870 HostContentSettingsMap* ProfileImpl::GetHostContentSettingsMap() { |
850 if (!host_content_settings_map_.get()) { | 871 if (!host_content_settings_map_.get()) { |
851 host_content_settings_map_ = new HostContentSettingsMap(GetPrefs(), false); | 872 host_content_settings_map_ = new HostContentSettingsMap(GetPrefs(), false); |
852 } | 873 } |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1151 if (!path.empty()) | 1172 if (!path.empty()) |
1152 *cache_path = path; | 1173 *cache_path = path; |
1153 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1174 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
1154 prefs_->GetInteger(prefs::kDiskCacheSize); | 1175 prefs_->GetInteger(prefs::kDiskCacheSize); |
1155 } | 1176 } |
1156 | 1177 |
1157 base::Callback<ChromeURLDataManagerBackend*(void)> | 1178 base::Callback<ChromeURLDataManagerBackend*(void)> |
1158 ProfileImpl::GetChromeURLDataManagerBackendGetter() const { | 1179 ProfileImpl::GetChromeURLDataManagerBackendGetter() const { |
1159 return io_data_.GetChromeURLDataManagerBackendGetter(); | 1180 return io_data_.GetChromeURLDataManagerBackendGetter(); |
1160 } | 1181 } |
OLD | NEW |