diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-18 02:41:26 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-18 02:41:26 +0000 |
commit | 9610ef248891f4be129eb915a43d226350569910 (patch) | |
tree | e0d45f8c90d82ec4b95120b2a6926e5b1e4dfd80 /chrome/browser/extensions/extension_host.cc | |
parent | f7906654d9ffbf1385843b4c7457797564273a56 (diff) | |
download | chromium_src-9610ef248891f4be129eb915a43d226350569910.zip chromium_src-9610ef248891f4be129eb915a43d226350569910.tar.gz chromium_src-9610ef248891f4be129eb915a43d226350569910.tar.bz2 |
Launch processes asynchronously so as not to block the UI thread. For now, renderer only, I'll take care of plugin/worker/utility processes in a followup change. (relanding 32203)
BUG=6844
Review URL: http://codereview.chromium.org/397031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32264 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_host.cc')
-rw-r--r-- | chrome/browser/extensions/extension_host.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc index 85f48de5..b0771ad 100644 --- a/chrome/browser/extensions/extension_host.cc +++ b/chrome/browser/extensions/extension_host.cc @@ -124,6 +124,11 @@ ExtensionHost::ExtensionHost(Extension* extension, SiteInstance* site_instance, render_view_host_->AllowBindings(BindingsPolicy::EXTENSION); if (enable_dom_automation_) render_view_host_->AllowBindings(BindingsPolicy::DOM_AUTOMATION); + + // Listen for when the render process' handle is available so we can add it + // to the task manager then. + registrar_.Add(this, NotificationType::RENDERER_PROCESS_CREATED, + Source<RenderProcessHost>(render_process_host())); } ExtensionHost::~ExtensionHost() { @@ -175,11 +180,6 @@ void ExtensionHost::CreateRenderViewNow() { render_view_host_->CreateRenderView(profile_->GetRequestContext()); NavigateToURL(url_); DCHECK(IsRenderViewLive()); - LOG(INFO) << "Sending EXTENSION_PROCESS_CREATED"; - NotificationService::current()->Notify( - NotificationType::EXTENSION_PROCESS_CREATED, - Source<Profile>(profile_), - Details<ExtensionHost>(this)); } void ExtensionHost::NavigateToURL(const GURL& url) { @@ -216,6 +216,12 @@ void ExtensionHost::Observe(NotificationType type, NavigateToURL(url_); } else if (type == NotificationType::BROWSER_THEME_CHANGED) { InsertThemeCSS(); + } else if (type == NotificationType::RENDERER_PROCESS_CREATED) { + LOG(INFO) << "Sending EXTENSION_PROCESS_CREATED"; + NotificationService::current()->Notify( + NotificationType::EXTENSION_PROCESS_CREATED, + Source<Profile>(profile_), + Details<ExtensionHost>(this)); } else { NOTREACHED(); } |