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

Side by Side Diff: mojo/dart/packages/mojo_services/lib/mojo/media/media_sink.mojom.dart

Issue 2006093002: Dart: Futures -> Callbacks. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Merge Created 4 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 // WARNING: DO NOT EDIT. This file was generated by a program. 1 // WARNING: DO NOT EDIT. This file was generated by a program.
2 // See $MOJO_SDK/tools/bindings/mojom_bindings_generator.py. 2 // See $MOJO_SDK/tools/bindings/mojom_bindings_generator.py.
3 3
4 library media_sink_mojom; 4 library media_sink_mojom;
5 import 'dart:async'; 5 import 'dart:async';
6 import 'package:mojo/bindings.dart' as bindings; 6 import 'package:mojo/bindings.dart' as bindings;
7 import 'package:mojo/core.dart' as core; 7 import 'package:mojo/core.dart' as core;
8 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic e_describer; 8 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic e_describer;
9 import 'package:mojo_services/mojo/media/media_transport.mojom.dart' as media_tr ansport_mojom; 9 import 'package:mojo_services/mojo/media/media_transport.mojom.dart' as media_tr ansport_mojom;
10 import 'package:mojo_services/mojo/media/timeline_controller.mojom.dart' as time line_controller_mojom; 10 import 'package:mojo_services/mojo/media/timeline_controller.mojom.dart' as time line_controller_mojom;
11 11
12 12
13 13
14 class _MediaSinkGetConsumerParams extends bindings.Struct { 14 class _MediaSinkGetConsumerParams extends bindings.Struct {
15 static const List<bindings.StructDataHeader> kVersions = const [ 15 static const List<bindings.StructDataHeader> kVersions = const [
16 const bindings.StructDataHeader(16, 0) 16 const bindings.StructDataHeader(16, 0)
17 ]; 17 ];
18 media_transport_mojom.MediaConsumerInterfaceRequest consumer = null; 18 media_transport_mojom.MediaConsumerInterfaceRequest consumer = null;
19 19
20 _MediaSinkGetConsumerParams() : super(kVersions.last.size); 20 _MediaSinkGetConsumerParams() : super(kVersions.last.size);
21 21
22 _MediaSinkGetConsumerParams.init(
23 media_transport_mojom.MediaConsumerInterfaceRequest this.consumer
24 ) : super(kVersions.last.size);
25
22 static _MediaSinkGetConsumerParams deserialize(bindings.Message message) { 26 static _MediaSinkGetConsumerParams deserialize(bindings.Message message) {
23 var decoder = new bindings.Decoder(message); 27 var decoder = new bindings.Decoder(message);
24 var result = decode(decoder); 28 var result = decode(decoder);
25 if (decoder.excessHandles != null) { 29 if (decoder.excessHandles != null) {
26 decoder.excessHandles.forEach((h) => h.close()); 30 decoder.excessHandles.forEach((h) => h.close());
27 } 31 }
28 return result; 32 return result;
29 } 33 }
30 34
31 static _MediaSinkGetConsumerParams decode(bindings.Decoder decoder0) { 35 static _MediaSinkGetConsumerParams decode(bindings.Decoder decoder0) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 87
84 88
85 class _MediaSinkGetTimelineControlSiteParams extends bindings.Struct { 89 class _MediaSinkGetTimelineControlSiteParams extends bindings.Struct {
86 static const List<bindings.StructDataHeader> kVersions = const [ 90 static const List<bindings.StructDataHeader> kVersions = const [
87 const bindings.StructDataHeader(16, 0) 91 const bindings.StructDataHeader(16, 0)
88 ]; 92 ];
89 timeline_controller_mojom.MediaTimelineControlSiteInterfaceRequest timelineCon trolSite = null; 93 timeline_controller_mojom.MediaTimelineControlSiteInterfaceRequest timelineCon trolSite = null;
90 94
91 _MediaSinkGetTimelineControlSiteParams() : super(kVersions.last.size); 95 _MediaSinkGetTimelineControlSiteParams() : super(kVersions.last.size);
92 96
97 _MediaSinkGetTimelineControlSiteParams.init(
98 timeline_controller_mojom.MediaTimelineControlSiteInterfaceRequest this.time lineControlSite
99 ) : super(kVersions.last.size);
100
93 static _MediaSinkGetTimelineControlSiteParams deserialize(bindings.Message mes sage) { 101 static _MediaSinkGetTimelineControlSiteParams deserialize(bindings.Message mes sage) {
94 var decoder = new bindings.Decoder(message); 102 var decoder = new bindings.Decoder(message);
95 var result = decode(decoder); 103 var result = decode(decoder);
96 if (decoder.excessHandles != null) { 104 if (decoder.excessHandles != null) {
97 decoder.excessHandles.forEach((h) => h.close()); 105 decoder.excessHandles.forEach((h) => h.close());
98 } 106 }
99 return result; 107 return result;
100 } 108 }
101 109
102 static _MediaSinkGetTimelineControlSiteParams decode(bindings.Decoder decoder0 ) { 110 static _MediaSinkGetTimelineControlSiteParams decode(bindings.Decoder decoder0 ) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 Map toJson() { 157 Map toJson() {
150 throw new bindings.MojoCodecError( 158 throw new bindings.MojoCodecError(
151 'Object containing handles cannot be encoded to JSON.'); 159 'Object containing handles cannot be encoded to JSON.');
152 } 160 }
153 } 161 }
154 162
155 const int _mediaSinkMethodGetConsumerName = 0; 163 const int _mediaSinkMethodGetConsumerName = 0;
156 const int _mediaSinkMethodGetTimelineControlSiteName = 1; 164 const int _mediaSinkMethodGetTimelineControlSiteName = 1;
157 165
158 class _MediaSinkServiceDescription implements service_describer.ServiceDescripti on { 166 class _MediaSinkServiceDescription implements service_describer.ServiceDescripti on {
159 dynamic getTopLevelInterface([Function responseFactory]) => 167 void getTopLevelInterface(Function responder) {
160 responseFactory(null); 168 responder(null);
169 }
161 170
162 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => 171 void getTypeDefinition(String typeKey, Function responder) {
163 responseFactory(null); 172 responder(null);
173 }
164 174
165 dynamic getAllTypeDefinitions([Function responseFactory]) => 175 void getAllTypeDefinitions(Function responder) {
166 responseFactory(null); 176 responder(null);
177 }
167 } 178 }
168 179
169 abstract class MediaSink { 180 abstract class MediaSink {
170 static const String serviceName = null; 181 static const String serviceName = null;
171 182
172 static service_describer.ServiceDescription _cachedServiceDescription; 183 static service_describer.ServiceDescription _cachedServiceDescription;
173 static service_describer.ServiceDescription get serviceDescription { 184 static service_describer.ServiceDescription get serviceDescription {
174 if (_cachedServiceDescription == null) { 185 if (_cachedServiceDescription == null) {
175 _cachedServiceDescription = new _MediaSinkServiceDescription(); 186 _cachedServiceDescription = new _MediaSinkServiceDescription();
176 } 187 }
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 : super.fromHandle(handle, autoBegin: impl != null) { 332 : super.fromHandle(handle, autoBegin: impl != null) {
322 _impl = impl; 333 _impl = impl;
323 } 334 }
324 335
325 _MediaSinkStubControl.unbound([this._impl]) : super.unbound(); 336 _MediaSinkStubControl.unbound([this._impl]) : super.unbound();
326 337
327 String get serviceName => MediaSink.serviceName; 338 String get serviceName => MediaSink.serviceName;
328 339
329 340
330 341
331 dynamic handleMessage(bindings.ServiceMessage message) { 342 void handleMessage(bindings.ServiceMessage message) {
332 if (bindings.ControlMessageHandler.isControlMessage(message)) { 343 if (bindings.ControlMessageHandler.isControlMessage(message)) {
333 return bindings.ControlMessageHandler.handleMessage(this, 344 bindings.ControlMessageHandler.handleMessage(
334 0, 345 this, 0, message);
335 message); 346 return;
336 } 347 }
337 if (_impl == null) { 348 if (_impl == null) {
338 throw new core.MojoApiError("$this has no implementation set"); 349 throw new core.MojoApiError("$this has no implementation set");
339 } 350 }
340 switch (message.header.type) { 351 switch (message.header.type) {
341 case _mediaSinkMethodGetConsumerName: 352 case _mediaSinkMethodGetConsumerName:
342 var params = _MediaSinkGetConsumerParams.deserialize( 353 var params = _MediaSinkGetConsumerParams.deserialize(
343 message.payload); 354 message.payload);
344 _impl.getConsumer(params.consumer); 355 _impl.getConsumer(params.consumer);
345 break; 356 break;
346 case _mediaSinkMethodGetTimelineControlSiteName: 357 case _mediaSinkMethodGetTimelineControlSiteName:
347 var params = _MediaSinkGetTimelineControlSiteParams.deserialize( 358 var params = _MediaSinkGetTimelineControlSiteParams.deserialize(
348 message.payload); 359 message.payload);
349 _impl.getTimelineControlSite(params.timelineControlSite); 360 _impl.getTimelineControlSite(params.timelineControlSite);
350 break; 361 break;
351 default: 362 default:
352 throw new bindings.MojoCodecError("Unexpected message name"); 363 throw new bindings.MojoCodecError("Unexpected message name");
353 break; 364 break;
354 } 365 }
355 return null;
356 } 366 }
357 367
358 MediaSink get impl => _impl; 368 MediaSink get impl => _impl;
359 set impl(MediaSink d) { 369 set impl(MediaSink d) {
360 if (d == null) { 370 if (d == null) {
361 throw new core.MojoApiError("$this: Cannot set a null implementation"); 371 throw new core.MojoApiError("$this: Cannot set a null implementation");
362 } 372 }
363 if (isBound && (_impl == null)) { 373 if (isBound && (_impl == null)) {
364 beginHandlingEvents(); 374 beginHandlingEvents();
365 } 375 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 void getConsumer(media_transport_mojom.MediaConsumerInterfaceRequest consumer) { 419 void getConsumer(media_transport_mojom.MediaConsumerInterfaceRequest consumer) {
410 return impl.getConsumer(consumer); 420 return impl.getConsumer(consumer);
411 } 421 }
412 void getTimelineControlSite(timeline_controller_mojom.MediaTimelineControlSite InterfaceRequest timelineControlSite) { 422 void getTimelineControlSite(timeline_controller_mojom.MediaTimelineControlSite InterfaceRequest timelineControlSite) {
413 return impl.getTimelineControlSite(timelineControlSite); 423 return impl.getTimelineControlSite(timelineControlSite);
414 } 424 }
415 } 425 }
416 426
417 427
418 428
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698