summaryrefslogtreecommitdiffstats
path: root/chrome/browser/worker_host
diff options
context:
space:
mode:
authordimich@chromium.org <dimich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-28 22:52:15 +0000
committerdimich@chromium.org <dimich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-28 22:52:15 +0000
commit66498a589df730f829214b70e61627a1009d464a (patch)
tree3da84988a3691dc90bdfe7f0f951af0a5e53ace8 /chrome/browser/worker_host
parent31dc3fbaf15769f904ecc00b0ab7aefe37acdeec (diff)
downloadchromium_src-66498a589df730f829214b70e61627a1009d464a.zip
chromium_src-66498a589df730f829214b70e61627a1009d464a.tar.gz
chromium_src-66498a589df730f829214b70e61627a1009d464a.tar.bz2
Fix browser process crash in WorkerTest.WorkerContextMultiPort.
Also enable that test. Crash caused by using stl::map[unexisting_key] which inserts a dummy element. Added a check. BUG=42783 TEST=WorkerTest.WorkerContextMultiPort Review URL: http://codereview.chromium.org/1737019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45875 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/worker_host')
-rw-r--r--chrome/browser/worker_host/message_port_dispatcher.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/chrome/browser/worker_host/message_port_dispatcher.cc b/chrome/browser/worker_host/message_port_dispatcher.cc
index f6e2bbf..070ea3d 100644
--- a/chrome/browser/worker_host/message_port_dispatcher.cc
+++ b/chrome/browser/worker_host/message_port_dispatcher.cc
@@ -237,6 +237,11 @@ void MessagePortDispatcher::OnSendQueuedMessages(
void MessagePortDispatcher::SendQueuedMessagesIfPossible(int message_port_id) {
DCHECK(CheckMessagePortMap(true));
+ if (!message_ports_.count(message_port_id)) {
+ NOTREACHED();
+ return;
+ }
+
MessagePort& port = message_ports_[message_port_id];
if (port.queue_messages || !port.sender)
return;