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

Side by Side Diff: mojo/dart/packages/mojo_services/lib/tracing/tracing.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 tracing_mojom; 4 library tracing_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 9
10 10
11 11
12 class _TraceProviderStartTracingParams extends bindings.Struct { 12 class _TraceProviderStartTracingParams extends bindings.Struct {
13 static const List<bindings.StructDataHeader> kVersions = const [ 13 static const List<bindings.StructDataHeader> kVersions = const [
14 const bindings.StructDataHeader(24, 0) 14 const bindings.StructDataHeader(24, 0)
15 ]; 15 ];
16 String categories = null; 16 String categories = null;
17 TraceRecorderInterface recorder = null; 17 TraceRecorderInterface recorder = null;
18 18
19 _TraceProviderStartTracingParams() : super(kVersions.last.size); 19 _TraceProviderStartTracingParams() : super(kVersions.last.size);
20 20
21 _TraceProviderStartTracingParams.init(
22 String this.categories,
23 TraceRecorderInterface this.recorder
24 ) : super(kVersions.last.size);
25
21 static _TraceProviderStartTracingParams deserialize(bindings.Message message) { 26 static _TraceProviderStartTracingParams deserialize(bindings.Message message) {
22 var decoder = new bindings.Decoder(message); 27 var decoder = new bindings.Decoder(message);
23 var result = decode(decoder); 28 var result = decode(decoder);
24 if (decoder.excessHandles != null) { 29 if (decoder.excessHandles != null) {
25 decoder.excessHandles.forEach((h) => h.close()); 30 decoder.excessHandles.forEach((h) => h.close());
26 } 31 }
27 return result; 32 return result;
28 } 33 }
29 34
30 static _TraceProviderStartTracingParams decode(bindings.Decoder decoder0) { 35 static _TraceProviderStartTracingParams decode(bindings.Decoder decoder0) {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 } 98 }
94 99
95 100
96 class _TraceProviderStopTracingParams extends bindings.Struct { 101 class _TraceProviderStopTracingParams extends bindings.Struct {
97 static const List<bindings.StructDataHeader> kVersions = const [ 102 static const List<bindings.StructDataHeader> kVersions = const [
98 const bindings.StructDataHeader(8, 0) 103 const bindings.StructDataHeader(8, 0)
99 ]; 104 ];
100 105
101 _TraceProviderStopTracingParams() : super(kVersions.last.size); 106 _TraceProviderStopTracingParams() : super(kVersions.last.size);
102 107
108 _TraceProviderStopTracingParams.init(
109 ) : super(kVersions.last.size);
110
103 static _TraceProviderStopTracingParams deserialize(bindings.Message message) { 111 static _TraceProviderStopTracingParams deserialize(bindings.Message message) {
104 var decoder = new bindings.Decoder(message); 112 var decoder = new bindings.Decoder(message);
105 var result = decode(decoder); 113 var result = decode(decoder);
106 if (decoder.excessHandles != null) { 114 if (decoder.excessHandles != null) {
107 decoder.excessHandles.forEach((h) => h.close()); 115 decoder.excessHandles.forEach((h) => h.close());
108 } 116 }
109 return result; 117 return result;
110 } 118 }
111 119
112 static _TraceProviderStopTracingParams decode(bindings.Decoder decoder0) { 120 static _TraceProviderStopTracingParams decode(bindings.Decoder decoder0) {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 160
153 161
154 class _TraceRecorderRecordParams extends bindings.Struct { 162 class _TraceRecorderRecordParams extends bindings.Struct {
155 static const List<bindings.StructDataHeader> kVersions = const [ 163 static const List<bindings.StructDataHeader> kVersions = const [
156 const bindings.StructDataHeader(16, 0) 164 const bindings.StructDataHeader(16, 0)
157 ]; 165 ];
158 String json = null; 166 String json = null;
159 167
160 _TraceRecorderRecordParams() : super(kVersions.last.size); 168 _TraceRecorderRecordParams() : super(kVersions.last.size);
161 169
170 _TraceRecorderRecordParams.init(
171 String this.json
172 ) : super(kVersions.last.size);
173
162 static _TraceRecorderRecordParams deserialize(bindings.Message message) { 174 static _TraceRecorderRecordParams deserialize(bindings.Message message) {
163 var decoder = new bindings.Decoder(message); 175 var decoder = new bindings.Decoder(message);
164 var result = decode(decoder); 176 var result = decode(decoder);
165 if (decoder.excessHandles != null) { 177 if (decoder.excessHandles != null) {
166 decoder.excessHandles.forEach((h) => h.close()); 178 decoder.excessHandles.forEach((h) => h.close());
167 } 179 }
168 return result; 180 return result;
169 } 181 }
170 182
171 static _TraceRecorderRecordParams decode(bindings.Decoder decoder0) { 183 static _TraceRecorderRecordParams decode(bindings.Decoder decoder0) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 237
226 class _TraceCollectorStartParams extends bindings.Struct { 238 class _TraceCollectorStartParams extends bindings.Struct {
227 static const List<bindings.StructDataHeader> kVersions = const [ 239 static const List<bindings.StructDataHeader> kVersions = const [
228 const bindings.StructDataHeader(24, 0) 240 const bindings.StructDataHeader(24, 0)
229 ]; 241 ];
230 core.MojoDataPipeProducer stream = null; 242 core.MojoDataPipeProducer stream = null;
231 String categories = null; 243 String categories = null;
232 244
233 _TraceCollectorStartParams() : super(kVersions.last.size); 245 _TraceCollectorStartParams() : super(kVersions.last.size);
234 246
247 _TraceCollectorStartParams.init(
248 core.MojoDataPipeProducer this.stream,
249 String this.categories
250 ) : super(kVersions.last.size);
251
235 static _TraceCollectorStartParams deserialize(bindings.Message message) { 252 static _TraceCollectorStartParams deserialize(bindings.Message message) {
236 var decoder = new bindings.Decoder(message); 253 var decoder = new bindings.Decoder(message);
237 var result = decode(decoder); 254 var result = decode(decoder);
238 if (decoder.excessHandles != null) { 255 if (decoder.excessHandles != null) {
239 decoder.excessHandles.forEach((h) => h.close()); 256 decoder.excessHandles.forEach((h) => h.close());
240 } 257 }
241 return result; 258 return result;
242 } 259 }
243 260
244 static _TraceCollectorStartParams decode(bindings.Decoder decoder0) { 261 static _TraceCollectorStartParams decode(bindings.Decoder decoder0) {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 } 324 }
308 325
309 326
310 class _TraceCollectorStopAndFlushParams extends bindings.Struct { 327 class _TraceCollectorStopAndFlushParams extends bindings.Struct {
311 static const List<bindings.StructDataHeader> kVersions = const [ 328 static const List<bindings.StructDataHeader> kVersions = const [
312 const bindings.StructDataHeader(8, 0) 329 const bindings.StructDataHeader(8, 0)
313 ]; 330 ];
314 331
315 _TraceCollectorStopAndFlushParams() : super(kVersions.last.size); 332 _TraceCollectorStopAndFlushParams() : super(kVersions.last.size);
316 333
334 _TraceCollectorStopAndFlushParams.init(
335 ) : super(kVersions.last.size);
336
317 static _TraceCollectorStopAndFlushParams deserialize(bindings.Message message) { 337 static _TraceCollectorStopAndFlushParams deserialize(bindings.Message message) {
318 var decoder = new bindings.Decoder(message); 338 var decoder = new bindings.Decoder(message);
319 var result = decode(decoder); 339 var result = decode(decoder);
320 if (decoder.excessHandles != null) { 340 if (decoder.excessHandles != null) {
321 decoder.excessHandles.forEach((h) => h.close()); 341 decoder.excessHandles.forEach((h) => h.close());
322 } 342 }
323 return result; 343 return result;
324 } 344 }
325 345
326 static _TraceCollectorStopAndFlushParams decode(bindings.Decoder decoder0) { 346 static _TraceCollectorStopAndFlushParams decode(bindings.Decoder decoder0) {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 Map toJson() { 381 Map toJson() {
362 Map map = new Map(); 382 Map map = new Map();
363 return map; 383 return map;
364 } 384 }
365 } 385 }
366 386
367 const int _traceProviderMethodStartTracingName = 0; 387 const int _traceProviderMethodStartTracingName = 0;
368 const int _traceProviderMethodStopTracingName = 1; 388 const int _traceProviderMethodStopTracingName = 1;
369 389
370 class _TraceProviderServiceDescription implements service_describer.ServiceDescr iption { 390 class _TraceProviderServiceDescription implements service_describer.ServiceDescr iption {
371 dynamic getTopLevelInterface([Function responseFactory]) => 391 void getTopLevelInterface(Function responder) {
372 responseFactory(null); 392 responder(null);
393 }
373 394
374 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => 395 void getTypeDefinition(String typeKey, Function responder) {
375 responseFactory(null); 396 responder(null);
397 }
376 398
377 dynamic getAllTypeDefinitions([Function responseFactory]) => 399 void getAllTypeDefinitions(Function responder) {
378 responseFactory(null); 400 responder(null);
401 }
379 } 402 }
380 403
381 abstract class TraceProvider { 404 abstract class TraceProvider {
382 static const String serviceName = "tracing::TraceProvider"; 405 static const String serviceName = "tracing::TraceProvider";
383 406
384 static service_describer.ServiceDescription _cachedServiceDescription; 407 static service_describer.ServiceDescription _cachedServiceDescription;
385 static service_describer.ServiceDescription get serviceDescription { 408 static service_describer.ServiceDescription get serviceDescription {
386 if (_cachedServiceDescription == null) { 409 if (_cachedServiceDescription == null) {
387 _cachedServiceDescription = new _TraceProviderServiceDescription(); 410 _cachedServiceDescription = new _TraceProviderServiceDescription();
388 } 411 }
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 : super.fromHandle(handle, autoBegin: impl != null) { 556 : super.fromHandle(handle, autoBegin: impl != null) {
534 _impl = impl; 557 _impl = impl;
535 } 558 }
536 559
537 _TraceProviderStubControl.unbound([this._impl]) : super.unbound(); 560 _TraceProviderStubControl.unbound([this._impl]) : super.unbound();
538 561
539 String get serviceName => TraceProvider.serviceName; 562 String get serviceName => TraceProvider.serviceName;
540 563
541 564
542 565
543 dynamic handleMessage(bindings.ServiceMessage message) { 566 void handleMessage(bindings.ServiceMessage message) {
544 if (bindings.ControlMessageHandler.isControlMessage(message)) { 567 if (bindings.ControlMessageHandler.isControlMessage(message)) {
545 return bindings.ControlMessageHandler.handleMessage(this, 568 bindings.ControlMessageHandler.handleMessage(
546 0, 569 this, 0, message);
547 message); 570 return;
548 } 571 }
549 if (_impl == null) { 572 if (_impl == null) {
550 throw new core.MojoApiError("$this has no implementation set"); 573 throw new core.MojoApiError("$this has no implementation set");
551 } 574 }
552 switch (message.header.type) { 575 switch (message.header.type) {
553 case _traceProviderMethodStartTracingName: 576 case _traceProviderMethodStartTracingName:
554 var params = _TraceProviderStartTracingParams.deserialize( 577 var params = _TraceProviderStartTracingParams.deserialize(
555 message.payload); 578 message.payload);
556 _impl.startTracing(params.categories, params.recorder); 579 _impl.startTracing(params.categories, params.recorder);
557 break; 580 break;
558 case _traceProviderMethodStopTracingName: 581 case _traceProviderMethodStopTracingName:
559 _impl.stopTracing(); 582 _impl.stopTracing();
560 break; 583 break;
561 default: 584 default:
562 throw new bindings.MojoCodecError("Unexpected message name"); 585 throw new bindings.MojoCodecError("Unexpected message name");
563 break; 586 break;
564 } 587 }
565 return null;
566 } 588 }
567 589
568 TraceProvider get impl => _impl; 590 TraceProvider get impl => _impl;
569 set impl(TraceProvider d) { 591 set impl(TraceProvider d) {
570 if (d == null) { 592 if (d == null) {
571 throw new core.MojoApiError("$this: Cannot set a null implementation"); 593 throw new core.MojoApiError("$this: Cannot set a null implementation");
572 } 594 }
573 if (isBound && (_impl == null)) { 595 if (isBound && (_impl == null)) {
574 beginHandlingEvents(); 596 beginHandlingEvents();
575 } 597 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 return impl.startTracing(categories, recorder); 642 return impl.startTracing(categories, recorder);
621 } 643 }
622 void stopTracing() { 644 void stopTracing() {
623 return impl.stopTracing(); 645 return impl.stopTracing();
624 } 646 }
625 } 647 }
626 648
627 const int _traceRecorderMethodRecordName = 0; 649 const int _traceRecorderMethodRecordName = 0;
628 650
629 class _TraceRecorderServiceDescription implements service_describer.ServiceDescr iption { 651 class _TraceRecorderServiceDescription implements service_describer.ServiceDescr iption {
630 dynamic getTopLevelInterface([Function responseFactory]) => 652 void getTopLevelInterface(Function responder) {
631 responseFactory(null); 653 responder(null);
654 }
632 655
633 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => 656 void getTypeDefinition(String typeKey, Function responder) {
634 responseFactory(null); 657 responder(null);
658 }
635 659
636 dynamic getAllTypeDefinitions([Function responseFactory]) => 660 void getAllTypeDefinitions(Function responder) {
637 responseFactory(null); 661 responder(null);
662 }
638 } 663 }
639 664
640 abstract class TraceRecorder { 665 abstract class TraceRecorder {
641 static const String serviceName = null; 666 static const String serviceName = null;
642 667
643 static service_describer.ServiceDescription _cachedServiceDescription; 668 static service_describer.ServiceDescription _cachedServiceDescription;
644 static service_describer.ServiceDescription get serviceDescription { 669 static service_describer.ServiceDescription get serviceDescription {
645 if (_cachedServiceDescription == null) { 670 if (_cachedServiceDescription == null) {
646 _cachedServiceDescription = new _TraceRecorderServiceDescription(); 671 _cachedServiceDescription = new _TraceRecorderServiceDescription();
647 } 672 }
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 : super.fromHandle(handle, autoBegin: impl != null) { 802 : super.fromHandle(handle, autoBegin: impl != null) {
778 _impl = impl; 803 _impl = impl;
779 } 804 }
780 805
781 _TraceRecorderStubControl.unbound([this._impl]) : super.unbound(); 806 _TraceRecorderStubControl.unbound([this._impl]) : super.unbound();
782 807
783 String get serviceName => TraceRecorder.serviceName; 808 String get serviceName => TraceRecorder.serviceName;
784 809
785 810
786 811
787 dynamic handleMessage(bindings.ServiceMessage message) { 812 void handleMessage(bindings.ServiceMessage message) {
788 if (bindings.ControlMessageHandler.isControlMessage(message)) { 813 if (bindings.ControlMessageHandler.isControlMessage(message)) {
789 return bindings.ControlMessageHandler.handleMessage(this, 814 bindings.ControlMessageHandler.handleMessage(
790 0, 815 this, 0, message);
791 message); 816 return;
792 } 817 }
793 if (_impl == null) { 818 if (_impl == null) {
794 throw new core.MojoApiError("$this has no implementation set"); 819 throw new core.MojoApiError("$this has no implementation set");
795 } 820 }
796 switch (message.header.type) { 821 switch (message.header.type) {
797 case _traceRecorderMethodRecordName: 822 case _traceRecorderMethodRecordName:
798 var params = _TraceRecorderRecordParams.deserialize( 823 var params = _TraceRecorderRecordParams.deserialize(
799 message.payload); 824 message.payload);
800 _impl.record(params.json); 825 _impl.record(params.json);
801 break; 826 break;
802 default: 827 default:
803 throw new bindings.MojoCodecError("Unexpected message name"); 828 throw new bindings.MojoCodecError("Unexpected message name");
804 break; 829 break;
805 } 830 }
806 return null;
807 } 831 }
808 832
809 TraceRecorder get impl => _impl; 833 TraceRecorder get impl => _impl;
810 set impl(TraceRecorder d) { 834 set impl(TraceRecorder d) {
811 if (d == null) { 835 if (d == null) {
812 throw new core.MojoApiError("$this: Cannot set a null implementation"); 836 throw new core.MojoApiError("$this: Cannot set a null implementation");
813 } 837 }
814 if (isBound && (_impl == null)) { 838 if (isBound && (_impl == null)) {
815 beginHandlingEvents(); 839 beginHandlingEvents();
816 } 840 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 883
860 void record(String json) { 884 void record(String json) {
861 return impl.record(json); 885 return impl.record(json);
862 } 886 }
863 } 887 }
864 888
865 const int _traceCollectorMethodStartName = 0; 889 const int _traceCollectorMethodStartName = 0;
866 const int _traceCollectorMethodStopAndFlushName = 1; 890 const int _traceCollectorMethodStopAndFlushName = 1;
867 891
868 class _TraceCollectorServiceDescription implements service_describer.ServiceDesc ription { 892 class _TraceCollectorServiceDescription implements service_describer.ServiceDesc ription {
869 dynamic getTopLevelInterface([Function responseFactory]) => 893 void getTopLevelInterface(Function responder) {
870 responseFactory(null); 894 responder(null);
895 }
871 896
872 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => 897 void getTypeDefinition(String typeKey, Function responder) {
873 responseFactory(null); 898 responder(null);
899 }
874 900
875 dynamic getAllTypeDefinitions([Function responseFactory]) => 901 void getAllTypeDefinitions(Function responder) {
876 responseFactory(null); 902 responder(null);
903 }
877 } 904 }
878 905
879 abstract class TraceCollector { 906 abstract class TraceCollector {
880 static const String serviceName = "tracing::TraceCollector"; 907 static const String serviceName = "tracing::TraceCollector";
881 908
882 static service_describer.ServiceDescription _cachedServiceDescription; 909 static service_describer.ServiceDescription _cachedServiceDescription;
883 static service_describer.ServiceDescription get serviceDescription { 910 static service_describer.ServiceDescription get serviceDescription {
884 if (_cachedServiceDescription == null) { 911 if (_cachedServiceDescription == null) {
885 _cachedServiceDescription = new _TraceCollectorServiceDescription(); 912 _cachedServiceDescription = new _TraceCollectorServiceDescription();
886 } 913 }
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 : super.fromHandle(handle, autoBegin: impl != null) { 1058 : super.fromHandle(handle, autoBegin: impl != null) {
1032 _impl = impl; 1059 _impl = impl;
1033 } 1060 }
1034 1061
1035 _TraceCollectorStubControl.unbound([this._impl]) : super.unbound(); 1062 _TraceCollectorStubControl.unbound([this._impl]) : super.unbound();
1036 1063
1037 String get serviceName => TraceCollector.serviceName; 1064 String get serviceName => TraceCollector.serviceName;
1038 1065
1039 1066
1040 1067
1041 dynamic handleMessage(bindings.ServiceMessage message) { 1068 void handleMessage(bindings.ServiceMessage message) {
1042 if (bindings.ControlMessageHandler.isControlMessage(message)) { 1069 if (bindings.ControlMessageHandler.isControlMessage(message)) {
1043 return bindings.ControlMessageHandler.handleMessage(this, 1070 bindings.ControlMessageHandler.handleMessage(
1044 0, 1071 this, 0, message);
1045 message); 1072 return;
1046 } 1073 }
1047 if (_impl == null) { 1074 if (_impl == null) {
1048 throw new core.MojoApiError("$this has no implementation set"); 1075 throw new core.MojoApiError("$this has no implementation set");
1049 } 1076 }
1050 switch (message.header.type) { 1077 switch (message.header.type) {
1051 case _traceCollectorMethodStartName: 1078 case _traceCollectorMethodStartName:
1052 var params = _TraceCollectorStartParams.deserialize( 1079 var params = _TraceCollectorStartParams.deserialize(
1053 message.payload); 1080 message.payload);
1054 _impl.start(params.stream, params.categories); 1081 _impl.start(params.stream, params.categories);
1055 break; 1082 break;
1056 case _traceCollectorMethodStopAndFlushName: 1083 case _traceCollectorMethodStopAndFlushName:
1057 _impl.stopAndFlush(); 1084 _impl.stopAndFlush();
1058 break; 1085 break;
1059 default: 1086 default:
1060 throw new bindings.MojoCodecError("Unexpected message name"); 1087 throw new bindings.MojoCodecError("Unexpected message name");
1061 break; 1088 break;
1062 } 1089 }
1063 return null;
1064 } 1090 }
1065 1091
1066 TraceCollector get impl => _impl; 1092 TraceCollector get impl => _impl;
1067 set impl(TraceCollector d) { 1093 set impl(TraceCollector d) {
1068 if (d == null) { 1094 if (d == null) {
1069 throw new core.MojoApiError("$this: Cannot set a null implementation"); 1095 throw new core.MojoApiError("$this: Cannot set a null implementation");
1070 } 1096 }
1071 if (isBound && (_impl == null)) { 1097 if (isBound && (_impl == null)) {
1072 beginHandlingEvents(); 1098 beginHandlingEvents();
1073 } 1099 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 void start(core.MojoDataPipeProducer stream, String categories) { 1143 void start(core.MojoDataPipeProducer stream, String categories) {
1118 return impl.start(stream, categories); 1144 return impl.start(stream, categories);
1119 } 1145 }
1120 void stopAndFlush() { 1146 void stopAndFlush() {
1121 return impl.stopAndFlush(); 1147 return impl.stopAndFlush();
1122 } 1148 }
1123 } 1149 }
1124 1150
1125 1151
1126 1152
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698