| 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.mojom; | 5 module media_router.mojom; |
| 6 | 6 |
| 7 import "mojo/common/time.mojom"; | 7 import "mojo/common/time.mojom"; |
| 8 import "url/mojo/origin.mojom"; |
| 8 | 9 |
| 9 // Represents an output sink to which media can be routed. | 10 // Represents an output sink to which media can be routed. |
| 10 struct MediaSink { | 11 struct MediaSink { |
| 11 enum IconType { | 12 enum IconType { |
| 12 CAST, | 13 CAST, |
| 13 CAST_AUDIO, | 14 CAST_AUDIO, |
| 14 CAST_AUDIO_GROUP, | 15 CAST_AUDIO_GROUP, |
| 15 GENERIC, | 16 GENERIC, |
| 16 HANGOUT | 17 HANGOUT |
| 17 }; | 18 }; |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 // | 164 // |
| 164 // If the operation was successful, |route| will be defined and | 165 // If the operation was successful, |route| will be defined and |
| 165 // |error_text| will be null. | 166 // |error_text| will be null. |
| 166 // If the operation failed, |route| will be null and |error_text| | 167 // If the operation failed, |route| will be null and |error_text| |
| 167 // will be set. | 168 // will be set. |
| 168 // |result| will be set to OK if successful, or an error code if an error | 169 // |result| will be set to OK if successful, or an error code if an error |
| 169 // occurred. | 170 // occurred. |
| 170 CreateRoute(string media_source, | 171 CreateRoute(string media_source, |
| 171 string sink_id, | 172 string sink_id, |
| 172 string original_presentation_id, | 173 string original_presentation_id, |
| 173 string origin, | 174 url.mojom.Origin origin, |
| 174 int32 tab_id, | 175 int32 tab_id, |
| 175 mojo.common.mojom.TimeDelta timeout, | 176 mojo.common.mojom.TimeDelta timeout, |
| 176 bool incognito) => | 177 bool incognito) => |
| 177 (MediaRoute? route, | 178 (MediaRoute? route, |
| 178 string? error_text, | 179 string? error_text, |
| 179 RouteRequestResultCode result_code); | 180 RouteRequestResultCode result_code); |
| 180 | 181 |
| 181 // Requests a connection to an established route for |media_source| given | 182 // Requests a connection to an established route for |media_source| given |
| 182 // by |presentation_id|. | 183 // by |presentation_id|. |
| 183 // | 184 // |
| 184 // |origin| and |tab_id| are used for validating same-origin/tab scopes; | 185 // |origin| and |tab_id| are used for validating same-origin/tab scopes; |
| 185 // see CreateRoute for additional documentation. | 186 // see CreateRoute for additional documentation. |
| 186 // | 187 // |
| 187 // If |timeout| is positive, it will be used in place of the default timeout | 188 // If |timeout| is positive, it will be used in place of the default timeout |
| 188 // defined by Media Route Provider Manager. | 189 // defined by Media Route Provider Manager. |
| 189 // | 190 // |
| 190 // If the route request was created by an incognito profile, | 191 // If the route request was created by an incognito profile, |
| 191 // |incognito| must be true. | 192 // |incognito| must be true. |
| 192 // | 193 // |
| 193 // If the operation was successful, |route| will be defined and | 194 // If the operation was successful, |route| will be defined and |
| 194 // |error_text| will be null. | 195 // |error_text| will be null. |
| 195 // If the operation failed, |route| will be null and |error_text| | 196 // If the operation failed, |route| will be null and |error_text| |
| 196 // will be set. | 197 // will be set. |
| 197 // |result| will be set to OK if successful, or an error code if an error | 198 // |result| will be set to OK if successful, or an error code if an error |
| 198 // occurred. | 199 // occurred. |
| 199 JoinRoute(string media_source, | 200 JoinRoute(string media_source, |
| 200 string presentation_id, | 201 string presentation_id, |
| 201 string origin, | 202 url.mojom.Origin origin, |
| 202 int32 tab_id, | 203 int32 tab_id, |
| 203 mojo.common.mojom.TimeDelta timeout, | 204 mojo.common.mojom.TimeDelta timeout, |
| 204 bool incognito) => | 205 bool incognito) => |
| 205 (MediaRoute? route, | 206 (MediaRoute? route, |
| 206 string? error_text, | 207 string? error_text, |
| 207 RouteRequestResultCode result_code); | 208 RouteRequestResultCode result_code); |
| 208 | 209 |
| 209 // Creates a new route for |media_source| that connects to the established | 210 // Creates a new route for |media_source| that connects to the established |
| 210 // route given by |route_id|. | 211 // route given by |route_id|. |
| 211 // | 212 // |
| (...skipping 13 matching lines...) Expand all Loading... |
| 225 // | 226 // |
| 226 // If the operation was successful, |route| will be defined and | 227 // If the operation was successful, |route| will be defined and |
| 227 // |error_text| will be null. If the operation failed, |route| will be null | 228 // |error_text| will be null. If the operation failed, |route| will be null |
| 228 // and |error_text| will be set. | 229 // and |error_text| will be set. |
| 229 // | 230 // |
| 230 // |result| will be set to OK if successful, or an error code if an error | 231 // |result| will be set to OK if successful, or an error code if an error |
| 231 // occurred. | 232 // occurred. |
| 232 ConnectRouteByRouteId(string media_source, | 233 ConnectRouteByRouteId(string media_source, |
| 233 string route_id, | 234 string route_id, |
| 234 string presentation_id, | 235 string presentation_id, |
| 235 string origin, | 236 url.mojom.Origin origin, |
| 236 int32 tab_id, | 237 int32 tab_id, |
| 237 mojo.common.mojom.TimeDelta timeout, | 238 mojo.common.mojom.TimeDelta timeout, |
| 238 bool incognito) => | 239 bool incognito) => |
| 239 (MediaRoute? route, | 240 (MediaRoute? route, |
| 240 string? error_text, | 241 string? error_text, |
| 241 RouteRequestResultCode result_code); | 242 RouteRequestResultCode result_code); |
| 242 | 243 |
| 243 // Terminates the route specified by |route_id|. If the route was terminated | 244 // Terminates the route specified by |route_id|. If the route was terminated |
| 244 // successfully, |result_code| is set to OK and |error_text| is null. | 245 // successfully, |result_code| is set to OK and |error_text| is null. |
| 245 // Otherwise, |result_code| is an error code and |error_text| describes the | 246 // Otherwise, |result_code| is an error code and |error_text| describes the |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 // Registers a MediaRouteProvider with the MediaRouter. | 357 // Registers a MediaRouteProvider with the MediaRouter. |
| 357 // Returns a string that uniquely identifies the Media Router browser | 358 // Returns a string that uniquely identifies the Media Router browser |
| 358 // process. | 359 // process. |
| 359 RegisterMediaRouteProvider(MediaRouteProvider media_router_provider) => | 360 RegisterMediaRouteProvider(MediaRouteProvider media_router_provider) => |
| 360 (string instance_id); | 361 (string instance_id); |
| 361 | 362 |
| 362 // Called when the Media Route Manager receives a new list of |sinks| | 363 // Called when the Media Route Manager receives a new list of |sinks| |
| 363 // compatible with |media_source|. The result is only valid for |origins|. If | 364 // compatible with |media_source|. The result is only valid for |origins|. If |
| 364 // |origins| is empty, the result is valid for any origin. | 365 // |origins| is empty, the result is valid for any origin. |
| 365 OnSinksReceived(string media_source, array<MediaSink> sinks, | 366 OnSinksReceived(string media_source, array<MediaSink> sinks, |
| 366 array<string> origins); | 367 array<url.mojom.Origin> origins); |
| 367 | 368 |
| 368 // Called when issues are reported for media routes. | 369 // Called when issues are reported for media routes. |
| 369 OnIssue(Issue issue); | 370 OnIssue(Issue issue); |
| 370 | 371 |
| 371 // Called when list of routes has been updated in the context of the | 372 // Called when list of routes has been updated in the context of the |
| 372 // calling |media_source|. The array |joinable_route_ids| should | 373 // calling |media_source|. The array |joinable_route_ids| should |
| 373 // contain route IDs of joinable routes found in the |routes| array. | 374 // contain route IDs of joinable routes found in the |routes| array. |
| 374 OnRoutesUpdated(array<MediaRoute> routes, string media_source, | 375 OnRoutesUpdated(array<MediaRoute> routes, string media_source, |
| 375 array<string> joinable_route_ids); | 376 array<string> joinable_route_ids); |
| 376 | 377 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 389 | 390 |
| 390 // Called when the a batch of messages arrives from the media sink for the | 391 // Called when the a batch of messages arrives from the media sink for the |
| 391 // route given by |route_id|. | 392 // route given by |route_id|. |
| 392 // |StartListeningForRouteMessages| must be called first in order to receive | 393 // |StartListeningForRouteMessages| must be called first in order to receive |
| 393 // messages. | 394 // messages. |
| 394 // |route_id|: ID of route of the messages. | 395 // |route_id|: ID of route of the messages. |
| 395 // |messages|: A non-empty list of messages received. | 396 // |messages|: A non-empty list of messages received. |
| 396 OnRouteMessagesReceived(string route_id, | 397 OnRouteMessagesReceived(string route_id, |
| 397 array<RouteMessage> messages); | 398 array<RouteMessage> messages); |
| 398 }; | 399 }; |
| OLD | NEW |