| 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 notifications_mojom; | 5 library notifications_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 |
| 11 | 11 |
| 12 | 12 |
| 13 class NotificationData extends bindings.Struct { | 13 class NotificationData extends bindings.Struct { |
| 14 static const List<bindings.StructDataHeader> kVersions = const [ | 14 static const List<bindings.StructDataHeader> kVersions = const [ |
| 15 const bindings.StructDataHeader(32, 0) | 15 const bindings.StructDataHeader(32, 0) |
| 16 ]; | 16 ]; |
| 17 String title = null; | 17 String title = null; |
| 18 String text = null; | 18 String text = null; |
| 19 bool playSound = false; | 19 bool playSound = false; |
| 20 bool vibrate = false; | 20 bool vibrate = false; |
| 21 bool setLights = false; | 21 bool setLights = false; |
| 22 | 22 |
| 23 NotificationData() : super(kVersions.last.size); | 23 NotificationData() : super(kVersions.last.size); |
| 24 | 24 |
| 25 NotificationData.init( |
| 26 String this.title, |
| 27 String this.text, |
| 28 bool this.playSound, |
| 29 bool this.vibrate, |
| 30 bool this.setLights |
| 31 ) : super(kVersions.last.size); |
| 32 |
| 25 static NotificationData deserialize(bindings.Message message) { | 33 static NotificationData deserialize(bindings.Message message) { |
| 26 var decoder = new bindings.Decoder(message); | 34 var decoder = new bindings.Decoder(message); |
| 27 var result = decode(decoder); | 35 var result = decode(decoder); |
| 28 if (decoder.excessHandles != null) { | 36 if (decoder.excessHandles != null) { |
| 29 decoder.excessHandles.forEach((h) => h.close()); | 37 decoder.excessHandles.forEach((h) => h.close()); |
| 30 } | 38 } |
| 31 return result; | 39 return result; |
| 32 } | 40 } |
| 33 | 41 |
| 34 static NotificationData decode(bindings.Decoder decoder0) { | 42 static NotificationData decode(bindings.Decoder decoder0) { |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 } | 146 } |
| 139 | 147 |
| 140 | 148 |
| 141 class _NotificationClientOnSelectedParams extends bindings.Struct { | 149 class _NotificationClientOnSelectedParams extends bindings.Struct { |
| 142 static const List<bindings.StructDataHeader> kVersions = const [ | 150 static const List<bindings.StructDataHeader> kVersions = const [ |
| 143 const bindings.StructDataHeader(8, 0) | 151 const bindings.StructDataHeader(8, 0) |
| 144 ]; | 152 ]; |
| 145 | 153 |
| 146 _NotificationClientOnSelectedParams() : super(kVersions.last.size); | 154 _NotificationClientOnSelectedParams() : super(kVersions.last.size); |
| 147 | 155 |
| 156 _NotificationClientOnSelectedParams.init( |
| 157 ) : super(kVersions.last.size); |
| 158 |
| 148 static _NotificationClientOnSelectedParams deserialize(bindings.Message messag
e) { | 159 static _NotificationClientOnSelectedParams deserialize(bindings.Message messag
e) { |
| 149 var decoder = new bindings.Decoder(message); | 160 var decoder = new bindings.Decoder(message); |
| 150 var result = decode(decoder); | 161 var result = decode(decoder); |
| 151 if (decoder.excessHandles != null) { | 162 if (decoder.excessHandles != null) { |
| 152 decoder.excessHandles.forEach((h) => h.close()); | 163 decoder.excessHandles.forEach((h) => h.close()); |
| 153 } | 164 } |
| 154 return result; | 165 return result; |
| 155 } | 166 } |
| 156 | 167 |
| 157 static _NotificationClientOnSelectedParams decode(bindings.Decoder decoder0) { | 168 static _NotificationClientOnSelectedParams decode(bindings.Decoder decoder0) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 } | 207 } |
| 197 | 208 |
| 198 | 209 |
| 199 class _NotificationClientOnDismissedParams extends bindings.Struct { | 210 class _NotificationClientOnDismissedParams extends bindings.Struct { |
| 200 static const List<bindings.StructDataHeader> kVersions = const [ | 211 static const List<bindings.StructDataHeader> kVersions = const [ |
| 201 const bindings.StructDataHeader(8, 0) | 212 const bindings.StructDataHeader(8, 0) |
| 202 ]; | 213 ]; |
| 203 | 214 |
| 204 _NotificationClientOnDismissedParams() : super(kVersions.last.size); | 215 _NotificationClientOnDismissedParams() : super(kVersions.last.size); |
| 205 | 216 |
| 217 _NotificationClientOnDismissedParams.init( |
| 218 ) : super(kVersions.last.size); |
| 219 |
| 206 static _NotificationClientOnDismissedParams deserialize(bindings.Message messa
ge) { | 220 static _NotificationClientOnDismissedParams deserialize(bindings.Message messa
ge) { |
| 207 var decoder = new bindings.Decoder(message); | 221 var decoder = new bindings.Decoder(message); |
| 208 var result = decode(decoder); | 222 var result = decode(decoder); |
| 209 if (decoder.excessHandles != null) { | 223 if (decoder.excessHandles != null) { |
| 210 decoder.excessHandles.forEach((h) => h.close()); | 224 decoder.excessHandles.forEach((h) => h.close()); |
| 211 } | 225 } |
| 212 return result; | 226 return result; |
| 213 } | 227 } |
| 214 | 228 |
| 215 static _NotificationClientOnDismissedParams decode(bindings.Decoder decoder0)
{ | 229 static _NotificationClientOnDismissedParams decode(bindings.Decoder decoder0)
{ |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 | 269 |
| 256 | 270 |
| 257 class _NotificationUpdateParams extends bindings.Struct { | 271 class _NotificationUpdateParams extends bindings.Struct { |
| 258 static const List<bindings.StructDataHeader> kVersions = const [ | 272 static const List<bindings.StructDataHeader> kVersions = const [ |
| 259 const bindings.StructDataHeader(16, 0) | 273 const bindings.StructDataHeader(16, 0) |
| 260 ]; | 274 ]; |
| 261 NotificationData notificationData = null; | 275 NotificationData notificationData = null; |
| 262 | 276 |
| 263 _NotificationUpdateParams() : super(kVersions.last.size); | 277 _NotificationUpdateParams() : super(kVersions.last.size); |
| 264 | 278 |
| 279 _NotificationUpdateParams.init( |
| 280 NotificationData this.notificationData |
| 281 ) : super(kVersions.last.size); |
| 282 |
| 265 static _NotificationUpdateParams deserialize(bindings.Message message) { | 283 static _NotificationUpdateParams deserialize(bindings.Message message) { |
| 266 var decoder = new bindings.Decoder(message); | 284 var decoder = new bindings.Decoder(message); |
| 267 var result = decode(decoder); | 285 var result = decode(decoder); |
| 268 if (decoder.excessHandles != null) { | 286 if (decoder.excessHandles != null) { |
| 269 decoder.excessHandles.forEach((h) => h.close()); | 287 decoder.excessHandles.forEach((h) => h.close()); |
| 270 } | 288 } |
| 271 return result; | 289 return result; |
| 272 } | 290 } |
| 273 | 291 |
| 274 static _NotificationUpdateParams decode(bindings.Decoder decoder0) { | 292 static _NotificationUpdateParams decode(bindings.Decoder decoder0) { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 } | 345 } |
| 328 | 346 |
| 329 | 347 |
| 330 class _NotificationCancelParams extends bindings.Struct { | 348 class _NotificationCancelParams extends bindings.Struct { |
| 331 static const List<bindings.StructDataHeader> kVersions = const [ | 349 static const List<bindings.StructDataHeader> kVersions = const [ |
| 332 const bindings.StructDataHeader(8, 0) | 350 const bindings.StructDataHeader(8, 0) |
| 333 ]; | 351 ]; |
| 334 | 352 |
| 335 _NotificationCancelParams() : super(kVersions.last.size); | 353 _NotificationCancelParams() : super(kVersions.last.size); |
| 336 | 354 |
| 355 _NotificationCancelParams.init( |
| 356 ) : super(kVersions.last.size); |
| 357 |
| 337 static _NotificationCancelParams deserialize(bindings.Message message) { | 358 static _NotificationCancelParams deserialize(bindings.Message message) { |
| 338 var decoder = new bindings.Decoder(message); | 359 var decoder = new bindings.Decoder(message); |
| 339 var result = decode(decoder); | 360 var result = decode(decoder); |
| 340 if (decoder.excessHandles != null) { | 361 if (decoder.excessHandles != null) { |
| 341 decoder.excessHandles.forEach((h) => h.close()); | 362 decoder.excessHandles.forEach((h) => h.close()); |
| 342 } | 363 } |
| 343 return result; | 364 return result; |
| 344 } | 365 } |
| 345 | 366 |
| 346 static _NotificationCancelParams decode(bindings.Decoder decoder0) { | 367 static _NotificationCancelParams decode(bindings.Decoder decoder0) { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 class _NotificationServicePostParams extends bindings.Struct { | 409 class _NotificationServicePostParams extends bindings.Struct { |
| 389 static const List<bindings.StructDataHeader> kVersions = const [ | 410 static const List<bindings.StructDataHeader> kVersions = const [ |
| 390 const bindings.StructDataHeader(32, 0) | 411 const bindings.StructDataHeader(32, 0) |
| 391 ]; | 412 ]; |
| 392 NotificationData notificationData = null; | 413 NotificationData notificationData = null; |
| 393 NotificationClientInterface client = null; | 414 NotificationClientInterface client = null; |
| 394 NotificationInterfaceRequest notification = null; | 415 NotificationInterfaceRequest notification = null; |
| 395 | 416 |
| 396 _NotificationServicePostParams() : super(kVersions.last.size); | 417 _NotificationServicePostParams() : super(kVersions.last.size); |
| 397 | 418 |
| 419 _NotificationServicePostParams.init( |
| 420 NotificationData this.notificationData, |
| 421 NotificationClientInterface this.client, |
| 422 NotificationInterfaceRequest this.notification |
| 423 ) : super(kVersions.last.size); |
| 424 |
| 398 static _NotificationServicePostParams deserialize(bindings.Message message) { | 425 static _NotificationServicePostParams deserialize(bindings.Message message) { |
| 399 var decoder = new bindings.Decoder(message); | 426 var decoder = new bindings.Decoder(message); |
| 400 var result = decode(decoder); | 427 var result = decode(decoder); |
| 401 if (decoder.excessHandles != null) { | 428 if (decoder.excessHandles != null) { |
| 402 decoder.excessHandles.forEach((h) => h.close()); | 429 decoder.excessHandles.forEach((h) => h.close()); |
| 403 } | 430 } |
| 404 return result; | 431 return result; |
| 405 } | 432 } |
| 406 | 433 |
| 407 static _NotificationServicePostParams decode(bindings.Decoder decoder0) { | 434 static _NotificationServicePostParams decode(bindings.Decoder decoder0) { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 Map toJson() { | 506 Map toJson() { |
| 480 throw new bindings.MojoCodecError( | 507 throw new bindings.MojoCodecError( |
| 481 'Object containing handles cannot be encoded to JSON.'); | 508 'Object containing handles cannot be encoded to JSON.'); |
| 482 } | 509 } |
| 483 } | 510 } |
| 484 | 511 |
| 485 const int _notificationClientMethodOnSelectedName = 0; | 512 const int _notificationClientMethodOnSelectedName = 0; |
| 486 const int _notificationClientMethodOnDismissedName = 1; | 513 const int _notificationClientMethodOnDismissedName = 1; |
| 487 | 514 |
| 488 class _NotificationClientServiceDescription implements service_describer.Service
Description { | 515 class _NotificationClientServiceDescription implements service_describer.Service
Description { |
| 489 dynamic getTopLevelInterface([Function responseFactory]) => | 516 void getTopLevelInterface(Function responder) { |
| 490 responseFactory(null); | 517 responder(null); |
| 518 } |
| 491 | 519 |
| 492 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 520 void getTypeDefinition(String typeKey, Function responder) { |
| 493 responseFactory(null); | 521 responder(null); |
| 522 } |
| 494 | 523 |
| 495 dynamic getAllTypeDefinitions([Function responseFactory]) => | 524 void getAllTypeDefinitions(Function responder) { |
| 496 responseFactory(null); | 525 responder(null); |
| 526 } |
| 497 } | 527 } |
| 498 | 528 |
| 499 abstract class NotificationClient { | 529 abstract class NotificationClient { |
| 500 static const String serviceName = null; | 530 static const String serviceName = null; |
| 501 | 531 |
| 502 static service_describer.ServiceDescription _cachedServiceDescription; | 532 static service_describer.ServiceDescription _cachedServiceDescription; |
| 503 static service_describer.ServiceDescription get serviceDescription { | 533 static service_describer.ServiceDescription get serviceDescription { |
| 504 if (_cachedServiceDescription == null) { | 534 if (_cachedServiceDescription == null) { |
| 505 _cachedServiceDescription = new _NotificationClientServiceDescription(); | 535 _cachedServiceDescription = new _NotificationClientServiceDescription(); |
| 506 } | 536 } |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 : super.fromHandle(handle, autoBegin: impl != null) { | 679 : super.fromHandle(handle, autoBegin: impl != null) { |
| 650 _impl = impl; | 680 _impl = impl; |
| 651 } | 681 } |
| 652 | 682 |
| 653 _NotificationClientStubControl.unbound([this._impl]) : super.unbound(); | 683 _NotificationClientStubControl.unbound([this._impl]) : super.unbound(); |
| 654 | 684 |
| 655 String get serviceName => NotificationClient.serviceName; | 685 String get serviceName => NotificationClient.serviceName; |
| 656 | 686 |
| 657 | 687 |
| 658 | 688 |
| 659 dynamic handleMessage(bindings.ServiceMessage message) { | 689 void handleMessage(bindings.ServiceMessage message) { |
| 660 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 690 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
| 661 return bindings.ControlMessageHandler.handleMessage(this, | 691 bindings.ControlMessageHandler.handleMessage( |
| 662 0, | 692 this, 0, message); |
| 663 message); | 693 return; |
| 664 } | 694 } |
| 665 if (_impl == null) { | 695 if (_impl == null) { |
| 666 throw new core.MojoApiError("$this has no implementation set"); | 696 throw new core.MojoApiError("$this has no implementation set"); |
| 667 } | 697 } |
| 668 switch (message.header.type) { | 698 switch (message.header.type) { |
| 669 case _notificationClientMethodOnSelectedName: | 699 case _notificationClientMethodOnSelectedName: |
| 670 _impl.onSelected(); | 700 _impl.onSelected(); |
| 671 break; | 701 break; |
| 672 case _notificationClientMethodOnDismissedName: | 702 case _notificationClientMethodOnDismissedName: |
| 673 _impl.onDismissed(); | 703 _impl.onDismissed(); |
| 674 break; | 704 break; |
| 675 default: | 705 default: |
| 676 throw new bindings.MojoCodecError("Unexpected message name"); | 706 throw new bindings.MojoCodecError("Unexpected message name"); |
| 677 break; | 707 break; |
| 678 } | 708 } |
| 679 return null; | |
| 680 } | 709 } |
| 681 | 710 |
| 682 NotificationClient get impl => _impl; | 711 NotificationClient get impl => _impl; |
| 683 set impl(NotificationClient d) { | 712 set impl(NotificationClient d) { |
| 684 if (d == null) { | 713 if (d == null) { |
| 685 throw new core.MojoApiError("$this: Cannot set a null implementation"); | 714 throw new core.MojoApiError("$this: Cannot set a null implementation"); |
| 686 } | 715 } |
| 687 if (isBound && (_impl == null)) { | 716 if (isBound && (_impl == null)) { |
| 688 beginHandlingEvents(); | 717 beginHandlingEvents(); |
| 689 } | 718 } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 } | 764 } |
| 736 void onDismissed() { | 765 void onDismissed() { |
| 737 return impl.onDismissed(); | 766 return impl.onDismissed(); |
| 738 } | 767 } |
| 739 } | 768 } |
| 740 | 769 |
| 741 const int _notificationMethodUpdateName = 0; | 770 const int _notificationMethodUpdateName = 0; |
| 742 const int _notificationMethodCancelName = 1; | 771 const int _notificationMethodCancelName = 1; |
| 743 | 772 |
| 744 class _NotificationServiceDescription implements service_describer.ServiceDescri
ption { | 773 class _NotificationServiceDescription implements service_describer.ServiceDescri
ption { |
| 745 dynamic getTopLevelInterface([Function responseFactory]) => | 774 void getTopLevelInterface(Function responder) { |
| 746 responseFactory(null); | 775 responder(null); |
| 776 } |
| 747 | 777 |
| 748 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 778 void getTypeDefinition(String typeKey, Function responder) { |
| 749 responseFactory(null); | 779 responder(null); |
| 780 } |
| 750 | 781 |
| 751 dynamic getAllTypeDefinitions([Function responseFactory]) => | 782 void getAllTypeDefinitions(Function responder) { |
| 752 responseFactory(null); | 783 responder(null); |
| 784 } |
| 753 } | 785 } |
| 754 | 786 |
| 755 abstract class Notification { | 787 abstract class Notification { |
| 756 static const String serviceName = null; | 788 static const String serviceName = null; |
| 757 | 789 |
| 758 static service_describer.ServiceDescription _cachedServiceDescription; | 790 static service_describer.ServiceDescription _cachedServiceDescription; |
| 759 static service_describer.ServiceDescription get serviceDescription { | 791 static service_describer.ServiceDescription get serviceDescription { |
| 760 if (_cachedServiceDescription == null) { | 792 if (_cachedServiceDescription == null) { |
| 761 _cachedServiceDescription = new _NotificationServiceDescription(); | 793 _cachedServiceDescription = new _NotificationServiceDescription(); |
| 762 } | 794 } |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 : super.fromHandle(handle, autoBegin: impl != null) { | 938 : super.fromHandle(handle, autoBegin: impl != null) { |
| 907 _impl = impl; | 939 _impl = impl; |
| 908 } | 940 } |
| 909 | 941 |
| 910 _NotificationStubControl.unbound([this._impl]) : super.unbound(); | 942 _NotificationStubControl.unbound([this._impl]) : super.unbound(); |
| 911 | 943 |
| 912 String get serviceName => Notification.serviceName; | 944 String get serviceName => Notification.serviceName; |
| 913 | 945 |
| 914 | 946 |
| 915 | 947 |
| 916 dynamic handleMessage(bindings.ServiceMessage message) { | 948 void handleMessage(bindings.ServiceMessage message) { |
| 917 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 949 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
| 918 return bindings.ControlMessageHandler.handleMessage(this, | 950 bindings.ControlMessageHandler.handleMessage( |
| 919 0, | 951 this, 0, message); |
| 920 message); | 952 return; |
| 921 } | 953 } |
| 922 if (_impl == null) { | 954 if (_impl == null) { |
| 923 throw new core.MojoApiError("$this has no implementation set"); | 955 throw new core.MojoApiError("$this has no implementation set"); |
| 924 } | 956 } |
| 925 switch (message.header.type) { | 957 switch (message.header.type) { |
| 926 case _notificationMethodUpdateName: | 958 case _notificationMethodUpdateName: |
| 927 var params = _NotificationUpdateParams.deserialize( | 959 var params = _NotificationUpdateParams.deserialize( |
| 928 message.payload); | 960 message.payload); |
| 929 _impl.update(params.notificationData); | 961 _impl.update(params.notificationData); |
| 930 break; | 962 break; |
| 931 case _notificationMethodCancelName: | 963 case _notificationMethodCancelName: |
| 932 _impl.cancel(); | 964 _impl.cancel(); |
| 933 break; | 965 break; |
| 934 default: | 966 default: |
| 935 throw new bindings.MojoCodecError("Unexpected message name"); | 967 throw new bindings.MojoCodecError("Unexpected message name"); |
| 936 break; | 968 break; |
| 937 } | 969 } |
| 938 return null; | |
| 939 } | 970 } |
| 940 | 971 |
| 941 Notification get impl => _impl; | 972 Notification get impl => _impl; |
| 942 set impl(Notification d) { | 973 set impl(Notification d) { |
| 943 if (d == null) { | 974 if (d == null) { |
| 944 throw new core.MojoApiError("$this: Cannot set a null implementation"); | 975 throw new core.MojoApiError("$this: Cannot set a null implementation"); |
| 945 } | 976 } |
| 946 if (isBound && (_impl == null)) { | 977 if (isBound && (_impl == null)) { |
| 947 beginHandlingEvents(); | 978 beginHandlingEvents(); |
| 948 } | 979 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 993 return impl.update(notificationData); | 1024 return impl.update(notificationData); |
| 994 } | 1025 } |
| 995 void cancel() { | 1026 void cancel() { |
| 996 return impl.cancel(); | 1027 return impl.cancel(); |
| 997 } | 1028 } |
| 998 } | 1029 } |
| 999 | 1030 |
| 1000 const int _notificationServiceMethodPostName = 0; | 1031 const int _notificationServiceMethodPostName = 0; |
| 1001 | 1032 |
| 1002 class _NotificationServiceServiceDescription implements service_describer.Servic
eDescription { | 1033 class _NotificationServiceServiceDescription implements service_describer.Servic
eDescription { |
| 1003 dynamic getTopLevelInterface([Function responseFactory]) => | 1034 void getTopLevelInterface(Function responder) { |
| 1004 responseFactory(null); | 1035 responder(null); |
| 1036 } |
| 1005 | 1037 |
| 1006 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 1038 void getTypeDefinition(String typeKey, Function responder) { |
| 1007 responseFactory(null); | 1039 responder(null); |
| 1040 } |
| 1008 | 1041 |
| 1009 dynamic getAllTypeDefinitions([Function responseFactory]) => | 1042 void getAllTypeDefinitions(Function responder) { |
| 1010 responseFactory(null); | 1043 responder(null); |
| 1044 } |
| 1011 } | 1045 } |
| 1012 | 1046 |
| 1013 abstract class NotificationService { | 1047 abstract class NotificationService { |
| 1014 static const String serviceName = "notifications::NotificationService"; | 1048 static const String serviceName = "notifications::NotificationService"; |
| 1015 | 1049 |
| 1016 static service_describer.ServiceDescription _cachedServiceDescription; | 1050 static service_describer.ServiceDescription _cachedServiceDescription; |
| 1017 static service_describer.ServiceDescription get serviceDescription { | 1051 static service_describer.ServiceDescription get serviceDescription { |
| 1018 if (_cachedServiceDescription == null) { | 1052 if (_cachedServiceDescription == null) { |
| 1019 _cachedServiceDescription = new _NotificationServiceServiceDescription(); | 1053 _cachedServiceDescription = new _NotificationServiceServiceDescription(); |
| 1020 } | 1054 } |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1152 : super.fromHandle(handle, autoBegin: impl != null) { | 1186 : super.fromHandle(handle, autoBegin: impl != null) { |
| 1153 _impl = impl; | 1187 _impl = impl; |
| 1154 } | 1188 } |
| 1155 | 1189 |
| 1156 _NotificationServiceStubControl.unbound([this._impl]) : super.unbound(); | 1190 _NotificationServiceStubControl.unbound([this._impl]) : super.unbound(); |
| 1157 | 1191 |
| 1158 String get serviceName => NotificationService.serviceName; | 1192 String get serviceName => NotificationService.serviceName; |
| 1159 | 1193 |
| 1160 | 1194 |
| 1161 | 1195 |
| 1162 dynamic handleMessage(bindings.ServiceMessage message) { | 1196 void handleMessage(bindings.ServiceMessage message) { |
| 1163 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 1197 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
| 1164 return bindings.ControlMessageHandler.handleMessage(this, | 1198 bindings.ControlMessageHandler.handleMessage( |
| 1165 0, | 1199 this, 0, message); |
| 1166 message); | 1200 return; |
| 1167 } | 1201 } |
| 1168 if (_impl == null) { | 1202 if (_impl == null) { |
| 1169 throw new core.MojoApiError("$this has no implementation set"); | 1203 throw new core.MojoApiError("$this has no implementation set"); |
| 1170 } | 1204 } |
| 1171 switch (message.header.type) { | 1205 switch (message.header.type) { |
| 1172 case _notificationServiceMethodPostName: | 1206 case _notificationServiceMethodPostName: |
| 1173 var params = _NotificationServicePostParams.deserialize( | 1207 var params = _NotificationServicePostParams.deserialize( |
| 1174 message.payload); | 1208 message.payload); |
| 1175 _impl.post(params.notificationData, params.client, params.notification); | 1209 _impl.post(params.notificationData, params.client, params.notification); |
| 1176 break; | 1210 break; |
| 1177 default: | 1211 default: |
| 1178 throw new bindings.MojoCodecError("Unexpected message name"); | 1212 throw new bindings.MojoCodecError("Unexpected message name"); |
| 1179 break; | 1213 break; |
| 1180 } | 1214 } |
| 1181 return null; | |
| 1182 } | 1215 } |
| 1183 | 1216 |
| 1184 NotificationService get impl => _impl; | 1217 NotificationService get impl => _impl; |
| 1185 set impl(NotificationService d) { | 1218 set impl(NotificationService d) { |
| 1186 if (d == null) { | 1219 if (d == null) { |
| 1187 throw new core.MojoApiError("$this: Cannot set a null implementation"); | 1220 throw new core.MojoApiError("$this: Cannot set a null implementation"); |
| 1188 } | 1221 } |
| 1189 if (isBound && (_impl == null)) { | 1222 if (isBound && (_impl == null)) { |
| 1190 beginHandlingEvents(); | 1223 beginHandlingEvents(); |
| 1191 } | 1224 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1232 } | 1265 } |
| 1233 | 1266 |
| 1234 | 1267 |
| 1235 void post(NotificationData notificationData, NotificationClientInterface clien
t, NotificationInterfaceRequest notification) { | 1268 void post(NotificationData notificationData, NotificationClientInterface clien
t, NotificationInterfaceRequest notification) { |
| 1236 return impl.post(notificationData, client, notification); | 1269 return impl.post(notificationData, client, notification); |
| 1237 } | 1270 } |
| 1238 } | 1271 } |
| 1239 | 1272 |
| 1240 | 1273 |
| 1241 | 1274 |
| OLD | NEW |