summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_message_service.cc
diff options
context:
space:
mode:
authormpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-02 23:33:00 +0000
committermpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-02 23:33:00 +0000
commita74050aee8760154318b1bece223259788e072aa (patch)
tree8bc07de35f651ad478d526a3bd999cb2f151cedf /chrome/browser/extensions/extension_message_service.cc
parent93872a5f1787449d2ae1a7baffc0630d4e9db82c (diff)
downloadchromium_src-a74050aee8760154318b1bece223259788e072aa.zip
chromium_src-a74050aee8760154318b1bece223259788e072aa.tar.gz
chromium_src-a74050aee8760154318b1bece223259788e072aa.tar.bz2
Attempt at a fix for ExtensionBrowserTest.MessagingContentScript.
BUG=20795 TEST=no Review URL: http://codereview.chromium.org/191010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25273 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_message_service.cc')
-rw-r--r--chrome/browser/extensions/extension_message_service.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/chrome/browser/extensions/extension_message_service.cc b/chrome/browser/extensions/extension_message_service.cc
index 70396c4..95ff7f3 100644
--- a/chrome/browser/extensions/extension_message_service.cc
+++ b/chrome/browser/extensions/extension_message_service.cc
@@ -153,11 +153,12 @@ void ExtensionMessageService::RemoveEventListener(const std::string& event_name,
// It is possible that this RenderProcessHost is being destroyed. If that is
// the case, we'll have already removed his listeners, so do nothing here.
RenderProcessHost* rph = RenderProcessHost::FromID(render_process_id);
- if (!rph)
+ if (!rph || rph->ListenersIterator().IsAtEnd())
return;
DCHECK_EQ(MessageLoop::current()->type(), MessageLoop::TYPE_UI);
- DCHECK_EQ(listeners_[event_name].count(render_process_id), 1u) << event_name;
+ DCHECK_EQ(listeners_[event_name].count(render_process_id), 1u)
+ << " PID=" << render_process_id << " event=" << event_name;
listeners_[event_name].erase(render_process_id);
if (extension_devtools_manager_.get()) {