Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Side by Side Diff: base/test/sequenced_worker_pool_owner.cc

Issue 1100773004: base: Remove most uses of MessageLoopProxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added some missing includes. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/test/launcher/unit_test_launcher.cc ('k') | base/test/task_runner_test_template.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/test/sequenced_worker_pool_owner.h" 5 #include "base/test/sequenced_worker_pool_owner.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/single_thread_task_runner.h"
9 10
10 namespace base { 11 namespace base {
11 12
12 SequencedWorkerPoolOwner::SequencedWorkerPoolOwner( 13 SequencedWorkerPoolOwner::SequencedWorkerPoolOwner(
13 size_t max_threads, 14 size_t max_threads,
14 const std::string& thread_name_prefix) 15 const std::string& thread_name_prefix)
15 : constructor_message_loop_(MessageLoop::current()), 16 : constructor_message_loop_(MessageLoop::current()),
16 pool_(new SequencedWorkerPool(max_threads, thread_name_prefix, this)), 17 pool_(new SequencedWorkerPool(max_threads, thread_name_prefix, this)),
17 has_work_call_count_(0) {} 18 has_work_call_count_(0) {}
18 19
(...skipping 24 matching lines...) Expand all
43 void SequencedWorkerPoolOwner::WillWaitForShutdown() { 44 void SequencedWorkerPoolOwner::WillWaitForShutdown() {
44 if (!will_wait_for_shutdown_callback_.is_null()) { 45 if (!will_wait_for_shutdown_callback_.is_null()) {
45 will_wait_for_shutdown_callback_.Run(); 46 will_wait_for_shutdown_callback_.Run();
46 47
47 // Release the reference to the callback to prevent retain cycles. 48 // Release the reference to the callback to prevent retain cycles.
48 will_wait_for_shutdown_callback_ = Closure(); 49 will_wait_for_shutdown_callback_ = Closure();
49 } 50 }
50 } 51 }
51 52
52 void SequencedWorkerPoolOwner::OnDestruct() { 53 void SequencedWorkerPoolOwner::OnDestruct() {
53 constructor_message_loop_->PostTask( 54 constructor_message_loop_->task_runner()->PostTask(
54 FROM_HERE, 55 FROM_HERE, constructor_message_loop_->QuitWhenIdleClosure());
55 constructor_message_loop_->QuitWhenIdleClosure());
56 } 56 }
57 57
58 } // namespace base 58 } // namespace base
OLDNEW
« no previous file with comments | « base/test/launcher/unit_test_launcher.cc ('k') | base/test/task_runner_test_template.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698