From 66498a589df730f829214b70e61627a1009d464a Mon Sep 17 00:00:00 2001 From: "dimich@chromium.org" Date: Wed, 28 Apr 2010 22:52:15 +0000 Subject: 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 --- chrome/browser/worker_host/message_port_dispatcher.cc | 5 +++++ chrome/worker/worker_uitest.cc | 5 ----- 2 files changed, 5 insertions(+), 5 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; diff --git a/chrome/worker/worker_uitest.cc b/chrome/worker/worker_uitest.cc index fc7c276..1abc538 100644 --- a/chrome/worker/worker_uitest.cc +++ b/chrome/worker/worker_uitest.cc @@ -229,11 +229,6 @@ TEST_F(WorkerTest, WorkerContextGc) { RunWorkerFastLayoutTest("worker-context-gc.html"); } -// All kinds of crashes on Linux http://crbug.com/22898 -#if defined(OS_LINUX) -#define WorkerContextMultiPort DISABLED_WorkerContextMultiPort -#endif - TEST_F(WorkerTest, WorkerContextMultiPort) { RunWorkerFastLayoutTest("worker-context-multi-port.html"); } -- cgit v1.1