From c9adbb1e8d955e1f658d92578ab5a51e4dbc8872 Mon Sep 17 00:00:00 2001 From: imcheng Date: Tue, 15 Mar 2016 15:17:04 -0700 Subject: [Media Router] Add origins to sink query results. Takes over https://codereview.chromium.org/1693963003/ Add |origins| to |OnSinksReceived| API from MRPM to MR. If |origins| is non-empty, then the result of sink query is only valid for those origins. Otherwise, the result is valid for all origins, which is the legacy behavior. The origin checking is done in base MediaSinksObserver class, which will call into the version of |OnSinksReceived| overridable by children classes. BUG=594858 Review URL: https://codereview.chromium.org/1784533004 Cr-Commit-Position: refs/heads/master@{#381332} --- extensions/renderer/resources/media_router_bindings.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'extensions/renderer') diff --git a/extensions/renderer/resources/media_router_bindings.js b/extensions/renderer/resources/media_router_bindings.js index b6252c5..cfb36f1 100644 --- a/extensions/renderer/resources/media_router_bindings.js +++ b/extensions/renderer/resources/media_router_bindings.js @@ -265,9 +265,13 @@ define('media_router_bindings', [ * updated. * @param {!string} sourceUrn * @param {!Array} sinks + * @param {Array=} opt_origins */ - MediaRouter.prototype.onSinksReceived = function(sourceUrn, sinks) { - this.service_.onSinksReceived(sourceUrn, sinks.map(sinkToMojo_)); + MediaRouter.prototype.onSinksReceived = function(sourceUrn, sinks, + opt_origins) { + // TODO(imcheng): Make origins required in M52+. + this.service_.onSinksReceived(sourceUrn, sinks.map(sinkToMojo_), + opt_origins || []); }; /** -- cgit v1.1