OLD | NEW |
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 http_server_factory_mojom; | 4 library http_server_factory_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 import 'package:mojo_services/http_server/http_server.mojom.dart' as http_server
_mojom; | 9 import 'package:mojo_services/http_server/http_server.mojom.dart' as http_server
_mojom; |
10 import 'package:mojo_services/mojo/net_address.mojom.dart' as net_address_mojom; | 10 import 'package:mojo_services/mojo/net_address.mojom.dart' as net_address_mojom; |
11 | 11 |
12 | 12 |
13 | 13 |
14 class _HttpServerFactoryCreateHttpServerParams extends bindings.Struct { | 14 class _HttpServerFactoryCreateHttpServerParams extends bindings.Struct { |
15 static const List<bindings.StructDataHeader> kVersions = const [ | 15 static const List<bindings.StructDataHeader> kVersions = const [ |
16 const bindings.StructDataHeader(24, 0) | 16 const bindings.StructDataHeader(24, 0) |
17 ]; | 17 ]; |
18 http_server_mojom.HttpServerInterfaceRequest serverRequest = null; | 18 http_server_mojom.HttpServerInterfaceRequest serverRequest = null; |
19 net_address_mojom.NetAddress localAddress = null; | 19 net_address_mojom.NetAddress localAddress = null; |
20 | 20 |
21 _HttpServerFactoryCreateHttpServerParams() : super(kVersions.last.size); | 21 _HttpServerFactoryCreateHttpServerParams() : super(kVersions.last.size); |
22 | 22 |
| 23 _HttpServerFactoryCreateHttpServerParams.init( |
| 24 http_server_mojom.HttpServerInterfaceRequest this.serverRequest, |
| 25 net_address_mojom.NetAddress this.localAddress |
| 26 ) : super(kVersions.last.size); |
| 27 |
23 static _HttpServerFactoryCreateHttpServerParams deserialize(bindings.Message m
essage) { | 28 static _HttpServerFactoryCreateHttpServerParams deserialize(bindings.Message m
essage) { |
24 var decoder = new bindings.Decoder(message); | 29 var decoder = new bindings.Decoder(message); |
25 var result = decode(decoder); | 30 var result = decode(decoder); |
26 if (decoder.excessHandles != null) { | 31 if (decoder.excessHandles != null) { |
27 decoder.excessHandles.forEach((h) => h.close()); | 32 decoder.excessHandles.forEach((h) => h.close()); |
28 } | 33 } |
29 return result; | 34 return result; |
30 } | 35 } |
31 | 36 |
32 static _HttpServerFactoryCreateHttpServerParams decode(bindings.Decoder decode
r0) { | 37 static _HttpServerFactoryCreateHttpServerParams decode(bindings.Decoder decode
r0) { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 96 |
92 Map toJson() { | 97 Map toJson() { |
93 throw new bindings.MojoCodecError( | 98 throw new bindings.MojoCodecError( |
94 'Object containing handles cannot be encoded to JSON.'); | 99 'Object containing handles cannot be encoded to JSON.'); |
95 } | 100 } |
96 } | 101 } |
97 | 102 |
98 const int _httpServerFactoryMethodCreateHttpServerName = 0; | 103 const int _httpServerFactoryMethodCreateHttpServerName = 0; |
99 | 104 |
100 class _HttpServerFactoryServiceDescription implements service_describer.ServiceD
escription { | 105 class _HttpServerFactoryServiceDescription implements service_describer.ServiceD
escription { |
101 dynamic getTopLevelInterface([Function responseFactory]) => | 106 void getTopLevelInterface(Function responder) { |
102 responseFactory(null); | 107 responder(null); |
| 108 } |
103 | 109 |
104 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 110 void getTypeDefinition(String typeKey, Function responder) { |
105 responseFactory(null); | 111 responder(null); |
| 112 } |
106 | 113 |
107 dynamic getAllTypeDefinitions([Function responseFactory]) => | 114 void getAllTypeDefinitions(Function responder) { |
108 responseFactory(null); | 115 responder(null); |
| 116 } |
109 } | 117 } |
110 | 118 |
111 abstract class HttpServerFactory { | 119 abstract class HttpServerFactory { |
112 static const String serviceName = "http_server::HttpServerFactory"; | 120 static const String serviceName = "http_server::HttpServerFactory"; |
113 | 121 |
114 static service_describer.ServiceDescription _cachedServiceDescription; | 122 static service_describer.ServiceDescription _cachedServiceDescription; |
115 static service_describer.ServiceDescription get serviceDescription { | 123 static service_describer.ServiceDescription get serviceDescription { |
116 if (_cachedServiceDescription == null) { | 124 if (_cachedServiceDescription == null) { |
117 _cachedServiceDescription = new _HttpServerFactoryServiceDescription(); | 125 _cachedServiceDescription = new _HttpServerFactoryServiceDescription(); |
118 } | 126 } |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 : super.fromHandle(handle, autoBegin: impl != null) { | 257 : super.fromHandle(handle, autoBegin: impl != null) { |
250 _impl = impl; | 258 _impl = impl; |
251 } | 259 } |
252 | 260 |
253 _HttpServerFactoryStubControl.unbound([this._impl]) : super.unbound(); | 261 _HttpServerFactoryStubControl.unbound([this._impl]) : super.unbound(); |
254 | 262 |
255 String get serviceName => HttpServerFactory.serviceName; | 263 String get serviceName => HttpServerFactory.serviceName; |
256 | 264 |
257 | 265 |
258 | 266 |
259 dynamic handleMessage(bindings.ServiceMessage message) { | 267 void handleMessage(bindings.ServiceMessage message) { |
260 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 268 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
261 return bindings.ControlMessageHandler.handleMessage(this, | 269 bindings.ControlMessageHandler.handleMessage( |
262 0, | 270 this, 0, message); |
263 message); | 271 return; |
264 } | 272 } |
265 if (_impl == null) { | 273 if (_impl == null) { |
266 throw new core.MojoApiError("$this has no implementation set"); | 274 throw new core.MojoApiError("$this has no implementation set"); |
267 } | 275 } |
268 switch (message.header.type) { | 276 switch (message.header.type) { |
269 case _httpServerFactoryMethodCreateHttpServerName: | 277 case _httpServerFactoryMethodCreateHttpServerName: |
270 var params = _HttpServerFactoryCreateHttpServerParams.deserialize( | 278 var params = _HttpServerFactoryCreateHttpServerParams.deserialize( |
271 message.payload); | 279 message.payload); |
272 _impl.createHttpServer(params.serverRequest, params.localAddress); | 280 _impl.createHttpServer(params.serverRequest, params.localAddress); |
273 break; | 281 break; |
274 default: | 282 default: |
275 throw new bindings.MojoCodecError("Unexpected message name"); | 283 throw new bindings.MojoCodecError("Unexpected message name"); |
276 break; | 284 break; |
277 } | 285 } |
278 return null; | |
279 } | 286 } |
280 | 287 |
281 HttpServerFactory get impl => _impl; | 288 HttpServerFactory get impl => _impl; |
282 set impl(HttpServerFactory d) { | 289 set impl(HttpServerFactory d) { |
283 if (d == null) { | 290 if (d == null) { |
284 throw new core.MojoApiError("$this: Cannot set a null implementation"); | 291 throw new core.MojoApiError("$this: Cannot set a null implementation"); |
285 } | 292 } |
286 if (isBound && (_impl == null)) { | 293 if (isBound && (_impl == null)) { |
287 beginHandlingEvents(); | 294 beginHandlingEvents(); |
288 } | 295 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 } | 336 } |
330 | 337 |
331 | 338 |
332 void createHttpServer(http_server_mojom.HttpServerInterfaceRequest serverReque
st, net_address_mojom.NetAddress localAddress) { | 339 void createHttpServer(http_server_mojom.HttpServerInterfaceRequest serverReque
st, net_address_mojom.NetAddress localAddress) { |
333 return impl.createHttpServer(serverRequest, localAddress); | 340 return impl.createHttpServer(serverRequest, localAddress); |
334 } | 341 } |
335 } | 342 } |
336 | 343 |
337 | 344 |
338 | 345 |
OLD | NEW |