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

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

Issue 2077413009: Add TaskPriority as a parameter to SequencedWorkerPool in preparation for TaskScheduler experiment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@a2_hook
Patch Set: tweak comment Created 4 years, 5 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 | « ash/sysui/sysui_application.cc ('k') | base/threading/sequenced_worker_pool.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 #include "base/single_thread_task_runner.h"
10 10
11 namespace base { 11 namespace base {
12 12
13 SequencedWorkerPoolOwner::SequencedWorkerPoolOwner( 13 SequencedWorkerPoolOwner::SequencedWorkerPoolOwner(
14 size_t max_threads, 14 size_t max_threads,
15 const std::string& thread_name_prefix) 15 const std::string& thread_name_prefix)
16 : constructor_message_loop_(MessageLoop::current()), 16 : constructor_message_loop_(MessageLoop::current()),
17 pool_(new SequencedWorkerPool(max_threads, thread_name_prefix, this)), 17 pool_(new SequencedWorkerPool(max_threads,
18 thread_name_prefix,
19 TaskPriority::USER_VISIBLE,
20 this)),
18 has_work_call_count_(0) {} 21 has_work_call_count_(0) {}
19 22
20 SequencedWorkerPoolOwner::~SequencedWorkerPoolOwner() { 23 SequencedWorkerPoolOwner::~SequencedWorkerPoolOwner() {
21 pool_->Shutdown(); 24 pool_->Shutdown();
22 pool_ = NULL; 25 pool_ = NULL;
23 26
24 // Spin the current message loop until SWP destruction verified in OnDestruct. 27 // Spin the current message loop until SWP destruction verified in OnDestruct.
25 exit_loop_.Run(); 28 exit_loop_.Run();
26 } 29 }
27 30
(...skipping 24 matching lines...) Expand all
52 will_wait_for_shutdown_callback_ = Closure(); 55 will_wait_for_shutdown_callback_ = Closure();
53 } 56 }
54 } 57 }
55 58
56 void SequencedWorkerPoolOwner::OnDestruct() { 59 void SequencedWorkerPoolOwner::OnDestruct() {
57 constructor_message_loop_->task_runner()->PostTask(FROM_HERE, 60 constructor_message_loop_->task_runner()->PostTask(FROM_HERE,
58 exit_loop_.QuitClosure()); 61 exit_loop_.QuitClosure());
59 } 62 }
60 63
61 } // namespace base 64 } // namespace base
OLDNEW
« no previous file with comments | « ash/sysui/sysui_application.cc ('k') | base/threading/sequenced_worker_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698