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

Side by Side Diff: chrome/browser/extensions/extension_process_manager.cc

Issue 220028: Create renderers for ExtensionHosts one a time to avoid blocking the UI. (Closed)
Patch Set: scoped task factory Created 11 years, 2 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/extensions/extension_host.cc ('k') | chrome/browser/gtk/extension_view_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/extension_process_manager.h" 5 #include "chrome/browser/extensions/extension_process_manager.h"
6 6
7 #include "chrome/browser/browsing_instance.h" 7 #include "chrome/browser/browsing_instance.h"
8 #include "chrome/browser/extensions/extension_host.h" 8 #include "chrome/browser/extensions/extension_host.h"
9 #include "chrome/browser/extensions/extensions_service.h" 9 #include "chrome/browser/extensions/extensions_service.h"
10 #include "chrome/browser/profile.h" 10 #include "chrome/browser/profile.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 return CreateView(extension, url, browser); 79 return CreateView(extension, url, browser);
80 } 80 }
81 return NULL; 81 return NULL;
82 } 82 }
83 83
84 ExtensionHost* ExtensionProcessManager::CreateBackgroundHost( 84 ExtensionHost* ExtensionProcessManager::CreateBackgroundHost(
85 Extension* extension, const GURL& url) { 85 Extension* extension, const GURL& url) {
86 ExtensionHost* host = 86 ExtensionHost* host =
87 new ExtensionHost(extension, GetSiteInstanceForURL(url), url, 87 new ExtensionHost(extension, GetSiteInstanceForURL(url), url,
88 ViewType::EXTENSION_BACKGROUND_PAGE); 88 ViewType::EXTENSION_BACKGROUND_PAGE);
89 host->CreateRenderView(NULL); // create a RenderViewHost with no view 89 host->CreateRenderViewSoon(NULL); // create a RenderViewHost with no view
90 OnExtensionHostCreated(host, true); 90 OnExtensionHostCreated(host, true);
91 return host; 91 return host;
92 } 92 }
93 93
94 void ExtensionProcessManager::RegisterExtensionProcess( 94 void ExtensionProcessManager::RegisterExtensionProcess(
95 const std::string& extension_id, int process_id) { 95 const std::string& extension_id, int process_id) {
96 ProcessIDMap::const_iterator it = process_ids_.find(extension_id); 96 ProcessIDMap::const_iterator it = process_ids_.find(extension_id);
97 if (it != process_ids_.end() && (*it).second == process_id) 97 if (it != process_ids_.end() && (*it).second == process_id)
98 return; 98 return;
99 99
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 void ExtensionProcessManager::OnExtensionHostCreated(ExtensionHost* host, 197 void ExtensionProcessManager::OnExtensionHostCreated(ExtensionHost* host,
198 bool is_background) { 198 bool is_background) {
199 all_hosts_.insert(host); 199 all_hosts_.insert(host);
200 if (is_background) 200 if (is_background)
201 background_hosts_.insert(host); 201 background_hosts_.insert(host);
202 NotificationService::current()->Notify( 202 NotificationService::current()->Notify(
203 NotificationType::EXTENSION_HOST_CREATED, 203 NotificationType::EXTENSION_HOST_CREATED,
204 Source<ExtensionProcessManager>(this), 204 Source<ExtensionProcessManager>(this),
205 Details<ExtensionHost>(host)); 205 Details<ExtensionHost>(host));
206 } 206 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_host.cc ('k') | chrome/browser/gtk/extension_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698