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

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

Issue 2718583002: Refactor WebBluetoothServiceClient in the web_bluetooth.mojom (Closed)
Patch Set: rebase Created 3 years, 9 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 | « third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e168bda22fe2c2c63fe12a256b16868df968a229 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 device events.
+interface WebBluetoothServerClient {
+ // Called when a device disconnects.
+ GATTServerDisconnected();
+};
- // The device identified by |device_id| has been disconnected.
- GattServerDisconnected(WebBluetoothDeviceId device_id);
+// 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);
};
« no previous file with comments | « third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698