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 content_handler_mojom; | 4 library content_handler_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/mojo/application.mojom.dart' as application_mojom; | 9 import 'package:mojo/mojo/application.mojom.dart' as application_mojom; |
10 import 'package:mojo/mojo/url_response.mojom.dart' as url_response_mojom; | 10 import 'package:mojo/mojo/url_response.mojom.dart' as url_response_mojom; |
11 | 11 |
12 | 12 |
13 | 13 |
14 class _ContentHandlerStartApplicationParams extends bindings.Struct { | 14 class _ContentHandlerStartApplicationParams 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 application_mojom.ApplicationInterfaceRequest application = null; | 18 application_mojom.ApplicationInterfaceRequest application = null; |
19 url_response_mojom.UrlResponse response = null; | 19 url_response_mojom.UrlResponse response = null; |
20 | 20 |
21 _ContentHandlerStartApplicationParams() : super(kVersions.last.size); | 21 _ContentHandlerStartApplicationParams() : super(kVersions.last.size); |
22 | 22 |
| 23 _ContentHandlerStartApplicationParams.init( |
| 24 application_mojom.ApplicationInterfaceRequest this.application, |
| 25 url_response_mojom.UrlResponse this.response |
| 26 ) : super(kVersions.last.size); |
| 27 |
23 static _ContentHandlerStartApplicationParams deserialize(bindings.Message mess
age) { | 28 static _ContentHandlerStartApplicationParams deserialize(bindings.Message mess
age) { |
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 _ContentHandlerStartApplicationParams decode(bindings.Decoder decoder0)
{ | 37 static _ContentHandlerStartApplicationParams decode(bindings.Decoder decoder0)
{ |
(...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 _contentHandlerMethodStartApplicationName = 0; | 103 const int _contentHandlerMethodStartApplicationName = 0; |
99 | 104 |
100 class _ContentHandlerServiceDescription implements service_describer.ServiceDesc
ription { | 105 class _ContentHandlerServiceDescription implements service_describer.ServiceDesc
ription { |
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 ContentHandler { | 119 abstract class ContentHandler { |
112 static const String serviceName = "mojo::ContentHandler"; | 120 static const String serviceName = "mojo::ContentHandler"; |
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 _ContentHandlerServiceDescription(); | 125 _cachedServiceDescription = new _ContentHandlerServiceDescription(); |
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 _ContentHandlerStubControl.unbound([this._impl]) : super.unbound(); | 261 _ContentHandlerStubControl.unbound([this._impl]) : super.unbound(); |
254 | 262 |
255 String get serviceName => ContentHandler.serviceName; | 263 String get serviceName => ContentHandler.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 _contentHandlerMethodStartApplicationName: | 277 case _contentHandlerMethodStartApplicationName: |
270 var params = _ContentHandlerStartApplicationParams.deserialize( | 278 var params = _ContentHandlerStartApplicationParams.deserialize( |
271 message.payload); | 279 message.payload); |
272 _impl.startApplication(params.application, params.response); | 280 _impl.startApplication(params.application, params.response); |
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 ContentHandler get impl => _impl; | 288 ContentHandler get impl => _impl; |
282 set impl(ContentHandler d) { | 289 set impl(ContentHandler 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 startApplication(application_mojom.ApplicationInterfaceRequest applicatio
n, url_response_mojom.UrlResponse response) { | 339 void startApplication(application_mojom.ApplicationInterfaceRequest applicatio
n, url_response_mojom.UrlResponse response) { |
333 return impl.startApplication(application, response); | 340 return impl.startApplication(application, response); |
334 } | 341 } |
335 } | 342 } |
336 | 343 |
337 | 344 |
338 | 345 |
OLD | NEW |