| Index: chrome/browser/media/router/media_router.mojom
|
| diff --git a/chrome/browser/media/router/media_router.mojom b/chrome/browser/media/router/media_router.mojom
|
| index 7df55ce0d9b844131cc95f73590ac3c1b3e0c7ee..c87457001e36c0343eecd092791cd15f04adb159 100644
|
| --- a/chrome/browser/media/router/media_router.mojom
|
| +++ b/chrome/browser/media/router/media_router.mojom
|
| @@ -143,6 +143,23 @@ interface MediaRouteProvider {
|
| string origin,
|
| int32 tab_id) => (MediaRoute? route, string? error_text);
|
|
|
| + // Connects an established route given by |route_id| with
|
| + // |media_source|. The presentation ID of the route created will be
|
| + // |presentation_id|, but it may be overridden by a provider implementation.
|
| + // The presentation ID will be used by the presentation API to refer to the
|
| + // created route. |origin| and |tab_id| are used for validating
|
| + // same-origin/tab scopes.
|
| + // (See CreateRoute for additional documentation)
|
| + // If the operation was successful, |route| will be defined and
|
| + // |error_text| will be null. If the operation failed, |route| will be null
|
| + // and |error_text| will be set.
|
| + ConnectRouteByRouteId(string media_source,
|
| + string route_id,
|
| + string presentation_id,
|
| + string origin,
|
| + int32 tab_id) =>
|
| + (MediaRoute? route, string? error_text);
|
| +
|
| // Terminates the route specified by |route_id|.
|
| TerminateRoute(string route_id);
|
|
|
| @@ -162,12 +179,29 @@ interface MediaRouteProvider {
|
| StopObservingMediaSinks(string media_source);
|
|
|
| // Starts reporting the state of active media routes via
|
| - // OnRoutesUpdated(). Querying will continue until
|
| - // StopObservingMediaRoutes() is called.
|
| - StartObservingMediaRoutes();
|
| -
|
| - // Stops querying the state of all media routes.
|
| - StopObservingMediaRoutes();
|
| + // OnRoutesUpdated() in the context of the |media_source|. The
|
| + // |media_source| represents the application interested in the media
|
| + // routes (usually the web page from which the content originates).
|
| + // If no |media_source| is given, this should be considered an
|
| + // observer that is not associated with a media source, and thus
|
| + // cannot connect to a remote route without showing a source. The
|
| + // |media_source| should be considered when returning joinable routes in the
|
| + // OnRoutesUpdated() call. If an empty |media_source| is given, there is no
|
| + // context in which a joinable route makes sense and therefore, there should
|
| + // not be any joinable routes returned in OnRoutesUpdated().
|
| + // Querying will continue until StopObservingMediaRoutes() is called with
|
| + // the same |media_source| (even if it's an empty string).
|
| + StartObservingMediaRoutes(string media_source);
|
| +
|
| + // Stops querying the state of all media routes in the context of
|
| + // the |media_source|. StartObservingMediaRoutes() has
|
| + // to be called with the same |media_source| for this to have any effect even
|
| + // if it's empty. Thus, StartObservingMediaRoutes(media_source) must be
|
| + // matched with StopObservingMediaRoutes(media_source).
|
| + // Calling StopObservingMediaRoutes() without a media_source will stop
|
| + // any media routes queries associated with emtpy strings (queries
|
| + // that being with StartObservingMediaRoutes()).
|
| + StopObservingMediaRoutes(string media_source);
|
|
|
| // Called when the MediaRouter is ready to get the next batch of messages
|
| // associated with |route_id|.
|
| @@ -223,8 +257,11 @@ interface MediaRouter {
|
| // Called when issues are reported for media routes.
|
| OnIssue(Issue issue);
|
|
|
| - // Called when list of routes has been updated.
|
| - OnRoutesUpdated(array<MediaRoute> routes);
|
| + // Called when list of routes has been updated in the context of the
|
| + // calling |media_source|. The array |joinable_route_ids| should
|
| + // contain route IDs of joinable routes found in the |routes| array.
|
| + OnRoutesUpdated(array<MediaRoute> routes, string media_source,
|
| + array<string> joinable_route_ids);
|
|
|
| // Called when the overall availability of media sinks has been updated.
|
| OnSinkAvailabilityUpdated(SinkAvailability availability);
|
|
|