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

Unified Diff: device/bluetooth/bluetooth_task_manager_win.cc

Issue 2891853003: Rename TaskRunner::RunsTasksOnCurrentThread() in //device, //services (Closed)
Patch Set: fixed build error Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/bluetooth/bluetooth_socket_win.cc ('k') | device/bluetooth/bluez/bluetooth_socket_bluez.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_task_manager_win.cc
diff --git a/device/bluetooth/bluetooth_task_manager_win.cc b/device/bluetooth/bluetooth_task_manager_win.cc
index 0e8c5935eccb33ec313a7150c90f439239ea3acc..3ff036515967d154e762fe9c635116ad95f5c8e4 100644
--- a/device/bluetooth/bluetooth_task_manager_win.cc
+++ b/device/bluetooth/bluetooth_task_manager_win.cc
@@ -243,18 +243,18 @@ BluetoothUUID BluetoothTaskManagerWin::BluetoothLowEnergyUuidToBluetoothUuid(
void BluetoothTaskManagerWin::AddObserver(Observer* observer) {
DCHECK(observer);
- DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
observers_.AddObserver(observer);
}
void BluetoothTaskManagerWin::RemoveObserver(Observer* observer) {
DCHECK(observer);
- DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
observers_.RemoveObserver(observer);
}
void BluetoothTaskManagerWin::Initialize() {
- DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
InitializeWithBluetoothTaskRunner(base::CreateSequencedTaskRunnerWithTraits(
{base::MayBlock(), base::TaskPriority::BACKGROUND,
base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}));
@@ -262,7 +262,7 @@ void BluetoothTaskManagerWin::Initialize() {
void BluetoothTaskManagerWin::InitializeWithBluetoothTaskRunner(
scoped_refptr<base::SequencedTaskRunner> bluetooth_task_runner) {
- DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
bluetooth_task_runner_ = bluetooth_task_runner;
bluetooth_task_runner_->PostTask(
FROM_HERE,
@@ -270,7 +270,7 @@ void BluetoothTaskManagerWin::InitializeWithBluetoothTaskRunner(
}
void BluetoothTaskManagerWin::StartPolling() {
- DCHECK(bluetooth_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(bluetooth_task_runner_->RunsTasksInCurrentSequence());
if (device::bluetooth_init_win::HasBluetoothStack()) {
PollAdapter();
@@ -291,7 +291,7 @@ void BluetoothTaskManagerWin::PostSetPoweredBluetoothTask(
bool powered,
const base::Closure& callback,
const BluetoothAdapter::ErrorCallback& error_callback) {
- DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
bluetooth_task_runner_->PostTask(
FROM_HERE,
base::Bind(&BluetoothTaskManagerWin::SetPowered,
@@ -302,14 +302,14 @@ void BluetoothTaskManagerWin::PostSetPoweredBluetoothTask(
}
void BluetoothTaskManagerWin::PostStartDiscoveryTask() {
- DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
bluetooth_task_runner_->PostTask(
FROM_HERE,
base::Bind(&BluetoothTaskManagerWin::StartDiscovery, this));
}
void BluetoothTaskManagerWin::PostStopDiscoveryTask() {
- DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
bluetooth_task_runner_->PostTask(
FROM_HERE,
base::Bind(&BluetoothTaskManagerWin::StopDiscovery, this));
@@ -348,32 +348,32 @@ void BluetoothTaskManagerWin::LogPollingError(const char* message,
}
void BluetoothTaskManagerWin::OnAdapterStateChanged(const AdapterState* state) {
- DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
for (auto& observer : observers_)
observer.AdapterStateChanged(*state);
}
void BluetoothTaskManagerWin::OnDiscoveryStarted(bool success) {
- DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
for (auto& observer : observers_)
observer.DiscoveryStarted(success);
}
void BluetoothTaskManagerWin::OnDiscoveryStopped() {
- DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
for (auto& observer : observers_)
observer.DiscoveryStopped();
}
void BluetoothTaskManagerWin::OnDevicesPolled(
std::vector<std::unique_ptr<DeviceState>> devices) {
- DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
for (auto& observer : observers_)
observer.DevicesPolled(devices);
}
void BluetoothTaskManagerWin::PollAdapter() {
- DCHECK(bluetooth_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(bluetooth_task_runner_->RunsTasksInCurrentSequence());
// Skips updating the adapter info if the adapter is in discovery mode.
if (!discovering_) {
@@ -402,7 +402,7 @@ void BluetoothTaskManagerWin::PollAdapter() {
}
void BluetoothTaskManagerWin::PostAdapterStateToUi() {
- DCHECK(bluetooth_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(bluetooth_task_runner_->RunsTasksInCurrentSequence());
AdapterState* state = new AdapterState();
GetAdapterState(adapter_handle_, state);
ui_task_runner_->PostTask(
@@ -416,7 +416,7 @@ void BluetoothTaskManagerWin::SetPowered(
bool powered,
const base::Closure& callback,
const BluetoothAdapter::ErrorCallback& error_callback) {
- DCHECK(bluetooth_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(bluetooth_task_runner_->RunsTasksInCurrentSequence());
bool success = false;
if (adapter_handle_) {
if (!powered) {
@@ -436,7 +436,7 @@ void BluetoothTaskManagerWin::SetPowered(
}
void BluetoothTaskManagerWin::StartDiscovery() {
- DCHECK(bluetooth_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(bluetooth_task_runner_->RunsTasksInCurrentSequence());
ui_task_runner_->PostTask(
FROM_HERE, base::Bind(&BluetoothTaskManagerWin::OnDiscoveryStarted, this,
!!adapter_handle_));
@@ -448,7 +448,7 @@ void BluetoothTaskManagerWin::StartDiscovery() {
}
void BluetoothTaskManagerWin::StopDiscovery() {
- DCHECK(bluetooth_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(bluetooth_task_runner_->RunsTasksInCurrentSequence());
discovering_ = false;
ui_task_runner_->PostTask(
FROM_HERE,
@@ -456,7 +456,7 @@ void BluetoothTaskManagerWin::StopDiscovery() {
}
void BluetoothTaskManagerWin::DiscoverDevices(int timeout_multiplier) {
- DCHECK(bluetooth_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(bluetooth_task_runner_->RunsTasksInCurrentSequence());
if (!discovering_ || !adapter_handle_) {
ui_task_runner_->PostTask(
FROM_HERE,
@@ -590,7 +590,7 @@ bool BluetoothTaskManagerWin::SearchLowEnergyDevices(
bool BluetoothTaskManagerWin::DiscoverServices(
std::vector<std::unique_ptr<DeviceState>>* device_list,
bool search_cached_services_only) {
- DCHECK(bluetooth_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(bluetooth_task_runner_->RunsTasksInCurrentSequence());
net::EnsureWinsockInit();
for (const auto& device : *device_list) {
std::vector<std::unique_ptr<ServiceRecordState>>* service_record_states =
@@ -884,7 +884,7 @@ void BluetoothTaskManagerWin::RegisterGattCharacteristicValueChangedEvent(
BTH_LE_GATT_DESCRIPTOR ccc_descriptor,
const GattEventRegistrationCallback& callback,
const GattCharacteristicValueChangedCallback& registered_callback) {
- DCHECK(bluetooth_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(bluetooth_task_runner_->RunsTasksInCurrentSequence());
BLUETOOTH_GATT_EVENT_HANDLE win_event_handle = NULL;
BLUETOOTH_GATT_VALUE_CHANGED_EVENT_REGISTRATION win_event_parameter;
@@ -932,7 +932,7 @@ void BluetoothTaskManagerWin::RegisterGattCharacteristicValueChangedEvent(
void BluetoothTaskManagerWin::UnregisterGattCharacteristicValueChangedEvent(
PVOID event_handle) {
- DCHECK(bluetooth_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(bluetooth_task_runner_->RunsTasksInCurrentSequence());
base::AutoLock auto_lock(g_characteristic_value_changed_registrations_lock);
CharacteristicValueChangedRegistrationMap::const_iterator it =
@@ -949,7 +949,7 @@ void BluetoothTaskManagerWin::PostGetGattIncludedCharacteristics(
const BluetoothUUID& uuid,
uint16_t attribute_handle,
const GetGattIncludedCharacteristicsCallback& callback) {
- DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
bluetooth_task_runner_->PostTask(
FROM_HERE,
base::Bind(&BluetoothTaskManagerWin::GetGattIncludedCharacteristics, this,
@@ -960,7 +960,7 @@ void BluetoothTaskManagerWin::PostGetGattIncludedDescriptors(
const base::FilePath& service_path,
const PBTH_LE_GATT_CHARACTERISTIC characteristic,
const GetGattIncludedDescriptorsCallback& callback) {
- DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
bluetooth_task_runner_->PostTask(
FROM_HERE,
base::Bind(&BluetoothTaskManagerWin::GetGattIncludedDescriptors, this,
@@ -971,7 +971,7 @@ void BluetoothTaskManagerWin::PostReadGattCharacteristicValue(
const base::FilePath& service_path,
const PBTH_LE_GATT_CHARACTERISTIC characteristic,
const ReadGattCharacteristicValueCallback& callback) {
- DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
bluetooth_task_runner_->PostTask(
FROM_HERE,
base::Bind(&BluetoothTaskManagerWin::ReadGattCharacteristicValue, this,
@@ -983,7 +983,7 @@ void BluetoothTaskManagerWin::PostWriteGattCharacteristicValue(
const PBTH_LE_GATT_CHARACTERISTIC characteristic,
const std::vector<uint8_t>& new_value,
const HResultCallback& callback) {
- DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
bluetooth_task_runner_->PostTask(
FROM_HERE,
base::Bind(&BluetoothTaskManagerWin::WriteGattCharacteristicValue, this,
@@ -996,7 +996,7 @@ void BluetoothTaskManagerWin::PostRegisterGattCharacteristicValueChangedEvent(
const PBTH_LE_GATT_DESCRIPTOR ccc_descriptor,
const GattEventRegistrationCallback& callback,
const GattCharacteristicValueChangedCallback& registered_callback) {
- DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
bluetooth_task_runner_->PostTask(
FROM_HERE,
base::Bind(
@@ -1007,7 +1007,7 @@ void BluetoothTaskManagerWin::PostRegisterGattCharacteristicValueChangedEvent(
void BluetoothTaskManagerWin::PostUnregisterGattCharacteristicValueChangedEvent(
PVOID event_handle) {
- DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
+ DCHECK(ui_task_runner_->RunsTasksInCurrentSequence());
bluetooth_task_runner_->PostTask(
FROM_HERE, base::Bind(&BluetoothTaskManagerWin::
UnregisterGattCharacteristicValueChangedEvent,
« no previous file with comments | « device/bluetooth/bluetooth_socket_win.cc ('k') | device/bluetooth/bluez/bluetooth_socket_bluez.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698