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 resources_mojom; | 5 library resources_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 import 'package:mojo_services/mojo/geometry.mojom.dart' as geometry_mojom; | 10 import 'package:mojo_services/mojo/geometry.mojom.dart' as geometry_mojom; |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 | 438 |
439 dynamic getAllTypeDefinitions([Function responseFactory]) => | 439 dynamic getAllTypeDefinitions([Function responseFactory]) => |
440 responseFactory(null); | 440 responseFactory(null); |
441 } | 441 } |
442 | 442 |
443 abstract class MailboxTextureCallback { | 443 abstract class MailboxTextureCallback { |
444 static const String serviceName = null; | 444 static const String serviceName = null; |
445 void onMailboxTextureReleased(); | 445 void onMailboxTextureReleased(); |
446 } | 446 } |
447 | 447 |
448 | 448 class _MailboxTextureCallbackProxyControl |
449 class _MailboxTextureCallbackProxyControl extends bindings.ProxyMessageHandler | 449 extends bindings.ProxyMessageHandler |
450 implements bindings.ProxyControl { | 450 implements bindings.ProxyControl { |
451 _MailboxTextureCallbackProxyControl.fromEndpoint( | 451 _MailboxTextureCallbackProxyControl.fromEndpoint( |
452 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 452 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
453 | 453 |
454 _MailboxTextureCallbackProxyControl.fromHandle( | 454 _MailboxTextureCallbackProxyControl.fromHandle( |
455 core.MojoHandle handle) : super.fromHandle(handle); | 455 core.MojoHandle handle) : super.fromHandle(handle); |
456 | 456 |
457 _MailboxTextureCallbackProxyControl.unbound() : super.unbound(); | 457 _MailboxTextureCallbackProxyControl.unbound() : super.unbound(); |
458 | 458 |
459 service_describer.ServiceDescription get serviceDescription => | 459 service_describer.ServiceDescription get serviceDescription => |
460 new _MailboxTextureCallbackServiceDescription(); | 460 new _MailboxTextureCallbackServiceDescription(); |
461 | 461 |
462 String get serviceName => MailboxTextureCallback.serviceName; | 462 String get serviceName => MailboxTextureCallback.serviceName; |
463 | 463 |
464 @override | |
465 void handleResponse(bindings.ServiceMessage message) { | 464 void handleResponse(bindings.ServiceMessage message) { |
466 switch (message.header.type) { | 465 switch (message.header.type) { |
467 default: | 466 default: |
468 proxyError("Unexpected message type: ${message.header.type}"); | 467 proxyError("Unexpected message type: ${message.header.type}"); |
469 close(immediate: true); | 468 close(immediate: true); |
470 break; | 469 break; |
471 } | 470 } |
472 } | 471 } |
473 | 472 |
474 @override | 473 @override |
475 String toString() { | 474 String toString() { |
476 var superString = super.toString(); | 475 var superString = super.toString(); |
477 return "_MailboxTextureCallbackProxyControl($superString)"; | 476 return "_MailboxTextureCallbackProxyControl($superString)"; |
478 } | 477 } |
479 } | 478 } |
480 | 479 |
481 | 480 class MailboxTextureCallbackProxy |
482 class MailboxTextureCallbackProxy extends bindings.Proxy | 481 extends bindings.Proxy |
483 implements MailboxTextureCallback { | 482 implements MailboxTextureCallback { |
484 MailboxTextureCallbackProxy.fromEndpoint( | 483 MailboxTextureCallbackProxy.fromEndpoint( |
485 core.MojoMessagePipeEndpoint endpoint) | 484 core.MojoMessagePipeEndpoint endpoint) |
486 : super(new _MailboxTextureCallbackProxyControl.fromEndpoint(endpoint)); | 485 : super(new _MailboxTextureCallbackProxyControl.fromEndpoint(endpoint)); |
487 | 486 |
488 MailboxTextureCallbackProxy.fromHandle(core.MojoHandle handle) | 487 MailboxTextureCallbackProxy.fromHandle(core.MojoHandle handle) |
489 : super(new _MailboxTextureCallbackProxyControl.fromHandle(handle)); | 488 : super(new _MailboxTextureCallbackProxyControl.fromHandle(handle)); |
490 | 489 |
491 MailboxTextureCallbackProxy.unbound() | 490 MailboxTextureCallbackProxy.unbound() |
492 : super(new _MailboxTextureCallbackProxyControl.unbound()); | 491 : super(new _MailboxTextureCallbackProxyControl.unbound()); |
493 | 492 |
(...skipping 15 matching lines...) Expand all Loading... |
509 if (!ctrl.isBound) { | 508 if (!ctrl.isBound) { |
510 ctrl.proxyError("The Proxy is closed."); | 509 ctrl.proxyError("The Proxy is closed."); |
511 return; | 510 return; |
512 } | 511 } |
513 var params = new _MailboxTextureCallbackOnMailboxTextureReleasedParams(); | 512 var params = new _MailboxTextureCallbackOnMailboxTextureReleasedParams(); |
514 ctrl.sendMessage(params, | 513 ctrl.sendMessage(params, |
515 _mailboxTextureCallbackMethodOnMailboxTextureReleasedName); | 514 _mailboxTextureCallbackMethodOnMailboxTextureReleasedName); |
516 } | 515 } |
517 } | 516 } |
518 | 517 |
519 | 518 class _MailboxTextureCallbackStubControl |
520 class MailboxTextureCallbackStub extends bindings.Stub { | 519 extends bindings.StubMessageHandler |
| 520 implements bindings.StubControl<MailboxTextureCallback> { |
521 MailboxTextureCallback _impl; | 521 MailboxTextureCallback _impl; |
522 | 522 |
523 MailboxTextureCallbackStub.fromEndpoint( | 523 _MailboxTextureCallbackStubControl.fromEndpoint( |
524 core.MojoMessagePipeEndpoint endpoint, [MailboxTextureCallback impl]) | 524 core.MojoMessagePipeEndpoint endpoint, [MailboxTextureCallback impl]) |
525 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 525 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
526 _impl = impl; | 526 _impl = impl; |
527 } | 527 } |
528 | 528 |
529 MailboxTextureCallbackStub.fromHandle( | 529 _MailboxTextureCallbackStubControl.fromHandle( |
530 core.MojoHandle handle, [MailboxTextureCallback impl]) | 530 core.MojoHandle handle, [MailboxTextureCallback impl]) |
531 : super.fromHandle(handle, autoBegin: impl != null) { | 531 : super.fromHandle(handle, autoBegin: impl != null) { |
532 _impl = impl; | 532 _impl = impl; |
533 } | 533 } |
534 | 534 |
535 MailboxTextureCallbackStub.unbound([this._impl]) : super.unbound(); | 535 _MailboxTextureCallbackStubControl.unbound([this._impl]) : super.unbound(); |
536 | |
537 static MailboxTextureCallbackStub newFromEndpoint( | |
538 core.MojoMessagePipeEndpoint endpoint) { | |
539 assert(endpoint.setDescription("For MailboxTextureCallbackStub")); | |
540 return new MailboxTextureCallbackStub.fromEndpoint(endpoint); | |
541 } | |
542 | 536 |
543 | 537 |
544 | 538 |
545 dynamic handleMessage(bindings.ServiceMessage message) { | 539 dynamic handleMessage(bindings.ServiceMessage message) { |
546 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 540 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
547 return bindings.ControlMessageHandler.handleMessage(this, | 541 return bindings.ControlMessageHandler.handleMessage(this, |
548 0, | 542 0, |
549 message); | 543 message); |
550 } | 544 } |
551 if (_impl == null) { | 545 if (_impl == null) { |
(...skipping 22 matching lines...) Expand all Loading... |
574 } | 568 } |
575 | 569 |
576 @override | 570 @override |
577 void bind(core.MojoMessagePipeEndpoint endpoint) { | 571 void bind(core.MojoMessagePipeEndpoint endpoint) { |
578 super.bind(endpoint); | 572 super.bind(endpoint); |
579 if (!isOpen && (_impl != null)) { | 573 if (!isOpen && (_impl != null)) { |
580 beginHandlingEvents(); | 574 beginHandlingEvents(); |
581 } | 575 } |
582 } | 576 } |
583 | 577 |
| 578 @override |
584 String toString() { | 579 String toString() { |
585 var superString = super.toString(); | 580 var superString = super.toString(); |
586 return "MailboxTextureCallbackStub($superString)"; | 581 return "_MailboxTextureCallbackStubControl($superString)"; |
587 } | 582 } |
588 | 583 |
589 int get version => 0; | 584 int get version => 0; |
590 | 585 |
591 static service_describer.ServiceDescription _cachedServiceDescription; | 586 static service_describer.ServiceDescription _cachedServiceDescription; |
592 static service_describer.ServiceDescription get serviceDescription { | 587 static service_describer.ServiceDescription get serviceDescription { |
593 if (_cachedServiceDescription == null) { | 588 if (_cachedServiceDescription == null) { |
594 _cachedServiceDescription = new _MailboxTextureCallbackServiceDescription(
); | 589 _cachedServiceDescription = new _MailboxTextureCallbackServiceDescription(
); |
595 } | 590 } |
596 return _cachedServiceDescription; | 591 return _cachedServiceDescription; |
597 } | 592 } |
598 } | 593 } |
599 | 594 |
| 595 class MailboxTextureCallbackStub |
| 596 extends bindings.Stub<MailboxTextureCallback> |
| 597 implements MailboxTextureCallback { |
| 598 MailboxTextureCallbackStub.fromEndpoint( |
| 599 core.MojoMessagePipeEndpoint endpoint, [MailboxTextureCallback impl]) |
| 600 : super(new _MailboxTextureCallbackStubControl.fromEndpoint(endpoint, impl
)); |
| 601 |
| 602 MailboxTextureCallbackStub.fromHandle( |
| 603 core.MojoHandle handle, [MailboxTextureCallback impl]) |
| 604 : super(new _MailboxTextureCallbackStubControl.fromHandle(handle, impl)); |
| 605 |
| 606 MailboxTextureCallbackStub.unbound([MailboxTextureCallback impl]) |
| 607 : super(new _MailboxTextureCallbackStubControl.unbound(impl)); |
| 608 |
| 609 static MailboxTextureCallbackStub newFromEndpoint( |
| 610 core.MojoMessagePipeEndpoint endpoint) { |
| 611 assert(endpoint.setDescription("For MailboxTextureCallbackStub")); |
| 612 return new MailboxTextureCallbackStub.fromEndpoint(endpoint); |
| 613 } |
| 614 |
| 615 static service_describer.ServiceDescription get serviceDescription => |
| 616 _MailboxTextureCallbackStubControl.serviceDescription; |
| 617 |
| 618 |
| 619 void onMailboxTextureReleased() { |
| 620 return impl.onMailboxTextureReleased(); |
| 621 } |
| 622 } |
| 623 |
600 | 624 |
601 | 625 |
OLD | NEW |