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

Unified Diff: device/bluetooth/bluetooth_task_manager_win.cc

Issue 604613002: Remove implicit HANDLE conversions from device. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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_low_energy_win.cc ('k') | device/hid/hid_connection_win.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 d89c1a03fde3b11707bd23b2ebff4132d2fb77f4..2e040c8ab6326c09f6aa0b1e473c14a9d2f6eb5c 100644
--- a/device/bluetooth/bluetooth_task_manager_win.cc
+++ b/device/bluetooth/bluetooth_task_manager_win.cc
@@ -291,7 +291,7 @@ void BluetoothTaskManagerWin::PollAdapter() {
if (!discovering_) {
const BLUETOOTH_FIND_RADIO_PARAMS adapter_param =
{ sizeof(BLUETOOTH_FIND_RADIO_PARAMS) };
- if (adapter_handle_)
+ if (adapter_handle_.IsValid())
adapter_handle_.Close();
HANDLE temp_adapter_handle;
HBLUETOOTH_RADIO_FIND handle = BluetoothFindFirstRadio(
@@ -317,7 +317,7 @@ void BluetoothTaskManagerWin::PollAdapter() {
void BluetoothTaskManagerWin::PostAdapterStateToUi() {
DCHECK(bluetooth_task_runner_->RunsTasksOnCurrentThread());
AdapterState* state = new AdapterState();
- GetAdapterState(adapter_handle_, state);
+ GetAdapterState(adapter_handle_.Get(), state);
ui_task_runner_->PostTask(
FROM_HERE,
base::Bind(&BluetoothTaskManagerWin::OnAdapterStateChanged,
@@ -331,10 +331,11 @@ void BluetoothTaskManagerWin::SetPowered(
const BluetoothAdapter::ErrorCallback& error_callback) {
DCHECK(bluetooth_task_runner_->RunsTasksOnCurrentThread());
bool success = false;
- if (adapter_handle_) {
+ if (adapter_handle_.IsValid()) {
if (!powered)
- BluetoothEnableDiscovery(adapter_handle_, false);
- success = !!BluetoothEnableIncomingConnections(adapter_handle_, powered);
+ BluetoothEnableDiscovery(adapter_handle_.Get(), false);
+ success =
+ !!BluetoothEnableIncomingConnections(adapter_handle_.Get(), powered);
}
if (success) {
@@ -351,8 +352,8 @@ void BluetoothTaskManagerWin::StartDiscovery() {
FROM_HERE,
base::Bind(&BluetoothTaskManagerWin::OnDiscoveryStarted,
this,
- !!adapter_handle_));
- if (!adapter_handle_)
+ adapter_handle_.IsValid()));
+ if (!adapter_handle_.IsValid())
return;
discovering_ = true;
@@ -369,7 +370,7 @@ void BluetoothTaskManagerWin::StopDiscovery() {
void BluetoothTaskManagerWin::DiscoverDevices(int timeout_multiplier) {
DCHECK(bluetooth_task_runner_->RunsTasksOnCurrentThread());
- if (!discovering_ || !adapter_handle_) {
+ if (!discovering_ || !adapter_handle_.IsValid()) {
ui_task_runner_->PostTask(
FROM_HERE,
base::Bind(&BluetoothTaskManagerWin::OnDiscoveryStopped, this));
« no previous file with comments | « device/bluetooth/bluetooth_low_energy_win.cc ('k') | device/hid/hid_connection_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698