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

Unified Diff: chrome/browser/extensions/extension_host.h

Issue 220028: Create renderers for ExtensionHosts one a time to avoid blocking the UI. (Closed)
Patch Set: scoped task factory Created 11 years, 3 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
« no previous file with comments | « chrome/browser/cocoa/extension_view_mac.mm ('k') | chrome/browser/extensions/extension_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_host.h
diff --git a/chrome/browser/extensions/extension_host.h b/chrome/browser/extensions/extension_host.h
index 3b3d64ef7503661a375189e26e49f9a76729e7a4..617cd8e71937dbd6a05cf265d88dc43602d73484 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
« no previous file with comments | « chrome/browser/cocoa/extension_view_mac.mm ('k') | chrome/browser/extensions/extension_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698