Commit a844a70d authored by Ryan Hansberry's avatar Ryan Hansberry Committed by Commit Bot

[Bluetooth] Document usage of Sync methods in adapter.mojom.

Follow guidance by reillyg@ in crrev.com/c/2314024 to discourage
clients other than Nearby from using [Sync] methods on adapter.mojom.

Change-Id: Ic71e1330747b240ba3f153ac96f6cbab0f375701
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2347166Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Commit-Queue: Ryan Hansberry <hansberry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#796902}
parent 09a6225e
...@@ -41,6 +41,10 @@ struct AdapterInfo { ...@@ -41,6 +41,10 @@ struct AdapterInfo {
bool discovering; bool discovering;
}; };
// Represents a request to discover nearby devices.
// Note: Methods which are declared [Sync] are for use by
// //chrome/services/sharing/nearby; all other usage of their synchronous
// signatures is strongly discouraged.
interface DiscoverySession { interface DiscoverySession {
// Returns true if the session is active, false otherwise. If false, the // Returns true if the session is active, false otherwise. If false, the
// adapter might still be discovering as there might still be other active // adapter might still be discovering as there might still be other active
...@@ -66,6 +70,9 @@ interface DiscoverySession { ...@@ -66,6 +70,9 @@ interface DiscoverySession {
// Represents an open connection to a remote device. Releasing it will destroy // Represents an open connection to a remote device. Releasing it will destroy
// the underlying connection, but callers should prefer to let a call to // the underlying connection, but callers should prefer to let a call to
// Disconnect() to finish first. // Disconnect() to finish first.
// Note: Methods which are declared [Sync] are for use by
// //chrome/services/sharing/nearby; all other usage of their synchronous
// signatures is strongly discouraged.
interface Socket { interface Socket {
// Use to gracefully close the underlying connection before destroying. The // Use to gracefully close the underlying connection before destroying. The
// reply callback can be used to synchronize a reconnection attempt; // reply callback can be used to synchronize a reconnection attempt;
...@@ -77,6 +84,9 @@ interface Socket { ...@@ -77,6 +84,9 @@ interface Socket {
// Handles requests to either query Bluetooth adapter capabilities or state, or // Handles requests to either query Bluetooth adapter capabilities or state, or
// find or connect to remote devices. Backed by //device/bluetooth. // find or connect to remote devices. Backed by //device/bluetooth.
// Note: Methods which are declared [Sync] are for use by
// //chrome/services/sharing/nearby; all other usage of their synchronous
// signatures is strongly discouraged.
interface Adapter { interface Adapter {
// Creates a GATT connection to the device with |address| and returns a // Creates a GATT connection to the device with |address| and returns a
// Device if the connection was succesful. The GATT connection is tied to the // Device if the connection was succesful. The GATT connection is tied to the
...@@ -142,4 +152,3 @@ interface AdapterClient { ...@@ -142,4 +152,3 @@ interface AdapterClient {
// Called after the device hasn't been seen for 3 minutes. // Called after the device hasn't been seen for 3 minutes.
DeviceRemoved(DeviceInfo device); DeviceRemoved(DeviceInfo device);
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment