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

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

Issue 2870060: Try to fix a valgrind leak. (Closed)
Patch Set: Created 10 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_message_service.cc
diff --git a/chrome/browser/extensions/extension_message_service.cc b/chrome/browser/extensions/extension_message_service.cc
index 979437a7ce536a6f82c16a50462d4302dba2d12d..bdd56209374b4e57dc0ea07076e0ae77130a7040 100644
--- a/chrome/browser/extensions/extension_message_service.cc
+++ b/chrome/browser/extensions/extension_message_service.cc
@@ -474,8 +474,11 @@ void ExtensionMessageService::DispatchEventToRenderers(
const std::string& event_name, const std::string& event_args,
bool has_incognito_data, const GURL& event_url) {
DCHECK_EQ(MessageLoop::current()->type(), MessageLoop::TYPE_UI);
+ ListenerMap::iterator it = listeners_.find(event_name);
+ if (it == listeners_.end())
+ return;
- std::set<int>& pids = listeners_[event_name];
+ std::set<int>& pids = it->second;
// Send the event only to renderers that are listening for it.
for (std::set<int>::iterator pid = pids.begin(); pid != pids.end(); ++pid) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698