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

Unified Diff: third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom

Issue 2718583002: Refactor WebBluetoothServiceClient in the web_bluetooth.mojom (Closed)
Patch Set: address more comments Created 3 years, 10 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: third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom
diff --git a/third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom b/third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom
index ddd5fd76bd75bc6ee6b70ad78327bb766cce8750..53bdaacf3df4d5830cfbda6e1cae744bde969257 100644
--- a/third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom
+++ b/third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom
@@ -160,11 +160,6 @@ struct WebBluetoothRemoteGATTDescriptor {
// Web Bluetooth Interface that Blink can use to perform
// Bluetooth GATT Operations on Bluetooth Devices.
interface WebBluetoothService {
- // Sets the client for this WebBluetoothService. The service will notify the
- // client of device events e.g. when a Characteristic's value changes or when
- // a device disconnects.
- SetClient(associated WebBluetoothServiceClient client);
-
RequestDevice(WebBluetoothRequestDeviceOptions options)
=> (WebBluetoothResult result, WebBluetoothDevice? device);
@@ -172,7 +167,9 @@ interface WebBluetoothService {
// if a connection to the device didn't exist already. If a GATT connection
// existed already then this function increases the ref count to keep that
// connection alive.
ortuno 2017/03/06 11:31:20 // Returns the result of the connection request an
juncai 2017/03/09 07:30:57 Done.
- RemoteServerConnect(WebBluetoothDeviceId device_id) => (WebBluetoothResult result);
+ RemoteServerConnect(WebBluetoothDeviceId device_id) => (
+ WebBluetoothResult result,
+ associated WebBluetoothServerClient&? client_request);
// If a GATT connection exists for Device identified by |device_id| then
// decreases the ref count for that connection.
@@ -224,7 +221,9 @@ interface WebBluetoothService {
// Starts notifications for the characteristic identified by
// |characteristic_instance_id|.
ortuno 2017/03/06 11:31:20 // Returns the result of the start notifications r
juncai 2017/03/09 07:30:57 Done.
RemoteCharacteristicStartNotifications(
- string characteristic_instance_id) => (WebBluetoothResult result);
+ string characteristic_instance_id) => (
+ WebBluetoothResult result,
+ associated WebBluetoothCharacteristicClient&? client_request);
// Stops notifications for the characteristic identified by
// |characteristic_instance_id|.
@@ -263,15 +262,16 @@ interface WebBluetoothService {
array<uint8> value) => (WebBluetoothResult result);
};
-// Classes should implement this interface and pass an associated pointer
-// bound to them to the WebBluetoothService by using SetClient. Classes
-// that do this will be notified of device events e.g. device disconnection.
-interface WebBluetoothServiceClient {
- // The characteristic identified by |characteristic_instance_id| has received
- // a notification of value change.
- RemoteCharacteristicValueChanged(string characteristic_instance_id,
- array<uint8> value);
+// Classes should implement this interface and will be notified of device
ortuno 2017/03/06 11:31:20 // Classes that implement this interface will be n
juncai 2017/03/09 07:30:57 Done.
+// events.
+interface WebBluetoothCharacteristicClient {
+ // Device has received a notification of value change.
+ RemoteCharacteristicValueChanged(array<uint8> value);
ortuno 2017/03/06 11:31:20 Called when we receive a notification for the char
juncai 2017/03/09 07:30:57 Done.
+};
- // The device identified by |device_id| has been disconnected.
- GattServerDisconnected(WebBluetoothDeviceId device_id);
+// Classes should implement this interface and will be notified of device
ortuno 2017/03/06 11:31:20 Classes that implement this interface will be noti
juncai 2017/03/09 07:30:57 Done.
+// events.
+interface WebBluetoothServerClient {
+ // Device has been disconnected.
ortuno 2017/03/06 11:31:20 Called when a device disconnects.
juncai 2017/03/09 07:30:57 Done.
+ GATTServerDisconnected();
};

Powered by Google App Engine
This is Rietveld 408576698