OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 library tracing_mojom; | 5 library tracing_mojom; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:mojo/bindings.dart' as bindings; | 9 import 'package:mojo/bindings.dart' as bindings; |
10 import 'package:mojo/core.dart' as core; | 10 import 'package:mojo/core.dart' as core; |
| 11 import 'package:mojo/mojo/bindings/types/mojom_types.mojom.dart' as mojom_types; |
| 12 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; |
11 | 13 |
12 | 14 |
13 | 15 |
14 class _TraceProviderStartTracingParams extends bindings.Struct { | 16 class _TraceProviderStartTracingParams extends bindings.Struct { |
15 static const List<bindings.StructDataHeader> kVersions = const [ | 17 static const List<bindings.StructDataHeader> kVersions = const [ |
16 const bindings.StructDataHeader(24, 0) | 18 const bindings.StructDataHeader(24, 0) |
17 ]; | 19 ]; |
18 String categories = null; | 20 String categories = null; |
19 Object recorder = null; | 21 Object recorder = null; |
20 | 22 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 "recorder: $recorder" ")"; | 80 "recorder: $recorder" ")"; |
79 } | 81 } |
80 | 82 |
81 Map toJson() { | 83 Map toJson() { |
82 throw new bindings.MojoCodecError( | 84 throw new bindings.MojoCodecError( |
83 'Object containing handles cannot be encoded to JSON.'); | 85 'Object containing handles cannot be encoded to JSON.'); |
84 } | 86 } |
85 } | 87 } |
86 | 88 |
87 | 89 |
| 90 |
| 91 |
88 class _TraceProviderStopTracingParams extends bindings.Struct { | 92 class _TraceProviderStopTracingParams extends bindings.Struct { |
89 static const List<bindings.StructDataHeader> kVersions = const [ | 93 static const List<bindings.StructDataHeader> kVersions = const [ |
90 const bindings.StructDataHeader(8, 0) | 94 const bindings.StructDataHeader(8, 0) |
91 ]; | 95 ]; |
92 | 96 |
93 _TraceProviderStopTracingParams() : super(kVersions.last.size); | 97 _TraceProviderStopTracingParams() : super(kVersions.last.size); |
94 | 98 |
95 static _TraceProviderStopTracingParams deserialize(bindings.Message message) { | 99 static _TraceProviderStopTracingParams deserialize(bindings.Message message) { |
96 var decoder = new bindings.Decoder(message); | 100 var decoder = new bindings.Decoder(message); |
97 var result = decode(decoder); | 101 var result = decode(decoder); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 return "_TraceProviderStopTracingParams("")"; | 140 return "_TraceProviderStopTracingParams("")"; |
137 } | 141 } |
138 | 142 |
139 Map toJson() { | 143 Map toJson() { |
140 Map map = new Map(); | 144 Map map = new Map(); |
141 return map; | 145 return map; |
142 } | 146 } |
143 } | 147 } |
144 | 148 |
145 | 149 |
| 150 |
| 151 |
146 class _TraceRecorderRecordParams extends bindings.Struct { | 152 class _TraceRecorderRecordParams extends bindings.Struct { |
147 static const List<bindings.StructDataHeader> kVersions = const [ | 153 static const List<bindings.StructDataHeader> kVersions = const [ |
148 const bindings.StructDataHeader(16, 0) | 154 const bindings.StructDataHeader(16, 0) |
149 ]; | 155 ]; |
150 String json = null; | 156 String json = null; |
151 | 157 |
152 _TraceRecorderRecordParams() : super(kVersions.last.size); | 158 _TraceRecorderRecordParams() : super(kVersions.last.size); |
153 | 159 |
154 static _TraceRecorderRecordParams deserialize(bindings.Message message) { | 160 static _TraceRecorderRecordParams deserialize(bindings.Message message) { |
155 var decoder = new bindings.Decoder(message); | 161 var decoder = new bindings.Decoder(message); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 } | 209 } |
204 | 210 |
205 Map toJson() { | 211 Map toJson() { |
206 Map map = new Map(); | 212 Map map = new Map(); |
207 map["json"] = json; | 213 map["json"] = json; |
208 return map; | 214 return map; |
209 } | 215 } |
210 } | 216 } |
211 | 217 |
212 | 218 |
| 219 |
| 220 |
213 class _TraceCollectorStartParams extends bindings.Struct { | 221 class _TraceCollectorStartParams extends bindings.Struct { |
214 static const List<bindings.StructDataHeader> kVersions = const [ | 222 static const List<bindings.StructDataHeader> kVersions = const [ |
215 const bindings.StructDataHeader(24, 0) | 223 const bindings.StructDataHeader(24, 0) |
216 ]; | 224 ]; |
217 core.MojoDataPipeProducer stream = null; | 225 core.MojoDataPipeProducer stream = null; |
218 String categories = null; | 226 String categories = null; |
219 | 227 |
220 _TraceCollectorStartParams() : super(kVersions.last.size); | 228 _TraceCollectorStartParams() : super(kVersions.last.size); |
221 | 229 |
222 static _TraceCollectorStartParams deserialize(bindings.Message message) { | 230 static _TraceCollectorStartParams deserialize(bindings.Message message) { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 "categories: $categories" ")"; | 285 "categories: $categories" ")"; |
278 } | 286 } |
279 | 287 |
280 Map toJson() { | 288 Map toJson() { |
281 throw new bindings.MojoCodecError( | 289 throw new bindings.MojoCodecError( |
282 'Object containing handles cannot be encoded to JSON.'); | 290 'Object containing handles cannot be encoded to JSON.'); |
283 } | 291 } |
284 } | 292 } |
285 | 293 |
286 | 294 |
| 295 |
| 296 |
287 class _TraceCollectorStopAndFlushParams extends bindings.Struct { | 297 class _TraceCollectorStopAndFlushParams extends bindings.Struct { |
288 static const List<bindings.StructDataHeader> kVersions = const [ | 298 static const List<bindings.StructDataHeader> kVersions = const [ |
289 const bindings.StructDataHeader(8, 0) | 299 const bindings.StructDataHeader(8, 0) |
290 ]; | 300 ]; |
291 | 301 |
292 _TraceCollectorStopAndFlushParams() : super(kVersions.last.size); | 302 _TraceCollectorStopAndFlushParams() : super(kVersions.last.size); |
293 | 303 |
294 static _TraceCollectorStopAndFlushParams deserialize(bindings.Message message)
{ | 304 static _TraceCollectorStopAndFlushParams deserialize(bindings.Message message)
{ |
295 var decoder = new bindings.Decoder(message); | 305 var decoder = new bindings.Decoder(message); |
296 var result = decode(decoder); | 306 var result = decode(decoder); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 String toString() { | 344 String toString() { |
335 return "_TraceCollectorStopAndFlushParams("")"; | 345 return "_TraceCollectorStopAndFlushParams("")"; |
336 } | 346 } |
337 | 347 |
338 Map toJson() { | 348 Map toJson() { |
339 Map map = new Map(); | 349 Map map = new Map(); |
340 return map; | 350 return map; |
341 } | 351 } |
342 } | 352 } |
343 | 353 |
| 354 |
| 355 |
| 356 |
344 const int _TraceProvider_startTracingName = 0; | 357 const int _TraceProvider_startTracingName = 0; |
345 const int _TraceProvider_stopTracingName = 1; | 358 const int _TraceProvider_stopTracingName = 1; |
346 | 359 |
| 360 |
| 361 |
| 362 class _TraceProviderServiceDescription implements service_describer.ServiceDescr
iption { |
| 363 dynamic getTopLevelInterface([Function responseFactory = null]) => null; |
| 364 |
| 365 dynamic getTypeDefinition(String typeKey, [Function responseFactory = null]) =
> |
| 366 null; |
| 367 |
| 368 dynamic getAllTypeDefinitions([Function responseFactory = null]) => null; |
| 369 } |
| 370 |
347 abstract class TraceProvider { | 371 abstract class TraceProvider { |
348 static const String serviceName = "tracing::TraceProvider"; | 372 static const String serviceName = "tracing::TraceProvider"; |
349 void startTracing(String categories, Object recorder); | 373 void startTracing(String categories, Object recorder); |
350 void stopTracing(); | 374 void stopTracing(); |
351 } | 375 } |
352 | 376 |
353 | 377 |
354 class _TraceProviderProxyImpl extends bindings.Proxy { | 378 class _TraceProviderProxyImpl extends bindings.Proxy { |
355 _TraceProviderProxyImpl.fromEndpoint( | 379 _TraceProviderProxyImpl.fromEndpoint( |
356 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 380 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
357 | 381 |
358 _TraceProviderProxyImpl.fromHandle(core.MojoHandle handle) : | 382 _TraceProviderProxyImpl.fromHandle(core.MojoHandle handle) : |
359 super.fromHandle(handle); | 383 super.fromHandle(handle); |
360 | 384 |
361 _TraceProviderProxyImpl.unbound() : super.unbound(); | 385 _TraceProviderProxyImpl.unbound() : super.unbound(); |
362 | 386 |
363 static _TraceProviderProxyImpl newFromEndpoint( | 387 static _TraceProviderProxyImpl newFromEndpoint( |
364 core.MojoMessagePipeEndpoint endpoint) { | 388 core.MojoMessagePipeEndpoint endpoint) { |
365 assert(endpoint.setDescription("For _TraceProviderProxyImpl")); | 389 assert(endpoint.setDescription("For _TraceProviderProxyImpl")); |
366 return new _TraceProviderProxyImpl.fromEndpoint(endpoint); | 390 return new _TraceProviderProxyImpl.fromEndpoint(endpoint); |
367 } | 391 } |
368 | 392 |
| 393 service_describer.ServiceDescription get serviceDescription => |
| 394 new _TraceProviderServiceDescription(); |
| 395 |
369 void handleResponse(bindings.ServiceMessage message) { | 396 void handleResponse(bindings.ServiceMessage message) { |
370 switch (message.header.type) { | 397 switch (message.header.type) { |
371 default: | 398 default: |
372 proxyError("Unexpected message type: ${message.header.type}"); | 399 proxyError("Unexpected message type: ${message.header.type}"); |
373 close(immediate: true); | 400 close(immediate: true); |
374 break; | 401 break; |
375 } | 402 } |
376 } | 403 } |
377 | 404 |
378 String toString() { | 405 String toString() { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 assert(_impl == null); | 543 assert(_impl == null); |
517 _impl = d; | 544 _impl = d; |
518 } | 545 } |
519 | 546 |
520 String toString() { | 547 String toString() { |
521 var superString = super.toString(); | 548 var superString = super.toString(); |
522 return "TraceProviderStub($superString)"; | 549 return "TraceProviderStub($superString)"; |
523 } | 550 } |
524 | 551 |
525 int get version => 0; | 552 int get version => 0; |
| 553 |
| 554 service_describer.ServiceDescription get serviceDescription => |
| 555 new _TraceProviderServiceDescription(); |
526 } | 556 } |
527 | 557 |
528 const int _TraceRecorder_recordName = 0; | 558 const int _TraceRecorder_recordName = 0; |
529 | 559 |
| 560 |
| 561 |
| 562 class _TraceRecorderServiceDescription implements service_describer.ServiceDescr
iption { |
| 563 dynamic getTopLevelInterface([Function responseFactory = null]) => null; |
| 564 |
| 565 dynamic getTypeDefinition(String typeKey, [Function responseFactory = null]) =
> |
| 566 null; |
| 567 |
| 568 dynamic getAllTypeDefinitions([Function responseFactory = null]) => null; |
| 569 } |
| 570 |
530 abstract class TraceRecorder { | 571 abstract class TraceRecorder { |
531 static const String serviceName = null; | 572 static const String serviceName = null; |
532 void record(String json); | 573 void record(String json); |
533 } | 574 } |
534 | 575 |
535 | 576 |
536 class _TraceRecorderProxyImpl extends bindings.Proxy { | 577 class _TraceRecorderProxyImpl extends bindings.Proxy { |
537 _TraceRecorderProxyImpl.fromEndpoint( | 578 _TraceRecorderProxyImpl.fromEndpoint( |
538 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 579 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
539 | 580 |
540 _TraceRecorderProxyImpl.fromHandle(core.MojoHandle handle) : | 581 _TraceRecorderProxyImpl.fromHandle(core.MojoHandle handle) : |
541 super.fromHandle(handle); | 582 super.fromHandle(handle); |
542 | 583 |
543 _TraceRecorderProxyImpl.unbound() : super.unbound(); | 584 _TraceRecorderProxyImpl.unbound() : super.unbound(); |
544 | 585 |
545 static _TraceRecorderProxyImpl newFromEndpoint( | 586 static _TraceRecorderProxyImpl newFromEndpoint( |
546 core.MojoMessagePipeEndpoint endpoint) { | 587 core.MojoMessagePipeEndpoint endpoint) { |
547 assert(endpoint.setDescription("For _TraceRecorderProxyImpl")); | 588 assert(endpoint.setDescription("For _TraceRecorderProxyImpl")); |
548 return new _TraceRecorderProxyImpl.fromEndpoint(endpoint); | 589 return new _TraceRecorderProxyImpl.fromEndpoint(endpoint); |
549 } | 590 } |
550 | 591 |
| 592 service_describer.ServiceDescription get serviceDescription => |
| 593 new _TraceRecorderServiceDescription(); |
| 594 |
551 void handleResponse(bindings.ServiceMessage message) { | 595 void handleResponse(bindings.ServiceMessage message) { |
552 switch (message.header.type) { | 596 switch (message.header.type) { |
553 default: | 597 default: |
554 proxyError("Unexpected message type: ${message.header.type}"); | 598 proxyError("Unexpected message type: ${message.header.type}"); |
555 close(immediate: true); | 599 close(immediate: true); |
556 break; | 600 break; |
557 } | 601 } |
558 } | 602 } |
559 | 603 |
560 String toString() { | 604 String toString() { |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 assert(_impl == null); | 728 assert(_impl == null); |
685 _impl = d; | 729 _impl = d; |
686 } | 730 } |
687 | 731 |
688 String toString() { | 732 String toString() { |
689 var superString = super.toString(); | 733 var superString = super.toString(); |
690 return "TraceRecorderStub($superString)"; | 734 return "TraceRecorderStub($superString)"; |
691 } | 735 } |
692 | 736 |
693 int get version => 0; | 737 int get version => 0; |
| 738 |
| 739 service_describer.ServiceDescription get serviceDescription => |
| 740 new _TraceRecorderServiceDescription(); |
694 } | 741 } |
695 | 742 |
696 const int _TraceCollector_startName = 0; | 743 const int _TraceCollector_startName = 0; |
697 const int _TraceCollector_stopAndFlushName = 1; | 744 const int _TraceCollector_stopAndFlushName = 1; |
698 | 745 |
| 746 |
| 747 |
| 748 class _TraceCollectorServiceDescription implements service_describer.ServiceDesc
ription { |
| 749 dynamic getTopLevelInterface([Function responseFactory = null]) => null; |
| 750 |
| 751 dynamic getTypeDefinition(String typeKey, [Function responseFactory = null]) =
> |
| 752 null; |
| 753 |
| 754 dynamic getAllTypeDefinitions([Function responseFactory = null]) => null; |
| 755 } |
| 756 |
699 abstract class TraceCollector { | 757 abstract class TraceCollector { |
700 static const String serviceName = "tracing::TraceCollector"; | 758 static const String serviceName = "tracing::TraceCollector"; |
701 void start(core.MojoDataPipeProducer stream, String categories); | 759 void start(core.MojoDataPipeProducer stream, String categories); |
702 void stopAndFlush(); | 760 void stopAndFlush(); |
703 } | 761 } |
704 | 762 |
705 | 763 |
706 class _TraceCollectorProxyImpl extends bindings.Proxy { | 764 class _TraceCollectorProxyImpl extends bindings.Proxy { |
707 _TraceCollectorProxyImpl.fromEndpoint( | 765 _TraceCollectorProxyImpl.fromEndpoint( |
708 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 766 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
709 | 767 |
710 _TraceCollectorProxyImpl.fromHandle(core.MojoHandle handle) : | 768 _TraceCollectorProxyImpl.fromHandle(core.MojoHandle handle) : |
711 super.fromHandle(handle); | 769 super.fromHandle(handle); |
712 | 770 |
713 _TraceCollectorProxyImpl.unbound() : super.unbound(); | 771 _TraceCollectorProxyImpl.unbound() : super.unbound(); |
714 | 772 |
715 static _TraceCollectorProxyImpl newFromEndpoint( | 773 static _TraceCollectorProxyImpl newFromEndpoint( |
716 core.MojoMessagePipeEndpoint endpoint) { | 774 core.MojoMessagePipeEndpoint endpoint) { |
717 assert(endpoint.setDescription("For _TraceCollectorProxyImpl")); | 775 assert(endpoint.setDescription("For _TraceCollectorProxyImpl")); |
718 return new _TraceCollectorProxyImpl.fromEndpoint(endpoint); | 776 return new _TraceCollectorProxyImpl.fromEndpoint(endpoint); |
719 } | 777 } |
720 | 778 |
| 779 service_describer.ServiceDescription get serviceDescription => |
| 780 new _TraceCollectorServiceDescription(); |
| 781 |
721 void handleResponse(bindings.ServiceMessage message) { | 782 void handleResponse(bindings.ServiceMessage message) { |
722 switch (message.header.type) { | 783 switch (message.header.type) { |
723 default: | 784 default: |
724 proxyError("Unexpected message type: ${message.header.type}"); | 785 proxyError("Unexpected message type: ${message.header.type}"); |
725 close(immediate: true); | 786 close(immediate: true); |
726 break; | 787 break; |
727 } | 788 } |
728 } | 789 } |
729 | 790 |
730 String toString() { | 791 String toString() { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 assert(_impl == null); | 929 assert(_impl == null); |
869 _impl = d; | 930 _impl = d; |
870 } | 931 } |
871 | 932 |
872 String toString() { | 933 String toString() { |
873 var superString = super.toString(); | 934 var superString = super.toString(); |
874 return "TraceCollectorStub($superString)"; | 935 return "TraceCollectorStub($superString)"; |
875 } | 936 } |
876 | 937 |
877 int get version => 0; | 938 int get version => 0; |
| 939 |
| 940 service_describer.ServiceDescription get serviceDescription => |
| 941 new _TraceCollectorServiceDescription(); |
878 } | 942 } |
879 | 943 |
880 | 944 |
| 945 |
| 946 |
OLD | NEW |