| 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 #ifndef CHROME_BROWSER_PROFILES_PROFILE_IMPL_IO_DATA_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_IMPL_IO_DATA_H_ |
| 6 #define CHROME_BROWSER_PROFILES_PROFILE_IMPL_IO_DATA_H_ | 6 #define CHROME_BROWSER_PROFILES_PROFILE_IMPL_IO_DATA_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // safely be used during initialization. | 59 // safely be used during initialization. |
| 60 content::ResourceContext* GetResourceContextNoInit() const; | 60 content::ResourceContext* GetResourceContextNoInit() const; |
| 61 scoped_refptr<ChromeURLRequestContextGetter> | 61 scoped_refptr<ChromeURLRequestContextGetter> |
| 62 GetMainRequestContextGetter() const; | 62 GetMainRequestContextGetter() const; |
| 63 scoped_refptr<ChromeURLRequestContextGetter> | 63 scoped_refptr<ChromeURLRequestContextGetter> |
| 64 GetMediaRequestContextGetter() const; | 64 GetMediaRequestContextGetter() const; |
| 65 scoped_refptr<ChromeURLRequestContextGetter> | 65 scoped_refptr<ChromeURLRequestContextGetter> |
| 66 GetExtensionsRequestContextGetter() const; | 66 GetExtensionsRequestContextGetter() const; |
| 67 scoped_refptr<ChromeURLRequestContextGetter> | 67 scoped_refptr<ChromeURLRequestContextGetter> |
| 68 GetIsolatedAppRequestContextGetter( | 68 GetIsolatedAppRequestContextGetter( |
| 69 const std::string& app_id) const; | 69 const StoragePartitionDetails& partition_details) const; |
| 70 scoped_refptr<ChromeURLRequestContextGetter> | 70 scoped_refptr<ChromeURLRequestContextGetter> |
| 71 GetIsolatedMediaRequestContextGetter( | 71 GetIsolatedMediaRequestContextGetter( |
| 72 const std::string& app_id) const; | 72 const StoragePartitionDetails& partition_details) const; |
| 73 | 73 |
| 74 void ClearNetworkingHistorySince(base::Time time); | 74 void ClearNetworkingHistorySince(base::Time time); |
| 75 | 75 |
| 76 private: | 76 private: |
| 77 typedef base::hash_map<std::string, | 77 DefineStoragePartitionDetailsMap( |
| 78 scoped_refptr<ChromeURLRequestContextGetter> > | 78 scoped_refptr<ChromeURLRequestContextGetter>) |
| 79 ChromeURLRequestContextGetterMap; | 79 ChromeURLRequestContextGetterMap; |
| 80 | 80 |
| 81 // Lazily initialize ProfileParams. We do this on the calls to | 81 // Lazily initialize ProfileParams. We do this on the calls to |
| 82 // Get*RequestContextGetter(), so we only initialize ProfileParams right | 82 // Get*RequestContextGetter(), so we only initialize ProfileParams right |
| 83 // before posting a task to the IO thread to start using them. This prevents | 83 // before posting a task to the IO thread to start using them. This prevents |
| 84 // objects that are supposed to be deleted on the IO thread, but are created | 84 // objects that are supposed to be deleted on the IO thread, but are created |
| 85 // on the UI thread from being unnecessarily initialized. | 85 // on the UI thread from being unnecessarily initialized. |
| 86 void LazyInitialize() const; | 86 void LazyInitialize() const; |
| 87 | 87 |
| 88 // Ordering is important here. Do not reorder unless you know what you're | 88 // Ordering is important here. Do not reorder unless you know what you're |
| 89 // doing. We need to release |io_data_| *before* the getters, because we | 89 // doing. We need to release |io_data_| *before* the getters, because we |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 typedef base::hash_map<std::string, net::HttpTransactionFactory* > | 132 typedef base::hash_map<std::string, net::HttpTransactionFactory* > |
| 133 HttpTransactionFactoryMap; | 133 HttpTransactionFactoryMap; |
| 134 | 134 |
| 135 ProfileImplIOData(); | 135 ProfileImplIOData(); |
| 136 virtual ~ProfileImplIOData(); | 136 virtual ~ProfileImplIOData(); |
| 137 | 137 |
| 138 virtual void LazyInitializeInternal( | 138 virtual void LazyInitializeInternal( |
| 139 ProfileParams* profile_params) const OVERRIDE; | 139 ProfileParams* profile_params) const OVERRIDE; |
| 140 virtual ChromeURLRequestContext* InitializeAppRequestContext( | 140 virtual ChromeURLRequestContext* InitializeAppRequestContext( |
| 141 ChromeURLRequestContext* main_context, | 141 ChromeURLRequestContext* main_context, |
| 142 const std::string& app_id, | 142 const StoragePartitionDetails& partition_details, |
| 143 scoped_ptr<net::URLRequestJobFactory::Interceptor> | 143 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
| 144 protocol_handler_interceptor) const OVERRIDE; | 144 protocol_handler_interceptor) const OVERRIDE; |
| 145 virtual ChromeURLRequestContext* InitializeMediaRequestContext( | 145 virtual ChromeURLRequestContext* InitializeMediaRequestContext( |
| 146 ChromeURLRequestContext* original_context, | 146 ChromeURLRequestContext* original_context, |
| 147 const std::string& app_id) const OVERRIDE; | 147 const StoragePartitionDetails& partition_details) const OVERRIDE; |
| 148 virtual ChromeURLRequestContext* | 148 virtual ChromeURLRequestContext* |
| 149 AcquireMediaRequestContext() const OVERRIDE; | 149 AcquireMediaRequestContext() const OVERRIDE; |
| 150 virtual ChromeURLRequestContext* | 150 virtual ChromeURLRequestContext* |
| 151 AcquireIsolatedAppRequestContext( | 151 AcquireIsolatedAppRequestContext( |
| 152 ChromeURLRequestContext* main_context, | 152 ChromeURLRequestContext* main_context, |
| 153 const std::string& app_id, | 153 const StoragePartitionDetails& partition_details, |
| 154 scoped_ptr<net::URLRequestJobFactory::Interceptor> | 154 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
| 155 protocol_handler_interceptor) const OVERRIDE; | 155 protocol_handler_interceptor) const OVERRIDE; |
| 156 virtual ChromeURLRequestContext* | 156 virtual ChromeURLRequestContext* |
| 157 AcquireIsolatedMediaRequestContext( | 157 AcquireIsolatedMediaRequestContext( |
| 158 ChromeURLRequestContext* app_context, | 158 ChromeURLRequestContext* app_context, |
| 159 const std::string& app_id) const OVERRIDE; | 159 const StoragePartitionDetails& partition_details) const OVERRIDE; |
| 160 virtual chrome_browser_net::LoadTimeStats* GetLoadTimeStats( | 160 virtual chrome_browser_net::LoadTimeStats* GetLoadTimeStats( |
| 161 IOThread::Globals* io_thread_globals) const OVERRIDE; | 161 IOThread::Globals* io_thread_globals) const OVERRIDE; |
| 162 | 162 |
| 163 void SetUpJobFactory(net::URLRequestJobFactory* job_factory, | 163 void SetUpJobFactory(net::URLRequestJobFactory* job_factory, |
| 164 scoped_ptr<net::URLRequestJobFactory::Interceptor> | 164 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
| 165 protocol_handler_interceptor, | 165 protocol_handler_interceptor, |
| 166 net::NetworkDelegate* network_delegate, | 166 net::NetworkDelegate* network_delegate, |
| 167 net::FtpTransactionFactory* ftp_transaction_factory, | 167 net::FtpTransactionFactory* ftp_transaction_factory, |
| 168 net::FtpAuthCache* ftp_auth_cache) const; | 168 net::FtpAuthCache* ftp_auth_cache) const; |
| 169 | 169 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 185 | 185 |
| 186 // Parameters needed for isolated apps. | 186 // Parameters needed for isolated apps. |
| 187 FilePath profile_path_; | 187 FilePath profile_path_; |
| 188 int app_cache_max_size_; | 188 int app_cache_max_size_; |
| 189 int app_media_cache_max_size_; | 189 int app_media_cache_max_size_; |
| 190 | 190 |
| 191 DISALLOW_COPY_AND_ASSIGN(ProfileImplIOData); | 191 DISALLOW_COPY_AND_ASSIGN(ProfileImplIOData); |
| 192 }; | 192 }; |
| 193 | 193 |
| 194 #endif // CHROME_BROWSER_PROFILES_PROFILE_IMPL_IO_DATA_H_ | 194 #endif // CHROME_BROWSER_PROFILES_PROFILE_IMPL_IO_DATA_H_ |
| OLD | NEW |