| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 : super.fromHandle(handle, autoBegin: impl != null) { | 662 : super.fromHandle(handle, autoBegin: impl != null) { |
| 633 _impl = impl; | 663 _impl = impl; |
| 634 } | 664 } |
| 635 | 665 |
| 636 _NotificationClientStubControl.unbound([this._impl]) : super.unbound(); | 666 _NotificationClientStubControl.unbound([this._impl]) : super.unbound(); |
| 637 | 667 |
| 638 String get serviceName => NotificationClient.serviceName; | 668 String get serviceName => NotificationClient.serviceName; |
| 639 | 669 |
| 640 | 670 |
| 641 | 671 |
| 642 dynamic handleMessage(bindings.ServiceMessage message) { | 672 void handleMessage(bindings.ServiceMessage message) { |
| 643 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 673 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
| 644 return bindings.ControlMessageHandler.handleMessage(this, | 674 bindings.ControlMessageHandler.handleMessage( |
| 645 0, | 675 this, 0, message); |
| 646 message); | 676 return; |
| 647 } | 677 } |
| 648 if (_impl == null) { | 678 if (_impl == null) { |
| 649 throw new core.MojoApiError("$this has no implementation set"); | 679 throw new core.MojoApiError("$this has no implementation set"); |
| 650 } | 680 } |
| 651 switch (message.header.type) { | 681 switch (message.header.type) { |
| 652 case _notificationClientMethodOnSelectedName: | 682 case _notificationClientMethodOnSelectedName: |
| 653 _impl.onSelected(); | 683 _impl.onSelected(); |
| 654 break; | 684 break; |
| 655 case _notificationClientMethodOnDismissedName: | 685 case _notificationClientMethodOnDismissedName: |
| 656 _impl.onDismissed(); | 686 _impl.onDismissed(); |
| 657 break; | 687 break; |
| 658 default: | 688 default: |
| 659 throw new bindings.MojoCodecError("Unexpected message name"); | 689 throw new bindings.MojoCodecError("Unexpected message name"); |
| 660 break; | 690 break; |
| 661 } | 691 } |
| 662 return null; | |
| 663 } | 692 } |
| 664 | 693 |
| 665 NotificationClient get impl => _impl; | 694 NotificationClient get impl => _impl; |
| 666 set impl(NotificationClient d) { | 695 set impl(NotificationClient d) { |
| 667 if (d == null) { | 696 if (d == null) { |
| 668 throw new core.MojoApiError("$this: Cannot set a null implementation"); | 697 throw new core.MojoApiError("$this: Cannot set a null implementation"); |
| 669 } | 698 } |
| 670 if (isBound && (_impl == null)) { | 699 if (isBound && (_impl == null)) { |
| 671 beginHandlingEvents(); | 700 beginHandlingEvents(); |
| 672 } | 701 } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 } | 747 } |
| 719 void onDismissed() { | 748 void onDismissed() { |
| 720 return impl.onDismissed(); | 749 return impl.onDismissed(); |
| 721 } | 750 } |
| 722 } | 751 } |
| 723 | 752 |
| 724 const int _notificationMethodUpdateName = 0; | 753 const int _notificationMethodUpdateName = 0; |
| 725 const int _notificationMethodCancelName = 1; | 754 const int _notificationMethodCancelName = 1; |
| 726 | 755 |
| 727 class _NotificationServiceDescription implements service_describer.ServiceDescri
ption { | 756 class _NotificationServiceDescription implements service_describer.ServiceDescri
ption { |
| 728 dynamic getTopLevelInterface([Function responseFactory]) => | 757 void getTopLevelInterface(Function responder) { |
| 729 responseFactory(null); | 758 responder(null); |
| 759 } |
| 730 | 760 |
| 731 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 761 void getTypeDefinition(String typeKey, Function responder) { |
| 732 responseFactory(null); | 762 responder(null); |
| 763 } |
| 733 | 764 |
| 734 dynamic getAllTypeDefinitions([Function responseFactory]) => | 765 void getAllTypeDefinitions(Function responder) { |
| 735 responseFactory(null); | 766 responder(null); |
| 767 } |
| 736 } | 768 } |
| 737 | 769 |
| 738 abstract class Notification { | 770 abstract class Notification { |
| 739 static const String serviceName = null; | 771 static const String serviceName = null; |
| 740 | 772 |
| 741 static service_describer.ServiceDescription _cachedServiceDescription; | 773 static service_describer.ServiceDescription _cachedServiceDescription; |
| 742 static service_describer.ServiceDescription get serviceDescription { | 774 static service_describer.ServiceDescription get serviceDescription { |
| 743 if (_cachedServiceDescription == null) { | 775 if (_cachedServiceDescription == null) { |
| 744 _cachedServiceDescription = new _NotificationServiceDescription(); | 776 _cachedServiceDescription = new _NotificationServiceDescription(); |
| 745 } | 777 } |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 : super.fromHandle(handle, autoBegin: impl != null) { | 904 : super.fromHandle(handle, autoBegin: impl != null) { |
| 873 _impl = impl; | 905 _impl = impl; |
| 874 } | 906 } |
| 875 | 907 |
| 876 _NotificationStubControl.unbound([this._impl]) : super.unbound(); | 908 _NotificationStubControl.unbound([this._impl]) : super.unbound(); |
| 877 | 909 |
| 878 String get serviceName => Notification.serviceName; | 910 String get serviceName => Notification.serviceName; |
| 879 | 911 |
| 880 | 912 |
| 881 | 913 |
| 882 dynamic handleMessage(bindings.ServiceMessage message) { | 914 void handleMessage(bindings.ServiceMessage message) { |
| 883 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 915 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
| 884 return bindings.ControlMessageHandler.handleMessage(this, | 916 bindings.ControlMessageHandler.handleMessage( |
| 885 0, | 917 this, 0, message); |
| 886 message); | 918 return; |
| 887 } | 919 } |
| 888 if (_impl == null) { | 920 if (_impl == null) { |
| 889 throw new core.MojoApiError("$this has no implementation set"); | 921 throw new core.MojoApiError("$this has no implementation set"); |
| 890 } | 922 } |
| 891 switch (message.header.type) { | 923 switch (message.header.type) { |
| 892 case _notificationMethodUpdateName: | 924 case _notificationMethodUpdateName: |
| 893 var params = _NotificationUpdateParams.deserialize( | 925 var params = _NotificationUpdateParams.deserialize( |
| 894 message.payload); | 926 message.payload); |
| 895 _impl.update(params.notificationData); | 927 _impl.update(params.notificationData); |
| 896 break; | 928 break; |
| 897 case _notificationMethodCancelName: | 929 case _notificationMethodCancelName: |
| 898 _impl.cancel(); | 930 _impl.cancel(); |
| 899 break; | 931 break; |
| 900 default: | 932 default: |
| 901 throw new bindings.MojoCodecError("Unexpected message name"); | 933 throw new bindings.MojoCodecError("Unexpected message name"); |
| 902 break; | 934 break; |
| 903 } | 935 } |
| 904 return null; | |
| 905 } | 936 } |
| 906 | 937 |
| 907 Notification get impl => _impl; | 938 Notification get impl => _impl; |
| 908 set impl(Notification d) { | 939 set impl(Notification d) { |
| 909 if (d == null) { | 940 if (d == null) { |
| 910 throw new core.MojoApiError("$this: Cannot set a null implementation"); | 941 throw new core.MojoApiError("$this: Cannot set a null implementation"); |
| 911 } | 942 } |
| 912 if (isBound && (_impl == null)) { | 943 if (isBound && (_impl == null)) { |
| 913 beginHandlingEvents(); | 944 beginHandlingEvents(); |
| 914 } | 945 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 return impl.update(notificationData); | 990 return impl.update(notificationData); |
| 960 } | 991 } |
| 961 void cancel() { | 992 void cancel() { |
| 962 return impl.cancel(); | 993 return impl.cancel(); |
| 963 } | 994 } |
| 964 } | 995 } |
| 965 | 996 |
| 966 const int _notificationServiceMethodPostName = 0; | 997 const int _notificationServiceMethodPostName = 0; |
| 967 | 998 |
| 968 class _NotificationServiceServiceDescription implements service_describer.Servic
eDescription { | 999 class _NotificationServiceServiceDescription implements service_describer.Servic
eDescription { |
| 969 dynamic getTopLevelInterface([Function responseFactory]) => | 1000 void getTopLevelInterface(Function responder) { |
| 970 responseFactory(null); | 1001 responder(null); |
| 1002 } |
| 971 | 1003 |
| 972 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 1004 void getTypeDefinition(String typeKey, Function responder) { |
| 973 responseFactory(null); | 1005 responder(null); |
| 1006 } |
| 974 | 1007 |
| 975 dynamic getAllTypeDefinitions([Function responseFactory]) => | 1008 void getAllTypeDefinitions(Function responder) { |
| 976 responseFactory(null); | 1009 responder(null); |
| 1010 } |
| 977 } | 1011 } |
| 978 | 1012 |
| 979 abstract class NotificationService { | 1013 abstract class NotificationService { |
| 980 static const String serviceName = "notifications::NotificationService"; | 1014 static const String serviceName = "notifications::NotificationService"; |
| 981 | 1015 |
| 982 static service_describer.ServiceDescription _cachedServiceDescription; | 1016 static service_describer.ServiceDescription _cachedServiceDescription; |
| 983 static service_describer.ServiceDescription get serviceDescription { | 1017 static service_describer.ServiceDescription get serviceDescription { |
| 984 if (_cachedServiceDescription == null) { | 1018 if (_cachedServiceDescription == null) { |
| 985 _cachedServiceDescription = new _NotificationServiceServiceDescription(); | 1019 _cachedServiceDescription = new _NotificationServiceServiceDescription(); |
| 986 } | 1020 } |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1105 : super.fromHandle(handle, autoBegin: impl != null) { | 1139 : super.fromHandle(handle, autoBegin: impl != null) { |
| 1106 _impl = impl; | 1140 _impl = impl; |
| 1107 } | 1141 } |
| 1108 | 1142 |
| 1109 _NotificationServiceStubControl.unbound([this._impl]) : super.unbound(); | 1143 _NotificationServiceStubControl.unbound([this._impl]) : super.unbound(); |
| 1110 | 1144 |
| 1111 String get serviceName => NotificationService.serviceName; | 1145 String get serviceName => NotificationService.serviceName; |
| 1112 | 1146 |
| 1113 | 1147 |
| 1114 | 1148 |
| 1115 dynamic handleMessage(bindings.ServiceMessage message) { | 1149 void handleMessage(bindings.ServiceMessage message) { |
| 1116 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 1150 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
| 1117 return bindings.ControlMessageHandler.handleMessage(this, | 1151 bindings.ControlMessageHandler.handleMessage( |
| 1118 0, | 1152 this, 0, message); |
| 1119 message); | 1153 return; |
| 1120 } | 1154 } |
| 1121 if (_impl == null) { | 1155 if (_impl == null) { |
| 1122 throw new core.MojoApiError("$this has no implementation set"); | 1156 throw new core.MojoApiError("$this has no implementation set"); |
| 1123 } | 1157 } |
| 1124 switch (message.header.type) { | 1158 switch (message.header.type) { |
| 1125 case _notificationServiceMethodPostName: | 1159 case _notificationServiceMethodPostName: |
| 1126 var params = _NotificationServicePostParams.deserialize( | 1160 var params = _NotificationServicePostParams.deserialize( |
| 1127 message.payload); | 1161 message.payload); |
| 1128 _impl.post(params.notificationData, params.client, params.notification); | 1162 _impl.post(params.notificationData, params.client, params.notification); |
| 1129 break; | 1163 break; |
| 1130 default: | 1164 default: |
| 1131 throw new bindings.MojoCodecError("Unexpected message name"); | 1165 throw new bindings.MojoCodecError("Unexpected message name"); |
| 1132 break; | 1166 break; |
| 1133 } | 1167 } |
| 1134 return null; | |
| 1135 } | 1168 } |
| 1136 | 1169 |
| 1137 NotificationService get impl => _impl; | 1170 NotificationService get impl => _impl; |
| 1138 set impl(NotificationService d) { | 1171 set impl(NotificationService d) { |
| 1139 if (d == null) { | 1172 if (d == null) { |
| 1140 throw new core.MojoApiError("$this: Cannot set a null implementation"); | 1173 throw new core.MojoApiError("$this: Cannot set a null implementation"); |
| 1141 } | 1174 } |
| 1142 if (isBound && (_impl == null)) { | 1175 if (isBound && (_impl == null)) { |
| 1143 beginHandlingEvents(); | 1176 beginHandlingEvents(); |
| 1144 } | 1177 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1185 } | 1218 } |
| 1186 | 1219 |
| 1187 | 1220 |
| 1188 void post(NotificationData notificationData, NotificationClientInterface clien
t, NotificationInterfaceRequest notification) { | 1221 void post(NotificationData notificationData, NotificationClientInterface clien
t, NotificationInterfaceRequest notification) { |
| 1189 return impl.post(notificationData, client, notification); | 1222 return impl.post(notificationData, client, notification); |
| 1190 } | 1223 } |
| 1191 } | 1224 } |
| 1192 | 1225 |
| 1193 | 1226 |
| 1194 | 1227 |
| OLD | NEW |