| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 // -------------------------------------------- | 379 // -------------------------------------------- |
| 388 // Virtual interface for subtypes to implement: | 380 // Virtual interface for subtypes to implement: |
| 389 // -------------------------------------------- | 381 // -------------------------------------------- |
| 390 | 382 |
| 391 // Does the actual initialization of the ProfileIOData subtype. Subtypes | 383 // Does the actual initialization of the ProfileIOData subtype. Subtypes |
| 392 // should use the static helper functions above to implement this. | 384 // should use the static helper functions above to implement this. |
| 393 virtual void InitializeInternal( | 385 virtual void InitializeInternal( |
| 394 ProfileParams* profile_params, | 386 ProfileParams* profile_params, |
| 395 content::ProtocolHandlerMap* protocol_handlers) const = 0; | 387 content::ProtocolHandlerMap* protocol_handlers) const = 0; |
| 396 | 388 |
| 397 // Initializes the RequestContext for extensions. | |
| 398 virtual void InitializeExtensionsRequestContext( | |
| 399 ProfileParams* profile_params) const = 0; | |
| 400 // Does an on-demand initialization of a RequestContext for the given | 389 // Does an on-demand initialization of a RequestContext for the given |
| 401 // isolated app. | 390 // isolated app. |
| 402 virtual ChromeURLRequestContext* InitializeAppRequestContext( | 391 virtual ChromeURLRequestContext* InitializeAppRequestContext( |
| 403 ChromeURLRequestContext* main_context, | 392 ChromeURLRequestContext* main_context, |
| 404 const StoragePartitionDescriptor& details, | 393 const StoragePartitionDescriptor& details, |
| 405 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> | 394 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
| 406 protocol_handler_interceptor, | 395 protocol_handler_interceptor, |
| 407 content::ProtocolHandlerMap* protocol_handlers) const = 0; | 396 content::ProtocolHandlerMap* protocol_handlers) const = 0; |
| 408 | 397 |
| 409 // Does an on-demand initialization of a media RequestContext for the given | 398 // 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... |
| 505 #if defined(ENABLE_NOTIFICATIONS) | 494 #if defined(ENABLE_NOTIFICATIONS) |
| 506 mutable DesktopNotificationService* notification_service_; | 495 mutable DesktopNotificationService* notification_service_; |
| 507 #endif | 496 #endif |
| 508 | 497 |
| 509 mutable scoped_ptr<TransportSecurityPersister> | 498 mutable scoped_ptr<TransportSecurityPersister> |
| 510 transport_security_persister_; | 499 transport_security_persister_; |
| 511 | 500 |
| 512 // These are only valid in between LazyInitialize() and their accessor being | 501 // These are only valid in between LazyInitialize() and their accessor being |
| 513 // called. | 502 // called. |
| 514 mutable scoped_ptr<ChromeURLRequestContext> main_request_context_; | 503 mutable scoped_ptr<ChromeURLRequestContext> main_request_context_; |
| 515 mutable scoped_ptr<ChromeURLRequestContext> extensions_request_context_; | |
| 516 // One URLRequestContext per isolated app for main and media requests. | 504 // One URLRequestContext per isolated app for main and media requests. |
| 517 mutable URLRequestContextMap app_request_context_map_; | 505 mutable URLRequestContextMap app_request_context_map_; |
| 518 mutable URLRequestContextMap isolated_media_request_context_map_; | 506 mutable URLRequestContextMap isolated_media_request_context_map_; |
| 519 | 507 |
| 520 mutable scoped_ptr<ResourceContext> resource_context_; | 508 mutable scoped_ptr<ResourceContext> resource_context_; |
| 521 | 509 |
| 522 mutable scoped_refptr<CookieSettings> cookie_settings_; | 510 mutable scoped_refptr<CookieSettings> cookie_settings_; |
| 523 | 511 |
| 524 mutable scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 512 mutable scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
| 525 | 513 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 537 | 525 |
| 538 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. | 526 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. |
| 539 bool initialized_on_UI_thread_; | 527 bool initialized_on_UI_thread_; |
| 540 | 528 |
| 541 bool is_incognito_; | 529 bool is_incognito_; |
| 542 | 530 |
| 543 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); | 531 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); |
| 544 }; | 532 }; |
| 545 | 533 |
| 546 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ | 534 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
| OLD | NEW |