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

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

Issue 1753013002: Mojom runtime type info: New implementation for Dart. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: No changes to sha1s Created 4 years, 9 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 // 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 web_socket_mojom; 5 library web_socket_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/mojo/network_error.mojom.dart' as network_error_mojom; 10 import 'package:mojo/mojo/network_error.mojom.dart' as network_error_mojom;
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 "client: $client" ")"; 142 "client: $client" ")";
143 } 143 }
144 144
145 Map toJson() { 145 Map toJson() {
146 throw new bindings.MojoCodecError( 146 throw new bindings.MojoCodecError(
147 'Object containing handles cannot be encoded to JSON.'); 147 'Object containing handles cannot be encoded to JSON.');
148 } 148 }
149 } 149 }
150 150
151 151
152
153
154 class _WebSocketSendParams extends bindings.Struct { 152 class _WebSocketSendParams extends bindings.Struct {
155 static const List<bindings.StructDataHeader> kVersions = const [ 153 static const List<bindings.StructDataHeader> kVersions = const [
156 const bindings.StructDataHeader(24, 0) 154 const bindings.StructDataHeader(24, 0)
157 ]; 155 ];
158 bool fin = false; 156 bool fin = false;
159 WebSocketMessageType type = null; 157 WebSocketMessageType type = null;
160 int numBytes = 0; 158 int numBytes = 0;
161 159
162 _WebSocketSendParams() : super(kVersions.last.size); 160 _WebSocketSendParams() : super(kVersions.last.size);
163 161
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 Map toJson() { 246 Map toJson() {
249 Map map = new Map(); 247 Map map = new Map();
250 map["fin"] = fin; 248 map["fin"] = fin;
251 map["type"] = type; 249 map["type"] = type;
252 map["numBytes"] = numBytes; 250 map["numBytes"] = numBytes;
253 return map; 251 return map;
254 } 252 }
255 } 253 }
256 254
257 255
258
259
260 class _WebSocketFlowControlParams extends bindings.Struct { 256 class _WebSocketFlowControlParams extends bindings.Struct {
261 static const List<bindings.StructDataHeader> kVersions = const [ 257 static const List<bindings.StructDataHeader> kVersions = const [
262 const bindings.StructDataHeader(16, 0) 258 const bindings.StructDataHeader(16, 0)
263 ]; 259 ];
264 int quota = 0; 260 int quota = 0;
265 261
266 _WebSocketFlowControlParams() : super(kVersions.last.size); 262 _WebSocketFlowControlParams() : super(kVersions.last.size);
267 263
268 static _WebSocketFlowControlParams deserialize(bindings.Message message) { 264 static _WebSocketFlowControlParams deserialize(bindings.Message message) {
269 var decoder = new bindings.Decoder(message); 265 var decoder = new bindings.Decoder(message);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 } 318 }
323 319
324 Map toJson() { 320 Map toJson() {
325 Map map = new Map(); 321 Map map = new Map();
326 map["quota"] = quota; 322 map["quota"] = quota;
327 return map; 323 return map;
328 } 324 }
329 } 325 }
330 326
331 327
332
333
334 class _WebSocketCloseParams extends bindings.Struct { 328 class _WebSocketCloseParams extends bindings.Struct {
335 static const List<bindings.StructDataHeader> kVersions = const [ 329 static const List<bindings.StructDataHeader> kVersions = const [
336 const bindings.StructDataHeader(24, 0) 330 const bindings.StructDataHeader(24, 0)
337 ]; 331 ];
338 int code = 0; 332 int code = 0;
339 String reason = null; 333 String reason = null;
340 334
341 _WebSocketCloseParams() : super(kVersions.last.size); 335 _WebSocketCloseParams() : super(kVersions.last.size);
342 336
343 static _WebSocketCloseParams deserialize(bindings.Message message) { 337 static _WebSocketCloseParams deserialize(bindings.Message message) {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 404
411 Map toJson() { 405 Map toJson() {
412 Map map = new Map(); 406 Map map = new Map();
413 map["code"] = code; 407 map["code"] = code;
414 map["reason"] = reason; 408 map["reason"] = reason;
415 return map; 409 return map;
416 } 410 }
417 } 411 }
418 412
419 413
420
421
422 class _WebSocketClientDidConnectParams extends bindings.Struct { 414 class _WebSocketClientDidConnectParams extends bindings.Struct {
423 static const List<bindings.StructDataHeader> kVersions = const [ 415 static const List<bindings.StructDataHeader> kVersions = const [
424 const bindings.StructDataHeader(32, 0) 416 const bindings.StructDataHeader(32, 0)
425 ]; 417 ];
426 String selectedSubprotocol = null; 418 String selectedSubprotocol = null;
427 String extensions = null; 419 String extensions = null;
428 core.MojoDataPipeConsumer receiveStream = null; 420 core.MojoDataPipeConsumer receiveStream = null;
429 421
430 _WebSocketClientDidConnectParams() : super(kVersions.last.size); 422 _WebSocketClientDidConnectParams() : super(kVersions.last.size);
431 423
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 "receiveStream: $receiveStream" ")"; 501 "receiveStream: $receiveStream" ")";
510 } 502 }
511 503
512 Map toJson() { 504 Map toJson() {
513 throw new bindings.MojoCodecError( 505 throw new bindings.MojoCodecError(
514 'Object containing handles cannot be encoded to JSON.'); 506 'Object containing handles cannot be encoded to JSON.');
515 } 507 }
516 } 508 }
517 509
518 510
519
520
521 class _WebSocketClientDidReceiveDataParams extends bindings.Struct { 511 class _WebSocketClientDidReceiveDataParams extends bindings.Struct {
522 static const List<bindings.StructDataHeader> kVersions = const [ 512 static const List<bindings.StructDataHeader> kVersions = const [
523 const bindings.StructDataHeader(24, 0) 513 const bindings.StructDataHeader(24, 0)
524 ]; 514 ];
525 bool fin = false; 515 bool fin = false;
526 WebSocketMessageType type = null; 516 WebSocketMessageType type = null;
527 int numBytes = 0; 517 int numBytes = 0;
528 518
529 _WebSocketClientDidReceiveDataParams() : super(kVersions.last.size); 519 _WebSocketClientDidReceiveDataParams() : super(kVersions.last.size);
530 520
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 Map toJson() { 605 Map toJson() {
616 Map map = new Map(); 606 Map map = new Map();
617 map["fin"] = fin; 607 map["fin"] = fin;
618 map["type"] = type; 608 map["type"] = type;
619 map["numBytes"] = numBytes; 609 map["numBytes"] = numBytes;
620 return map; 610 return map;
621 } 611 }
622 } 612 }
623 613
624 614
625
626
627 class _WebSocketClientDidReceiveFlowControlParams extends bindings.Struct { 615 class _WebSocketClientDidReceiveFlowControlParams extends bindings.Struct {
628 static const List<bindings.StructDataHeader> kVersions = const [ 616 static const List<bindings.StructDataHeader> kVersions = const [
629 const bindings.StructDataHeader(16, 0) 617 const bindings.StructDataHeader(16, 0)
630 ]; 618 ];
631 int quota = 0; 619 int quota = 0;
632 620
633 _WebSocketClientDidReceiveFlowControlParams() : super(kVersions.last.size); 621 _WebSocketClientDidReceiveFlowControlParams() : super(kVersions.last.size);
634 622
635 static _WebSocketClientDidReceiveFlowControlParams deserialize(bindings.Messag e message) { 623 static _WebSocketClientDidReceiveFlowControlParams deserialize(bindings.Messag e message) {
636 var decoder = new bindings.Decoder(message); 624 var decoder = new bindings.Decoder(message);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 } 677 }
690 678
691 Map toJson() { 679 Map toJson() {
692 Map map = new Map(); 680 Map map = new Map();
693 map["quota"] = quota; 681 map["quota"] = quota;
694 return map; 682 return map;
695 } 683 }
696 } 684 }
697 685
698 686
699
700
701 class _WebSocketClientDidFailParams extends bindings.Struct { 687 class _WebSocketClientDidFailParams extends bindings.Struct {
702 static const List<bindings.StructDataHeader> kVersions = const [ 688 static const List<bindings.StructDataHeader> kVersions = const [
703 const bindings.StructDataHeader(16, 0) 689 const bindings.StructDataHeader(16, 0)
704 ]; 690 ];
705 String message = null; 691 String message = null;
706 692
707 _WebSocketClientDidFailParams() : super(kVersions.last.size); 693 _WebSocketClientDidFailParams() : super(kVersions.last.size);
708 694
709 static _WebSocketClientDidFailParams deserialize(bindings.Message message) { 695 static _WebSocketClientDidFailParams deserialize(bindings.Message message) {
710 var decoder = new bindings.Decoder(message); 696 var decoder = new bindings.Decoder(message);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 } 749 }
764 750
765 Map toJson() { 751 Map toJson() {
766 Map map = new Map(); 752 Map map = new Map();
767 map["message"] = message; 753 map["message"] = message;
768 return map; 754 return map;
769 } 755 }
770 } 756 }
771 757
772 758
773
774
775 class _WebSocketClientDidCloseParams extends bindings.Struct { 759 class _WebSocketClientDidCloseParams extends bindings.Struct {
776 static const List<bindings.StructDataHeader> kVersions = const [ 760 static const List<bindings.StructDataHeader> kVersions = const [
777 const bindings.StructDataHeader(24, 0) 761 const bindings.StructDataHeader(24, 0)
778 ]; 762 ];
779 bool wasClean = false; 763 bool wasClean = false;
780 int code = 0; 764 int code = 0;
781 String reason = null; 765 String reason = null;
782 766
783 _WebSocketClientDidCloseParams() : super(kVersions.last.size); 767 _WebSocketClientDidCloseParams() : super(kVersions.last.size);
784 768
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 848
865 Map toJson() { 849 Map toJson() {
866 Map map = new Map(); 850 Map map = new Map();
867 map["wasClean"] = wasClean; 851 map["wasClean"] = wasClean;
868 map["code"] = code; 852 map["code"] = code;
869 map["reason"] = reason; 853 map["reason"] = reason;
870 return map; 854 return map;
871 } 855 }
872 } 856 }
873 857
874
875
876
877 const int _WebSocket_connectName = 0; 858 const int _WebSocket_connectName = 0;
878 const int _WebSocket_sendName = 1; 859 const int _WebSocket_sendName = 1;
879 const int _WebSocket_flowControlName = 2; 860 const int _WebSocket_flowControlName = 2;
880 const int _WebSocket_closeName = 3; 861 const int _WebSocket_closeName = 3;
881 862
882 class WebSocketMessageType extends bindings.MojoEnum { 863 class WebSocketMessageType extends bindings.MojoEnum {
883 static const WebSocketMessageType continuation = const WebSocketMessageType._( 0); 864 static const WebSocketMessageType continuation = const WebSocketMessageType._( 0);
884 static const WebSocketMessageType text = const WebSocketMessageType._(1); 865 static const WebSocketMessageType text = const WebSocketMessageType._(1);
885 static const WebSocketMessageType binary = const WebSocketMessageType._(2); 866 static const WebSocketMessageType binary = const WebSocketMessageType._(2);
886 867
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
931 case binary: 912 case binary:
932 return 'WebSocketMessageType.binary'; 913 return 'WebSocketMessageType.binary';
933 default: 914 default:
934 return null; 915 return null;
935 } 916 }
936 } 917 }
937 918
938 int toJson() => mojoEnumValue; 919 int toJson() => mojoEnumValue;
939 } 920 }
940 921
941
942
943
944
945 class _WebSocketServiceDescription implements service_describer.ServiceDescripti on { 922 class _WebSocketServiceDescription implements service_describer.ServiceDescripti on {
946 dynamic getTopLevelInterface([Function responseFactory]) => 923 dynamic getTopLevelInterface([Function responseFactory]) =>
947 responseFactory(null); 924 responseFactory(null);
948 925
949 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => 926 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) =>
950 responseFactory(null); 927 responseFactory(null);
951 928
952 dynamic getAllTypeDefinitions([Function responseFactory]) => 929 dynamic getAllTypeDefinitions([Function responseFactory]) =>
953 responseFactory(null); 930 responseFactory(null);
954 } 931 }
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1182 return _cachedServiceDescription; 1159 return _cachedServiceDescription;
1183 } 1160 }
1184 } 1161 }
1185 1162
1186 const int _WebSocketClient_didConnectName = 0; 1163 const int _WebSocketClient_didConnectName = 0;
1187 const int _WebSocketClient_didReceiveDataName = 1; 1164 const int _WebSocketClient_didReceiveDataName = 1;
1188 const int _WebSocketClient_didReceiveFlowControlName = 2; 1165 const int _WebSocketClient_didReceiveFlowControlName = 2;
1189 const int _WebSocketClient_didFailName = 3; 1166 const int _WebSocketClient_didFailName = 3;
1190 const int _WebSocketClient_didCloseName = 4; 1167 const int _WebSocketClient_didCloseName = 4;
1191 1168
1192
1193
1194 class _WebSocketClientServiceDescription implements service_describer.ServiceDes cription { 1169 class _WebSocketClientServiceDescription implements service_describer.ServiceDes cription {
1195 dynamic getTopLevelInterface([Function responseFactory]) => 1170 dynamic getTopLevelInterface([Function responseFactory]) =>
1196 responseFactory(null); 1171 responseFactory(null);
1197 1172
1198 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => 1173 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) =>
1199 responseFactory(null); 1174 responseFactory(null);
1200 1175
1201 dynamic getAllTypeDefinitions([Function responseFactory]) => 1176 dynamic getAllTypeDefinitions([Function responseFactory]) =>
1202 responseFactory(null); 1177 responseFactory(null);
1203 } 1178 }
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
1440 static service_describer.ServiceDescription get serviceDescription { 1415 static service_describer.ServiceDescription get serviceDescription {
1441 if (_cachedServiceDescription == null) { 1416 if (_cachedServiceDescription == null) {
1442 _cachedServiceDescription = new _WebSocketClientServiceDescription(); 1417 _cachedServiceDescription = new _WebSocketClientServiceDescription();
1443 } 1418 }
1444 return _cachedServiceDescription; 1419 return _cachedServiceDescription;
1445 } 1420 }
1446 } 1421 }
1447 1422
1448 1423
1449 1424
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698