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

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

Issue 10175008: Improving the process model extension API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Syncing to the latest tree after a week away. Created 8 years, 7 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/browser/extensions/extension_function_registry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_event_router.cc
diff --git a/chrome/browser/extensions/extension_event_router.cc b/chrome/browser/extensions/extension_event_router.cc
index abd8f031ab5b0eff2ced9a1983db2c35ed5a0023..8b27f22c2f3535faf026373814c1797faa6f6683 100644
--- a/chrome/browser/extensions/extension_event_router.cc
+++ b/chrome/browser/extensions/extension_event_router.cc
@@ -132,8 +132,10 @@ void ExtensionEventRouter::AddEventListener(
process->GetID());
// We lazily tell the TaskManager to start updating when listeners to the
- // processes.onUpdated event arrive.
- if (event_name.compare(extension_processes_api_constants::kOnUpdated) == 0)
+ // processes.onUpdated or processes.onUpdatedWithMemory events arrive.
+ if (event_name.compare(extension_processes_api_constants::kOnUpdated) == 0 ||
+ event_name.compare(
+ extension_processes_api_constants::kOnUpdatedWithMemory) == 0)
ExtensionProcessesEventRouter::GetInstance()->ListenerAdded();
}
@@ -153,9 +155,12 @@ void ExtensionEventRouter::RemoveEventListener(
extension_devtools_manager_->RemoveEventListener(event_name,
process->GetID());
- // If a processes.onUpdated event listener is removed (or a process with one
- // exits), then we let the TaskManager know that it has one fewer listener.
- if (event_name.compare(extension_processes_api_constants::kOnUpdated) == 0)
+ // If a processes.onUpdated or processes.onUpdatedWithMemory event listener
+ // is removed (or a process with one exits), then we let the extension API
+ // know that it has one fewer listener.
+ if (event_name.compare(extension_processes_api_constants::kOnUpdated) == 0 ||
+ event_name.compare(
+ extension_processes_api_constants::kOnUpdatedWithMemory) == 0)
ExtensionProcessesEventRouter::GetInstance()->ListenerRemoved();
BrowserThread::PostTask(
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_function_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698