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

Unified Diff: extensions/renderer/resources/media_router_bindings.js

Issue 1245213002: [MediaRouter] Implement send binary message from PSDImpl to MRPManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated UT to verify the |data| Created 5 years, 5 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 | « chrome/browser/media/router/test_helper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « chrome/browser/media/router/test_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698