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 http_server_mojom; | 5 library http_server_mojom; |
6 import 'dart:async'; | 6 import 'dart:async'; |
7 import 'package:mojo/bindings.dart' as bindings; | 7 import 'package:mojo/bindings.dart' as bindings; |
8 import 'package:mojo/core.dart' as core; | 8 import 'package:mojo/core.dart' as core; |
9 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; | 9 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; |
10 import 'package:mojo_services/http_server/http_request.mojom.dart' as http_reque
st_mojom; | 10 import 'package:mojo_services/http_server/http_request.mojom.dart' as http_reque
st_mojom; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 "handler: $handler" ")"; | 89 "handler: $handler" ")"; |
90 } | 90 } |
91 | 91 |
92 Map toJson() { | 92 Map toJson() { |
93 throw new bindings.MojoCodecError( | 93 throw new bindings.MojoCodecError( |
94 'Object containing handles cannot be encoded to JSON.'); | 94 'Object containing handles cannot be encoded to JSON.'); |
95 } | 95 } |
96 } | 96 } |
97 | 97 |
98 | 98 |
99 | |
100 | |
101 class HttpServerSetHandlerResponseParams extends bindings.Struct { | 99 class HttpServerSetHandlerResponseParams extends bindings.Struct { |
102 static const List<bindings.StructDataHeader> kVersions = const [ | 100 static const List<bindings.StructDataHeader> kVersions = const [ |
103 const bindings.StructDataHeader(16, 0) | 101 const bindings.StructDataHeader(16, 0) |
104 ]; | 102 ]; |
105 bool success = false; | 103 bool success = false; |
106 | 104 |
107 HttpServerSetHandlerResponseParams() : super(kVersions.last.size); | 105 HttpServerSetHandlerResponseParams() : super(kVersions.last.size); |
108 | 106 |
109 static HttpServerSetHandlerResponseParams deserialize(bindings.Message message
) { | 107 static HttpServerSetHandlerResponseParams deserialize(bindings.Message message
) { |
110 var decoder = new bindings.Decoder(message); | 108 var decoder = new bindings.Decoder(message); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 } | 161 } |
164 | 162 |
165 Map toJson() { | 163 Map toJson() { |
166 Map map = new Map(); | 164 Map map = new Map(); |
167 map["success"] = success; | 165 map["success"] = success; |
168 return map; | 166 return map; |
169 } | 167 } |
170 } | 168 } |
171 | 169 |
172 | 170 |
173 | |
174 | |
175 class _HttpServerGetPortParams extends bindings.Struct { | 171 class _HttpServerGetPortParams extends bindings.Struct { |
176 static const List<bindings.StructDataHeader> kVersions = const [ | 172 static const List<bindings.StructDataHeader> kVersions = const [ |
177 const bindings.StructDataHeader(8, 0) | 173 const bindings.StructDataHeader(8, 0) |
178 ]; | 174 ]; |
179 | 175 |
180 _HttpServerGetPortParams() : super(kVersions.last.size); | 176 _HttpServerGetPortParams() : super(kVersions.last.size); |
181 | 177 |
182 static _HttpServerGetPortParams deserialize(bindings.Message message) { | 178 static _HttpServerGetPortParams deserialize(bindings.Message message) { |
183 var decoder = new bindings.Decoder(message); | 179 var decoder = new bindings.Decoder(message); |
184 var result = decode(decoder); | 180 var result = decode(decoder); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 return "_HttpServerGetPortParams("")"; | 219 return "_HttpServerGetPortParams("")"; |
224 } | 220 } |
225 | 221 |
226 Map toJson() { | 222 Map toJson() { |
227 Map map = new Map(); | 223 Map map = new Map(); |
228 return map; | 224 return map; |
229 } | 225 } |
230 } | 226 } |
231 | 227 |
232 | 228 |
233 | |
234 | |
235 class HttpServerGetPortResponseParams extends bindings.Struct { | 229 class HttpServerGetPortResponseParams extends bindings.Struct { |
236 static const List<bindings.StructDataHeader> kVersions = const [ | 230 static const List<bindings.StructDataHeader> kVersions = const [ |
237 const bindings.StructDataHeader(16, 0) | 231 const bindings.StructDataHeader(16, 0) |
238 ]; | 232 ]; |
239 int port = 0; | 233 int port = 0; |
240 | 234 |
241 HttpServerGetPortResponseParams() : super(kVersions.last.size); | 235 HttpServerGetPortResponseParams() : super(kVersions.last.size); |
242 | 236 |
243 static HttpServerGetPortResponseParams deserialize(bindings.Message message) { | 237 static HttpServerGetPortResponseParams deserialize(bindings.Message message) { |
244 var decoder = new bindings.Decoder(message); | 238 var decoder = new bindings.Decoder(message); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 } | 291 } |
298 | 292 |
299 Map toJson() { | 293 Map toJson() { |
300 Map map = new Map(); | 294 Map map = new Map(); |
301 map["port"] = port; | 295 map["port"] = port; |
302 return map; | 296 return map; |
303 } | 297 } |
304 } | 298 } |
305 | 299 |
306 | 300 |
307 | |
308 | |
309 class _HttpHandlerHandleRequestParams extends bindings.Struct { | 301 class _HttpHandlerHandleRequestParams extends bindings.Struct { |
310 static const List<bindings.StructDataHeader> kVersions = const [ | 302 static const List<bindings.StructDataHeader> kVersions = const [ |
311 const bindings.StructDataHeader(16, 0) | 303 const bindings.StructDataHeader(16, 0) |
312 ]; | 304 ]; |
313 http_request_mojom.HttpRequest request = null; | 305 http_request_mojom.HttpRequest request = null; |
314 | 306 |
315 _HttpHandlerHandleRequestParams() : super(kVersions.last.size); | 307 _HttpHandlerHandleRequestParams() : super(kVersions.last.size); |
316 | 308 |
317 static _HttpHandlerHandleRequestParams deserialize(bindings.Message message) { | 309 static _HttpHandlerHandleRequestParams deserialize(bindings.Message message) { |
318 var decoder = new bindings.Decoder(message); | 310 var decoder = new bindings.Decoder(message); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 "request: $request" ")"; | 363 "request: $request" ")"; |
372 } | 364 } |
373 | 365 |
374 Map toJson() { | 366 Map toJson() { |
375 throw new bindings.MojoCodecError( | 367 throw new bindings.MojoCodecError( |
376 'Object containing handles cannot be encoded to JSON.'); | 368 'Object containing handles cannot be encoded to JSON.'); |
377 } | 369 } |
378 } | 370 } |
379 | 371 |
380 | 372 |
381 | |
382 | |
383 class HttpHandlerHandleRequestResponseParams extends bindings.Struct { | 373 class HttpHandlerHandleRequestResponseParams extends bindings.Struct { |
384 static const List<bindings.StructDataHeader> kVersions = const [ | 374 static const List<bindings.StructDataHeader> kVersions = const [ |
385 const bindings.StructDataHeader(16, 0) | 375 const bindings.StructDataHeader(16, 0) |
386 ]; | 376 ]; |
387 http_response_mojom.HttpResponse response = null; | 377 http_response_mojom.HttpResponse response = null; |
388 | 378 |
389 HttpHandlerHandleRequestResponseParams() : super(kVersions.last.size); | 379 HttpHandlerHandleRequestResponseParams() : super(kVersions.last.size); |
390 | 380 |
391 static HttpHandlerHandleRequestResponseParams deserialize(bindings.Message mes
sage) { | 381 static HttpHandlerHandleRequestResponseParams deserialize(bindings.Message mes
sage) { |
392 var decoder = new bindings.Decoder(message); | 382 var decoder = new bindings.Decoder(message); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 return "HttpHandlerHandleRequestResponseParams(" | 434 return "HttpHandlerHandleRequestResponseParams(" |
445 "response: $response" ")"; | 435 "response: $response" ")"; |
446 } | 436 } |
447 | 437 |
448 Map toJson() { | 438 Map toJson() { |
449 throw new bindings.MojoCodecError( | 439 throw new bindings.MojoCodecError( |
450 'Object containing handles cannot be encoded to JSON.'); | 440 'Object containing handles cannot be encoded to JSON.'); |
451 } | 441 } |
452 } | 442 } |
453 | 443 |
454 | |
455 | |
456 | |
457 const int _HttpServer_setHandlerName = 0; | 444 const int _HttpServer_setHandlerName = 0; |
458 const int _HttpServer_getPortName = 1; | 445 const int _HttpServer_getPortName = 1; |
459 | 446 |
460 | |
461 | |
462 class _HttpServerServiceDescription implements service_describer.ServiceDescript
ion { | 447 class _HttpServerServiceDescription implements service_describer.ServiceDescript
ion { |
463 dynamic getTopLevelInterface([Function responseFactory]) => | 448 dynamic getTopLevelInterface([Function responseFactory]) => |
464 responseFactory(null); | 449 responseFactory(null); |
465 | 450 |
466 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 451 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => |
467 responseFactory(null); | 452 responseFactory(null); |
468 | 453 |
469 dynamic getAllTypeDefinitions([Function responseFactory]) => | 454 dynamic getAllTypeDefinitions([Function responseFactory]) => |
470 responseFactory(null); | 455 responseFactory(null); |
471 } | 456 } |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 static service_describer.ServiceDescription get serviceDescription { | 724 static service_describer.ServiceDescription get serviceDescription { |
740 if (_cachedServiceDescription == null) { | 725 if (_cachedServiceDescription == null) { |
741 _cachedServiceDescription = new _HttpServerServiceDescription(); | 726 _cachedServiceDescription = new _HttpServerServiceDescription(); |
742 } | 727 } |
743 return _cachedServiceDescription; | 728 return _cachedServiceDescription; |
744 } | 729 } |
745 } | 730 } |
746 | 731 |
747 const int _HttpHandler_handleRequestName = 0; | 732 const int _HttpHandler_handleRequestName = 0; |
748 | 733 |
749 | |
750 | |
751 class _HttpHandlerServiceDescription implements service_describer.ServiceDescrip
tion { | 734 class _HttpHandlerServiceDescription implements service_describer.ServiceDescrip
tion { |
752 dynamic getTopLevelInterface([Function responseFactory]) => | 735 dynamic getTopLevelInterface([Function responseFactory]) => |
753 responseFactory(null); | 736 responseFactory(null); |
754 | 737 |
755 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 738 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => |
756 responseFactory(null); | 739 responseFactory(null); |
757 | 740 |
758 dynamic getAllTypeDefinitions([Function responseFactory]) => | 741 dynamic getAllTypeDefinitions([Function responseFactory]) => |
759 responseFactory(null); | 742 responseFactory(null); |
760 } | 743 } |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 static service_describer.ServiceDescription get serviceDescription { | 956 static service_describer.ServiceDescription get serviceDescription { |
974 if (_cachedServiceDescription == null) { | 957 if (_cachedServiceDescription == null) { |
975 _cachedServiceDescription = new _HttpHandlerServiceDescription(); | 958 _cachedServiceDescription = new _HttpHandlerServiceDescription(); |
976 } | 959 } |
977 return _cachedServiceDescription; | 960 return _cachedServiceDescription; |
978 } | 961 } |
979 } | 962 } |
980 | 963 |
981 | 964 |
982 | 965 |
OLD | NEW |