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