Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Side by Side Diff: mojo/dart/packages/mojo_services/lib/mojo/web_socket.mojom.dart

Issue 2006093002: Dart: Futures -> Callbacks. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Merge Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // WARNING: DO NOT EDIT. This file was generated by a program. 1 // WARNING: DO NOT EDIT. This file was generated by a program.
2 // See $MOJO_SDK/tools/bindings/mojom_bindings_generator.py. 2 // See $MOJO_SDK/tools/bindings/mojom_bindings_generator.py.
3 3
4 library web_socket_mojom; 4 library web_socket_mojom;
5 import 'dart:async'; 5 import 'dart:async';
6 import 'package:mojo/bindings.dart' as bindings; 6 import 'package:mojo/bindings.dart' as bindings;
7 import 'package:mojo/core.dart' as core; 7 import 'package:mojo/core.dart' as core;
8 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic e_describer; 8 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic e_describer;
9 9
10 10
11 11
12 class _WebSocketConnectParams extends bindings.Struct { 12 class _WebSocketConnectParams extends bindings.Struct {
13 static const List<bindings.StructDataHeader> kVersions = const [ 13 static const List<bindings.StructDataHeader> kVersions = const [
14 const bindings.StructDataHeader(48, 0) 14 const bindings.StructDataHeader(48, 0)
15 ]; 15 ];
16 String url = null; 16 String url = null;
17 List<String> protocols = null; 17 List<String> protocols = null;
18 String origin = null; 18 String origin = null;
19 core.MojoDataPipeConsumer sendStream = null; 19 core.MojoDataPipeConsumer sendStream = null;
20 WebSocketClientInterface client = null; 20 WebSocketClientInterface client = null;
21 21
22 _WebSocketConnectParams() : super(kVersions.last.size); 22 _WebSocketConnectParams() : super(kVersions.last.size);
23 23
24 _WebSocketConnectParams.init(
25 String this.url,
26 List<String> this.protocols,
27 String this.origin,
28 core.MojoDataPipeConsumer this.sendStream,
29 WebSocketClientInterface this.client
30 ) : super(kVersions.last.size);
31
24 static _WebSocketConnectParams deserialize(bindings.Message message) { 32 static _WebSocketConnectParams deserialize(bindings.Message message) {
25 var decoder = new bindings.Decoder(message); 33 var decoder = new bindings.Decoder(message);
26 var result = decode(decoder); 34 var result = decode(decoder);
27 if (decoder.excessHandles != null) { 35 if (decoder.excessHandles != null) {
28 decoder.excessHandles.forEach((h) => h.close()); 36 decoder.excessHandles.forEach((h) => h.close());
29 } 37 }
30 return result; 38 return result;
31 } 39 }
32 40
33 static _WebSocketConnectParams decode(bindings.Decoder decoder0) { 41 static _WebSocketConnectParams decode(bindings.Decoder decoder0) {
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 class _WebSocketSendParams extends bindings.Struct { 158 class _WebSocketSendParams extends bindings.Struct {
151 static const List<bindings.StructDataHeader> kVersions = const [ 159 static const List<bindings.StructDataHeader> kVersions = const [
152 const bindings.StructDataHeader(24, 0) 160 const bindings.StructDataHeader(24, 0)
153 ]; 161 ];
154 bool fin = false; 162 bool fin = false;
155 WebSocketMessageType type = null; 163 WebSocketMessageType type = null;
156 int numBytes = 0; 164 int numBytes = 0;
157 165
158 _WebSocketSendParams() : super(kVersions.last.size); 166 _WebSocketSendParams() : super(kVersions.last.size);
159 167
168 _WebSocketSendParams.init(
169 bool this.fin,
170 WebSocketMessageType this.type,
171 int this.numBytes
172 ) : super(kVersions.last.size);
173
160 static _WebSocketSendParams deserialize(bindings.Message message) { 174 static _WebSocketSendParams deserialize(bindings.Message message) {
161 var decoder = new bindings.Decoder(message); 175 var decoder = new bindings.Decoder(message);
162 var result = decode(decoder); 176 var result = decode(decoder);
163 if (decoder.excessHandles != null) { 177 if (decoder.excessHandles != null) {
164 decoder.excessHandles.forEach((h) => h.close()); 178 decoder.excessHandles.forEach((h) => h.close());
165 } 179 }
166 return result; 180 return result;
167 } 181 }
168 182
169 static _WebSocketSendParams decode(bindings.Decoder decoder0) { 183 static _WebSocketSendParams decode(bindings.Decoder decoder0) {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 266
253 267
254 class _WebSocketFlowControlParams extends bindings.Struct { 268 class _WebSocketFlowControlParams extends bindings.Struct {
255 static const List<bindings.StructDataHeader> kVersions = const [ 269 static const List<bindings.StructDataHeader> kVersions = const [
256 const bindings.StructDataHeader(16, 0) 270 const bindings.StructDataHeader(16, 0)
257 ]; 271 ];
258 int quota = 0; 272 int quota = 0;
259 273
260 _WebSocketFlowControlParams() : super(kVersions.last.size); 274 _WebSocketFlowControlParams() : super(kVersions.last.size);
261 275
276 _WebSocketFlowControlParams.init(
277 int this.quota
278 ) : super(kVersions.last.size);
279
262 static _WebSocketFlowControlParams deserialize(bindings.Message message) { 280 static _WebSocketFlowControlParams deserialize(bindings.Message message) {
263 var decoder = new bindings.Decoder(message); 281 var decoder = new bindings.Decoder(message);
264 var result = decode(decoder); 282 var result = decode(decoder);
265 if (decoder.excessHandles != null) { 283 if (decoder.excessHandles != null) {
266 decoder.excessHandles.forEach((h) => h.close()); 284 decoder.excessHandles.forEach((h) => h.close());
267 } 285 }
268 return result; 286 return result;
269 } 287 }
270 288
271 static _WebSocketFlowControlParams decode(bindings.Decoder decoder0) { 289 static _WebSocketFlowControlParams decode(bindings.Decoder decoder0) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 343
326 class _WebSocketCloseParams extends bindings.Struct { 344 class _WebSocketCloseParams extends bindings.Struct {
327 static const List<bindings.StructDataHeader> kVersions = const [ 345 static const List<bindings.StructDataHeader> kVersions = const [
328 const bindings.StructDataHeader(24, 0) 346 const bindings.StructDataHeader(24, 0)
329 ]; 347 ];
330 int code = 0; 348 int code = 0;
331 String reason = null; 349 String reason = null;
332 350
333 _WebSocketCloseParams() : super(kVersions.last.size); 351 _WebSocketCloseParams() : super(kVersions.last.size);
334 352
353 _WebSocketCloseParams.init(
354 int this.code,
355 String this.reason
356 ) : super(kVersions.last.size);
357
335 static _WebSocketCloseParams deserialize(bindings.Message message) { 358 static _WebSocketCloseParams deserialize(bindings.Message message) {
336 var decoder = new bindings.Decoder(message); 359 var decoder = new bindings.Decoder(message);
337 var result = decode(decoder); 360 var result = decode(decoder);
338 if (decoder.excessHandles != null) { 361 if (decoder.excessHandles != null) {
339 decoder.excessHandles.forEach((h) => h.close()); 362 decoder.excessHandles.forEach((h) => h.close());
340 } 363 }
341 return result; 364 return result;
342 } 365 }
343 366
344 static _WebSocketCloseParams decode(bindings.Decoder decoder0) { 367 static _WebSocketCloseParams decode(bindings.Decoder decoder0) {
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 class _WebSocketClientDidConnectParams extends bindings.Struct { 435 class _WebSocketClientDidConnectParams extends bindings.Struct {
413 static const List<bindings.StructDataHeader> kVersions = const [ 436 static const List<bindings.StructDataHeader> kVersions = const [
414 const bindings.StructDataHeader(32, 0) 437 const bindings.StructDataHeader(32, 0)
415 ]; 438 ];
416 String selectedSubprotocol = null; 439 String selectedSubprotocol = null;
417 String extensions = null; 440 String extensions = null;
418 core.MojoDataPipeConsumer receiveStream = null; 441 core.MojoDataPipeConsumer receiveStream = null;
419 442
420 _WebSocketClientDidConnectParams() : super(kVersions.last.size); 443 _WebSocketClientDidConnectParams() : super(kVersions.last.size);
421 444
445 _WebSocketClientDidConnectParams.init(
446 String this.selectedSubprotocol,
447 String this.extensions,
448 core.MojoDataPipeConsumer this.receiveStream
449 ) : super(kVersions.last.size);
450
422 static _WebSocketClientDidConnectParams deserialize(bindings.Message message) { 451 static _WebSocketClientDidConnectParams deserialize(bindings.Message message) {
423 var decoder = new bindings.Decoder(message); 452 var decoder = new bindings.Decoder(message);
424 var result = decode(decoder); 453 var result = decode(decoder);
425 if (decoder.excessHandles != null) { 454 if (decoder.excessHandles != null) {
426 decoder.excessHandles.forEach((h) => h.close()); 455 decoder.excessHandles.forEach((h) => h.close());
427 } 456 }
428 return result; 457 return result;
429 } 458 }
430 459
431 static _WebSocketClientDidConnectParams decode(bindings.Decoder decoder0) { 460 static _WebSocketClientDidConnectParams decode(bindings.Decoder decoder0) {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 class _WebSocketClientDidReceiveDataParams extends bindings.Struct { 538 class _WebSocketClientDidReceiveDataParams extends bindings.Struct {
510 static const List<bindings.StructDataHeader> kVersions = const [ 539 static const List<bindings.StructDataHeader> kVersions = const [
511 const bindings.StructDataHeader(24, 0) 540 const bindings.StructDataHeader(24, 0)
512 ]; 541 ];
513 bool fin = false; 542 bool fin = false;
514 WebSocketMessageType type = null; 543 WebSocketMessageType type = null;
515 int numBytes = 0; 544 int numBytes = 0;
516 545
517 _WebSocketClientDidReceiveDataParams() : super(kVersions.last.size); 546 _WebSocketClientDidReceiveDataParams() : super(kVersions.last.size);
518 547
548 _WebSocketClientDidReceiveDataParams.init(
549 bool this.fin,
550 WebSocketMessageType this.type,
551 int this.numBytes
552 ) : super(kVersions.last.size);
553
519 static _WebSocketClientDidReceiveDataParams deserialize(bindings.Message messa ge) { 554 static _WebSocketClientDidReceiveDataParams deserialize(bindings.Message messa ge) {
520 var decoder = new bindings.Decoder(message); 555 var decoder = new bindings.Decoder(message);
521 var result = decode(decoder); 556 var result = decode(decoder);
522 if (decoder.excessHandles != null) { 557 if (decoder.excessHandles != null) {
523 decoder.excessHandles.forEach((h) => h.close()); 558 decoder.excessHandles.forEach((h) => h.close());
524 } 559 }
525 return result; 560 return result;
526 } 561 }
527 562
528 static _WebSocketClientDidReceiveDataParams decode(bindings.Decoder decoder0) { 563 static _WebSocketClientDidReceiveDataParams decode(bindings.Decoder decoder0) {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 646
612 647
613 class _WebSocketClientDidReceiveFlowControlParams extends bindings.Struct { 648 class _WebSocketClientDidReceiveFlowControlParams extends bindings.Struct {
614 static const List<bindings.StructDataHeader> kVersions = const [ 649 static const List<bindings.StructDataHeader> kVersions = const [
615 const bindings.StructDataHeader(16, 0) 650 const bindings.StructDataHeader(16, 0)
616 ]; 651 ];
617 int quota = 0; 652 int quota = 0;
618 653
619 _WebSocketClientDidReceiveFlowControlParams() : super(kVersions.last.size); 654 _WebSocketClientDidReceiveFlowControlParams() : super(kVersions.last.size);
620 655
656 _WebSocketClientDidReceiveFlowControlParams.init(
657 int this.quota
658 ) : super(kVersions.last.size);
659
621 static _WebSocketClientDidReceiveFlowControlParams deserialize(bindings.Messag e message) { 660 static _WebSocketClientDidReceiveFlowControlParams deserialize(bindings.Messag e message) {
622 var decoder = new bindings.Decoder(message); 661 var decoder = new bindings.Decoder(message);
623 var result = decode(decoder); 662 var result = decode(decoder);
624 if (decoder.excessHandles != null) { 663 if (decoder.excessHandles != null) {
625 decoder.excessHandles.forEach((h) => h.close()); 664 decoder.excessHandles.forEach((h) => h.close());
626 } 665 }
627 return result; 666 return result;
628 } 667 }
629 668
630 static _WebSocketClientDidReceiveFlowControlParams decode(bindings.Decoder dec oder0) { 669 static _WebSocketClientDidReceiveFlowControlParams decode(bindings.Decoder dec oder0) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 722
684 723
685 class _WebSocketClientDidFailParams extends bindings.Struct { 724 class _WebSocketClientDidFailParams extends bindings.Struct {
686 static const List<bindings.StructDataHeader> kVersions = const [ 725 static const List<bindings.StructDataHeader> kVersions = const [
687 const bindings.StructDataHeader(16, 0) 726 const bindings.StructDataHeader(16, 0)
688 ]; 727 ];
689 String message = null; 728 String message = null;
690 729
691 _WebSocketClientDidFailParams() : super(kVersions.last.size); 730 _WebSocketClientDidFailParams() : super(kVersions.last.size);
692 731
732 _WebSocketClientDidFailParams.init(
733 String this.message
734 ) : super(kVersions.last.size);
735
693 static _WebSocketClientDidFailParams deserialize(bindings.Message message) { 736 static _WebSocketClientDidFailParams deserialize(bindings.Message message) {
694 var decoder = new bindings.Decoder(message); 737 var decoder = new bindings.Decoder(message);
695 var result = decode(decoder); 738 var result = decode(decoder);
696 if (decoder.excessHandles != null) { 739 if (decoder.excessHandles != null) {
697 decoder.excessHandles.forEach((h) => h.close()); 740 decoder.excessHandles.forEach((h) => h.close());
698 } 741 }
699 return result; 742 return result;
700 } 743 }
701 744
702 static _WebSocketClientDidFailParams decode(bindings.Decoder decoder0) { 745 static _WebSocketClientDidFailParams decode(bindings.Decoder decoder0) {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 class _WebSocketClientDidCloseParams extends bindings.Struct { 800 class _WebSocketClientDidCloseParams extends bindings.Struct {
758 static const List<bindings.StructDataHeader> kVersions = const [ 801 static const List<bindings.StructDataHeader> kVersions = const [
759 const bindings.StructDataHeader(24, 0) 802 const bindings.StructDataHeader(24, 0)
760 ]; 803 ];
761 bool wasClean = false; 804 bool wasClean = false;
762 int code = 0; 805 int code = 0;
763 String reason = null; 806 String reason = null;
764 807
765 _WebSocketClientDidCloseParams() : super(kVersions.last.size); 808 _WebSocketClientDidCloseParams() : super(kVersions.last.size);
766 809
810 _WebSocketClientDidCloseParams.init(
811 bool this.wasClean,
812 int this.code,
813 String this.reason
814 ) : super(kVersions.last.size);
815
767 static _WebSocketClientDidCloseParams deserialize(bindings.Message message) { 816 static _WebSocketClientDidCloseParams deserialize(bindings.Message message) {
768 var decoder = new bindings.Decoder(message); 817 var decoder = new bindings.Decoder(message);
769 var result = decode(decoder); 818 var result = decode(decoder);
770 if (decoder.excessHandles != null) { 819 if (decoder.excessHandles != null) {
771 decoder.excessHandles.forEach((h) => h.close()); 820 decoder.excessHandles.forEach((h) => h.close());
772 } 821 }
773 return result; 822 return result;
774 } 823 }
775 824
776 static _WebSocketClientDidCloseParams decode(bindings.Decoder decoder0) { 825 static _WebSocketClientDidCloseParams decode(bindings.Decoder decoder0) {
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 return 'WebSocketMessageType.binary'; 960 return 'WebSocketMessageType.binary';
912 default: 961 default:
913 return null; 962 return null;
914 } 963 }
915 } 964 }
916 965
917 int toJson() => mojoEnumValue; 966 int toJson() => mojoEnumValue;
918 } 967 }
919 968
920 class _WebSocketServiceDescription implements service_describer.ServiceDescripti on { 969 class _WebSocketServiceDescription implements service_describer.ServiceDescripti on {
921 dynamic getTopLevelInterface([Function responseFactory]) => 970 void getTopLevelInterface(Function responder) {
922 responseFactory(null); 971 responder(null);
972 }
923 973
924 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => 974 void getTypeDefinition(String typeKey, Function responder) {
925 responseFactory(null); 975 responder(null);
976 }
926 977
927 dynamic getAllTypeDefinitions([Function responseFactory]) => 978 void getAllTypeDefinitions(Function responder) {
928 responseFactory(null); 979 responder(null);
980 }
929 } 981 }
930 982
931 abstract class WebSocket { 983 abstract class WebSocket {
932 static const String serviceName = null; 984 static const String serviceName = null;
933 985
934 static service_describer.ServiceDescription _cachedServiceDescription; 986 static service_describer.ServiceDescription _cachedServiceDescription;
935 static service_describer.ServiceDescription get serviceDescription { 987 static service_describer.ServiceDescription get serviceDescription {
936 if (_cachedServiceDescription == null) { 988 if (_cachedServiceDescription == null) {
937 _cachedServiceDescription = new _WebSocketServiceDescription(); 989 _cachedServiceDescription = new _WebSocketServiceDescription();
938 } 990 }
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 : super.fromHandle(handle, autoBegin: impl != null) { 1173 : super.fromHandle(handle, autoBegin: impl != null) {
1122 _impl = impl; 1174 _impl = impl;
1123 } 1175 }
1124 1176
1125 _WebSocketStubControl.unbound([this._impl]) : super.unbound(); 1177 _WebSocketStubControl.unbound([this._impl]) : super.unbound();
1126 1178
1127 String get serviceName => WebSocket.serviceName; 1179 String get serviceName => WebSocket.serviceName;
1128 1180
1129 1181
1130 1182
1131 dynamic handleMessage(bindings.ServiceMessage message) { 1183 void handleMessage(bindings.ServiceMessage message) {
1132 if (bindings.ControlMessageHandler.isControlMessage(message)) { 1184 if (bindings.ControlMessageHandler.isControlMessage(message)) {
1133 return bindings.ControlMessageHandler.handleMessage(this, 1185 bindings.ControlMessageHandler.handleMessage(
1134 0, 1186 this, 0, message);
1135 message); 1187 return;
1136 } 1188 }
1137 if (_impl == null) { 1189 if (_impl == null) {
1138 throw new core.MojoApiError("$this has no implementation set"); 1190 throw new core.MojoApiError("$this has no implementation set");
1139 } 1191 }
1140 switch (message.header.type) { 1192 switch (message.header.type) {
1141 case _webSocketMethodConnectName: 1193 case _webSocketMethodConnectName:
1142 var params = _WebSocketConnectParams.deserialize( 1194 var params = _WebSocketConnectParams.deserialize(
1143 message.payload); 1195 message.payload);
1144 _impl.connect(params.url, params.protocols, params.origin, params.sendSt ream, params.client); 1196 _impl.connect(params.url, params.protocols, params.origin, params.sendSt ream, params.client);
1145 break; 1197 break;
1146 case _webSocketMethodSendName: 1198 case _webSocketMethodSendName:
1147 var params = _WebSocketSendParams.deserialize( 1199 var params = _WebSocketSendParams.deserialize(
1148 message.payload); 1200 message.payload);
1149 _impl.send(params.fin, params.type, params.numBytes); 1201 _impl.send(params.fin, params.type, params.numBytes);
1150 break; 1202 break;
1151 case _webSocketMethodFlowControlName: 1203 case _webSocketMethodFlowControlName:
1152 var params = _WebSocketFlowControlParams.deserialize( 1204 var params = _WebSocketFlowControlParams.deserialize(
1153 message.payload); 1205 message.payload);
1154 _impl.flowControl(params.quota); 1206 _impl.flowControl(params.quota);
1155 break; 1207 break;
1156 case _webSocketMethodCloseName: 1208 case _webSocketMethodCloseName:
1157 var params = _WebSocketCloseParams.deserialize( 1209 var params = _WebSocketCloseParams.deserialize(
1158 message.payload); 1210 message.payload);
1159 _impl.close_(params.code, params.reason); 1211 _impl.close_(params.code, params.reason);
1160 break; 1212 break;
1161 default: 1213 default:
1162 throw new bindings.MojoCodecError("Unexpected message name"); 1214 throw new bindings.MojoCodecError("Unexpected message name");
1163 break; 1215 break;
1164 } 1216 }
1165 return null;
1166 } 1217 }
1167 1218
1168 WebSocket get impl => _impl; 1219 WebSocket get impl => _impl;
1169 set impl(WebSocket d) { 1220 set impl(WebSocket d) {
1170 if (d == null) { 1221 if (d == null) {
1171 throw new core.MojoApiError("$this: Cannot set a null implementation"); 1222 throw new core.MojoApiError("$this: Cannot set a null implementation");
1172 } 1223 }
1173 if (isBound && (_impl == null)) { 1224 if (isBound && (_impl == null)) {
1174 beginHandlingEvents(); 1225 beginHandlingEvents();
1175 } 1226 }
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 } 1281 }
1231 } 1282 }
1232 1283
1233 const int _webSocketClientMethodDidConnectName = 0; 1284 const int _webSocketClientMethodDidConnectName = 0;
1234 const int _webSocketClientMethodDidReceiveDataName = 1; 1285 const int _webSocketClientMethodDidReceiveDataName = 1;
1235 const int _webSocketClientMethodDidReceiveFlowControlName = 2; 1286 const int _webSocketClientMethodDidReceiveFlowControlName = 2;
1236 const int _webSocketClientMethodDidFailName = 3; 1287 const int _webSocketClientMethodDidFailName = 3;
1237 const int _webSocketClientMethodDidCloseName = 4; 1288 const int _webSocketClientMethodDidCloseName = 4;
1238 1289
1239 class _WebSocketClientServiceDescription implements service_describer.ServiceDes cription { 1290 class _WebSocketClientServiceDescription implements service_describer.ServiceDes cription {
1240 dynamic getTopLevelInterface([Function responseFactory]) => 1291 void getTopLevelInterface(Function responder) {
1241 responseFactory(null); 1292 responder(null);
1293 }
1242 1294
1243 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => 1295 void getTypeDefinition(String typeKey, Function responder) {
1244 responseFactory(null); 1296 responder(null);
1297 }
1245 1298
1246 dynamic getAllTypeDefinitions([Function responseFactory]) => 1299 void getAllTypeDefinitions(Function responder) {
1247 responseFactory(null); 1300 responder(null);
1301 }
1248 } 1302 }
1249 1303
1250 abstract class WebSocketClient { 1304 abstract class WebSocketClient {
1251 static const String serviceName = null; 1305 static const String serviceName = null;
1252 1306
1253 static service_describer.ServiceDescription _cachedServiceDescription; 1307 static service_describer.ServiceDescription _cachedServiceDescription;
1254 static service_describer.ServiceDescription get serviceDescription { 1308 static service_describer.ServiceDescription get serviceDescription {
1255 if (_cachedServiceDescription == null) { 1309 if (_cachedServiceDescription == null) {
1256 _cachedServiceDescription = new _WebSocketClientServiceDescription(); 1310 _cachedServiceDescription = new _WebSocketClientServiceDescription();
1257 } 1311 }
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
1453 : super.fromHandle(handle, autoBegin: impl != null) { 1507 : super.fromHandle(handle, autoBegin: impl != null) {
1454 _impl = impl; 1508 _impl = impl;
1455 } 1509 }
1456 1510
1457 _WebSocketClientStubControl.unbound([this._impl]) : super.unbound(); 1511 _WebSocketClientStubControl.unbound([this._impl]) : super.unbound();
1458 1512
1459 String get serviceName => WebSocketClient.serviceName; 1513 String get serviceName => WebSocketClient.serviceName;
1460 1514
1461 1515
1462 1516
1463 dynamic handleMessage(bindings.ServiceMessage message) { 1517 void handleMessage(bindings.ServiceMessage message) {
1464 if (bindings.ControlMessageHandler.isControlMessage(message)) { 1518 if (bindings.ControlMessageHandler.isControlMessage(message)) {
1465 return bindings.ControlMessageHandler.handleMessage(this, 1519 bindings.ControlMessageHandler.handleMessage(
1466 0, 1520 this, 0, message);
1467 message); 1521 return;
1468 } 1522 }
1469 if (_impl == null) { 1523 if (_impl == null) {
1470 throw new core.MojoApiError("$this has no implementation set"); 1524 throw new core.MojoApiError("$this has no implementation set");
1471 } 1525 }
1472 switch (message.header.type) { 1526 switch (message.header.type) {
1473 case _webSocketClientMethodDidConnectName: 1527 case _webSocketClientMethodDidConnectName:
1474 var params = _WebSocketClientDidConnectParams.deserialize( 1528 var params = _WebSocketClientDidConnectParams.deserialize(
1475 message.payload); 1529 message.payload);
1476 _impl.didConnect(params.selectedSubprotocol, params.extensions, params.r eceiveStream); 1530 _impl.didConnect(params.selectedSubprotocol, params.extensions, params.r eceiveStream);
1477 break; 1531 break;
(...skipping 14 matching lines...) Expand all
1492 break; 1546 break;
1493 case _webSocketClientMethodDidCloseName: 1547 case _webSocketClientMethodDidCloseName:
1494 var params = _WebSocketClientDidCloseParams.deserialize( 1548 var params = _WebSocketClientDidCloseParams.deserialize(
1495 message.payload); 1549 message.payload);
1496 _impl.didClose(params.wasClean, params.code, params.reason); 1550 _impl.didClose(params.wasClean, params.code, params.reason);
1497 break; 1551 break;
1498 default: 1552 default:
1499 throw new bindings.MojoCodecError("Unexpected message name"); 1553 throw new bindings.MojoCodecError("Unexpected message name");
1500 break; 1554 break;
1501 } 1555 }
1502 return null;
1503 } 1556 }
1504 1557
1505 WebSocketClient get impl => _impl; 1558 WebSocketClient get impl => _impl;
1506 set impl(WebSocketClient d) { 1559 set impl(WebSocketClient d) {
1507 if (d == null) { 1560 if (d == null) {
1508 throw new core.MojoApiError("$this: Cannot set a null implementation"); 1561 throw new core.MojoApiError("$this: Cannot set a null implementation");
1509 } 1562 }
1510 if (isBound && (_impl == null)) { 1563 if (isBound && (_impl == null)) {
1511 beginHandlingEvents(); 1564 beginHandlingEvents();
1512 } 1565 }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
1565 void didFail(String message) { 1618 void didFail(String message) {
1566 return impl.didFail(message); 1619 return impl.didFail(message);
1567 } 1620 }
1568 void didClose(bool wasClean, int code, String reason) { 1621 void didClose(bool wasClean, int code, String reason) {
1569 return impl.didClose(wasClean, code, reason); 1622 return impl.didClose(wasClean, code, reason);
1570 } 1623 }
1571 } 1624 }
1572 1625
1573 1626
1574 1627
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698