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