Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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| can be used to optionally verify that the origin is |
|
mark a. foltz
2016/03/03 22:58:36
I would say:
|origin| is the origin of the client
matt.boetger
2016/03/04 00:22:10
This is the second time you have suggested a chang
| |
| 219 // authorized to issue the query. | |
| 220 StartObservingMediaSinks(string media_source, string origin); | |
| 219 | 221 |
| 220 // Stops querying sinks for |media_source|. | 222 // Stops querying sinks for |media_source|. |
|
mark a. foltz
2016/03/03 22:58:36
And:
|origin| is the origin of the client that sta
matt.boetger
2016/03/04 00:22:10
Done.
| |
| 221 StopObservingMediaSinks(string media_source); | 223 StopObservingMediaSinks(string media_source, string origin); |
| 222 | 224 |
| 223 // Starts reporting the state of active media routes via | 225 // Starts reporting the state of active media routes via |
| 224 // OnRoutesUpdated() in the context of the |media_source|. The | 226 // OnRoutesUpdated() in the context of the |media_source|. The |
| 225 // |media_source| represents the application interested in the media | 227 // |media_source| represents the application interested in the media |
| 226 // routes (usually the web page from which the content originates). | 228 // routes (usually the web page from which the content originates). |
| 227 // If no |media_source| is given, this should be considered an | 229 // If no |media_source| is given, this should be considered an |
| 228 // observer that is not associated with a media source, and thus | 230 // observer that is not associated with a media source, and thus |
| 229 // cannot connect to a remote route without showing a source. The | 231 // cannot connect to a remote route without showing a source. The |
| 230 // |media_source| should be considered when returning joinable routes in the | 232 // |media_source| should be considered when returning joinable routes in the |
| 231 // OnRoutesUpdated() call. If an empty |media_source| is given, there is no | 233 // OnRoutesUpdated() call. If an empty |media_source| is given, there is no |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 295 WENT_AWAY | 297 WENT_AWAY |
| 296 }; | 298 }; |
| 297 | 299 |
| 298 // Registers a MediaRouteProvider with the MediaRouter. | 300 // Registers a MediaRouteProvider with the MediaRouter. |
| 299 // Returns a string that uniquely identifies the Media Router browser | 301 // Returns a string that uniquely identifies the Media Router browser |
| 300 // process. | 302 // process. |
| 301 RegisterMediaRouteProvider(MediaRouteProvider media_router_provider) => | 303 RegisterMediaRouteProvider(MediaRouteProvider media_router_provider) => |
| 302 (string instance_id); | 304 (string instance_id); |
| 303 | 305 |
| 304 // Called when the Media Route Manager receives a new list of sinks. | 306 // Called when the Media Route Manager receives a new list of sinks. |
| 305 OnSinksReceived(string media_source, array<MediaSink> sinks); | 307 OnSinksReceived(string media_source, string origin, array<MediaSink> sinks); |
| 306 | 308 |
| 307 // Called when issues are reported for media routes. | 309 // Called when issues are reported for media routes. |
| 308 OnIssue(Issue issue); | 310 OnIssue(Issue issue); |
| 309 | 311 |
| 310 // Called when list of routes has been updated in the context of the | 312 // Called when list of routes has been updated in the context of the |
| 311 // calling |media_source|. The array |joinable_route_ids| should | 313 // calling |media_source|. The array |joinable_route_ids| should |
| 312 // contain route IDs of joinable routes found in the |routes| array. | 314 // contain route IDs of joinable routes found in the |routes| array. |
| 313 OnRoutesUpdated(array<MediaRoute> routes, string media_source, | 315 OnRoutesUpdated(array<MediaRoute> routes, string media_source, |
| 314 array<string> joinable_route_ids); | 316 array<string> joinable_route_ids); |
| 315 | 317 |
| 316 // Called when the overall availability of media sinks has been updated. | 318 // Called when the overall availability of media sinks has been updated. |
| 317 OnSinkAvailabilityUpdated(SinkAvailability availability); | 319 OnSinkAvailabilityUpdated(SinkAvailability availability); |
| 318 | 320 |
| 319 // Called when the state of presentation connected to route |route_id| has | 321 // Called when the state of presentation connected to route |route_id| has |
| 320 // changed to |state|. | 322 // changed to |state|. |
| 321 OnPresentationConnectionStateChanged( | 323 OnPresentationConnectionStateChanged( |
| 322 string route_id, PresentationConnectionState state); | 324 string route_id, PresentationConnectionState state); |
| 323 | 325 |
| 324 // Called when the presentation connected to route |route_id| has closed. | 326 // Called when the presentation connected to route |route_id| has closed. |
| 325 OnPresentationConnectionClosed( | 327 OnPresentationConnectionClosed( |
| 326 string route_id, PresentationConnectionCloseReason reason, | 328 string route_id, PresentationConnectionCloseReason reason, |
| 327 string message); | 329 string message); |
| 328 }; | 330 }; |
| 329 | 331 |
| OLD | NEW |