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

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: Moved to async extension functions and generated docs. Created 8 years, 8 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
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 0b957df105e5dda66627ed0d1aa6ffd1a9a4f785..c023ae2b2a67d20d737d3038502bef9c77fc005e 100644
--- a/chrome/browser/extensions/extension_event_router.cc
+++ b/chrome/browser/extensions/extension_event_router.cc
@@ -131,8 +131,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();
}
@@ -152,9 +154,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(

Powered by Google App Engine
This is Rietveld 408576698