Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: content/browser/renderer_host/resource_dispatcher_host.h

Issue 9150016: Move creation and ownership of ResourceDispatcherHost and PluginService to content. This gives a ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_;

Powered by Google App Engine
This is Rietveld 408576698