Chromium Code Reviews| 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 d8dbfc424b8b8920d53a02ea08fa9f0176715d89..1e6012a12bf6e874ca1365a34ef307800f50bba3 100644 |
| --- a/third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom |
| +++ b/third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom |
| @@ -148,11 +148,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); |
| @@ -160,7 +155,10 @@ 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. |
| - RemoteServerConnect(WebBluetoothDeviceId device_id) => (WebBluetoothResult result); |
| + // Returns the result of the connection request. |
| + RemoteServerConnect( |
| + WebBluetoothDeviceId device_id, |
| + associated WebBluetoothServerClient client) => (WebBluetoothResult result); |
| // If a GATT connection exists for Device identified by |device_id| then |
| // decreases the ref count for that connection. |
| @@ -211,8 +209,11 @@ interface WebBluetoothService { |
| // Starts notifications for the characteristic identified by |
| // |characteristic_instance_id|. |
| + // Returns the result of the connection request. |
| RemoteCharacteristicStartNotifications( |
| - string characteristic_instance_id) => (WebBluetoothResult result); |
| + string characteristic_instance_id, |
| + associated WebBluetoothCharacteristicClient client) => ( |
| + WebBluetoothResult result); |
| // Stops notifications for the characteristic identified by |
| // |characteristic_instance_id|. |
| @@ -251,15 +252,15 @@ 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 that implement this interface will be notified of characteristic |
| +// events. |
| +interface WebBluetoothCharacteristicClient { |
| + // Called when we receive a notification for the characteristic. |
| + RemoteCharacteristicValueChanged(array<uint8> value); |
| +}; |
| - // The device identified by |device_id| has been disconnected. |
| - GattServerDisconnected(WebBluetoothDeviceId device_id); |
| +// Classes that implement this interface will be notified of device events. |
|
scheib
2017/03/16 06:08:51
We typically list the Bluetooth and GATT concepts
juncai
2017/03/16 18:06:24
Done.
|
| +interface WebBluetoothServerClient { |
| + // Called when a device disconnects. |
| + GATTServerDisconnected(); |
| }; |