diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-21 21:06:23 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-21 21:06:23 +0000 |
commit | 421d1cd06fb54c660e0f251df5a0d6403a214670 (patch) | |
tree | 174505a79267a4ac711bb20f4730f8c8f65f81ad /chrome/worker/worker_thread.cc | |
parent | 830853df6093d39820366da09a18296097335d56 (diff) | |
download | chromium_src-421d1cd06fb54c660e0f251df5a0d6403a214670.zip chromium_src-421d1cd06fb54c660e0f251df5a0d6403a214670.tar.gz chromium_src-421d1cd06fb54c660e0f251df5a0d6403a214670.tar.bz2 |
Revert r21117 as it caused reliability failures.
Also included in this revert: r21165, r21180, and a couple valgrind suppression edits
TBR=huanr
Review URL: http://codereview.chromium.org/155876
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21216 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/worker/worker_thread.cc')
-rw-r--r-- | chrome/worker/worker_thread.cc | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/chrome/worker/worker_thread.cc b/chrome/worker/worker_thread.cc index e4be0b9..7663b7a 100644 --- a/chrome/worker/worker_thread.cc +++ b/chrome/worker/worker_thread.cc @@ -15,22 +15,37 @@ static base::LazyInstance<base::ThreadLocalPointer<WorkerThread> > lazy_tls( base::LINKER_INITIALIZED); -WorkerThread::WorkerThread() { - lazy_tls.Pointer()->Set(this); - webkit_client_.reset(new WorkerWebKitClientImpl); - WebKit::initialize(webkit_client_.get()); +WorkerThread::WorkerThread() + : ChildThread(base::Thread::Options(MessageLoop::TYPE_DEFAULT, + kV8StackSize)) { } WorkerThread::~WorkerThread() { - // Shutdown in reverse of the initialization order. - WebKit::shutdown(); - lazy_tls.Pointer()->Set(NULL); } WorkerThread* WorkerThread::current() { return lazy_tls.Pointer()->Get(); } +void WorkerThread::Init() { + lazy_tls.Pointer()->Set(this); + ChildThread::Init(); + webkit_client_.reset(new WorkerWebKitClientImpl); + WebKit::initialize(webkit_client_.get()); +} + +void WorkerThread::CleanUp() { + // Shutdown in reverse of the initialization order. + + if (webkit_client_.get()) { + WebKit::shutdown(); + webkit_client_.reset(); + } + + ChildThread::CleanUp(); + lazy_tls.Pointer()->Set(NULL); +} + void WorkerThread::OnControlMessageReceived(const IPC::Message& msg) { IPC_BEGIN_MESSAGE_MAP(WorkerThread, msg) IPC_MESSAGE_HANDLER(WorkerProcessMsg_CreateWorker, OnCreateWorker) |