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 14 matching lines...) Expand all Loading... | |
25 class SpecialStoragePolicy; | 25 class SpecialStoragePolicy; |
26 } // namespace quota | 26 } // namespace quota |
27 | 27 |
28 class ProfileImplIOData : public ProfileIOData { | 28 class ProfileImplIOData : public ProfileIOData { |
29 public: | 29 public: |
30 class Handle { | 30 class Handle { |
31 public: | 31 public: |
32 explicit Handle(Profile* profile); | 32 explicit Handle(Profile* profile); |
33 ~Handle(); | 33 ~Handle(); |
34 | 34 |
35 bool HasMainRequestContext() const { | 35 bool HasMainRequestContext() const { |
awong
2012/12/13 01:06:15
I think this function isn't used. Can we remove?
pauljensen
2012/12/13 17:58:44
Done.
| |
36 return main_request_context_getter_ != NULL; | 36 return main_request_context_getter_ != NULL; |
37 } | 37 } |
38 | 38 |
39 // Init() must be called before ~Handle(). It records all the necessary | 39 // Init() must be called before ~Handle(). It records most of the |
40 // parameters needed to construct a ChromeURLRequestContextGetter. | 40 // parameters needed to construct a ChromeURLRequestContextGetter. |
41 void Init(const FilePath& cookie_path, | 41 void Init(const FilePath& cookie_path, |
42 const FilePath& server_bound_cert_path, | 42 const FilePath& server_bound_cert_path, |
43 const FilePath& cache_path, | 43 const FilePath& cache_path, |
44 int cache_max_size, | 44 int cache_max_size, |
45 const FilePath& media_cache_path, | 45 const FilePath& media_cache_path, |
46 int media_cache_max_size, | 46 int media_cache_max_size, |
47 const FilePath& extensions_cookie_path, | 47 const FilePath& extensions_cookie_path, |
48 const FilePath& profile_path, | 48 const FilePath& profile_path, |
49 const FilePath& infinite_cache_path, | 49 const FilePath& infinite_cache_path, |
50 chrome_browser_net::Predictor* predictor, | 50 chrome_browser_net::Predictor* predictor, |
51 PrefService* local_state, | |
52 IOThread* io_thread, | |
53 bool restore_old_session_cookies, | 51 bool restore_old_session_cookies, |
54 quota::SpecialStoragePolicy* special_storage_policy); | 52 quota::SpecialStoragePolicy* special_storage_policy); |
55 | 53 |
56 base::Callback<ChromeURLDataManagerBackend*(void)> | 54 base::Callback<ChromeURLDataManagerBackend*(void)> |
57 GetChromeURLDataManagerBackendGetter() const; | 55 GetChromeURLDataManagerBackendGetter() const; |
58 content::ResourceContext* GetResourceContext() const; | 56 content::ResourceContext* GetResourceContext() const; |
59 // GetResourceContextNoInit() does not call LazyInitialize() so it can be | 57 // GetResourceContextNoInit() does not call LazyInitialize() so it can be |
60 // safely be used during initialization. | 58 // safely be used during initialization. |
61 content::ResourceContext* GetResourceContextNoInit() const; | 59 content::ResourceContext* GetResourceContextNoInit() const; |
62 scoped_refptr<ChromeURLRequestContextGetter> | 60 scoped_refptr<ChromeURLRequestContextGetter> |
63 GetMainRequestContextGetter() const; | 61 GetMainRequestContextGetter() const; |
64 scoped_refptr<ChromeURLRequestContextGetter> | 62 scoped_refptr<ChromeURLRequestContextGetter> |
63 CreateMainRequestContextGetter( | |
awong
2012/12/13 01:06:15
Can we group these Create functions separately fro
pauljensen
2012/12/13 17:58:44
Done.
| |
64 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
65 blob_protocol_handler, | |
66 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
67 file_system_protocol_handler, | |
68 scoped_ptr<net::URLRequestJobFactory::Interceptor> | |
69 developer_protocol_handler, | |
70 PrefService* local_state, | |
71 IOThread* io_thread) const; | |
72 scoped_refptr<ChromeURLRequestContextGetter> | |
65 GetMediaRequestContextGetter() const; | 73 GetMediaRequestContextGetter() const; |
66 scoped_refptr<ChromeURLRequestContextGetter> | 74 scoped_refptr<ChromeURLRequestContextGetter> |
67 GetExtensionsRequestContextGetter() const; | 75 GetExtensionsRequestContextGetter() const; |
68 scoped_refptr<ChromeURLRequestContextGetter> | 76 scoped_refptr<ChromeURLRequestContextGetter> |
69 GetIsolatedAppRequestContextGetter( | 77 CreateIsolatedAppRequestContextGetter( |
70 const FilePath& partition_path, | 78 const FilePath& partition_path, |
71 bool in_memory) const; | 79 bool in_memory, |
80 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
81 blob_protocol_handler, | |
82 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
83 file_system_protocol_handler, | |
84 scoped_ptr<net::URLRequestJobFactory::Interceptor> | |
85 developer_protocol_handler) const; | |
72 scoped_refptr<ChromeURLRequestContextGetter> | 86 scoped_refptr<ChromeURLRequestContextGetter> |
73 GetIsolatedMediaRequestContextGetter( | 87 GetIsolatedMediaRequestContextGetter( |
74 const FilePath& partition_path, | 88 const FilePath& partition_path, |
75 bool in_memory) const; | 89 bool in_memory) const; |
76 | 90 |
77 // Deletes all network related data since |time|. It deletes transport | 91 // Deletes all network related data since |time|. It deletes transport |
78 // security state since |time| and also deletes HttpServerProperties data. | 92 // security state since |time| and also deletes HttpServerProperties data. |
79 // Works asynchronously, however if the |completion| callback is non-null, | 93 // Works asynchronously, however if the |completion| callback is non-null, |
80 // it will be posted on the UI thread once the removal process completes. | 94 // it will be posted on the UI thread once the removal process completes. |
81 void ClearNetworkingHistorySince(base::Time time, | 95 void ClearNetworkingHistorySince(base::Time time, |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
137 bool restore_old_session_cookies; | 151 bool restore_old_session_cookies; |
138 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy; | 152 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy; |
139 }; | 153 }; |
140 | 154 |
141 typedef base::hash_map<std::string, net::HttpTransactionFactory* > | 155 typedef base::hash_map<std::string, net::HttpTransactionFactory* > |
142 HttpTransactionFactoryMap; | 156 HttpTransactionFactoryMap; |
143 | 157 |
144 ProfileImplIOData(); | 158 ProfileImplIOData(); |
145 virtual ~ProfileImplIOData(); | 159 virtual ~ProfileImplIOData(); |
146 | 160 |
147 virtual void LazyInitializeInternal( | 161 virtual void InitializeInternal( |
148 ProfileParams* profile_params) const OVERRIDE; | 162 ProfileParams* profile_params, |
163 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
164 blob_protocol_handler, | |
165 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
166 file_system_protocol_handler, | |
167 scoped_ptr<net::URLRequestJobFactory::Interceptor> | |
168 developer_protocol_handler) const OVERRIDE; | |
149 virtual void InitializeExtensionsRequestContext( | 169 virtual void InitializeExtensionsRequestContext( |
150 ProfileParams* profile_params) const OVERRIDE; | 170 ProfileParams* profile_params) const OVERRIDE; |
151 virtual ChromeURLRequestContext* InitializeAppRequestContext( | 171 virtual ChromeURLRequestContext* InitializeAppRequestContext( |
152 ChromeURLRequestContext* main_context, | 172 ChromeURLRequestContext* main_context, |
153 const StoragePartitionDescriptor& partition_descriptor, | 173 const StoragePartitionDescriptor& partition_descriptor, |
154 scoped_ptr<net::URLRequestJobFactory::Interceptor> | 174 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
155 protocol_handler_interceptor) const OVERRIDE; | 175 protocol_handler_interceptor, |
176 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
177 blob_protocol_handler, | |
178 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
179 file_system_protocol_handler, | |
180 scoped_ptr<net::URLRequestJobFactory::Interceptor> | |
181 developer_protocol_handler) const OVERRIDE; | |
156 virtual ChromeURLRequestContext* InitializeMediaRequestContext( | 182 virtual ChromeURLRequestContext* InitializeMediaRequestContext( |
157 ChromeURLRequestContext* original_context, | 183 ChromeURLRequestContext* original_context, |
158 const StoragePartitionDescriptor& partition_descriptor) const OVERRIDE; | 184 const StoragePartitionDescriptor& partition_descriptor) const OVERRIDE; |
159 virtual ChromeURLRequestContext* | 185 virtual ChromeURLRequestContext* |
160 AcquireMediaRequestContext() const OVERRIDE; | 186 AcquireMediaRequestContext() const OVERRIDE; |
161 virtual ChromeURLRequestContext* | 187 virtual ChromeURLRequestContext* |
162 AcquireIsolatedAppRequestContext( | 188 AcquireIsolatedAppRequestContext( |
163 ChromeURLRequestContext* main_context, | 189 ChromeURLRequestContext* main_context, |
164 const StoragePartitionDescriptor& partition_descriptor, | 190 const StoragePartitionDescriptor& partition_descriptor, |
165 scoped_ptr<net::URLRequestJobFactory::Interceptor> | 191 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
166 protocol_handler_interceptor) const OVERRIDE; | 192 protocol_handler_interceptor, |
193 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
194 blob_protocol_handler, | |
195 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
196 file_system_protocol_handler, | |
197 scoped_ptr<net::URLRequestJobFactory::Interceptor> | |
198 developer_protocol_handler) const OVERRIDE; | |
167 virtual ChromeURLRequestContext* | 199 virtual ChromeURLRequestContext* |
168 AcquireIsolatedMediaRequestContext( | 200 AcquireIsolatedMediaRequestContext( |
169 ChromeURLRequestContext* app_context, | 201 ChromeURLRequestContext* app_context, |
170 const StoragePartitionDescriptor& partition_descriptor) | 202 const StoragePartitionDescriptor& partition_descriptor) |
171 const OVERRIDE; | 203 const OVERRIDE; |
172 virtual chrome_browser_net::LoadTimeStats* GetLoadTimeStats( | 204 virtual chrome_browser_net::LoadTimeStats* GetLoadTimeStats( |
173 IOThread::Globals* io_thread_globals) const OVERRIDE; | 205 IOThread::Globals* io_thread_globals) const OVERRIDE; |
174 | 206 |
175 void SetUpJobFactory(net::URLRequestJobFactoryImpl* job_factory, | 207 void SetUpJobFactory(net::URLRequestJobFactoryImpl* job_factory, |
176 scoped_ptr<net::URLRequestJobFactory::Interceptor> | 208 scoped_ptr<net::URLRequestJobFactory::Interceptor> |
(...skipping 29 matching lines...) Expand all Loading... | |
206 | 238 |
207 // Parameters needed for isolated apps. | 239 // Parameters needed for isolated apps. |
208 FilePath profile_path_; | 240 FilePath profile_path_; |
209 int app_cache_max_size_; | 241 int app_cache_max_size_; |
210 int app_media_cache_max_size_; | 242 int app_media_cache_max_size_; |
211 | 243 |
212 DISALLOW_COPY_AND_ASSIGN(ProfileImplIOData); | 244 DISALLOW_COPY_AND_ASSIGN(ProfileImplIOData); |
213 }; | 245 }; |
214 | 246 |
215 #endif // CHROME_BROWSER_PROFILES_PROFILE_IMPL_IO_DATA_H_ | 247 #endif // CHROME_BROWSER_PROFILES_PROFILE_IMPL_IO_DATA_H_ |
OLD | NEW |