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

Unified Diff: chrome/browser/extensions/extensions_service.cc

Issue 341029: Only dispatch tab events when there is someone listening (Closed)
Patch Set: pre-review 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/common/extensions/extension.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extensions_service.cc
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
index ef6d9cdf1012d3cb026b3effbbd646f0a58a7b1d..d681e83d5f58023b830c0f64c5f4ddc672896044 100644
--- a/chrome/browser/extensions/extensions_service.cc
+++ b/chrome/browser/extensions/extensions_service.cc
@@ -127,9 +127,6 @@ void ExtensionsService::Init() {
// the first extension, because its members listen for loaded notifications.
g_browser_process->resource_dispatcher_host();
- // Start up the extension event routers.
- ExtensionBrowserEventRouter::GetInstance()->Init();
-
LoadAllExtensions();
// TODO(erikkay) this should probably be deferred to a future point
@@ -508,6 +505,12 @@ void ExtensionsService::OnExtensionLoaded(Extension* extension,
case Extension::ENABLED:
extensions_.push_back(scoped_extension.release());
+ // We delay starting up the browser event router until at least one
+ // extension that needs it is loaded.
+ if (extension->HasApiPermission(Extension::kTabPermission)) {
+ ExtensionBrowserEventRouter::GetInstance()->Init();
Evan Martin 2009/10/29 01:56:29 Are you certain there's no other way for this to b
Aaron Boodman 2009/10/29 04:03:25 I don't understand.
rafaelw 2009/10/29 04:08:46 Don't need braces On 2009/10/29 01:56:29, Evan Ma
+ }
+
if (extension->location() != Extension::LOAD)
extension_prefs_->MigrateToPrefs(extension);
« no previous file with comments | « no previous file | chrome/common/extensions/extension.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698