| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 // Initializes the ProfileIOData object and primes the RequestContext | 83 // Initializes the ProfileIOData object and primes the RequestContext |
| 84 // generation. Must be called prior to any of the Get*() methods other than | 84 // generation. Must be called prior to any of the Get*() methods other than |
| 85 // GetResouceContext or GetMetricsEnabledStateOnIOThread. | 85 // GetResouceContext or GetMetricsEnabledStateOnIOThread. |
| 86 void Init( | 86 void Init( |
| 87 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 87 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 88 blob_protocol_handler, | 88 blob_protocol_handler, |
| 89 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 89 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 90 file_system_protocol_handler, | 90 file_system_protocol_handler, |
| 91 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 91 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 92 developer_protocol_handler, | |
| 93 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 94 chrome_protocol_handler, | 92 chrome_protocol_handler, |
| 95 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 93 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 96 chrome_devtools_protocol_handler) const; | 94 chrome_devtools_protocol_handler) const; |
| 97 | 95 |
| 98 ChromeURLRequestContext* GetMainRequestContext() const; | 96 ChromeURLRequestContext* GetMainRequestContext() const; |
| 99 ChromeURLRequestContext* GetMediaRequestContext() const; | 97 ChromeURLRequestContext* GetMediaRequestContext() const; |
| 100 ChromeURLRequestContext* GetExtensionsRequestContext() const; | 98 ChromeURLRequestContext* GetExtensionsRequestContext() const; |
| 101 ChromeURLRequestContext* GetIsolatedAppRequestContext( | 99 ChromeURLRequestContext* GetIsolatedAppRequestContext( |
| 102 ChromeURLRequestContext* main_context, | 100 ChromeURLRequestContext* main_context, |
| 103 const StoragePartitionDescriptor& partition_descriptor, | 101 const StoragePartitionDescriptor& partition_descriptor, |
| 104 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> | 102 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
| 105 protocol_handler_interceptor, | 103 protocol_handler_interceptor, |
| 106 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 104 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 107 blob_protocol_handler, | 105 blob_protocol_handler, |
| 108 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 106 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 109 file_system_protocol_handler, | 107 file_system_protocol_handler, |
| 110 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 108 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 111 developer_protocol_handler, | |
| 112 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 113 chrome_protocol_handler, | 109 chrome_protocol_handler, |
| 114 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 110 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 115 chrome_devtools_protocol_handler) const; | 111 chrome_devtools_protocol_handler) const; |
| 116 ChromeURLRequestContext* GetIsolatedMediaRequestContext( | 112 ChromeURLRequestContext* GetIsolatedMediaRequestContext( |
| 117 ChromeURLRequestContext* app_context, | 113 ChromeURLRequestContext* app_context, |
| 118 const StoragePartitionDescriptor& partition_descriptor) const; | 114 const StoragePartitionDescriptor& partition_descriptor) const; |
| 119 | 115 |
| 120 // These are useful when the Chrome layer is called from the content layer | 116 // These are useful when the Chrome layer is called from the content layer |
| 121 // with a content::ResourceContext, and they want access to Chrome data for | 117 // with a content::ResourceContext, and they want access to Chrome data for |
| 122 // that profile. | 118 // that profile. |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 | 376 |
| 381 // Does the actual initialization of the ProfileIOData subtype. Subtypes | 377 // Does the actual initialization of the ProfileIOData subtype. Subtypes |
| 382 // should use the static helper functions above to implement this. | 378 // should use the static helper functions above to implement this. |
| 383 virtual void InitializeInternal( | 379 virtual void InitializeInternal( |
| 384 ProfileParams* profile_params, | 380 ProfileParams* profile_params, |
| 385 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 381 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 386 blob_protocol_handler, | 382 blob_protocol_handler, |
| 387 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 383 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 388 file_system_protocol_handler, | 384 file_system_protocol_handler, |
| 389 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 385 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 390 developer_protocol_handler, | |
| 391 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 392 chrome_protocol_handler, | 386 chrome_protocol_handler, |
| 393 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 387 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 394 chrome_devtools_protocol_handler) const = 0; | 388 chrome_devtools_protocol_handler) const = 0; |
| 395 | 389 |
| 396 // Initializes the RequestContext for extensions. | 390 // Initializes the RequestContext for extensions. |
| 397 virtual void InitializeExtensionsRequestContext( | 391 virtual void InitializeExtensionsRequestContext( |
| 398 ProfileParams* profile_params) const = 0; | 392 ProfileParams* profile_params) const = 0; |
| 399 // Does an on-demand initialization of a RequestContext for the given | 393 // Does an on-demand initialization of a RequestContext for the given |
| 400 // isolated app. | 394 // isolated app. |
| 401 virtual ChromeURLRequestContext* InitializeAppRequestContext( | 395 virtual ChromeURLRequestContext* InitializeAppRequestContext( |
| 402 ChromeURLRequestContext* main_context, | 396 ChromeURLRequestContext* main_context, |
| 403 const StoragePartitionDescriptor& details, | 397 const StoragePartitionDescriptor& details, |
| 404 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> | 398 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
| 405 protocol_handler_interceptor, | 399 protocol_handler_interceptor, |
| 406 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 400 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 407 blob_protocol_handler, | 401 blob_protocol_handler, |
| 408 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 402 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 409 file_system_protocol_handler, | 403 file_system_protocol_handler, |
| 410 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 404 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 411 developer_protocol_handler, | |
| 412 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 413 chrome_protocol_handler, | 405 chrome_protocol_handler, |
| 414 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 406 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 415 chrome_devtools_protocol_handler) const = 0; | 407 chrome_devtools_protocol_handler) const = 0; |
| 416 | 408 |
| 417 // Does an on-demand initialization of a media RequestContext for the given | 409 // Does an on-demand initialization of a media RequestContext for the given |
| 418 // isolated app. | 410 // isolated app. |
| 419 virtual ChromeURLRequestContext* InitializeMediaRequestContext( | 411 virtual ChromeURLRequestContext* InitializeMediaRequestContext( |
| 420 ChromeURLRequestContext* original_context, | 412 ChromeURLRequestContext* original_context, |
| 421 const StoragePartitionDescriptor& details) const = 0; | 413 const StoragePartitionDescriptor& details) const = 0; |
| 422 | 414 |
| 423 // These functions are used to transfer ownership of the lazily initialized | 415 // These functions are used to transfer ownership of the lazily initialized |
| 424 // context from ProfileIOData to the URLRequestContextGetter. | 416 // context from ProfileIOData to the URLRequestContextGetter. |
| 425 virtual ChromeURLRequestContext* | 417 virtual ChromeURLRequestContext* |
| 426 AcquireMediaRequestContext() const = 0; | 418 AcquireMediaRequestContext() const = 0; |
| 427 virtual ChromeURLRequestContext* | 419 virtual ChromeURLRequestContext* |
| 428 AcquireIsolatedAppRequestContext( | 420 AcquireIsolatedAppRequestContext( |
| 429 ChromeURLRequestContext* main_context, | 421 ChromeURLRequestContext* main_context, |
| 430 const StoragePartitionDescriptor& partition_descriptor, | 422 const StoragePartitionDescriptor& partition_descriptor, |
| 431 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> | 423 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
| 432 protocol_handler_interceptor, | 424 protocol_handler_interceptor, |
| 433 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 425 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 434 blob_protocol_handler, | 426 blob_protocol_handler, |
| 435 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 427 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 436 file_system_protocol_handler, | 428 file_system_protocol_handler, |
| 437 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 429 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 438 developer_protocol_handler, | |
| 439 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | |
| 440 chrome_protocol_handler, | 430 chrome_protocol_handler, |
| 441 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 431 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
| 442 chrome_devtools_protocol_handler) const = 0; | 432 chrome_devtools_protocol_handler) const = 0; |
| 443 virtual ChromeURLRequestContext* | 433 virtual ChromeURLRequestContext* |
| 444 AcquireIsolatedMediaRequestContext( | 434 AcquireIsolatedMediaRequestContext( |
| 445 ChromeURLRequestContext* app_context, | 435 ChromeURLRequestContext* app_context, |
| 446 const StoragePartitionDescriptor& partition_descriptor) const = 0; | 436 const StoragePartitionDescriptor& partition_descriptor) const = 0; |
| 447 | 437 |
| 448 // Returns the LoadTimeStats object to be used for this profile. | 438 // Returns the LoadTimeStats object to be used for this profile. |
| 449 virtual chrome_browser_net::LoadTimeStats* GetLoadTimeStats( | 439 virtual chrome_browser_net::LoadTimeStats* GetLoadTimeStats( |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 | 538 |
| 549 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. | 539 // TODO(jhawkins): Remove once crbug.com/102004 is fixed. |
| 550 bool initialized_on_UI_thread_; | 540 bool initialized_on_UI_thread_; |
| 551 | 541 |
| 552 bool is_incognito_; | 542 bool is_incognito_; |
| 553 | 543 |
| 554 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); | 544 DISALLOW_COPY_AND_ASSIGN(ProfileIOData); |
| 555 }; | 545 }; |
| 556 | 546 |
| 557 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ | 547 #endif // CHROME_BROWSER_PROFILES_PROFILE_IO_DATA_H_ |
| OLD | NEW |