Index: content/browser/renderer_host/resource_dispatcher_host.h |
=================================================================== |
--- content/browser/renderer_host/resource_dispatcher_host.h (revision 116798) |
+++ content/browser/renderer_host/resource_dispatcher_host.h (working copy) |
@@ -59,16 +59,29 @@ |
class CONTENT_EXPORT ResourceDispatcherHost : public net::URLRequest::Delegate { |
public: |
- explicit ResourceDispatcherHost( |
- const ResourceQueue::DelegateSet& resource_queue_delegates); |
+ ResourceDispatcherHost(); |
virtual ~ResourceDispatcherHost(); |
- void Initialize(); |
+ // Returns the current ResourceDispatcherHost, creating it if necessary. The |
+ // first time this is called must be on the UI thread, but after that it can |
+ // be called from the IO thread as well. |
+ static ResourceDispatcherHost* Get(); |
+ // Returns true if the ResourceDispatcherHost has been created (i.e. Get() has |
+ // been called). |
+ static bool IsCreated(); |
+ |
// Puts the resource dispatcher host in an inactive state (unable to begin |
// new requests). Cancels all pending requests. |
void Shutdown(); |
+ // Destructs the current ResourceDispatcherHost. |
+ void Destruct(); |
+ |
+ // Adds a delegate that can delay requests. This should be called early, i.e. |
+ // in the ContentBrowserClient::ResourceDispatcherHostCreated callback. |
+ void AddResourceQueueDelegate(ResourceQueueDelegate* delegate); |
+ |
// Returns true if the message was a resource message that was processed. |
// If it was, message_was_ok will be false iff the message was corrupt. |
bool OnMessageReceived(const IPC::Message& message, |
@@ -462,6 +475,9 @@ |
// Handles the resource requests from the moment we want to start them. |
ResourceQueue resource_queue_; |
+ // Used temporarily during construction. |
+ ResourceQueue::DelegateSet* temporarily_delegate_set_; |
+ |
// We own the download file writing thread and manager |
scoped_refptr<DownloadFileManager> download_file_manager_; |