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_service_registry', | 10 'content/public/renderer/frame_service_registry', |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
670 function(err) { | 670 function(err) { |
671 return toErrorRouteResponse_(err); | 671 return toErrorRouteResponse_(err); |
672 }); | 672 }); |
673 }; | 673 }; |
674 | 674 |
675 /** | 675 /** |
676 * Terminates the route specified by |routeId|. | 676 * Terminates the route specified by |routeId|. |
677 * @param {!string} routeId | 677 * @param {!string} routeId |
678 */ | 678 */ |
679 MediaRouteProvider.prototype.terminateRoute = function(routeId) { | 679 MediaRouteProvider.prototype.terminateRoute = function(routeId) { |
680 this.handlers_.terminateRoute(routeId); | 680 // TODO(crbug.com/627967): Remove code path that doesn't expect a Promise |
681 // in M56 | |
apacible
2016/07/14 16:46:36
nitty nit: period at the end of this line.
mark a. foltz
2016/07/15 20:03:36
Done.
| |
682 var maybePromise = this.handlers_.terminateRoute(routeId); | |
683 var successResult = {result_code: RouteRequestResultCode.OK}; | |
684 if (maybePromise) { | |
685 maybePromise.then( | |
686 function() { return successResult; }, | |
687 function(err) { return toErrorRouteResponse_(err); }); | |
apacible
2016/07/14 16:46:36
Styling preference: move closing ");" to separate
mark a. foltz
2016/07/15 20:03:36
Done.
| |
688 } else { | |
689 return successResult; | |
690 } | |
681 }; | 691 }; |
682 | 692 |
683 /** | 693 /** |
684 * Posts a message to the route designated by |routeId|. | 694 * Posts a message to the route designated by |routeId|. |
685 * @param {!string} routeId | 695 * @param {!string} routeId |
686 * @param {!string} message | 696 * @param {!string} message |
687 * @return {!Promise.<boolean>} Resolved with true if the message was sent, | 697 * @return {!Promise.<boolean>} Resolved with true if the message was sent, |
688 * or false on failure. | 698 * or false on failure. |
689 */ | 699 */ |
690 MediaRouteProvider.prototype.sendRouteMessage = function( | 700 MediaRouteProvider.prototype.sendRouteMessage = function( |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
810 }; | 820 }; |
811 | 821 |
812 mediaRouter = new MediaRouter(connector.bindHandleToProxy( | 822 mediaRouter = new MediaRouter(connector.bindHandleToProxy( |
813 serviceProvider.connectToService( | 823 serviceProvider.connectToService( |
814 mediaRouterMojom.MediaRouter.name), | 824 mediaRouterMojom.MediaRouter.name), |
815 mediaRouterMojom.MediaRouter)); | 825 mediaRouterMojom.MediaRouter)); |
816 | 826 |
817 return mediaRouter; | 827 return mediaRouter; |
818 }); | 828 }); |
819 | 829 |
OLD | NEW |