| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 var mediaRouter; | 5 var mediaRouter; |
| 6 | 6 |
| 7 define('media_router_bindings', [ | 7 define('media_router_bindings', [ |
| 8 'mojo/public/js/bindings', | 8 'mojo/public/js/bindings', |
| 9 'mojo/public/js/core', | 9 'mojo/public/js/core', |
| 10 'content/public/renderer/frame_interfaces', | 10 'content/public/renderer/frame_interfaces', |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 .then(function() { | 709 .then(function() { |
| 710 return {'sent': true}; | 710 return {'sent': true}; |
| 711 }, function() { | 711 }, function() { |
| 712 return {'sent': false}; | 712 return {'sent': false}; |
| 713 }); | 713 }); |
| 714 }; | 714 }; |
| 715 | 715 |
| 716 /** | 716 /** |
| 717 * Sends a binary message to the route designated by |routeId|. | 717 * Sends a binary message to the route designated by |routeId|. |
| 718 * @param {!string} routeId | 718 * @param {!string} routeId |
| 719 * @param {!Uint8Array} data | 719 * @param {!Array<number>} data |
| 720 * @return {!Promise.<boolean>} Resolved with true if the data was sent, | 720 * @return {!Promise.<boolean>} Resolved with true if the data was sent, |
| 721 * or false on failure. | 721 * or false on failure. |
| 722 */ | 722 */ |
| 723 MediaRouteProvider.prototype.sendRouteBinaryMessage = function( | 723 MediaRouteProvider.prototype.sendRouteBinaryMessage = function( |
| 724 routeId, data) { | 724 routeId, data) { |
| 725 this.handlers_.onBeforeInvokeHandler(); | 725 this.handlers_.onBeforeInvokeHandler(); |
| 726 return this.handlers_.sendRouteBinaryMessage(routeId, data) | 726 return this.handlers_.sendRouteBinaryMessage(routeId, new Uint8Array(data)) |
| 727 .then(function() { | 727 .then(function() { |
| 728 return {'sent': true}; | 728 return {'sent': true}; |
| 729 }, function() { | 729 }, function() { |
| 730 return {'sent': false}; | 730 return {'sent': false}; |
| 731 }); | 731 }); |
| 732 }; | 732 }; |
| 733 | 733 |
| 734 /** | 734 /** |
| 735 * Listen for messages from a route. | 735 * Listen for messages from a route. |
| 736 * @param {!string} routeId | 736 * @param {!string} routeId |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 823 'sink_id': this.handlers_.searchSinks(sinkId, sourceUrn, searchCriteria) | 823 'sink_id': this.handlers_.searchSinks(sinkId, sourceUrn, searchCriteria) |
| 824 }); | 824 }); |
| 825 }; | 825 }; |
| 826 | 826 |
| 827 mediaRouter = new MediaRouter(connector.bindHandleToProxy( | 827 mediaRouter = new MediaRouter(connector.bindHandleToProxy( |
| 828 frameInterfaces.getInterface(mediaRouterMojom.MediaRouter.name), | 828 frameInterfaces.getInterface(mediaRouterMojom.MediaRouter.name), |
| 829 mediaRouterMojom.MediaRouter)); | 829 mediaRouterMojom.MediaRouter)); |
| 830 | 830 |
| 831 return mediaRouter; | 831 return mediaRouter; |
| 832 }); | 832 }); |
| OLD | NEW |