Commit 6582d0b5 authored by miu's avatar miu Committed by Commit bot

Fix media_router_bindings.js for binary messaging.

Mojo JS codegen provides binary data in objects of type Array<number>,
not Uint8Array. This change fixes the assumption, and provides the
required Uint8Array to the provider handler function.

Review-Url: https://codereview.chromium.org/2568933003
Cr-Commit-Position: refs/heads/master@{#438025}
parent f16b8a06
...@@ -716,14 +716,14 @@ define('media_router_bindings', [ ...@@ -716,14 +716,14 @@ define('media_router_bindings', [
/** /**
* Sends a binary message to the route designated by |routeId|. * Sends a binary message to the route designated by |routeId|.
* @param {!string} routeId * @param {!string} routeId
* @param {!Uint8Array} data * @param {!Array<number>} data
* @return {!Promise.<boolean>} Resolved with true if the data was sent, * @return {!Promise.<boolean>} Resolved with true if the data was sent,
* or false on failure. * or false on failure.
*/ */
MediaRouteProvider.prototype.sendRouteBinaryMessage = function( MediaRouteProvider.prototype.sendRouteBinaryMessage = function(
routeId, data) { routeId, data) {
this.handlers_.onBeforeInvokeHandler(); this.handlers_.onBeforeInvokeHandler();
return this.handlers_.sendRouteBinaryMessage(routeId, data) return this.handlers_.sendRouteBinaryMessage(routeId, new Uint8Array(data))
.then(function() { .then(function() {
return {'sent': true}; return {'sent': true};
}, function() { }, function() {
......
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