diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-24 21:58:08 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-24 21:58:08 +0000 |
commit | 9d7eed94008640d64ce3e6108829509eaa52c4b1 (patch) | |
tree | b226dc5489acd8fb48fbf88004ce67393ee946a0 /chrome/browser/extensions/extension_host.h | |
parent | 8f37b0fd073dd6ffef654d206f429a9368ef674a (diff) | |
download | chromium_src-9d7eed94008640d64ce3e6108829509eaa52c4b1.zip chromium_src-9d7eed94008640d64ce3e6108829509eaa52c4b1.tar.gz chromium_src-9d7eed94008640d64ce3e6108829509eaa52c4b1.tar.bz2 |
Create renderers for ExtensionHosts one at a time to avoid blocking the UI.
BUG=14040
TEST=Install a bunch of extensions with toolstrips, then restart Chrome. The UI should be responsive while the toolstrips are loading.
Review URL: http://codereview.chromium.org/220028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27137 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_host.h')
-rw-r--r-- | chrome/browser/extensions/extension_host.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/chrome/browser/extensions/extension_host.h b/chrome/browser/extensions/extension_host.h index 3b3d64e..617cd8e 100644 --- a/chrome/browser/extensions/extension_host.h +++ b/chrome/browser/extensions/extension_host.h @@ -38,6 +38,8 @@ class ExtensionHost : public RenderViewHostDelegate, public ExtensionFunctionDispatcher::Delegate, public NotificationObserver { public: + class ProcessCreationQueue; + // Enable DOM automation in created render view hosts. static void EnableDOMAutomation() { enable_dom_automation_ = true; } @@ -75,10 +77,10 @@ class ExtensionHost : public RenderViewHostDelegate, // Returns true if the render view is initialized and didn't crash. bool IsRenderViewLive() const; - // Initializes our RenderViewHost by creating its RenderView and navigating - // to this host's url. Uses host_view for the RenderViewHost's view (can be - // NULL). - void CreateRenderView(RenderWidgetHostView* host_view); + // Prepares to initializes our RenderViewHost by creating its RenderView and + // navigating to this host's url. Uses host_view for the RenderViewHost's view + // (can be NULL). This happens delayed to avoid locking the UI. + void CreateRenderViewSoon(RenderWidgetHostView* host_view); // Sets |url_| and navigates |render_view_host_|. void NavigateToURL(const GURL& url); @@ -138,10 +140,15 @@ class ExtensionHost : public RenderViewHostDelegate, const NotificationDetails& details); private: + friend class ProcessCreationQueue; + // Whether to allow DOM automation for created RenderViewHosts. This is used // for testing. static bool enable_dom_automation_; + // Actually create the RenderView for this host. See CreateRenderViewSoon. + void CreateRenderViewNow(); + // ExtensionFunctionDispatcher::Delegate // If this ExtensionHost has a view, this returns the Browser that view is a // part of. If this is a global background page, we use the active Browser |