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_IO_DATA_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
6 #define CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ | 6 #define CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // Called by Profile. | 92 // Called by Profile. |
93 content::ResourceContext* GetResourceContext() const; | 93 content::ResourceContext* GetResourceContext() const; |
94 | 94 |
95 // Initializes the ProfileIOData object and primes the RequestContext | 95 // Initializes the ProfileIOData object and primes the RequestContext |
96 // generation. Must be called prior to any of the Get*() methods other than | 96 // generation. Must be called prior to any of the Get*() methods other than |
97 // GetResouceContext or GetMetricsEnabledStateOnIOThread. | 97 // GetResouceContext or GetMetricsEnabledStateOnIOThread. |
98 void Init(content::ProtocolHandlerMap* protocol_handlers) const; | 98 void Init(content::ProtocolHandlerMap* protocol_handlers) const; |
99 | 99 |
100 ChromeURLRequestContext* GetMainRequestContext() const; | 100 ChromeURLRequestContext* GetMainRequestContext() const; |
101 ChromeURLRequestContext* GetMediaRequestContext() const; | 101 ChromeURLRequestContext* GetMediaRequestContext() const; |
| 102 ChromeURLRequestContext* GetExtensionsRequestContext() const; |
102 ChromeURLRequestContext* GetIsolatedAppRequestContext( | 103 ChromeURLRequestContext* GetIsolatedAppRequestContext( |
103 ChromeURLRequestContext* main_context, | 104 ChromeURLRequestContext* main_context, |
104 const StoragePartitionDescriptor& partition_descriptor, | 105 const StoragePartitionDescriptor& partition_descriptor, |
105 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> | 106 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
106 protocol_handler_interceptor, | 107 protocol_handler_interceptor, |
107 content::ProtocolHandlerMap* protocol_handlers) const; | 108 content::ProtocolHandlerMap* protocol_handlers) const; |
108 ChromeURLRequestContext* GetIsolatedMediaRequestContext( | 109 ChromeURLRequestContext* GetIsolatedMediaRequestContext( |
109 ChromeURLRequestContext* app_context, | 110 ChromeURLRequestContext* app_context, |
110 const StoragePartitionDescriptor& partition_descriptor) const; | 111 const StoragePartitionDescriptor& partition_descriptor) const; |
111 | 112 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 } | 146 } |
146 | 147 |
147 void set_reverse_autologin_pending_email(const std::string& email) { | 148 void set_reverse_autologin_pending_email(const std::string& email) { |
148 reverse_autologin_pending_email_ = email; | 149 reverse_autologin_pending_email_ = email; |
149 } | 150 } |
150 | 151 |
151 StringListPrefMember* one_click_signin_rejected_email_list() const { | 152 StringListPrefMember* one_click_signin_rejected_email_list() const { |
152 return &one_click_signin_rejected_email_list_; | 153 return &one_click_signin_rejected_email_list_; |
153 } | 154 } |
154 | 155 |
| 156 ChromeURLRequestContext* extensions_request_context() const { |
| 157 return extensions_request_context_.get(); |
| 158 } |
| 159 |
155 BooleanPrefMember* safe_browsing_enabled() const { | 160 BooleanPrefMember* safe_browsing_enabled() const { |
156 return &safe_browsing_enabled_; | 161 return &safe_browsing_enabled_; |
157 } | 162 } |
158 | 163 |
159 BooleanPrefMember* printing_enabled() const { | 164 BooleanPrefMember* printing_enabled() const { |
160 return &printing_enabled_; | 165 return &printing_enabled_; |
161 } | 166 } |
162 | 167 |
163 BooleanPrefMember* sync_disabled() const { | 168 BooleanPrefMember* sync_disabled() const { |
164 return &sync_disabled_; | 169 return &sync_disabled_; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 scoped_ptr<net::HttpTransactionFactory> http_factory_; | 218 scoped_ptr<net::HttpTransactionFactory> http_factory_; |
214 }; | 219 }; |
215 | 220 |
216 // A URLRequestContext for apps that owns its cookie store and HTTP factory, | 221 // A URLRequestContext for apps that owns its cookie store and HTTP factory, |
217 // to ensure they are deleted. | 222 // to ensure they are deleted. |
218 class AppRequestContext : public ChromeURLRequestContext { | 223 class AppRequestContext : public ChromeURLRequestContext { |
219 public: | 224 public: |
220 explicit AppRequestContext( | 225 explicit AppRequestContext( |
221 chrome_browser_net::LoadTimeStats* load_time_stats); | 226 chrome_browser_net::LoadTimeStats* load_time_stats); |
222 | 227 |
| 228 void SetCookieStore(net::CookieStore* cookie_store); |
223 void SetHttpTransactionFactory( | 229 void SetHttpTransactionFactory( |
224 scoped_ptr<net::HttpTransactionFactory> http_factory); | 230 scoped_ptr<net::HttpTransactionFactory> http_factory); |
225 void SetJobFactory(scoped_ptr<net::URLRequestJobFactory> job_factory); | 231 void SetJobFactory(scoped_ptr<net::URLRequestJobFactory> job_factory); |
226 | 232 |
227 private: | 233 private: |
228 virtual ~AppRequestContext(); | 234 virtual ~AppRequestContext(); |
229 | 235 |
| 236 scoped_refptr<net::CookieStore> cookie_store_; |
230 scoped_ptr<net::HttpTransactionFactory> http_factory_; | 237 scoped_ptr<net::HttpTransactionFactory> http_factory_; |
231 scoped_ptr<net::URLRequestJobFactory> job_factory_; | 238 scoped_ptr<net::URLRequestJobFactory> job_factory_; |
232 }; | 239 }; |
233 | 240 |
234 // Created on the UI thread, read on the IO thread during ProfileIOData lazy | 241 // Created on the UI thread, read on the IO thread during ProfileIOData lazy |
235 // initialization. | 242 // initialization. |
236 struct ProfileParams { | 243 struct ProfileParams { |
237 ProfileParams(); | 244 ProfileParams(); |
238 ~ProfileParams(); | 245 ~ProfileParams(); |
239 | 246 |
240 base::FilePath path; | 247 base::FilePath path; |
241 IOThread* io_thread; | 248 IOThread* io_thread; |
242 scoped_refptr<CookieSettings> cookie_settings; | 249 scoped_refptr<CookieSettings> cookie_settings; |
243 scoped_refptr<HostContentSettingsMap> host_content_settings_map; | 250 scoped_refptr<HostContentSettingsMap> host_content_settings_map; |
244 scoped_refptr<net::SSLConfigService> ssl_config_service; | 251 scoped_refptr<net::SSLConfigService> ssl_config_service; |
| 252 scoped_refptr<net::CookieMonster::Delegate> cookie_monster_delegate; |
245 scoped_refptr<ExtensionInfoMap> extension_info_map; | 253 scoped_refptr<ExtensionInfoMap> extension_info_map; |
246 scoped_ptr<chrome_browser_net::ResourcePrefetchPredictorObserver> | 254 scoped_ptr<chrome_browser_net::ResourcePrefetchPredictorObserver> |
247 resource_prefetch_predictor_observer_; | 255 resource_prefetch_predictor_observer_; |
248 | 256 |
249 #if defined(ENABLE_NOTIFICATIONS) | 257 #if defined(ENABLE_NOTIFICATIONS) |
250 DesktopNotificationService* notification_service; | 258 DesktopNotificationService* notification_service; |
251 #endif | 259 #endif |
252 | 260 |
253 // This pointer exists only as a means of conveying a url job factory | 261 // This pointer exists only as a means of conveying a url job factory |
254 // pointer from the protocol handler registry on the UI thread to the | 262 // pointer from the protocol handler registry on the UI thread to the |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 // -------------------------------------------- | 385 // -------------------------------------------- |
378 // Virtual interface for subtypes to implement: | 386 // Virtual interface for subtypes to implement: |
379 // -------------------------------------------- | 387 // -------------------------------------------- |
380 | 388 |
381 // Does the actual initialization of the ProfileIOData subtype. Subtypes | 389 // Does the actual initialization of the ProfileIOData subtype. Subtypes |
382 // should use the static helper functions above to implement this. | 390 // should use the static helper functions above to implement this. |
383 virtual void InitializeInternal( | 391 virtual void InitializeInternal( |
384 ProfileParams* profile_params, | 392 ProfileParams* profile_params, |
385 content::ProtocolHandlerMap* protocol_handlers) const = 0; | 393 content::ProtocolHandlerMap* protocol_handlers) const = 0; |
386 | 394 |
| 395 // Initializes the RequestContext for extensions. |
| 396 virtual void InitializeExtensionsRequestContext( |
| 397 ProfileParams* profile_params) const = 0; |
387 // Does an on-demand initialization of a RequestContext for the given | 398 // Does an on-demand initialization of a RequestContext for the given |
388 // isolated app. | 399 // isolated app. |
389 virtual ChromeURLRequestContext* InitializeAppRequestContext( | 400 virtual ChromeURLRequestContext* InitializeAppRequestContext( |
390 ChromeURLRequestContext* main_context, | 401 ChromeURLRequestContext* main_context, |
391 const StoragePartitionDescriptor& details, | 402 const StoragePartitionDescriptor& details, |
392 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> | 403 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
393 protocol_handler_interceptor, | 404 protocol_handler_interceptor, |
394 content::ProtocolHandlerMap* protocol_handlers) const = 0; | 405 content::ProtocolHandlerMap* protocol_handlers) const = 0; |
395 | 406 |
396 // Does an on-demand initialization of a media RequestContext for the given | 407 // Does an on-demand initialization of a media RequestContext for the given |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 #if defined(ENABLE_NOTIFICATIONS) | 503 #if defined(ENABLE_NOTIFICATIONS) |
493 mutable DesktopNotificationService* notification_service_; | 504 mutable DesktopNotificationService* notification_service_; |
494 #endif | 505 #endif |
495 | 506 |
496 mutable scoped_ptr<TransportSecurityPersister> | 507 mutable scoped_ptr<TransportSecurityPersister> |
497 transport_security_persister_; | 508 transport_security_persister_; |
498 | 509 |
499 // These are only valid in between LazyInitialize() and their accessor being | 510 // These are only valid in between LazyInitialize() and their accessor being |
500 // called. | 511 // called. |
501 mutable scoped_ptr<ChromeURLRequestContext> main_request_context_; | 512 mutable scoped_ptr<ChromeURLRequestContext> main_request_context_; |
| 513 mutable scoped_ptr<ChromeURLRequestContext> extensions_request_context_; |
502 // One URLRequestContext per isolated app for main and media requests. | 514 // One URLRequestContext per isolated app for main and media requests. |
503 mutable URLRequestContextMap app_request_context_map_; | 515 mutable URLRequestContextMap app_request_context_map_; |
504 mutable URLRequestContextMap isolated_media_request_context_map_; | 516 mutable URLRequestContextMap isolated_media_request_context_map_; |
505 | 517 |
506 mutable scoped_ptr<ResourceContext> resource_context_; | 518 mutable scoped_ptr<ResourceContext> resource_context_; |
507 | 519 |
508 mutable scoped_refptr<CookieSettings> cookie_settings_; | 520 mutable scoped_refptr<CookieSettings> cookie_settings_; |
509 | 521 |
510 mutable scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 522 mutable scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
511 | 523 |
(...skipping 11 matching lines...) Expand all Loading... |
523 | 535 |
524 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. | 536 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. |
525 bool initialized_on_UI_thread_; | 537 bool initialized_on_UI_thread_; |
526 | 538 |
527 bool is_incognito_; | 539 bool is_incognito_; |
528 | 540 |
529 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); | 541 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); |
530 }; | 542 }; |
531 | 543 |
532 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ | 544 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
OLD | NEW |