diff options
author | sorin <sorin@chromium.org> | 2015-05-27 12:50:51 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-27 19:51:25 +0000 |
commit | 85e6803d2080f0565b91fdf5dadb671bea572c55 (patch) | |
tree | 44b2db73f0448c8ea7268ae1decfd756a1da442e /components/update_client | |
parent | 013831e64e2ca1414e86fe2498cb193d5a8b8354 (diff) | |
download | chromium_src-85e6803d2080f0565b91fdf5dadb671bea572c55.zip chromium_src-85e6803d2080f0565b91fdf5dadb671bea572c55.tar.gz chromium_src-85e6803d2080f0565b91fdf5dadb671bea572c55.tar.bz2 |
SequencedWorkerPool has a race condition on destruction that could result in a memory leak in some cases (see https://code.google.com/p/chromium/issues/detail?id=273800).
BUG=492450,450337
Review URL: https://codereview.chromium.org/1162433002
Cr-Commit-Position: refs/heads/master@{#331627}
Diffstat (limited to 'components/update_client')
-rw-r--r-- | components/update_client/update_client_unittest.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/components/update_client/update_client_unittest.cc b/components/update_client/update_client_unittest.cc index bda4008..4440d95 100644 --- a/components/update_client/update_client_unittest.cc +++ b/components/update_client/update_client_unittest.cc @@ -12,8 +12,8 @@ #include "base/message_loop/message_loop.h" #include "base/path_service.h" #include "base/run_loop.h" +#include "base/test/sequenced_worker_pool_owner.h" #include "base/thread_task_runner_handle.h" -#include "base/threading/sequenced_worker_pool.h" #include "base/values.h" #include "base/version.h" #include "components/update_client/crx_update_item.h" @@ -153,7 +153,7 @@ class UpdateClientTest : public testing::Test { base::RunLoop runloop_; base::Closure quit_closure_; - scoped_refptr<base::SequencedWorkerPool> worker_pool_; + scoped_ptr<base::SequencedWorkerPoolOwner> worker_pool_; scoped_refptr<update_client::Configurator> config_; @@ -161,11 +161,13 @@ class UpdateClientTest : public testing::Test { }; UpdateClientTest::UpdateClientTest() - : worker_pool_(new base::SequencedWorkerPool(kNumWorkerThreads_, "test")) { + : worker_pool_( + new base::SequencedWorkerPoolOwner(kNumWorkerThreads_, "test")) { quit_closure_ = runloop_.QuitClosure(); + auto pool = worker_pool_->pool(); config_ = new TestConfigurator( - worker_pool_->GetSequencedTaskRunner(worker_pool_->GetSequenceToken()), + pool->GetSequencedTaskRunner(pool->GetSequenceToken()), message_loop_.task_runner()); } @@ -177,7 +179,7 @@ void UpdateClientTest::RunThreads() { } void UpdateClientTest::StopWorkerPool() { - worker_pool_->Shutdown(); + worker_pool_->pool()->Shutdown(); } base::FilePath UpdateClientTest::TestFilePath(const char* file) { |