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

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

Issue 2324133003: [Media Router] Use TimeDelta in mojo interfaces (Closed)
Patch Set: Created 4 years, 3 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
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 00f838ee93f1e9824bfab2ee1da915ab4afab0cd..e4ef8d06ca69f4a2d6fc4a78b771e6e92d2eb5e1 100644
--- a/extensions/renderer/resources/media_router_bindings.js
+++ b/extensions/renderer/resources/media_router_bindings.js
@@ -10,6 +10,7 @@ define('media_router_bindings', [
'content/public/renderer/frame_interfaces',
'chrome/browser/media/router/mojo/media_router.mojom',
'extensions/common/mojo/keep_alive.mojom',
+ 'mojo/common/common_custom_types.mojom',
'mojo/public/js/connection',
'mojo/public/js/router',
], function(bindings,
@@ -17,6 +18,7 @@ define('media_router_bindings', [
frameInterfaces,
mediaRouterMojom,
keepAliveMojom,
+ commonCustomTypesMojom,
connector,
routerModule) {
'use strict';
@@ -599,9 +601,9 @@ define('media_router_bindings', [
* requesting presentation. TODO(mfoltz): Remove.
* @param {!string} origin Origin of site requesting presentation.
* @param {!number} tabId ID of tab requesting presentation.
- * @param {!number} timeoutMillis If positive, the timeout duration for the
- * request, measured in seconds. Otherwise, the default duration will be
- * used.
+ * @param {!TimeDelta} timeout If positive, the timeout duration for the
+ * request, measured in microseconds. Otherwise, the default duration will
miu 2016/09/10 00:40:17 nit: Please remove "measured in microseconds" sinc
btolsch 2016/09/10 00:51:39 Done.
+ * be used.
* @param {!boolean} incognito If true, the route is being requested by
* an incognito profile.
* @return {!Promise.<!Object>} A Promise resolving to an object describing
@@ -610,10 +612,10 @@ define('media_router_bindings', [
*/
MediaRouteProvider.prototype.createRoute =
function(sourceUrn, sinkId, presentationId, origin, tabId,
- timeoutMillis, incognito) {
+ timeout, incognito) {
return this.handlers_.createRoute(
- sourceUrn, sinkId, presentationId, origin, tabId, timeoutMillis,
- incognito)
+ sourceUrn, sinkId, presentationId, origin, tabId,
+ Math.floor(timeout.microseconds / 1000), incognito)
.then(function(route) {
return toSuccessRouteResponse_(route);
},
@@ -630,9 +632,9 @@ define('media_router_bindings', [
* @param {!string} presentationId Presentation ID to join.
* @param {!string} origin Origin of site requesting join.
* @param {!number} tabId ID of tab requesting join.
- * @param {!number} timeoutMillis If positive, the timeout duration for the
- * request, measured in seconds. Otherwise, the default duration will be
- * used.
+ * @param {!TimeDelta} timeout If positive, the timeout duration for the
+ * request, measured in microseconds. Otherwise, the default duration will
+ * be used.
* @param {!boolean} incognito If true, the route is being requested by
* an incognito profile.
* @return {!Promise.<!Object>} A Promise resolving to an object describing
@@ -643,7 +645,8 @@ define('media_router_bindings', [
function(sourceUrn, presentationId, origin, tabId, timeoutMillis,
incognito) {
return this.handlers_.joinRoute(
- sourceUrn, presentationId, origin, tabId, timeoutMillis, incognito)
+ sourceUrn, presentationId, origin, tabId,
+ Math.floor(timeout.microseconds / 1000), incognito)
.then(function(route) {
return toSuccessRouteResponse_(route);
},
@@ -661,9 +664,9 @@ define('media_router_bindings', [
* @param {!string} presentationId Presentation ID to join.
* @param {!string} origin Origin of site requesting join.
* @param {!number} tabId ID of tab requesting join.
- * @param {!number} timeoutMillis If positive, the timeout duration for the
- * request, measured in seconds. Otherwise, the default duration will be
- * used.
+ * @param {!TimeDelta} timeout If positive, the timeout duration for the
+ * request, measured in microseconds. Otherwise, the default duration will
+ * be used.
* @param {!boolean} incognito If true, the route is being requested by
* an incognito profile.
* @return {!Promise.<!Object>} A Promise resolving to an object describing
@@ -672,10 +675,10 @@ define('media_router_bindings', [
*/
MediaRouteProvider.prototype.connectRouteByRouteId =
function(sourceUrn, routeId, presentationId, origin, tabId,
- timeoutMillis, incognito) {
+ timeout, incognito) {
return this.handlers_.connectRouteByRouteId(
- sourceUrn, routeId, presentationId, origin, tabId, timeoutMillis,
- incognito)
+ sourceUrn, routeId, presentationId, origin, tabId,
+ Math.floor(timeout.microseconds / 1000), incognito)
.then(function(route) {
return toSuccessRouteResponse_(route);
},

Powered by Google App Engine
This is Rietveld 408576698