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

Side by Side Diff: extensions/renderer/resources/media_router_bindings.js

Issue 2145983003: [Media Router] Adds return value to mojo MediaRouteProvider::TerminateRoute. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initial patch Created 4 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 unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698