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

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

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

Powered by Google App Engine
This is Rietveld 408576698