| 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 import 'dart:async'; | 6 import 'dart:async'; |
| 7 import 'package:mojo/bindings.dart' as bindings; | 7 import 'package:mojo/bindings.dart' as bindings; |
| 8 import 'package:mojo/core.dart' as core; | 8 import 'package:mojo/core.dart' as core; |
| 9 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; | 9 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; |
| 10 | 10 |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 dynamic getAllTypeDefinitions([Function responseFactory]) => | 378 dynamic getAllTypeDefinitions([Function responseFactory]) => |
| 379 responseFactory(null); | 379 responseFactory(null); |
| 380 } | 380 } |
| 381 | 381 |
| 382 abstract class TraceProvider { | 382 abstract class TraceProvider { |
| 383 static const String serviceName = "tracing::TraceProvider"; | 383 static const String serviceName = "tracing::TraceProvider"; |
| 384 void startTracing(String categories, Object recorder); | 384 void startTracing(String categories, Object recorder); |
| 385 void stopTracing(); | 385 void stopTracing(); |
| 386 } | 386 } |
| 387 | 387 |
| 388 | 388 class _TraceProviderProxyControl |
| 389 class _TraceProviderProxyControl extends bindings.ProxyMessageHandler | 389 extends bindings.ProxyMessageHandler |
| 390 implements bindings.ProxyControl { | 390 implements bindings.ProxyControl { |
| 391 _TraceProviderProxyControl.fromEndpoint( | 391 _TraceProviderProxyControl.fromEndpoint( |
| 392 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 392 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 393 | 393 |
| 394 _TraceProviderProxyControl.fromHandle( | 394 _TraceProviderProxyControl.fromHandle( |
| 395 core.MojoHandle handle) : super.fromHandle(handle); | 395 core.MojoHandle handle) : super.fromHandle(handle); |
| 396 | 396 |
| 397 _TraceProviderProxyControl.unbound() : super.unbound(); | 397 _TraceProviderProxyControl.unbound() : super.unbound(); |
| 398 | 398 |
| 399 service_describer.ServiceDescription get serviceDescription => | 399 service_describer.ServiceDescription get serviceDescription => |
| 400 new _TraceProviderServiceDescription(); | 400 new _TraceProviderServiceDescription(); |
| 401 | 401 |
| 402 String get serviceName => TraceProvider.serviceName; | 402 String get serviceName => TraceProvider.serviceName; |
| 403 | 403 |
| 404 @override | |
| 405 void handleResponse(bindings.ServiceMessage message) { | 404 void handleResponse(bindings.ServiceMessage message) { |
| 406 switch (message.header.type) { | 405 switch (message.header.type) { |
| 407 default: | 406 default: |
| 408 proxyError("Unexpected message type: ${message.header.type}"); | 407 proxyError("Unexpected message type: ${message.header.type}"); |
| 409 close(immediate: true); | 408 close(immediate: true); |
| 410 break; | 409 break; |
| 411 } | 410 } |
| 412 } | 411 } |
| 413 | 412 |
| 414 @override | 413 @override |
| 415 String toString() { | 414 String toString() { |
| 416 var superString = super.toString(); | 415 var superString = super.toString(); |
| 417 return "_TraceProviderProxyControl($superString)"; | 416 return "_TraceProviderProxyControl($superString)"; |
| 418 } | 417 } |
| 419 } | 418 } |
| 420 | 419 |
| 421 | 420 class TraceProviderProxy |
| 422 class TraceProviderProxy extends bindings.Proxy | 421 extends bindings.Proxy |
| 423 implements TraceProvider { | 422 implements TraceProvider { |
| 424 TraceProviderProxy.fromEndpoint( | 423 TraceProviderProxy.fromEndpoint( |
| 425 core.MojoMessagePipeEndpoint endpoint) | 424 core.MojoMessagePipeEndpoint endpoint) |
| 426 : super(new _TraceProviderProxyControl.fromEndpoint(endpoint)); | 425 : super(new _TraceProviderProxyControl.fromEndpoint(endpoint)); |
| 427 | 426 |
| 428 TraceProviderProxy.fromHandle(core.MojoHandle handle) | 427 TraceProviderProxy.fromHandle(core.MojoHandle handle) |
| 429 : super(new _TraceProviderProxyControl.fromHandle(handle)); | 428 : super(new _TraceProviderProxyControl.fromHandle(handle)); |
| 430 | 429 |
| 431 TraceProviderProxy.unbound() | 430 TraceProviderProxy.unbound() |
| 432 : super(new _TraceProviderProxyControl.unbound()); | 431 : super(new _TraceProviderProxyControl.unbound()); |
| 433 | 432 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 460 if (!ctrl.isBound) { | 459 if (!ctrl.isBound) { |
| 461 ctrl.proxyError("The Proxy is closed."); | 460 ctrl.proxyError("The Proxy is closed."); |
| 462 return; | 461 return; |
| 463 } | 462 } |
| 464 var params = new _TraceProviderStopTracingParams(); | 463 var params = new _TraceProviderStopTracingParams(); |
| 465 ctrl.sendMessage(params, | 464 ctrl.sendMessage(params, |
| 466 _traceProviderMethodStopTracingName); | 465 _traceProviderMethodStopTracingName); |
| 467 } | 466 } |
| 468 } | 467 } |
| 469 | 468 |
| 470 | 469 class _TraceProviderStubControl |
| 471 class TraceProviderStub extends bindings.Stub { | 470 extends bindings.StubMessageHandler |
| 471 implements bindings.StubControl<TraceProvider> { |
| 472 TraceProvider _impl; | 472 TraceProvider _impl; |
| 473 | 473 |
| 474 TraceProviderStub.fromEndpoint( | 474 _TraceProviderStubControl.fromEndpoint( |
| 475 core.MojoMessagePipeEndpoint endpoint, [TraceProvider impl]) | 475 core.MojoMessagePipeEndpoint endpoint, [TraceProvider impl]) |
| 476 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 476 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
| 477 _impl = impl; | 477 _impl = impl; |
| 478 } | 478 } |
| 479 | 479 |
| 480 TraceProviderStub.fromHandle( | 480 _TraceProviderStubControl.fromHandle( |
| 481 core.MojoHandle handle, [TraceProvider impl]) | 481 core.MojoHandle handle, [TraceProvider impl]) |
| 482 : super.fromHandle(handle, autoBegin: impl != null) { | 482 : super.fromHandle(handle, autoBegin: impl != null) { |
| 483 _impl = impl; | 483 _impl = impl; |
| 484 } | 484 } |
| 485 | 485 |
| 486 TraceProviderStub.unbound([this._impl]) : super.unbound(); | 486 _TraceProviderStubControl.unbound([this._impl]) : super.unbound(); |
| 487 | |
| 488 static TraceProviderStub newFromEndpoint( | |
| 489 core.MojoMessagePipeEndpoint endpoint) { | |
| 490 assert(endpoint.setDescription("For TraceProviderStub")); | |
| 491 return new TraceProviderStub.fromEndpoint(endpoint); | |
| 492 } | |
| 493 | 487 |
| 494 | 488 |
| 495 | 489 |
| 496 dynamic handleMessage(bindings.ServiceMessage message) { | 490 dynamic handleMessage(bindings.ServiceMessage message) { |
| 497 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 491 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
| 498 return bindings.ControlMessageHandler.handleMessage(this, | 492 return bindings.ControlMessageHandler.handleMessage(this, |
| 499 0, | 493 0, |
| 500 message); | 494 message); |
| 501 } | 495 } |
| 502 if (_impl == null) { | 496 if (_impl == null) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 530 } | 524 } |
| 531 | 525 |
| 532 @override | 526 @override |
| 533 void bind(core.MojoMessagePipeEndpoint endpoint) { | 527 void bind(core.MojoMessagePipeEndpoint endpoint) { |
| 534 super.bind(endpoint); | 528 super.bind(endpoint); |
| 535 if (!isOpen && (_impl != null)) { | 529 if (!isOpen && (_impl != null)) { |
| 536 beginHandlingEvents(); | 530 beginHandlingEvents(); |
| 537 } | 531 } |
| 538 } | 532 } |
| 539 | 533 |
| 534 @override |
| 540 String toString() { | 535 String toString() { |
| 541 var superString = super.toString(); | 536 var superString = super.toString(); |
| 542 return "TraceProviderStub($superString)"; | 537 return "_TraceProviderStubControl($superString)"; |
| 543 } | 538 } |
| 544 | 539 |
| 545 int get version => 0; | 540 int get version => 0; |
| 546 | 541 |
| 547 static service_describer.ServiceDescription _cachedServiceDescription; | 542 static service_describer.ServiceDescription _cachedServiceDescription; |
| 548 static service_describer.ServiceDescription get serviceDescription { | 543 static service_describer.ServiceDescription get serviceDescription { |
| 549 if (_cachedServiceDescription == null) { | 544 if (_cachedServiceDescription == null) { |
| 550 _cachedServiceDescription = new _TraceProviderServiceDescription(); | 545 _cachedServiceDescription = new _TraceProviderServiceDescription(); |
| 551 } | 546 } |
| 552 return _cachedServiceDescription; | 547 return _cachedServiceDescription; |
| 553 } | 548 } |
| 554 } | 549 } |
| 555 | 550 |
| 551 class TraceProviderStub |
| 552 extends bindings.Stub<TraceProvider> |
| 553 implements TraceProvider { |
| 554 TraceProviderStub.fromEndpoint( |
| 555 core.MojoMessagePipeEndpoint endpoint, [TraceProvider impl]) |
| 556 : super(new _TraceProviderStubControl.fromEndpoint(endpoint, impl)); |
| 557 |
| 558 TraceProviderStub.fromHandle( |
| 559 core.MojoHandle handle, [TraceProvider impl]) |
| 560 : super(new _TraceProviderStubControl.fromHandle(handle, impl)); |
| 561 |
| 562 TraceProviderStub.unbound([TraceProvider impl]) |
| 563 : super(new _TraceProviderStubControl.unbound(impl)); |
| 564 |
| 565 static TraceProviderStub newFromEndpoint( |
| 566 core.MojoMessagePipeEndpoint endpoint) { |
| 567 assert(endpoint.setDescription("For TraceProviderStub")); |
| 568 return new TraceProviderStub.fromEndpoint(endpoint); |
| 569 } |
| 570 |
| 571 static service_describer.ServiceDescription get serviceDescription => |
| 572 _TraceProviderStubControl.serviceDescription; |
| 573 |
| 574 |
| 575 void startTracing(String categories, Object recorder) { |
| 576 return impl.startTracing(categories, recorder); |
| 577 } |
| 578 void stopTracing() { |
| 579 return impl.stopTracing(); |
| 580 } |
| 581 } |
| 582 |
| 556 const int _traceRecorderMethodRecordName = 0; | 583 const int _traceRecorderMethodRecordName = 0; |
| 557 | 584 |
| 558 class _TraceRecorderServiceDescription implements service_describer.ServiceDescr
iption { | 585 class _TraceRecorderServiceDescription implements service_describer.ServiceDescr
iption { |
| 559 dynamic getTopLevelInterface([Function responseFactory]) => | 586 dynamic getTopLevelInterface([Function responseFactory]) => |
| 560 responseFactory(null); | 587 responseFactory(null); |
| 561 | 588 |
| 562 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 589 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => |
| 563 responseFactory(null); | 590 responseFactory(null); |
| 564 | 591 |
| 565 dynamic getAllTypeDefinitions([Function responseFactory]) => | 592 dynamic getAllTypeDefinitions([Function responseFactory]) => |
| 566 responseFactory(null); | 593 responseFactory(null); |
| 567 } | 594 } |
| 568 | 595 |
| 569 abstract class TraceRecorder { | 596 abstract class TraceRecorder { |
| 570 static const String serviceName = null; | 597 static const String serviceName = null; |
| 571 void record(String json); | 598 void record(String json); |
| 572 } | 599 } |
| 573 | 600 |
| 574 | 601 class _TraceRecorderProxyControl |
| 575 class _TraceRecorderProxyControl extends bindings.ProxyMessageHandler | 602 extends bindings.ProxyMessageHandler |
| 576 implements bindings.ProxyControl { | 603 implements bindings.ProxyControl { |
| 577 _TraceRecorderProxyControl.fromEndpoint( | 604 _TraceRecorderProxyControl.fromEndpoint( |
| 578 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 605 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 579 | 606 |
| 580 _TraceRecorderProxyControl.fromHandle( | 607 _TraceRecorderProxyControl.fromHandle( |
| 581 core.MojoHandle handle) : super.fromHandle(handle); | 608 core.MojoHandle handle) : super.fromHandle(handle); |
| 582 | 609 |
| 583 _TraceRecorderProxyControl.unbound() : super.unbound(); | 610 _TraceRecorderProxyControl.unbound() : super.unbound(); |
| 584 | 611 |
| 585 service_describer.ServiceDescription get serviceDescription => | 612 service_describer.ServiceDescription get serviceDescription => |
| 586 new _TraceRecorderServiceDescription(); | 613 new _TraceRecorderServiceDescription(); |
| 587 | 614 |
| 588 String get serviceName => TraceRecorder.serviceName; | 615 String get serviceName => TraceRecorder.serviceName; |
| 589 | 616 |
| 590 @override | |
| 591 void handleResponse(bindings.ServiceMessage message) { | 617 void handleResponse(bindings.ServiceMessage message) { |
| 592 switch (message.header.type) { | 618 switch (message.header.type) { |
| 593 default: | 619 default: |
| 594 proxyError("Unexpected message type: ${message.header.type}"); | 620 proxyError("Unexpected message type: ${message.header.type}"); |
| 595 close(immediate: true); | 621 close(immediate: true); |
| 596 break; | 622 break; |
| 597 } | 623 } |
| 598 } | 624 } |
| 599 | 625 |
| 600 @override | 626 @override |
| 601 String toString() { | 627 String toString() { |
| 602 var superString = super.toString(); | 628 var superString = super.toString(); |
| 603 return "_TraceRecorderProxyControl($superString)"; | 629 return "_TraceRecorderProxyControl($superString)"; |
| 604 } | 630 } |
| 605 } | 631 } |
| 606 | 632 |
| 607 | 633 class TraceRecorderProxy |
| 608 class TraceRecorderProxy extends bindings.Proxy | 634 extends bindings.Proxy |
| 609 implements TraceRecorder { | 635 implements TraceRecorder { |
| 610 TraceRecorderProxy.fromEndpoint( | 636 TraceRecorderProxy.fromEndpoint( |
| 611 core.MojoMessagePipeEndpoint endpoint) | 637 core.MojoMessagePipeEndpoint endpoint) |
| 612 : super(new _TraceRecorderProxyControl.fromEndpoint(endpoint)); | 638 : super(new _TraceRecorderProxyControl.fromEndpoint(endpoint)); |
| 613 | 639 |
| 614 TraceRecorderProxy.fromHandle(core.MojoHandle handle) | 640 TraceRecorderProxy.fromHandle(core.MojoHandle handle) |
| 615 : super(new _TraceRecorderProxyControl.fromHandle(handle)); | 641 : super(new _TraceRecorderProxyControl.fromHandle(handle)); |
| 616 | 642 |
| 617 TraceRecorderProxy.unbound() | 643 TraceRecorderProxy.unbound() |
| 618 : super(new _TraceRecorderProxyControl.unbound()); | 644 : super(new _TraceRecorderProxyControl.unbound()); |
| 619 | 645 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 636 ctrl.proxyError("The Proxy is closed."); | 662 ctrl.proxyError("The Proxy is closed."); |
| 637 return; | 663 return; |
| 638 } | 664 } |
| 639 var params = new _TraceRecorderRecordParams(); | 665 var params = new _TraceRecorderRecordParams(); |
| 640 params.json = json; | 666 params.json = json; |
| 641 ctrl.sendMessage(params, | 667 ctrl.sendMessage(params, |
| 642 _traceRecorderMethodRecordName); | 668 _traceRecorderMethodRecordName); |
| 643 } | 669 } |
| 644 } | 670 } |
| 645 | 671 |
| 646 | 672 class _TraceRecorderStubControl |
| 647 class TraceRecorderStub extends bindings.Stub { | 673 extends bindings.StubMessageHandler |
| 674 implements bindings.StubControl<TraceRecorder> { |
| 648 TraceRecorder _impl; | 675 TraceRecorder _impl; |
| 649 | 676 |
| 650 TraceRecorderStub.fromEndpoint( | 677 _TraceRecorderStubControl.fromEndpoint( |
| 651 core.MojoMessagePipeEndpoint endpoint, [TraceRecorder impl]) | 678 core.MojoMessagePipeEndpoint endpoint, [TraceRecorder impl]) |
| 652 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 679 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
| 653 _impl = impl; | 680 _impl = impl; |
| 654 } | 681 } |
| 655 | 682 |
| 656 TraceRecorderStub.fromHandle( | 683 _TraceRecorderStubControl.fromHandle( |
| 657 core.MojoHandle handle, [TraceRecorder impl]) | 684 core.MojoHandle handle, [TraceRecorder impl]) |
| 658 : super.fromHandle(handle, autoBegin: impl != null) { | 685 : super.fromHandle(handle, autoBegin: impl != null) { |
| 659 _impl = impl; | 686 _impl = impl; |
| 660 } | 687 } |
| 661 | 688 |
| 662 TraceRecorderStub.unbound([this._impl]) : super.unbound(); | 689 _TraceRecorderStubControl.unbound([this._impl]) : super.unbound(); |
| 663 | |
| 664 static TraceRecorderStub newFromEndpoint( | |
| 665 core.MojoMessagePipeEndpoint endpoint) { | |
| 666 assert(endpoint.setDescription("For TraceRecorderStub")); | |
| 667 return new TraceRecorderStub.fromEndpoint(endpoint); | |
| 668 } | |
| 669 | 690 |
| 670 | 691 |
| 671 | 692 |
| 672 dynamic handleMessage(bindings.ServiceMessage message) { | 693 dynamic handleMessage(bindings.ServiceMessage message) { |
| 673 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 694 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
| 674 return bindings.ControlMessageHandler.handleMessage(this, | 695 return bindings.ControlMessageHandler.handleMessage(this, |
| 675 0, | 696 0, |
| 676 message); | 697 message); |
| 677 } | 698 } |
| 678 if (_impl == null) { | 699 if (_impl == null) { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 703 } | 724 } |
| 704 | 725 |
| 705 @override | 726 @override |
| 706 void bind(core.MojoMessagePipeEndpoint endpoint) { | 727 void bind(core.MojoMessagePipeEndpoint endpoint) { |
| 707 super.bind(endpoint); | 728 super.bind(endpoint); |
| 708 if (!isOpen && (_impl != null)) { | 729 if (!isOpen && (_impl != null)) { |
| 709 beginHandlingEvents(); | 730 beginHandlingEvents(); |
| 710 } | 731 } |
| 711 } | 732 } |
| 712 | 733 |
| 734 @override |
| 713 String toString() { | 735 String toString() { |
| 714 var superString = super.toString(); | 736 var superString = super.toString(); |
| 715 return "TraceRecorderStub($superString)"; | 737 return "_TraceRecorderStubControl($superString)"; |
| 716 } | 738 } |
| 717 | 739 |
| 718 int get version => 0; | 740 int get version => 0; |
| 719 | 741 |
| 720 static service_describer.ServiceDescription _cachedServiceDescription; | 742 static service_describer.ServiceDescription _cachedServiceDescription; |
| 721 static service_describer.ServiceDescription get serviceDescription { | 743 static service_describer.ServiceDescription get serviceDescription { |
| 722 if (_cachedServiceDescription == null) { | 744 if (_cachedServiceDescription == null) { |
| 723 _cachedServiceDescription = new _TraceRecorderServiceDescription(); | 745 _cachedServiceDescription = new _TraceRecorderServiceDescription(); |
| 724 } | 746 } |
| 725 return _cachedServiceDescription; | 747 return _cachedServiceDescription; |
| 726 } | 748 } |
| 727 } | 749 } |
| 728 | 750 |
| 751 class TraceRecorderStub |
| 752 extends bindings.Stub<TraceRecorder> |
| 753 implements TraceRecorder { |
| 754 TraceRecorderStub.fromEndpoint( |
| 755 core.MojoMessagePipeEndpoint endpoint, [TraceRecorder impl]) |
| 756 : super(new _TraceRecorderStubControl.fromEndpoint(endpoint, impl)); |
| 757 |
| 758 TraceRecorderStub.fromHandle( |
| 759 core.MojoHandle handle, [TraceRecorder impl]) |
| 760 : super(new _TraceRecorderStubControl.fromHandle(handle, impl)); |
| 761 |
| 762 TraceRecorderStub.unbound([TraceRecorder impl]) |
| 763 : super(new _TraceRecorderStubControl.unbound(impl)); |
| 764 |
| 765 static TraceRecorderStub newFromEndpoint( |
| 766 core.MojoMessagePipeEndpoint endpoint) { |
| 767 assert(endpoint.setDescription("For TraceRecorderStub")); |
| 768 return new TraceRecorderStub.fromEndpoint(endpoint); |
| 769 } |
| 770 |
| 771 static service_describer.ServiceDescription get serviceDescription => |
| 772 _TraceRecorderStubControl.serviceDescription; |
| 773 |
| 774 |
| 775 void record(String json) { |
| 776 return impl.record(json); |
| 777 } |
| 778 } |
| 779 |
| 729 const int _traceCollectorMethodStartName = 0; | 780 const int _traceCollectorMethodStartName = 0; |
| 730 const int _traceCollectorMethodStopAndFlushName = 1; | 781 const int _traceCollectorMethodStopAndFlushName = 1; |
| 731 | 782 |
| 732 class _TraceCollectorServiceDescription implements service_describer.ServiceDesc
ription { | 783 class _TraceCollectorServiceDescription implements service_describer.ServiceDesc
ription { |
| 733 dynamic getTopLevelInterface([Function responseFactory]) => | 784 dynamic getTopLevelInterface([Function responseFactory]) => |
| 734 responseFactory(null); | 785 responseFactory(null); |
| 735 | 786 |
| 736 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 787 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => |
| 737 responseFactory(null); | 788 responseFactory(null); |
| 738 | 789 |
| 739 dynamic getAllTypeDefinitions([Function responseFactory]) => | 790 dynamic getAllTypeDefinitions([Function responseFactory]) => |
| 740 responseFactory(null); | 791 responseFactory(null); |
| 741 } | 792 } |
| 742 | 793 |
| 743 abstract class TraceCollector { | 794 abstract class TraceCollector { |
| 744 static const String serviceName = "tracing::TraceCollector"; | 795 static const String serviceName = "tracing::TraceCollector"; |
| 745 void start(core.MojoDataPipeProducer stream, String categories); | 796 void start(core.MojoDataPipeProducer stream, String categories); |
| 746 void stopAndFlush(); | 797 void stopAndFlush(); |
| 747 } | 798 } |
| 748 | 799 |
| 749 | 800 class _TraceCollectorProxyControl |
| 750 class _TraceCollectorProxyControl extends bindings.ProxyMessageHandler | 801 extends bindings.ProxyMessageHandler |
| 751 implements bindings.ProxyControl { | 802 implements bindings.ProxyControl { |
| 752 _TraceCollectorProxyControl.fromEndpoint( | 803 _TraceCollectorProxyControl.fromEndpoint( |
| 753 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 804 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 754 | 805 |
| 755 _TraceCollectorProxyControl.fromHandle( | 806 _TraceCollectorProxyControl.fromHandle( |
| 756 core.MojoHandle handle) : super.fromHandle(handle); | 807 core.MojoHandle handle) : super.fromHandle(handle); |
| 757 | 808 |
| 758 _TraceCollectorProxyControl.unbound() : super.unbound(); | 809 _TraceCollectorProxyControl.unbound() : super.unbound(); |
| 759 | 810 |
| 760 service_describer.ServiceDescription get serviceDescription => | 811 service_describer.ServiceDescription get serviceDescription => |
| 761 new _TraceCollectorServiceDescription(); | 812 new _TraceCollectorServiceDescription(); |
| 762 | 813 |
| 763 String get serviceName => TraceCollector.serviceName; | 814 String get serviceName => TraceCollector.serviceName; |
| 764 | 815 |
| 765 @override | |
| 766 void handleResponse(bindings.ServiceMessage message) { | 816 void handleResponse(bindings.ServiceMessage message) { |
| 767 switch (message.header.type) { | 817 switch (message.header.type) { |
| 768 default: | 818 default: |
| 769 proxyError("Unexpected message type: ${message.header.type}"); | 819 proxyError("Unexpected message type: ${message.header.type}"); |
| 770 close(immediate: true); | 820 close(immediate: true); |
| 771 break; | 821 break; |
| 772 } | 822 } |
| 773 } | 823 } |
| 774 | 824 |
| 775 @override | 825 @override |
| 776 String toString() { | 826 String toString() { |
| 777 var superString = super.toString(); | 827 var superString = super.toString(); |
| 778 return "_TraceCollectorProxyControl($superString)"; | 828 return "_TraceCollectorProxyControl($superString)"; |
| 779 } | 829 } |
| 780 } | 830 } |
| 781 | 831 |
| 782 | 832 class TraceCollectorProxy |
| 783 class TraceCollectorProxy extends bindings.Proxy | 833 extends bindings.Proxy |
| 784 implements TraceCollector { | 834 implements TraceCollector { |
| 785 TraceCollectorProxy.fromEndpoint( | 835 TraceCollectorProxy.fromEndpoint( |
| 786 core.MojoMessagePipeEndpoint endpoint) | 836 core.MojoMessagePipeEndpoint endpoint) |
| 787 : super(new _TraceCollectorProxyControl.fromEndpoint(endpoint)); | 837 : super(new _TraceCollectorProxyControl.fromEndpoint(endpoint)); |
| 788 | 838 |
| 789 TraceCollectorProxy.fromHandle(core.MojoHandle handle) | 839 TraceCollectorProxy.fromHandle(core.MojoHandle handle) |
| 790 : super(new _TraceCollectorProxyControl.fromHandle(handle)); | 840 : super(new _TraceCollectorProxyControl.fromHandle(handle)); |
| 791 | 841 |
| 792 TraceCollectorProxy.unbound() | 842 TraceCollectorProxy.unbound() |
| 793 : super(new _TraceCollectorProxyControl.unbound()); | 843 : super(new _TraceCollectorProxyControl.unbound()); |
| 794 | 844 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 821 if (!ctrl.isBound) { | 871 if (!ctrl.isBound) { |
| 822 ctrl.proxyError("The Proxy is closed."); | 872 ctrl.proxyError("The Proxy is closed."); |
| 823 return; | 873 return; |
| 824 } | 874 } |
| 825 var params = new _TraceCollectorStopAndFlushParams(); | 875 var params = new _TraceCollectorStopAndFlushParams(); |
| 826 ctrl.sendMessage(params, | 876 ctrl.sendMessage(params, |
| 827 _traceCollectorMethodStopAndFlushName); | 877 _traceCollectorMethodStopAndFlushName); |
| 828 } | 878 } |
| 829 } | 879 } |
| 830 | 880 |
| 831 | 881 class _TraceCollectorStubControl |
| 832 class TraceCollectorStub extends bindings.Stub { | 882 extends bindings.StubMessageHandler |
| 883 implements bindings.StubControl<TraceCollector> { |
| 833 TraceCollector _impl; | 884 TraceCollector _impl; |
| 834 | 885 |
| 835 TraceCollectorStub.fromEndpoint( | 886 _TraceCollectorStubControl.fromEndpoint( |
| 836 core.MojoMessagePipeEndpoint endpoint, [TraceCollector impl]) | 887 core.MojoMessagePipeEndpoint endpoint, [TraceCollector impl]) |
| 837 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 888 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
| 838 _impl = impl; | 889 _impl = impl; |
| 839 } | 890 } |
| 840 | 891 |
| 841 TraceCollectorStub.fromHandle( | 892 _TraceCollectorStubControl.fromHandle( |
| 842 core.MojoHandle handle, [TraceCollector impl]) | 893 core.MojoHandle handle, [TraceCollector impl]) |
| 843 : super.fromHandle(handle, autoBegin: impl != null) { | 894 : super.fromHandle(handle, autoBegin: impl != null) { |
| 844 _impl = impl; | 895 _impl = impl; |
| 845 } | 896 } |
| 846 | 897 |
| 847 TraceCollectorStub.unbound([this._impl]) : super.unbound(); | 898 _TraceCollectorStubControl.unbound([this._impl]) : super.unbound(); |
| 848 | |
| 849 static TraceCollectorStub newFromEndpoint( | |
| 850 core.MojoMessagePipeEndpoint endpoint) { | |
| 851 assert(endpoint.setDescription("For TraceCollectorStub")); | |
| 852 return new TraceCollectorStub.fromEndpoint(endpoint); | |
| 853 } | |
| 854 | 899 |
| 855 | 900 |
| 856 | 901 |
| 857 dynamic handleMessage(bindings.ServiceMessage message) { | 902 dynamic handleMessage(bindings.ServiceMessage message) { |
| 858 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 903 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
| 859 return bindings.ControlMessageHandler.handleMessage(this, | 904 return bindings.ControlMessageHandler.handleMessage(this, |
| 860 0, | 905 0, |
| 861 message); | 906 message); |
| 862 } | 907 } |
| 863 if (_impl == null) { | 908 if (_impl == null) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 891 } | 936 } |
| 892 | 937 |
| 893 @override | 938 @override |
| 894 void bind(core.MojoMessagePipeEndpoint endpoint) { | 939 void bind(core.MojoMessagePipeEndpoint endpoint) { |
| 895 super.bind(endpoint); | 940 super.bind(endpoint); |
| 896 if (!isOpen && (_impl != null)) { | 941 if (!isOpen && (_impl != null)) { |
| 897 beginHandlingEvents(); | 942 beginHandlingEvents(); |
| 898 } | 943 } |
| 899 } | 944 } |
| 900 | 945 |
| 946 @override |
| 901 String toString() { | 947 String toString() { |
| 902 var superString = super.toString(); | 948 var superString = super.toString(); |
| 903 return "TraceCollectorStub($superString)"; | 949 return "_TraceCollectorStubControl($superString)"; |
| 904 } | 950 } |
| 905 | 951 |
| 906 int get version => 0; | 952 int get version => 0; |
| 907 | 953 |
| 908 static service_describer.ServiceDescription _cachedServiceDescription; | 954 static service_describer.ServiceDescription _cachedServiceDescription; |
| 909 static service_describer.ServiceDescription get serviceDescription { | 955 static service_describer.ServiceDescription get serviceDescription { |
| 910 if (_cachedServiceDescription == null) { | 956 if (_cachedServiceDescription == null) { |
| 911 _cachedServiceDescription = new _TraceCollectorServiceDescription(); | 957 _cachedServiceDescription = new _TraceCollectorServiceDescription(); |
| 912 } | 958 } |
| 913 return _cachedServiceDescription; | 959 return _cachedServiceDescription; |
| 914 } | 960 } |
| 915 } | 961 } |
| 916 | 962 |
| 963 class TraceCollectorStub |
| 964 extends bindings.Stub<TraceCollector> |
| 965 implements TraceCollector { |
| 966 TraceCollectorStub.fromEndpoint( |
| 967 core.MojoMessagePipeEndpoint endpoint, [TraceCollector impl]) |
| 968 : super(new _TraceCollectorStubControl.fromEndpoint(endpoint, impl)); |
| 969 |
| 970 TraceCollectorStub.fromHandle( |
| 971 core.MojoHandle handle, [TraceCollector impl]) |
| 972 : super(new _TraceCollectorStubControl.fromHandle(handle, impl)); |
| 973 |
| 974 TraceCollectorStub.unbound([TraceCollector impl]) |
| 975 : super(new _TraceCollectorStubControl.unbound(impl)); |
| 976 |
| 977 static TraceCollectorStub newFromEndpoint( |
| 978 core.MojoMessagePipeEndpoint endpoint) { |
| 979 assert(endpoint.setDescription("For TraceCollectorStub")); |
| 980 return new TraceCollectorStub.fromEndpoint(endpoint); |
| 981 } |
| 982 |
| 983 static service_describer.ServiceDescription get serviceDescription => |
| 984 _TraceCollectorStubControl.serviceDescription; |
| 985 |
| 986 |
| 987 void start(core.MojoDataPipeProducer stream, String categories) { |
| 988 return impl.start(stream, categories); |
| 989 } |
| 990 void stopAndFlush() { |
| 991 return impl.stopAndFlush(); |
| 992 } |
| 993 } |
| 994 |
| 917 | 995 |
| 918 | 996 |
| OLD | NEW |