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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 168 // Sends |message| via the media route |media_route_id|. | 168 // Sends |message| via the media route |media_route_id|. |
| 169 // If the operation was successful, |sent| is true; otherwise it is false. | 169 // If the operation was successful, |sent| is true; otherwise it is false. |
| 170 SendRouteMessage(string media_route_id, string message) => (bool sent); | 170 SendRouteMessage(string media_route_id, string message) => (bool sent); |
| 171 | 171 |
| 172 // Sends |data| via the media route |media_route_id|. | 172 // Sends |data| via the media route |media_route_id|. |
| 173 // If the operation was successful, |sent| is true; otherwise it is false. | 173 // If the operation was successful, |sent| is true; otherwise it is false. |
| 174 SendRouteBinaryMessage(string media_route_id, array<uint8> data) | 174 SendRouteBinaryMessage(string media_route_id, array<uint8> data) |
| 175 => (bool sent); | 175 => (bool sent); |
| 176 | 176 |
| 177 // Starts querying for sinks capable of displaying |media_source|. | 177 // Starts querying for sinks capable of displaying |media_source|. |
| 178 StartObservingMediaSinks(string media_source); | 178 // |origin| can be used to validate the media sink query to prevent |
|
mark a. foltz
2016/02/17 21:50:51
Maybe just say "to optionally verify that the orig
matt.boetger
2016/02/18 00:50:33
Done.
| |
| 179 // fingerprinting by nefarious origins. | |
| 180 StartObservingMediaSinks(string media_source, string origin); | |
| 179 | 181 |
| 180 // Stops querying sinks for |media_source|. | 182 // Stops querying sinks for |media_source|. |
| 181 StopObservingMediaSinks(string media_source); | 183 StopObservingMediaSinks(string media_source); |
| 182 | 184 |
| 183 // Starts reporting the state of active media routes via | 185 // Starts reporting the state of active media routes via |
| 184 // OnRoutesUpdated() in the context of the |media_source|. The | 186 // OnRoutesUpdated() in the context of the |media_source|. The |
| 185 // |media_source| represents the application interested in the media | 187 // |media_source| represents the application interested in the media |
| 186 // routes (usually the web page from which the content originates). | 188 // routes (usually the web page from which the content originates). |
| 187 // If no |media_source| is given, this should be considered an | 189 // If no |media_source| is given, this should be considered an |
| 188 // observer that is not associated with a media source, and thus | 190 // observer that is not associated with a media source, and thus |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 248 TERMINATED | 250 TERMINATED |
| 249 }; | 251 }; |
| 250 | 252 |
| 251 // Registers a MediaRouteProvider with the MediaRouter. | 253 // Registers a MediaRouteProvider with the MediaRouter. |
| 252 // Returns a string that uniquely identifies the Media Router browser | 254 // Returns a string that uniquely identifies the Media Router browser |
| 253 // process. | 255 // process. |
| 254 RegisterMediaRouteProvider(MediaRouteProvider media_router_provider) => | 256 RegisterMediaRouteProvider(MediaRouteProvider media_router_provider) => |
| 255 (string instance_id); | 257 (string instance_id); |
| 256 | 258 |
| 257 // Called when the Media Route Manager receives a new list of sinks. | 259 // Called when the Media Route Manager receives a new list of sinks. |
| 258 OnSinksReceived(string media_source, array<MediaSink> sinks); | 260 OnSinksReceived(string media_source, array<MediaSink> sinks); |
|
imcheng
2016/02/16 20:54:18
do we need an origin param here?
| |
| 259 | 261 |
| 260 // Called when issues are reported for media routes. | 262 // Called when issues are reported for media routes. |
| 261 OnIssue(Issue issue); | 263 OnIssue(Issue issue); |
| 262 | 264 |
| 263 // Called when list of routes has been updated in the context of the | 265 // Called when list of routes has been updated in the context of the |
| 264 // calling |media_source|. The array |joinable_route_ids| should | 266 // calling |media_source|. The array |joinable_route_ids| should |
| 265 // contain route IDs of joinable routes found in the |routes| array. | 267 // contain route IDs of joinable routes found in the |routes| array. |
| 266 OnRoutesUpdated(array<MediaRoute> routes, string media_source, | 268 OnRoutesUpdated(array<MediaRoute> routes, string media_source, |
| 267 array<string> joinable_route_ids); | 269 array<string> joinable_route_ids); |
| 268 | 270 |
| 269 // Called when the overall availability of media sinks has been updated. | 271 // Called when the overall availability of media sinks has been updated. |
| 270 OnSinkAvailabilityUpdated(SinkAvailability availability); | 272 OnSinkAvailabilityUpdated(SinkAvailability availability); |
| 271 | 273 |
| 272 // Called when the state of presentation connected to route |route_id| has | 274 // Called when the state of presentation connected to route |route_id| has |
| 273 // changed to |state|. | 275 // changed to |state|. |
| 274 OnPresentationConnectionStateChanged( | 276 OnPresentationConnectionStateChanged( |
| 275 string route_id, PresentationConnectionState state); | 277 string route_id, PresentationConnectionState state); |
| 276 }; | 278 }; |
| 277 | 279 |
| OLD | NEW |