| 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 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; |
| 8 | 9 |
| 9 import 'package:mojo/bindings.dart' as bindings; | 10 import 'package:mojo/bindings.dart' as bindings; |
| 10 import 'package:mojo/core.dart' as core; | 11 import 'package:mojo/core.dart' as core; |
| 12 import 'package:mojo/mojo/bindings/types/mojom_types.mojom.dart' as mojom_types; |
| 13 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; |
| 11 import 'package:mojo_services/http_server/http_request.mojom.dart' as http_reque
st_mojom; | 14 import 'package:mojo_services/http_server/http_request.mojom.dart' as http_reque
st_mojom; |
| 12 import 'package:mojo_services/http_server/http_response.mojom.dart' as http_resp
onse_mojom; | 15 import 'package:mojo_services/http_server/http_response.mojom.dart' as http_resp
onse_mojom; |
| 13 | 16 |
| 14 | 17 |
| 15 | 18 |
| 16 class _HttpServerSetHandlerParams extends bindings.Struct { | 19 class _HttpServerSetHandlerParams extends bindings.Struct { |
| 17 static const List<bindings.StructDataHeader> kVersions = const [ | 20 static const List<bindings.StructDataHeader> kVersions = const [ |
| 18 const bindings.StructDataHeader(24, 0) | 21 const bindings.StructDataHeader(24, 0) |
| 19 ]; | 22 ]; |
| 20 String pattern = null; | 23 String pattern = null; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 return "_HttpServerSetHandlerParams(" | 81 return "_HttpServerSetHandlerParams(" |
| 79 "pattern: $pattern" ", " | 82 "pattern: $pattern" ", " |
| 80 "handler: $handler" ")"; | 83 "handler: $handler" ")"; |
| 81 } | 84 } |
| 82 | 85 |
| 83 Map toJson() { | 86 Map toJson() { |
| 84 throw new bindings.MojoCodecError( | 87 throw new bindings.MojoCodecError( |
| 85 'Object containing handles cannot be encoded to JSON.'); | 88 'Object containing handles cannot be encoded to JSON.'); |
| 86 } | 89 } |
| 87 } | 90 } |
| 91 mojom_types.MojomStruct _http_server_HttpServer_SetHandler_Params__() { |
| 92 return new mojom_types.MojomStruct() |
| 93 ..declData = (new mojom_types.DeclarationData() |
| 94 ..shortName = '_HttpServerSetHandlerParams' |
| 95 ..fullIdentifier = 'http_server._HttpServerSetHandlerParams') |
| 96 ..fields = <mojom_types.StructField>[ |
| 97 new mojom_types.StructField() |
| 98 ..declData = (new mojom_types.DeclarationData()..shortName = 'Pattern') |
| 99 ..type = (new mojom_types.Type() |
| 100 ..stringType = (new mojom_types.StringType()..nullable = false)), |
| 101 |
| 102 new mojom_types.StructField() |
| 103 ..declData = (new mojom_types.DeclarationData()..shortName = 'Handler') |
| 104 ..type = (new mojom_types.Type() |
| 105 ..typeReference = (new mojom_types.TypeReference() |
| 106 |
| 107 ..identifier = '_http_server_HttpHandler__' |
| 108 ..typeKey = '_http_server_HttpHandler__' |
| 109 )), |
| 110 ]; |
| 111 } |
| 88 | 112 |
| 89 | 113 |
| 90 class HttpServerSetHandlerResponseParams extends bindings.Struct { | 114 class HttpServerSetHandlerResponseParams extends bindings.Struct { |
| 91 static const List<bindings.StructDataHeader> kVersions = const [ | 115 static const List<bindings.StructDataHeader> kVersions = const [ |
| 92 const bindings.StructDataHeader(16, 0) | 116 const bindings.StructDataHeader(16, 0) |
| 93 ]; | 117 ]; |
| 94 bool success = false; | 118 bool success = false; |
| 95 | 119 |
| 96 HttpServerSetHandlerResponseParams() : super(kVersions.last.size); | 120 HttpServerSetHandlerResponseParams() : super(kVersions.last.size); |
| 97 | 121 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 return "HttpServerSetHandlerResponseParams(" | 169 return "HttpServerSetHandlerResponseParams(" |
| 146 "success: $success" ")"; | 170 "success: $success" ")"; |
| 147 } | 171 } |
| 148 | 172 |
| 149 Map toJson() { | 173 Map toJson() { |
| 150 Map map = new Map(); | 174 Map map = new Map(); |
| 151 map["success"] = success; | 175 map["success"] = success; |
| 152 return map; | 176 return map; |
| 153 } | 177 } |
| 154 } | 178 } |
| 179 mojom_types.MojomStruct _http_server_HttpServer_SetHandler_ResponseParams__() { |
| 180 return new mojom_types.MojomStruct() |
| 181 ..declData = (new mojom_types.DeclarationData() |
| 182 ..shortName = 'HttpServerSetHandlerResponseParams' |
| 183 ..fullIdentifier = 'http_server.HttpServerSetHandlerResponseParams') |
| 184 ..fields = <mojom_types.StructField>[ |
| 185 new mojom_types.StructField() |
| 186 ..declData = (new mojom_types.DeclarationData()..shortName = 'Success') |
| 187 ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.bo
ol), |
| 188 ]; |
| 189 } |
| 155 | 190 |
| 156 | 191 |
| 157 class _HttpServerGetPortParams extends bindings.Struct { | 192 class _HttpServerGetPortParams extends bindings.Struct { |
| 158 static const List<bindings.StructDataHeader> kVersions = const [ | 193 static const List<bindings.StructDataHeader> kVersions = const [ |
| 159 const bindings.StructDataHeader(8, 0) | 194 const bindings.StructDataHeader(8, 0) |
| 160 ]; | 195 ]; |
| 161 | 196 |
| 162 _HttpServerGetPortParams() : super(kVersions.last.size); | 197 _HttpServerGetPortParams() : super(kVersions.last.size); |
| 163 | 198 |
| 164 static _HttpServerGetPortParams deserialize(bindings.Message message) { | 199 static _HttpServerGetPortParams deserialize(bindings.Message message) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 | 238 |
| 204 String toString() { | 239 String toString() { |
| 205 return "_HttpServerGetPortParams("")"; | 240 return "_HttpServerGetPortParams("")"; |
| 206 } | 241 } |
| 207 | 242 |
| 208 Map toJson() { | 243 Map toJson() { |
| 209 Map map = new Map(); | 244 Map map = new Map(); |
| 210 return map; | 245 return map; |
| 211 } | 246 } |
| 212 } | 247 } |
| 248 mojom_types.MojomStruct _http_server_HttpServer_GetPort_Params__() { |
| 249 return new mojom_types.MojomStruct() |
| 250 ..declData = (new mojom_types.DeclarationData() |
| 251 ..shortName = '_HttpServerGetPortParams' |
| 252 ..fullIdentifier = 'http_server._HttpServerGetPortParams') |
| 253 ..fields = <mojom_types.StructField>[]; |
| 254 } |
| 213 | 255 |
| 214 | 256 |
| 215 class HttpServerGetPortResponseParams extends bindings.Struct { | 257 class HttpServerGetPortResponseParams extends bindings.Struct { |
| 216 static const List<bindings.StructDataHeader> kVersions = const [ | 258 static const List<bindings.StructDataHeader> kVersions = const [ |
| 217 const bindings.StructDataHeader(16, 0) | 259 const bindings.StructDataHeader(16, 0) |
| 218 ]; | 260 ]; |
| 219 int port = 0; | 261 int port = 0; |
| 220 | 262 |
| 221 HttpServerGetPortResponseParams() : super(kVersions.last.size); | 263 HttpServerGetPortResponseParams() : super(kVersions.last.size); |
| 222 | 264 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 return "HttpServerGetPortResponseParams(" | 312 return "HttpServerGetPortResponseParams(" |
| 271 "port: $port" ")"; | 313 "port: $port" ")"; |
| 272 } | 314 } |
| 273 | 315 |
| 274 Map toJson() { | 316 Map toJson() { |
| 275 Map map = new Map(); | 317 Map map = new Map(); |
| 276 map["port"] = port; | 318 map["port"] = port; |
| 277 return map; | 319 return map; |
| 278 } | 320 } |
| 279 } | 321 } |
| 322 mojom_types.MojomStruct _http_server_HttpServer_GetPort_ResponseParams__() { |
| 323 return new mojom_types.MojomStruct() |
| 324 ..declData = (new mojom_types.DeclarationData() |
| 325 ..shortName = 'HttpServerGetPortResponseParams' |
| 326 ..fullIdentifier = 'http_server.HttpServerGetPortResponseParams') |
| 327 ..fields = <mojom_types.StructField>[ |
| 328 new mojom_types.StructField() |
| 329 ..declData = (new mojom_types.DeclarationData()..shortName = 'Port') |
| 330 ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.ui
nt16), |
| 331 ]; |
| 332 } |
| 280 | 333 |
| 281 | 334 |
| 282 class _HttpHandlerHandleRequestParams extends bindings.Struct { | 335 class _HttpHandlerHandleRequestParams extends bindings.Struct { |
| 283 static const List<bindings.StructDataHeader> kVersions = const [ | 336 static const List<bindings.StructDataHeader> kVersions = const [ |
| 284 const bindings.StructDataHeader(16, 0) | 337 const bindings.StructDataHeader(16, 0) |
| 285 ]; | 338 ]; |
| 286 http_request_mojom.HttpRequest request = null; | 339 http_request_mojom.HttpRequest request = null; |
| 287 | 340 |
| 288 _HttpHandlerHandleRequestParams() : super(kVersions.last.size); | 341 _HttpHandlerHandleRequestParams() : super(kVersions.last.size); |
| 289 | 342 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 String toString() { | 390 String toString() { |
| 338 return "_HttpHandlerHandleRequestParams(" | 391 return "_HttpHandlerHandleRequestParams(" |
| 339 "request: $request" ")"; | 392 "request: $request" ")"; |
| 340 } | 393 } |
| 341 | 394 |
| 342 Map toJson() { | 395 Map toJson() { |
| 343 throw new bindings.MojoCodecError( | 396 throw new bindings.MojoCodecError( |
| 344 'Object containing handles cannot be encoded to JSON.'); | 397 'Object containing handles cannot be encoded to JSON.'); |
| 345 } | 398 } |
| 346 } | 399 } |
| 400 mojom_types.MojomStruct _http_server_HttpHandler_HandleRequest_Params__() { |
| 401 return new mojom_types.MojomStruct() |
| 402 ..declData = (new mojom_types.DeclarationData() |
| 403 ..shortName = '_HttpHandlerHandleRequestParams' |
| 404 ..fullIdentifier = 'http_server._HttpHandlerHandleRequestParams') |
| 405 ..fields = <mojom_types.StructField>[ |
| 406 new mojom_types.StructField() |
| 407 ..declData = (new mojom_types.DeclarationData()..shortName = 'Request') |
| 408 ..type = (new mojom_types.Type() |
| 409 ..typeReference = (new mojom_types.TypeReference() |
| 410 |
| 411 ..identifier = '_http_request_HttpRequest__' |
| 412 ..typeKey = '_http_request_HttpRequest__' |
| 413 )), |
| 414 ]; |
| 415 } |
| 347 | 416 |
| 348 | 417 |
| 349 class HttpHandlerHandleRequestResponseParams extends bindings.Struct { | 418 class HttpHandlerHandleRequestResponseParams extends bindings.Struct { |
| 350 static const List<bindings.StructDataHeader> kVersions = const [ | 419 static const List<bindings.StructDataHeader> kVersions = const [ |
| 351 const bindings.StructDataHeader(16, 0) | 420 const bindings.StructDataHeader(16, 0) |
| 352 ]; | 421 ]; |
| 353 http_response_mojom.HttpResponse response = null; | 422 http_response_mojom.HttpResponse response = null; |
| 354 | 423 |
| 355 HttpHandlerHandleRequestResponseParams() : super(kVersions.last.size); | 424 HttpHandlerHandleRequestResponseParams() : super(kVersions.last.size); |
| 356 | 425 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 String toString() { | 473 String toString() { |
| 405 return "HttpHandlerHandleRequestResponseParams(" | 474 return "HttpHandlerHandleRequestResponseParams(" |
| 406 "response: $response" ")"; | 475 "response: $response" ")"; |
| 407 } | 476 } |
| 408 | 477 |
| 409 Map toJson() { | 478 Map toJson() { |
| 410 throw new bindings.MojoCodecError( | 479 throw new bindings.MojoCodecError( |
| 411 'Object containing handles cannot be encoded to JSON.'); | 480 'Object containing handles cannot be encoded to JSON.'); |
| 412 } | 481 } |
| 413 } | 482 } |
| 483 mojom_types.MojomStruct _http_server_HttpHandler_HandleRequest_ResponseParams__(
) { |
| 484 return new mojom_types.MojomStruct() |
| 485 ..declData = (new mojom_types.DeclarationData() |
| 486 ..shortName = 'HttpHandlerHandleRequestResponseParams' |
| 487 ..fullIdentifier = 'http_server.HttpHandlerHandleRequestResponseParams') |
| 488 ..fields = <mojom_types.StructField>[ |
| 489 new mojom_types.StructField() |
| 490 ..declData = (new mojom_types.DeclarationData()..shortName = 'Response') |
| 491 ..type = (new mojom_types.Type() |
| 492 ..typeReference = (new mojom_types.TypeReference() |
| 493 |
| 494 ..identifier = '_http_response_HttpResponse__' |
| 495 ..typeKey = '_http_response_HttpResponse__' |
| 496 )), |
| 497 ]; |
| 498 } |
| 499 |
| 414 | 500 |
| 415 const int _HttpServer_setHandlerName = 0; | 501 const int _HttpServer_setHandlerName = 0; |
| 416 const int _HttpServer_getPortName = 1; | 502 const int _HttpServer_getPortName = 1; |
| 417 | 503 |
| 504 mojom_types.MojomInterface _http_server_HttpServer__() { |
| 505 return new mojom_types.MojomInterface() |
| 506 ..declData = (new mojom_types.DeclarationData() |
| 507 ..shortName = 'HttpServer' |
| 508 ..fullIdentifier = 'http_server.HttpServer') |
| 509 ..interfaceName = 'HttpServer' |
| 510 ..methods = <int, mojom_types.MojomMethod>{ |
| 511 _HttpServer_setHandlerName: new mojom_types.MojomMethod() |
| 512 ..declData = (new mojom_types.DeclarationData()..shortName = 'SetHandler
') |
| 513 ..ordinal = _HttpServer_setHandlerName |
| 514 ..responseParams = _http_server_HttpServer_SetHandler_ResponseParams__()
..parameters = _http_server_HttpServer_SetHandler_Params__(),_HttpServer_getPort
Name: new mojom_types.MojomMethod() |
| 515 ..declData = (new mojom_types.DeclarationData()..shortName = 'GetPort') |
| 516 ..ordinal = _HttpServer_getPortName |
| 517 ..responseParams = _http_server_HttpServer_GetPort_ResponseParams__()..p
arameters = _http_server_HttpServer_GetPort_Params__(), |
| 518 }; |
| 519 } |
| 520 |
| 521 class _HttpServerServiceDescription implements service_describer.ServiceDescript
ion { |
| 522 dynamic getTopLevelInterface([Function responseFactory = null]) { |
| 523 return _http_server_HttpServer__(); |
| 524 } |
| 525 dynamic getTypeDefinition(String typeKey,[Function responseFactory = null]) { |
| 526 return getAllMojomTypeDefinitions()[typeKey]; |
| 527 } |
| 528 dynamic getAllTypeDefinitions([Function responseFactory = null]) { |
| 529 return getAllMojomTypeDefinitions(); |
| 530 } |
| 531 } |
| 532 |
| 418 abstract class HttpServer { | 533 abstract class HttpServer { |
| 419 static const String serviceName = null; | 534 static const String serviceName = null; |
| 420 dynamic setHandler(String pattern,Object handler,[Function responseFactory = n
ull]); | 535 dynamic setHandler(String pattern,Object handler,[Function responseFactory = n
ull]); |
| 421 dynamic getPort([Function responseFactory = null]); | 536 dynamic getPort([Function responseFactory = null]); |
| 422 } | 537 } |
| 423 | 538 |
| 424 | 539 |
| 425 class _HttpServerProxyImpl extends bindings.Proxy { | 540 class _HttpServerProxyImpl extends bindings.Proxy { |
| 426 _HttpServerProxyImpl.fromEndpoint( | 541 _HttpServerProxyImpl.fromEndpoint( |
| 427 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 542 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 428 | 543 |
| 429 _HttpServerProxyImpl.fromHandle(core.MojoHandle handle) : | 544 _HttpServerProxyImpl.fromHandle(core.MojoHandle handle) : |
| 430 super.fromHandle(handle); | 545 super.fromHandle(handle); |
| 431 | 546 |
| 432 _HttpServerProxyImpl.unbound() : super.unbound(); | 547 _HttpServerProxyImpl.unbound() : super.unbound(); |
| 433 | 548 |
| 434 static _HttpServerProxyImpl newFromEndpoint( | 549 static _HttpServerProxyImpl newFromEndpoint( |
| 435 core.MojoMessagePipeEndpoint endpoint) { | 550 core.MojoMessagePipeEndpoint endpoint) { |
| 436 assert(endpoint.setDescription("For _HttpServerProxyImpl")); | 551 assert(endpoint.setDescription("For _HttpServerProxyImpl")); |
| 437 return new _HttpServerProxyImpl.fromEndpoint(endpoint); | 552 return new _HttpServerProxyImpl.fromEndpoint(endpoint); |
| 438 } | 553 } |
| 439 | 554 |
| 555 service_describer.ServiceDescription get serviceDescription => |
| 556 new _HttpServerServiceDescription(); |
| 557 |
| 440 void handleResponse(bindings.ServiceMessage message) { | 558 void handleResponse(bindings.ServiceMessage message) { |
| 441 switch (message.header.type) { | 559 switch (message.header.type) { |
| 442 case _HttpServer_setHandlerName: | 560 case _HttpServer_setHandlerName: |
| 443 var r = HttpServerSetHandlerResponseParams.deserialize( | 561 var r = HttpServerSetHandlerResponseParams.deserialize( |
| 444 message.payload); | 562 message.payload); |
| 445 if (!message.header.hasRequestId) { | 563 if (!message.header.hasRequestId) { |
| 446 proxyError("Expected a message with a valid request Id."); | 564 proxyError("Expected a message with a valid request Id."); |
| 447 return; | 565 return; |
| 448 } | 566 } |
| 449 Completer c = completerMap[message.header.requestId]; | 567 Completer c = completerMap[message.header.requestId]; |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 assert(_impl == null); | 789 assert(_impl == null); |
| 672 _impl = d; | 790 _impl = d; |
| 673 } | 791 } |
| 674 | 792 |
| 675 String toString() { | 793 String toString() { |
| 676 var superString = super.toString(); | 794 var superString = super.toString(); |
| 677 return "HttpServerStub($superString)"; | 795 return "HttpServerStub($superString)"; |
| 678 } | 796 } |
| 679 | 797 |
| 680 int get version => 0; | 798 int get version => 0; |
| 799 |
| 800 |
| 801 service_describer.ServiceDescription get serviceDescription => |
| 802 new _HttpServerServiceDescription(); |
| 681 } | 803 } |
| 682 | 804 |
| 683 const int _HttpHandler_handleRequestName = 0; | 805 const int _HttpHandler_handleRequestName = 0; |
| 684 | 806 |
| 807 mojom_types.MojomInterface _http_server_HttpHandler__() { |
| 808 return new mojom_types.MojomInterface() |
| 809 ..declData = (new mojom_types.DeclarationData() |
| 810 ..shortName = 'HttpHandler' |
| 811 ..fullIdentifier = 'http_server.HttpHandler') |
| 812 ..interfaceName = 'HttpHandler' |
| 813 ..methods = <int, mojom_types.MojomMethod>{ |
| 814 _HttpHandler_handleRequestName: new mojom_types.MojomMethod() |
| 815 ..declData = (new mojom_types.DeclarationData()..shortName = 'HandleRequ
est') |
| 816 ..ordinal = _HttpHandler_handleRequestName |
| 817 ..responseParams = _http_server_HttpHandler_HandleRequest_ResponseParams
__()..parameters = _http_server_HttpHandler_HandleRequest_Params__(), |
| 818 }; |
| 819 } |
| 820 |
| 821 class _HttpHandlerServiceDescription implements service_describer.ServiceDescrip
tion { |
| 822 dynamic getTopLevelInterface([Function responseFactory = null]) { |
| 823 return _http_server_HttpHandler__(); |
| 824 } |
| 825 dynamic getTypeDefinition(String typeKey,[Function responseFactory = null]) { |
| 826 return getAllMojomTypeDefinitions()[typeKey]; |
| 827 } |
| 828 dynamic getAllTypeDefinitions([Function responseFactory = null]) { |
| 829 return getAllMojomTypeDefinitions(); |
| 830 } |
| 831 } |
| 832 |
| 685 abstract class HttpHandler { | 833 abstract class HttpHandler { |
| 686 static const String serviceName = null; | 834 static const String serviceName = null; |
| 687 dynamic handleRequest(http_request_mojom.HttpRequest request,[Function respons
eFactory = null]); | 835 dynamic handleRequest(http_request_mojom.HttpRequest request,[Function respons
eFactory = null]); |
| 688 } | 836 } |
| 689 | 837 |
| 690 | 838 |
| 691 class _HttpHandlerProxyImpl extends bindings.Proxy { | 839 class _HttpHandlerProxyImpl extends bindings.Proxy { |
| 692 _HttpHandlerProxyImpl.fromEndpoint( | 840 _HttpHandlerProxyImpl.fromEndpoint( |
| 693 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 841 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 694 | 842 |
| 695 _HttpHandlerProxyImpl.fromHandle(core.MojoHandle handle) : | 843 _HttpHandlerProxyImpl.fromHandle(core.MojoHandle handle) : |
| 696 super.fromHandle(handle); | 844 super.fromHandle(handle); |
| 697 | 845 |
| 698 _HttpHandlerProxyImpl.unbound() : super.unbound(); | 846 _HttpHandlerProxyImpl.unbound() : super.unbound(); |
| 699 | 847 |
| 700 static _HttpHandlerProxyImpl newFromEndpoint( | 848 static _HttpHandlerProxyImpl newFromEndpoint( |
| 701 core.MojoMessagePipeEndpoint endpoint) { | 849 core.MojoMessagePipeEndpoint endpoint) { |
| 702 assert(endpoint.setDescription("For _HttpHandlerProxyImpl")); | 850 assert(endpoint.setDescription("For _HttpHandlerProxyImpl")); |
| 703 return new _HttpHandlerProxyImpl.fromEndpoint(endpoint); | 851 return new _HttpHandlerProxyImpl.fromEndpoint(endpoint); |
| 704 } | 852 } |
| 705 | 853 |
| 854 service_describer.ServiceDescription get serviceDescription => |
| 855 new _HttpHandlerServiceDescription(); |
| 856 |
| 706 void handleResponse(bindings.ServiceMessage message) { | 857 void handleResponse(bindings.ServiceMessage message) { |
| 707 switch (message.header.type) { | 858 switch (message.header.type) { |
| 708 case _HttpHandler_handleRequestName: | 859 case _HttpHandler_handleRequestName: |
| 709 var r = HttpHandlerHandleRequestResponseParams.deserialize( | 860 var r = HttpHandlerHandleRequestResponseParams.deserialize( |
| 710 message.payload); | 861 message.payload); |
| 711 if (!message.header.hasRequestId) { | 862 if (!message.header.hasRequestId) { |
| 712 proxyError("Expected a message with a valid request Id."); | 863 proxyError("Expected a message with a valid request Id."); |
| 713 return; | 864 return; |
| 714 } | 865 } |
| 715 Completer c = completerMap[message.header.requestId]; | 866 Completer c = completerMap[message.header.requestId]; |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 assert(_impl == null); | 1032 assert(_impl == null); |
| 882 _impl = d; | 1033 _impl = d; |
| 883 } | 1034 } |
| 884 | 1035 |
| 885 String toString() { | 1036 String toString() { |
| 886 var superString = super.toString(); | 1037 var superString = super.toString(); |
| 887 return "HttpHandlerStub($superString)"; | 1038 return "HttpHandlerStub($superString)"; |
| 888 } | 1039 } |
| 889 | 1040 |
| 890 int get version => 0; | 1041 int get version => 0; |
| 1042 |
| 1043 |
| 1044 service_describer.ServiceDescription get serviceDescription => |
| 1045 new _HttpHandlerServiceDescription(); |
| 891 } | 1046 } |
| 892 | 1047 |
| 893 | 1048 |
| 1049 |
| 1050 |
| 1051 |
| 1052 |
| 1053 |
| 1054 Map<String, mojom_types.UserDefinedType> _initDescriptions() { |
| 1055 var map = new HashMap<String, mojom_types.UserDefinedType>(); |
| 1056 map["_http_server_HttpServer_SetHandler_Params__"] = |
| 1057 new mojom_types.UserDefinedType() |
| 1058 ..structType = _http_server_HttpServer_SetHandler_Params__(); |
| 1059 map["_http_server_HttpServer_SetHandler_ResponseParams__"] = |
| 1060 new mojom_types.UserDefinedType() |
| 1061 ..structType = _http_server_HttpServer_SetHandler_ResponseParams__(); |
| 1062 map["_http_server_HttpServer_GetPort_Params__"] = |
| 1063 new mojom_types.UserDefinedType() |
| 1064 ..structType = _http_server_HttpServer_GetPort_Params__(); |
| 1065 map["_http_server_HttpServer_GetPort_ResponseParams__"] = |
| 1066 new mojom_types.UserDefinedType() |
| 1067 ..structType = _http_server_HttpServer_GetPort_ResponseParams__(); |
| 1068 map["_http_server_HttpHandler_HandleRequest_Params__"] = |
| 1069 new mojom_types.UserDefinedType() |
| 1070 ..structType = _http_server_HttpHandler_HandleRequest_Params__(); |
| 1071 map["_http_server_HttpHandler_HandleRequest_ResponseParams__"] = |
| 1072 new mojom_types.UserDefinedType() |
| 1073 ..structType = _http_server_HttpHandler_HandleRequest_ResponseParams__(); |
| 1074 map["_http_server_HttpServer__"] = |
| 1075 new mojom_types.UserDefinedType() |
| 1076 ..interfaceType = _http_server_HttpServer__(); |
| 1077 map["_http_server_HttpHandler__"] = |
| 1078 new mojom_types.UserDefinedType() |
| 1079 ..interfaceType = _http_server_HttpHandler__(); |
| 1080 http_request_mojom.getAllMojomTypeDefinitions().forEach((String s, mojom_types.U
serDefinedType udt) { |
| 1081 map[s] = udt; |
| 1082 }); |
| 1083 http_response_mojom.getAllMojomTypeDefinitions().forEach((String s, mojom_types.
UserDefinedType udt) { |
| 1084 map[s] = udt; |
| 1085 }); |
| 1086 |
| 1087 return map; |
| 1088 } |
| 1089 |
| 1090 var _MojomDesc; |
| 1091 Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() { |
| 1092 if (_MojomDesc == null) { |
| 1093 _MojomDesc = _initDescriptions(); |
| 1094 } |
| 1095 return _MojomDesc; |
| 1096 } |
| 1097 |
| OLD | NEW |