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

Side by Side Diff: chrome/browser/media/router/media_router.mojom

Issue 1693963003: Pass origin to StartObservingMediaSinks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Marks Review Fixes with URL changes Created 4 years, 9 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 module media_router.interfaces; 5 module media_router.interfaces;
6 6
7 // Represents an output sink to which media can be routed. 7 // Represents an output sink to which media can be routed.
8 struct MediaSink { 8 struct MediaSink {
9 enum IconType { 9 enum IconType {
10 CAST, 10 CAST,
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 // Sends |message| via the media route |media_route_id|. 208 // Sends |message| via the media route |media_route_id|.
209 // If the operation was successful, |sent| is true; otherwise it is false. 209 // If the operation was successful, |sent| is true; otherwise it is false.
210 SendRouteMessage(string media_route_id, string message) => (bool sent); 210 SendRouteMessage(string media_route_id, string message) => (bool sent);
211 211
212 // Sends |data| via the media route |media_route_id|. 212 // Sends |data| via the media route |media_route_id|.
213 // If the operation was successful, |sent| is true; otherwise it is false. 213 // If the operation was successful, |sent| is true; otherwise it is false.
214 SendRouteBinaryMessage(string media_route_id, array<uint8> data) 214 SendRouteBinaryMessage(string media_route_id, array<uint8> data)
215 => (bool sent); 215 => (bool sent);
216 216
217 // Starts querying for sinks capable of displaying |media_source|. 217 // Starts querying for sinks capable of displaying |media_source|.
218 StartObservingMediaSinks(string media_source); 218 // |origin| is the origin of the client that is requesting media
219 // sinks. It may be used to verify that |origin| is authorized to
220 // receive sinks for |media_source|.
221 StartObservingMediaSinks(string media_source, string origin);
219 222
220 // Stops querying sinks for |media_source|. 223 // Stops querying sinks for |media_source|.
221 StopObservingMediaSinks(string media_source); 224 // |origin| is the origin of the client that started the query.
225 StopObservingMediaSinks(string media_source, string origin);
222 226
223 // Starts reporting the state of active media routes via 227 // Starts reporting the state of active media routes via
224 // OnRoutesUpdated() in the context of the |media_source|. The 228 // OnRoutesUpdated() in the context of the |media_source|. The
225 // |media_source| represents the application interested in the media 229 // |media_source| represents the application interested in the media
226 // routes (usually the web page from which the content originates). 230 // routes (usually the web page from which the content originates).
227 // If no |media_source| is given, this should be considered an 231 // If no |media_source| is given, this should be considered an
228 // observer that is not associated with a media source, and thus 232 // observer that is not associated with a media source, and thus
229 // cannot connect to a remote route without showing a source. The 233 // cannot connect to a remote route without showing a source. The
230 // |media_source| should be considered when returning joinable routes in the 234 // |media_source| should be considered when returning joinable routes in the
231 // OnRoutesUpdated() call. If an empty |media_source| is given, there is no 235 // OnRoutesUpdated() call. If an empty |media_source| is given, there is no
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 WENT_AWAY 299 WENT_AWAY
296 }; 300 };
297 301
298 // Registers a MediaRouteProvider with the MediaRouter. 302 // Registers a MediaRouteProvider with the MediaRouter.
299 // Returns a string that uniquely identifies the Media Router browser 303 // Returns a string that uniquely identifies the Media Router browser
300 // process. 304 // process.
301 RegisterMediaRouteProvider(MediaRouteProvider media_router_provider) => 305 RegisterMediaRouteProvider(MediaRouteProvider media_router_provider) =>
302 (string instance_id); 306 (string instance_id);
303 307
304 // Called when the Media Route Manager receives a new list of sinks. 308 // Called when the Media Route Manager receives a new list of sinks.
305 OnSinksReceived(string media_source, array<MediaSink> sinks); 309 OnSinksReceived(string media_source, string origin, array<MediaSink> sinks);
306 310
307 // Called when issues are reported for media routes. 311 // Called when issues are reported for media routes.
308 OnIssue(Issue issue); 312 OnIssue(Issue issue);
309 313
310 // Called when list of routes has been updated in the context of the 314 // Called when list of routes has been updated in the context of the
311 // calling |media_source|. The array |joinable_route_ids| should 315 // calling |media_source|. The array |joinable_route_ids| should
312 // contain route IDs of joinable routes found in the |routes| array. 316 // contain route IDs of joinable routes found in the |routes| array.
313 OnRoutesUpdated(array<MediaRoute> routes, string media_source, 317 OnRoutesUpdated(array<MediaRoute> routes, string media_source,
314 array<string> joinable_route_ids); 318 array<string> joinable_route_ids);
315 319
316 // Called when the overall availability of media sinks has been updated. 320 // Called when the overall availability of media sinks has been updated.
317 OnSinkAvailabilityUpdated(SinkAvailability availability); 321 OnSinkAvailabilityUpdated(SinkAvailability availability);
318 322
319 // Called when the state of presentation connected to route |route_id| has 323 // Called when the state of presentation connected to route |route_id| has
320 // changed to |state|. 324 // changed to |state|.
321 OnPresentationConnectionStateChanged( 325 OnPresentationConnectionStateChanged(
322 string route_id, PresentationConnectionState state); 326 string route_id, PresentationConnectionState state);
323 327
324 // Called when the presentation connected to route |route_id| has closed. 328 // Called when the presentation connected to route |route_id| has closed.
325 OnPresentationConnectionClosed( 329 OnPresentationConnectionClosed(
326 string route_id, PresentationConnectionCloseReason reason, 330 string route_id, PresentationConnectionCloseReason reason,
327 string message); 331 string message);
328 }; 332 };
329 333
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698