| 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/common_custom_types.mojom"; |
| 8 |
| 7 // Represents an output sink to which media can be routed. | 9 // Represents an output sink to which media can be routed. |
| 8 struct MediaSink { | 10 struct MediaSink { |
| 9 enum IconType { | 11 enum IconType { |
| 10 CAST, | 12 CAST, |
| 11 CAST_AUDIO, | 13 CAST_AUDIO, |
| 12 CAST_AUDIO_GROUP, | 14 CAST_AUDIO_GROUP, |
| 13 GENERIC, | 15 GENERIC, |
| 14 HANGOUT | 16 HANGOUT |
| 15 }; | 17 }; |
| 16 | 18 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 // Creates a media route from |media_source| to the sink given by |sink_id|. | 145 // Creates a media route from |media_source| to the sink given by |sink_id|. |
| 144 // | 146 // |
| 145 // The presentation ID of the route created will be |presentation_id|, but it | 147 // The presentation ID of the route created will be |presentation_id|, but it |
| 146 // may be overridden by a provider implementation. The presentation ID will | 148 // may be overridden by a provider implementation. The presentation ID will |
| 147 // be used by the presentation API to refer to the created route. | 149 // be used by the presentation API to refer to the created route. |
| 148 // | 150 // |
| 149 // |origin| and |tab_id| may be passed in for enforcing same-origin and/or | 151 // |origin| and |tab_id| may be passed in for enforcing same-origin and/or |
| 150 // same-tab scopes. Use -1 as |tab_id| in cases where the request is not | 152 // same-tab scopes. Use -1 as |tab_id| in cases where the request is not |
| 151 // made on behalf of a tab. | 153 // made on behalf of a tab. |
| 152 // | 154 // |
| 153 // If |timeout_millis| is positive, it will be used in place of the default | 155 // If |timeout| is positive, it will be used in place of the default timeout |
| 154 // timeout defined by Media Route Provider Manager. | 156 // defined by Media Route Provider Manager. |
| 155 // | 157 // |
| 156 // If |incognito| is true, the request was made by an incognito profile. | 158 // If |incognito| is true, the request was made by an incognito profile. |
| 157 // | 159 // |
| 158 // If the operation was successful, |route| will be defined and | 160 // If the operation was successful, |route| will be defined and |
| 159 // |error_text| will be null. | 161 // |error_text| will be null. |
| 160 // If the operation failed, |route| will be null and |error_text| | 162 // If the operation failed, |route| will be null and |error_text| |
| 161 // will be set. | 163 // will be set. |
| 162 // |result| will be set to OK if successful, or an error code if an error | 164 // |result| will be set to OK if successful, or an error code if an error |
| 163 // occurred. | 165 // occurred. |
| 164 CreateRoute(string media_source, | 166 CreateRoute(string media_source, |
| 165 string sink_id, | 167 string sink_id, |
| 166 string original_presentation_id, | 168 string original_presentation_id, |
| 167 string origin, | 169 string origin, |
| 168 int32 tab_id, | 170 int32 tab_id, |
| 169 int64 timeout_millis, | 171 mojo.common.mojom.TimeDelta timeout, |
| 170 bool incognito) => | 172 bool incognito) => |
| 171 (MediaRoute? route, | 173 (MediaRoute? route, |
| 172 string? error_text, | 174 string? error_text, |
| 173 RouteRequestResultCode result_code); | 175 RouteRequestResultCode result_code); |
| 174 | 176 |
| 175 // Requests a connection to an established route for |media_source| given | 177 // Requests a connection to an established route for |media_source| given |
| 176 // by |presentation_id|. | 178 // by |presentation_id|. |
| 177 // | 179 // |
| 178 // |origin| and |tab_id| are used for validating same-origin/tab scopes; | 180 // |origin| and |tab_id| are used for validating same-origin/tab scopes; |
| 179 // see CreateRoute for additional documentation. | 181 // see CreateRoute for additional documentation. |
| 180 // | 182 // |
| 181 // If |timeout_millis| is positive, it will be used in place of the default | 183 // If |timeout| is positive, it will be used in place of the default timeout |
| 182 // timeout defined by Media Route Provider Manager. | 184 // defined by Media Route Provider Manager. |
| 183 // | 185 // |
| 184 // If the route request was created by an incognito profile, | 186 // If the route request was created by an incognito profile, |
| 185 // |incognito| must be true. | 187 // |incognito| must be true. |
| 186 // | 188 // |
| 187 // If the operation was successful, |route| will be defined and | 189 // If the operation was successful, |route| will be defined and |
| 188 // |error_text| will be null. | 190 // |error_text| will be null. |
| 189 // If the operation failed, |route| will be null and |error_text| | 191 // If the operation failed, |route| will be null and |error_text| |
| 190 // will be set. | 192 // will be set. |
| 191 // |result| will be set to OK if successful, or an error code if an error | 193 // |result| will be set to OK if successful, or an error code if an error |
| 192 // occurred. | 194 // occurred. |
| 193 JoinRoute(string media_source, | 195 JoinRoute(string media_source, |
| 194 string presentation_id, | 196 string presentation_id, |
| 195 string origin, | 197 string origin, |
| 196 int32 tab_id, | 198 int32 tab_id, |
| 197 int64 timeout_millis, | 199 mojo.common.mojom.TimeDelta timeout, |
| 198 bool incognito) => | 200 bool incognito) => |
| 199 (MediaRoute? route, | 201 (MediaRoute? route, |
| 200 string? error_text, | 202 string? error_text, |
| 201 RouteRequestResultCode result_code); | 203 RouteRequestResultCode result_code); |
| 202 | 204 |
| 203 // Creates a new route for |media_source| that connects to the established | 205 // Creates a new route for |media_source| that connects to the established |
| 204 // route given by |route_id|. | 206 // route given by |route_id|. |
| 205 // | 207 // |
| 206 // The presentation ID of the new route will be |presentation_id|, but it may | 208 // The presentation ID of the new route will be |presentation_id|, but it may |
| 207 // be overridden by a provider implementation. The presentation ID will be | 209 // be overridden by a provider implementation. The presentation ID will be |
| 208 // used by the presentation API to refer to the created route. | 210 // used by the presentation API to refer to the created route. |
| 209 // | 211 // |
| 210 // |origin| and |tab_id| are used for validating same-origin/tab scopes; see | 212 // |origin| and |tab_id| are used for validating same-origin/tab scopes; see |
| 211 // CreateRoute for additional documentation. | 213 // CreateRoute for additional documentation. |
| 212 // | 214 // |
| 213 // If |timeout_millis| is positive, it will be used in place of the default | 215 // If |timeout| is positive, it will be used in place of the default timeout |
| 214 // timeout defined by Media Route Provider Manager; see CreateRoute for | 216 // defined by Media Route Provider Manager; see CreateRoute for additional |
| 215 // additional documentation. | 217 // documentation. |
| 216 // | 218 // |
| 217 // If the route request was created by an incognito profile, | 219 // If the route request was created by an incognito profile, |
| 218 // |incognito| must be true. | 220 // |incognito| must be true. |
| 219 // | 221 // |
| 220 // If the operation was successful, |route| will be defined and | 222 // If the operation was successful, |route| will be defined and |
| 221 // |error_text| will be null. If the operation failed, |route| will be null | 223 // |error_text| will be null. If the operation failed, |route| will be null |
| 222 // and |error_text| will be set. | 224 // and |error_text| will be set. |
| 223 // | 225 // |
| 224 // |result| will be set to OK if successful, or an error code if an error | 226 // |result| will be set to OK if successful, or an error code if an error |
| 225 // occurred. | 227 // occurred. |
| 226 ConnectRouteByRouteId(string media_source, | 228 ConnectRouteByRouteId(string media_source, |
| 227 string route_id, | 229 string route_id, |
| 228 string presentation_id, | 230 string presentation_id, |
| 229 string origin, | 231 string origin, |
| 230 int32 tab_id, | 232 int32 tab_id, |
| 231 int64 timeout_millis, | 233 mojo.common.mojom.TimeDelta timeout, |
| 232 bool incognito) => | 234 bool incognito) => |
| 233 (MediaRoute? route, | 235 (MediaRoute? route, |
| 234 string? error_text, | 236 string? error_text, |
| 235 RouteRequestResultCode result_code); | 237 RouteRequestResultCode result_code); |
| 236 | 238 |
| 237 // Terminates the route specified by |route_id|. If the route was terminated | 239 // Terminates the route specified by |route_id|. If the route was terminated |
| 238 // successfully, |result_code| is set to OK and |error_text| is null. | 240 // successfully, |result_code| is set to OK and |error_text| is null. |
| 239 // Otherwise, |result_code| is an error code and |error_text| describes the | 241 // Otherwise, |result_code| is an error code and |error_text| describes the |
| 240 // error. | 242 // error. |
| 241 TerminateRoute(string route_id) => | 243 TerminateRoute(string route_id) => |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 | 385 |
| 384 // Called when the a batch of messages arrives from the media sink for the | 386 // Called when the a batch of messages arrives from the media sink for the |
| 385 // route given by |route_id|. | 387 // route given by |route_id|. |
| 386 // |StartListeningForRouteMessages| must be called first in order to receive | 388 // |StartListeningForRouteMessages| must be called first in order to receive |
| 387 // messages. | 389 // messages. |
| 388 // |route_id|: ID of route of the messages. | 390 // |route_id|: ID of route of the messages. |
| 389 // |messages|: A non-empty list of messages received. | 391 // |messages|: A non-empty list of messages received. |
| 390 OnRouteMessagesReceived(string route_id, | 392 OnRouteMessagesReceived(string route_id, |
| 391 array<RouteMessage> messages); | 393 array<RouteMessage> messages); |
| 392 }; | 394 }; |
| OLD | NEW |