Index: extensions/renderer/resources/media_router_bindings.js |
diff --git a/extensions/renderer/resources/media_router_bindings.js b/extensions/renderer/resources/media_router_bindings.js |
index d1dccb6886c597ef936bc5ea498a5b6edab5b16a..b3bd32d4185ca6001a8193d69ab1872eea1e4f29 100644 |
--- a/extensions/renderer/resources/media_router_bindings.js |
+++ b/extensions/renderer/resources/media_router_bindings.js |
@@ -316,6 +316,11 @@ define('media_router_bindings', [ |
this.sendRouteMessage = null; |
/** |
+ * @type {function(string, Uint8Array): Promise} |
+ */ |
+ this.sendRouteBinaryMessage = null; |
+ |
+ /** |
* @type {function(Array.<string>): Promise.<Array.<RouteMessage>>} |
*/ |
this.listenForRouteMessages = null; |
@@ -368,6 +373,7 @@ define('media_router_bindings', [ |
'stopObservingMediaRoutes', |
'startObservingMediaRoutes', |
'sendRouteMessage', |
+ 'sendRouteBinaryMessage', |
'listenForRouteMessages', |
'closeRoute', |
'joinRoute', |
@@ -479,6 +485,23 @@ define('media_router_bindings', [ |
}; |
/** |
+ * Sends a binary message to the route designated by |routeId|. |
+ * @param {!string} routeId |
+ * @param {!Uint8Array} data |
+ * @return {!Promise.<boolean>} Resolved with true if the data was sent, |
+ * or false on failure. |
+ */ |
+ MediaRouteProvider.prototype.sendRouteBinaryMessage = function( |
+ routeId, data) { |
+ return this.handlers_.sendRouteBinaryMessage(routeId, data) |
+ .then(function() { |
+ return {'sent': true}; |
+ }, function() { |
+ return {'sent': false}; |
+ }); |
+ }; |
+ |
+ /** |
* Listen for next batch of messages from one of the routeIds. |
* @param {!Array.<string>} routeIds |
* @return {!Promise.<Array.<RouteMessage>>} Resolved with a list of messages, |