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

Unified Diff: chrome/common/extensions/api/dial.idl

Issue 2602593002: [chrome.dial] [WIP] Adds an API to get the active network ID. (Closed)
Patch Set: Outline API Created 4 years 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: chrome/common/extensions/api/dial.idl
diff --git a/chrome/common/extensions/api/dial.idl b/chrome/common/extensions/api/dial.idl
index d16fdfd6919ea8af27f36f817f86f8c4d509e738..9cc51c55f7afc71c55508bf6637c82dab4dfd283 100644
--- a/chrome/common/extensions/api/dial.idl
+++ b/chrome/common/extensions/api/dial.idl
@@ -23,7 +23,9 @@ namespace dial {
enum DialErrorCode {
no_listeners,
+ // Deprecated. Use onNetworkIdChanged instead.
no_valid_network_interfaces,
+ // Deprecated. Use onNetworkIdChanged instead.
network_disconnected,
cellular_network,
socket_error,
@@ -35,6 +37,7 @@ namespace dial {
};
callback BooleanCallback = void (boolean result);
+ callback NetworkIdCallback = void (DOMString result);
interface Functions {
@@ -43,6 +46,10 @@ namespace dial {
// callback is invoked with |true| if discovery was initiated or |false|
// otherwise.
static void discoverNow(BooleanCallback callback);
+
+ // Returns the current discovery network identifier. See the documentation
+ // for onNetworkIdChanged for details.
+ static void getNetworkId(NetworkIdCallback callback);
};
interface Events {
@@ -60,5 +67,21 @@ namespace dial {
// Event fired to inform clients on errors during device discovery.
static void onError(DialError error);
+
+ // Fired when the network being used for discovery has changed. |networkId|
+ // contains a short signature combining information from network interface
+ // and WiFi network identifiers to identify the current set of networks
+ // being used for discovery. This can be used by clients to clear and
+ // re-bootstrap device caches on a network change.
+ //
+ // |networkId| can take the following values:
+ // - "#XXXXXX" is a signature of the set of active networks.
+ // - "disconnected" means there is no active network for discovery.
+ // - "unknown" means there is an active network, but its signature
+ // cannot be determined.
+ //
+ // This event may be throttled to prevent it from firing too frequently; it
+ // is designed to be event-page friendly.
+ static void onNetworkIdChanged(DOMString networkId);
};
};

Powered by Google App Engine
This is Rietveld 408576698