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 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 | 499 |
500 InitHostZoomMap(); | 500 InitHostZoomMap(); |
501 | 501 |
502 // Make sure we initialize the ProfileIOData after everything else has been | 502 // Make sure we initialize the ProfileIOData after everything else has been |
503 // initialized that we might be reading from the IO thread. | 503 // initialized that we might be reading from the IO thread. |
504 | 504 |
505 io_data_.Init(cookie_path, server_bound_cert_path, cache_path, | 505 io_data_.Init(cookie_path, server_bound_cert_path, cache_path, |
506 cache_max_size, media_cache_path, media_cache_max_size, | 506 cache_max_size, media_cache_path, media_cache_max_size, |
507 extensions_cookie_path, GetPath(), infinite_cache_path, | 507 extensions_cookie_path, GetPath(), infinite_cache_path, |
508 predictor_, | 508 predictor_, |
509 g_browser_process->local_state(), | |
510 g_browser_process->io_thread(), | |
511 restore_old_session_cookies, | 509 restore_old_session_cookies, |
512 GetSpecialStoragePolicy()); | 510 GetSpecialStoragePolicy()); |
513 | 511 |
514 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( | 512 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( |
515 PluginPrefs::GetForProfile(this), | 513 PluginPrefs::GetForProfile(this), |
516 io_data_.GetResourceContextNoInit()); | 514 io_data_.GetResourceContextNoInit()); |
517 | 515 |
518 // Delay README creation to not impact startup performance. | 516 // Delay README creation to not impact startup performance. |
519 BrowserThread::PostDelayedTask( | 517 BrowserThread::PostDelayedTask( |
520 BrowserThread::FILE, FROM_HERE, | 518 BrowserThread::FILE, FROM_HERE, |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 } | 784 } |
787 return otr_prefs_.get(); | 785 return otr_prefs_.get(); |
788 } | 786 } |
789 | 787 |
790 FilePath ProfileImpl::GetPrefFilePath() { | 788 FilePath ProfileImpl::GetPrefFilePath() { |
791 FilePath pref_file_path = path_; | 789 FilePath pref_file_path = path_; |
792 pref_file_path = pref_file_path.Append(chrome::kPreferencesFilename); | 790 pref_file_path = pref_file_path.Append(chrome::kPreferencesFilename); |
793 return pref_file_path; | 791 return pref_file_path; |
794 } | 792 } |
795 | 793 |
| 794 net::URLRequestContextGetter* ProfileImpl::CreateRequestContext( |
| 795 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 796 blob_protocol_handler, |
| 797 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 798 file_system_protocol_handler, |
| 799 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
| 800 developer_protocol_handler) { |
| 801 return io_data_.CreateMainRequestContextGetter( |
| 802 blob_protocol_handler.Pass(), |
| 803 file_system_protocol_handler.Pass(), |
| 804 developer_protocol_handler.Pass(), |
| 805 g_browser_process->local_state(), |
| 806 g_browser_process->io_thread()); |
| 807 } |
| 808 |
796 net::URLRequestContextGetter* ProfileImpl::GetRequestContext() { | 809 net::URLRequestContextGetter* ProfileImpl::GetRequestContext() { |
797 return io_data_.GetMainRequestContextGetter(); | 810 return io_data_.GetMainRequestContextGetter(); |
798 } | 811 } |
799 | 812 |
800 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForRenderProcess( | 813 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForRenderProcess( |
801 int renderer_child_id) { | 814 int renderer_child_id) { |
802 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( | 815 content::RenderProcessHost* rph = content::RenderProcessHost::FromID( |
803 renderer_child_id); | 816 renderer_child_id); |
804 | 817 |
805 return rph->GetStoragePartition()->GetURLRequestContext(); | 818 return rph->GetStoragePartition()->GetURLRequestContext(); |
(...skipping 23 matching lines...) Expand all Loading... |
829 } | 842 } |
830 | 843 |
831 content::ResourceContext* ProfileImpl::GetResourceContext() { | 844 content::ResourceContext* ProfileImpl::GetResourceContext() { |
832 return io_data_.GetResourceContext(); | 845 return io_data_.GetResourceContext(); |
833 } | 846 } |
834 | 847 |
835 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForExtensions() { | 848 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForExtensions() { |
836 return io_data_.GetExtensionsRequestContextGetter(); | 849 return io_data_.GetExtensionsRequestContextGetter(); |
837 } | 850 } |
838 | 851 |
839 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForStoragePartition( | 852 net::URLRequestContextGetter* |
| 853 ProfileImpl::CreateRequestContextForStoragePartition( |
840 const FilePath& partition_path, | 854 const FilePath& partition_path, |
841 bool in_memory) { | 855 bool in_memory, |
842 return io_data_.GetIsolatedAppRequestContextGetter(partition_path, in_memory); | 856 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 857 blob_protocol_handler, |
| 858 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 859 file_system_protocol_handler, |
| 860 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
| 861 developer_protocol_handler) { |
| 862 return io_data_.CreateIsolatedAppRequestContextGetter( |
| 863 partition_path, in_memory, blob_protocol_handler.Pass(), |
| 864 file_system_protocol_handler.Pass(), developer_protocol_handler.Pass()); |
843 } | 865 } |
844 | 866 |
845 net::SSLConfigService* ProfileImpl::GetSSLConfigService() { | 867 net::SSLConfigService* ProfileImpl::GetSSLConfigService() { |
846 return ssl_config_service_manager_->Get(); | 868 return ssl_config_service_manager_->Get(); |
847 } | 869 } |
848 | 870 |
849 HostContentSettingsMap* ProfileImpl::GetHostContentSettingsMap() { | 871 HostContentSettingsMap* ProfileImpl::GetHostContentSettingsMap() { |
850 if (!host_content_settings_map_.get()) { | 872 if (!host_content_settings_map_.get()) { |
851 host_content_settings_map_ = new HostContentSettingsMap(GetPrefs(), false); | 873 host_content_settings_map_ = new HostContentSettingsMap(GetPrefs(), false); |
852 } | 874 } |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1151 if (!path.empty()) | 1173 if (!path.empty()) |
1152 *cache_path = path; | 1174 *cache_path = path; |
1153 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1175 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
1154 prefs_->GetInteger(prefs::kDiskCacheSize); | 1176 prefs_->GetInteger(prefs::kDiskCacheSize); |
1155 } | 1177 } |
1156 | 1178 |
1157 base::Callback<ChromeURLDataManagerBackend*(void)> | 1179 base::Callback<ChromeURLDataManagerBackend*(void)> |
1158 ProfileImpl::GetChromeURLDataManagerBackendGetter() const { | 1180 ProfileImpl::GetChromeURLDataManagerBackendGetter() const { |
1159 return io_data_.GetChromeURLDataManagerBackendGetter(); | 1181 return io_data_.GetChromeURLDataManagerBackendGetter(); |
1160 } | 1182 } |
OLD | NEW |