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