summaryrefslogtreecommitdiffstats
path: root/chrome/worker/webworker_stub_base.cc
diff options
context:
space:
mode:
authorrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-25 07:58:17 +0000
committerrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-25 07:58:17 +0000
commit31af2abddfa0c05ee19de5b4646197fa552c7e49 (patch)
tree2c9efbd2c3b8d4846230a7cb9cb8f8be7c4da2dd /chrome/worker/webworker_stub_base.cc
parent49fa9d59bca4ba0118a3e65f7cad5886cc4d5c3e (diff)
downloadchromium_src-31af2abddfa0c05ee19de5b4646197fa552c7e49.zip
chromium_src-31af2abddfa0c05ee19de5b4646197fa552c7e49.tar.gz
chromium_src-31af2abddfa0c05ee19de5b4646197fa552c7e49.tar.bz2
Revert r39951 - Broke Valgrind - "Make sure the workers are given a chance to terminate their thread when the IPC channel fails.
Usually, the ChildThread::OnChannelError() simply kills the message loop. we want to give workers an opportunity to get out of their threads to avoid crashes when main thread destroys globals. BUG=35963 TEST=WorkerTest.StressJSExecution Review URL: http://codereview.chromium.org/647064" Revert r39997 - Attempted Fix - "Fix a conditional jump depending on an uninitialized value by setting it to false in the ctor." TBR=dimich BUG=none TEST=Valgrind Review URL: http://codereview.chromium.org/661068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39999 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/worker/webworker_stub_base.cc')
-rw-r--r--chrome/worker/webworker_stub_base.cc10
1 files changed, 2 insertions, 8 deletions
diff --git a/chrome/worker/webworker_stub_base.cc b/chrome/worker/webworker_stub_base.cc
index b999f44..8ea2a15 100644
--- a/chrome/worker/webworker_stub_base.cc
+++ b/chrome/worker/webworker_stub_base.cc
@@ -12,19 +12,13 @@ WebWorkerStubBase::WebWorkerStubBase(int route_id)
: route_id_(route_id),
ALLOW_THIS_IN_INITIALIZER_LIST(client_(route_id, this)) {
- WorkerThread* workerThread = WorkerThread::current();
- DCHECK(workerThread);
- workerThread->AddWorkerStub(this);
// Start processing incoming IPCs for this worker.
- workerThread->AddRoute(route_id_, this);
+ WorkerThread::current()->AddRoute(route_id_, this);
ChildProcess::current()->AddRefProcess();
}
WebWorkerStubBase::~WebWorkerStubBase() {
- WorkerThread* workerThread = WorkerThread::current();
- DCHECK(workerThread);
- workerThread->RemoveWorkerStub(this);
- workerThread->RemoveRoute(route_id_);
+ WorkerThread::current()->RemoveRoute(route_id_);
ChildProcess::current()->ReleaseProcess();
}