Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: chrome/browser/media/router/media_router.mojom

Issue 1173753003: [Media Router] Implement JoinRoute + update CreateRoute API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 // The sink identifier, e.g. "rs71w7mFzYLFlabir_qO4NHl6SUc." 9 // The sink identifier, e.g. "rs71w7mFzYLFlabir_qO4NHl6SUc."
10 string sink_id; 10 string sink_id;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 array<ActionType>? secondary_actions; 77 array<ActionType>? secondary_actions;
78 78
79 // A help page to be opened if users select learn_more. 79 // A help page to be opened if users select learn_more.
80 string? help_url; 80 string? help_url;
81 }; 81 };
82 82
83 // Modeled after the MediaRouter interface defined in 83 // Modeled after the MediaRouter interface defined in
84 // chrome/browser/media/router/media_router.h 84 // chrome/browser/media/router/media_router.h
85 interface MediaRouter { 85 interface MediaRouter {
86 // Initiates a media route from |media_source| to |sink_id|. 86 // Initiates a media route from |media_source| to |sink_id|.
87 // The presentation ID of the route created will be |presentation_id|, but it
88 // may be overridden by a provider implementation. The presentation ID will
mark a. foltz 2015/06/10 23:18:51 Does any provider actually do this? Last time I c
imcheng (use chromium acct) 2015/06/11 22:49:12 I remember in the Start + Join doc that there was
89 // be used by the presentation API to refer to the created route.
90 // |origin| and |tab_id| may be passed in for enforcing same-origin and/or
91 // same-tab scopes and are optional.
92 // Since int types cannot be made optional, use -1 as |tab_id| in cases where
93 // it is not applicable.
87 // If the operation was successful, |route| will be defined and 94 // If the operation was successful, |route| will be defined and
88 // |error_text| will be null. 95 // |error_text| will be null.
89 // If the operation failed, |route| will be null and |error_text| 96 // If the operation failed, |route| will be null and |error_text|
90 // will be set. 97 // will be set.
91 CreateRoute(string media_source, string sink_id) => 98 CreateRoute(string media_source,
92 (MediaRoute? route, string? error_text); 99 string sink_id,
100 string presentation_id,
mark a. foltz 2015/06/10 23:18:51 This might be better named default_presentation_id
imcheng (use chromium acct) 2015/06/11 22:49:12 Done.
101 string? origin,
102 int32 tab_id) => (MediaRoute? route, string? error_text);
103
104 // Joins an established route given by |presentation_id|
105 // with |media_source|.
106 // |origin| and |tab_id| are used for validating same-origin/tab scopes and
107 // are optional. (See CreateRoute for additional documentation)
108 // If the operation was successful, |route| will be defined and
109 // |error_text| will be null.
110 // If the operation failed, |route| will be null and |error_text|
111 // will be set.
112 JoinRoute(string media_source,
113 string presentation_id,
114 string? origin,
115 int32 tab_id) => (MediaRoute? route, string? error_text);
93 116
94 // Closes the route specified by |route_id|. 117 // Closes the route specified by |route_id|.
95 CloseRoute(string route_id); 118 CloseRoute(string route_id);
96 119
97 // Sends |message| with optional |extra_info_json| via the media route 120 // Sends |message| with optional |extra_info_json| via the media route
98 // |media_route_id|. 121 // |media_route_id|.
99 PostMessage(string media_route_id, string message); 122 PostMessage(string media_route_id, string message);
100 123
101 // Starts querying for sinks capable of displaying |media_source|. 124 // Starts querying for sinks capable of displaying |media_source|.
102 StartObservingMediaSinks(string media_source); 125 StartObservingMediaSinks(string media_source);
(...skipping 29 matching lines...) Expand all
132 // Called when the Media Route Manager receives a route message. 155 // Called when the Media Route Manager receives a route message.
133 OnMessage(string media_source, string message); 156 OnMessage(string media_source, string message);
134 157
135 // Called when issues are reported for media routes. 158 // Called when issues are reported for media routes.
136 OnIssue(Issue issue); 159 OnIssue(Issue issue);
137 160
138 // Called when list of routes has been updated. 161 // Called when list of routes has been updated.
139 OnRoutesUpdated(array<MediaRoute> routes); 162 OnRoutesUpdated(array<MediaRoute> routes);
140 }; 163 };
141 164
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698