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

Unified Diff: content/renderer/bluetooth/bluetooth_dispatcher.h

Issue 1334763002: bluetooth: Subscribe to notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-origin
Patch Set: Created 5 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
Index: content/renderer/bluetooth/bluetooth_dispatcher.h
diff --git a/content/renderer/bluetooth/bluetooth_dispatcher.h b/content/renderer/bluetooth/bluetooth_dispatcher.h
index 4109414400c2bd31b62e9309db61f11cbd7e9227..938c169d69ed50ae3628c77a571866978054ab39 100644
--- a/content/renderer/bluetooth/bluetooth_dispatcher.h
+++ b/content/renderer/bluetooth/bluetooth_dispatcher.h
@@ -69,6 +69,10 @@ class BluetoothDispatcher : public WorkerThread::Observer {
void writeValue(const blink::WebString& characteristic_instance_id,
const std::vector<uint8_t>& value,
blink::WebBluetoothWriteValueCallbacks*);
+ void startNotifications(const blink::WebString& characteristic_instance_id,
+ blink::WebBluetoothStartNotificationsCallbacks*);
+ void stopNotifications(const blink::WebString& characteristic_instance_id,
+ blink::WebBluetoothStopNotificationsCallbacks*);
// WorkerThread::Observer implementation.
void WillStopCurrentWorkerThread() override;
@@ -112,6 +116,11 @@ class BluetoothDispatcher : public WorkerThread::Observer {
void OnWriteValueError(int thread_id,
int request_id,
blink::WebBluetoothError error);
+ void OnStartNotificationsSuccess(int thread_id, int request_id);
+ void OnStartNotificationsError(int thread_id,
+ int request_id,
+ blink::WebBluetoothError error);
+ void OnStopNotificationsSuccess(int thread_id, int request_id);
scoped_refptr<ThreadSafeSender> thread_safe_sender_;
@@ -135,6 +144,12 @@ class BluetoothDispatcher : public WorkerThread::Observer {
pending_read_value_requests_;
IDMap<blink::WebBluetoothWriteValueCallbacks, IDMapOwnPointer>
pending_write_value_requests_;
+ // Tracks requests to start notifications from a characteristic.
+ IDMap<blink::WebBluetoothStartNotificationsCallbacks, IDMapOwnPointer>
+ pending_start_notifications_requests_;
+ // Tracks requests to stop notifications from a characteristic.
+ IDMap<blink::WebBluetoothStopNotificationsCallbacks, IDMapOwnPointer>
+ pending_stop_notifications_requests_;
DISALLOW_COPY_AND_ASSIGN(BluetoothDispatcher);
};

Powered by Google App Engine
This is Rietveld 408576698