diff options
author | imcheng <imcheng@chromium.org> | 2016-03-15 15:17:04 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-15 22:18:27 +0000 |
commit | c9adbb1e8d955e1f658d92578ab5a51e4dbc8872 (patch) | |
tree | 63cd1a2bda276ad936782e5957d9a9b614200c9f /extensions/renderer | |
parent | 02864e3315b0959644d47603a2d2627474deb9fb (diff) | |
download | chromium_src-c9adbb1e8d955e1f658d92578ab5a51e4dbc8872.zip chromium_src-c9adbb1e8d955e1f658d92578ab5a51e4dbc8872.tar.gz chromium_src-c9adbb1e8d955e1f658d92578ab5a51e4dbc8872.tar.bz2 |
[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}
Diffstat (limited to 'extensions/renderer')
-rw-r--r-- | extensions/renderer/resources/media_router_bindings.js | 8 |
1 files changed, 6 insertions, 2 deletions
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<!MediaSink>} sinks + * @param {Array<string>=} 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 || []); }; /** |