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

Unified Diff: device/bluetooth/bluetooth_remote_gatt_characteristic_win.cc

Issue 2051333004: Implement BluetoothGattNotifySession::Stop on Android, 2nd attempt (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address new review comments Created 4 years, 4 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
Index: device/bluetooth/bluetooth_remote_gatt_characteristic_win.cc
diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic_win.cc b/device/bluetooth/bluetooth_remote_gatt_characteristic_win.cc
index aec99968c82741c815827abe2ca6c946067be558..1ef3129df4c4f0b9db73c4fc7c68edef2b3aa689 100644
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic_win.cc
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_win.cc
@@ -9,7 +9,7 @@
#include "base/bind.h"
#include "base/memory/ptr_util.h"
#include "device/bluetooth/bluetooth_adapter_win.h"
-#include "device/bluetooth/bluetooth_gatt_notify_session_win.h"
+#include "device/bluetooth/bluetooth_gatt_notify_session.h"
#include "device/bluetooth/bluetooth_remote_gatt_descriptor_win.h"
#include "device/bluetooth/bluetooth_remote_gatt_service_win.h"
#include "device/bluetooth/bluetooth_task_manager_win.h"
@@ -145,8 +145,8 @@ void BluetoothRemoteGattCharacteristicWin::StartNotifySession(
DCHECK(ui_task_runner_->RunsTasksOnCurrentThread());
if (IsNotifying()) {
- std::unique_ptr<BluetoothGattNotifySessionWin> notify_session(
- new BluetoothGattNotifySessionWin(weak_ptr_factory_.GetWeakPtr()));
+ std::unique_ptr<BluetoothGattNotifySession> notify_session(
+ new BluetoothGattNotifySession(weak_ptr_factory_.GetWeakPtr()));
ui_task_runner_->PostTask(
FROM_HERE,
base::Bind(callback, base::Passed(std::move(notify_session))));
@@ -197,6 +197,16 @@ void BluetoothRemoteGattCharacteristicWin::StartNotifySession(
gatt_event_registeration_in_progress_ = true;
}
+void BluetoothRemoteGattCharacteristicWin::StopNotifySession(
+ BluetoothGattNotifySession* session,
+ const base::Closure& callback) {
+ // TODO(http://crbug.com/636270): Remove this method and use the base version.
+ // Instead, we should implement SubscribeToNotifications and
+ // UnsubscribeFromNotifications.
+
+ ui_task_runner_->PostTask(FROM_HERE, callback);
+}
+
void BluetoothRemoteGattCharacteristicWin::ReadRemoteCharacteristic(
const ValueCallback& callback,
const ErrorCallback& error_callback) {
@@ -262,6 +272,22 @@ uint16_t BluetoothRemoteGattCharacteristicWin::GetAttributeHandle() const {
return characteristic_info_->AttributeHandle;
}
+void BluetoothRemoteGattCharacteristicWin::SubscribeToNotifications(
+ BluetoothRemoteGattDescriptor* ccc_descriptor,
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) {
+ // TODO(http://crbug.com/636270): Implement this method
+ NOTIMPLEMENTED();
+}
+
+void BluetoothRemoteGattCharacteristicWin::UnsubscribeFromNotifications(
+ BluetoothRemoteGattDescriptor* ccc_descriptor,
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) {
+ // TODO(http://crbug.com/636270): Implement this method
+ NOTIMPLEMENTED();
+}
+
void BluetoothRemoteGattCharacteristicWin::OnGetIncludedDescriptorsCallback(
std::unique_ptr<BTH_LE_GATT_DESCRIPTOR> descriptors,
uint16_t num,
@@ -422,7 +448,7 @@ void BluetoothRemoteGattCharacteristicWin::GattEventRegistrationCallback(
gatt_event_handle_ = event_handle;
for (const auto& callback : callbacks) {
callback.first.Run(base::WrapUnique(
- new BluetoothGattNotifySessionWin(weak_ptr_factory_.GetWeakPtr())));
+ new BluetoothGattNotifySession(weak_ptr_factory_.GetWeakPtr())));
}
} else {
for (const auto& callback : callbacks)

Powered by Google App Engine
This is Rietveld 408576698