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

Side by Side Diff: device/bluetooth/bluetooth_task_manager_win.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
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 "device/bluetooth/bluetooth_task_manager_win.h" 5 #include "device/bluetooth/bluetooth_task_manager_win.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <winsock2.h> 8 #include <winsock2.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 } 250 }
251 251
252 void BluetoothTaskManagerWin::RemoveObserver(Observer* observer) { 252 void BluetoothTaskManagerWin::RemoveObserver(Observer* observer) {
253 DCHECK(observer); 253 DCHECK(observer);
254 DCHECK(ui_task_runner_->RunsTasksOnCurrentThread()); 254 DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
255 observers_.RemoveObserver(observer); 255 observers_.RemoveObserver(observer);
256 } 256 }
257 257
258 void BluetoothTaskManagerWin::Initialize() { 258 void BluetoothTaskManagerWin::Initialize() {
259 DCHECK(ui_task_runner_->RunsTasksOnCurrentThread()); 259 DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
260 worker_pool_ = new base::SequencedWorkerPool(kNumThreadsInWorkerPool, 260 worker_pool_ = new base::SequencedWorkerPool(
261 kBluetoothThreadName); 261 kNumThreadsInWorkerPool, kBluetoothThreadName,
262 base::TaskPriority::USER_VISIBLE);
262 InitializeWithBluetoothTaskRunner( 263 InitializeWithBluetoothTaskRunner(
263 worker_pool_->GetSequencedTaskRunnerWithShutdownBehavior( 264 worker_pool_->GetSequencedTaskRunnerWithShutdownBehavior(
264 worker_pool_->GetSequenceToken(), 265 worker_pool_->GetSequenceToken(),
265 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN)); 266 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN));
266 } 267 }
267 268
268 void BluetoothTaskManagerWin::InitializeWithBluetoothTaskRunner( 269 void BluetoothTaskManagerWin::InitializeWithBluetoothTaskRunner(
269 scoped_refptr<base::SequencedTaskRunner> bluetooth_task_runner) { 270 scoped_refptr<base::SequencedTaskRunner> bluetooth_task_runner) {
270 DCHECK(ui_task_runner_->RunsTasksOnCurrentThread()); 271 DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
271 bluetooth_task_runner_ = bluetooth_task_runner; 272 bluetooth_task_runner_ = bluetooth_task_runner;
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 void BluetoothTaskManagerWin::PostUnregisterGattCharacteristicValueChangedEvent( 1034 void BluetoothTaskManagerWin::PostUnregisterGattCharacteristicValueChangedEvent(
1034 PVOID event_handle) { 1035 PVOID event_handle) {
1035 DCHECK(ui_task_runner_->RunsTasksOnCurrentThread()); 1036 DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
1036 bluetooth_task_runner_->PostTask( 1037 bluetooth_task_runner_->PostTask(
1037 FROM_HERE, base::Bind(&BluetoothTaskManagerWin:: 1038 FROM_HERE, base::Bind(&BluetoothTaskManagerWin::
1038 UnregisterGattCharacteristicValueChangedEvent, 1039 UnregisterGattCharacteristicValueChangedEvent,
1039 this, event_handle)); 1040 this, event_handle));
1040 } 1041 }
1041 1042
1042 } // namespace device 1043 } // namespace device
OLDNEW
« no previous file with comments | « content/browser/browser_thread_impl.cc ('k') | ios/chrome/browser/net/image_fetcher_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698