diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-20 01:06:00 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-20 01:06:00 +0000 |
commit | 844550002b16a17c6b5d4e9bd406117e9ec6d9b2 (patch) | |
tree | 800abcd02551cd59c1d5ef4c53eb9487ff977c88 /chrome/browser/extensions/extension_host.h | |
parent | ebc717e8bbba0699fc3527225f622c3e31cbccf1 (diff) | |
download | chromium_src-844550002b16a17c6b5d4e9bd406117e9ec6d9b2.zip chromium_src-844550002b16a17c6b5d4e9bd406117e9ec6d9b2.tar.gz chromium_src-844550002b16a17c6b5d4e9bd406117e9ec6d9b2.tar.bz2 |
Undo my revert at r32524 due to a startup test regression.
ExtensionHosts once again spawn extension processes asynchronously. However,
if the process is already started, we now initialize the RenderView
synchronously. This is so bug 28049 stays fixed.
BUG=28049
Review URL: http://codereview.chromium.org/402101
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32578 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 552bc8c..9407b85 100644 --- a/chrome/browser/extensions/extension_host.h +++ b/chrome/browser/extensions/extension_host.h @@ -44,6 +44,8 @@ class ExtensionHost : public ExtensionPopupHost::PopupDelegate, public NotificationObserver, public JavaScriptMessageBoxClient { public: + class ProcessCreationQueue; + // Enable DOM automation in created render view hosts. static void EnableDOMAutomation() { enable_dom_automation_ = true; } @@ -82,10 +84,10 @@ class ExtensionHost : public ExtensionPopupHost::PopupDelegate, // 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); @@ -156,10 +158,15 @@ class ExtensionHost : public ExtensionPopupHost::PopupDelegate, virtual TabContents* AsTabContents() { return NULL; } 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 |