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 sharing_mojom; | 4 library sharing_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 | 9 |
10 | 10 |
11 | 11 |
12 class _SharingServiceShareTextParams extends bindings.Struct { | 12 class _SharingServiceShareTextParams extends bindings.Struct { |
13 static const List<bindings.StructDataHeader> kVersions = const [ | 13 static const List<bindings.StructDataHeader> kVersions = const [ |
14 const bindings.StructDataHeader(16, 0) | 14 const bindings.StructDataHeader(16, 0) |
15 ]; | 15 ]; |
16 String text = null; | 16 String text = null; |
17 | 17 |
18 _SharingServiceShareTextParams() : super(kVersions.last.size); | 18 _SharingServiceShareTextParams() : super(kVersions.last.size); |
19 | 19 |
| 20 _SharingServiceShareTextParams.init( |
| 21 String this.text |
| 22 ) : super(kVersions.last.size); |
| 23 |
20 static _SharingServiceShareTextParams deserialize(bindings.Message message) { | 24 static _SharingServiceShareTextParams deserialize(bindings.Message message) { |
21 var decoder = new bindings.Decoder(message); | 25 var decoder = new bindings.Decoder(message); |
22 var result = decode(decoder); | 26 var result = decode(decoder); |
23 if (decoder.excessHandles != null) { | 27 if (decoder.excessHandles != null) { |
24 decoder.excessHandles.forEach((h) => h.close()); | 28 decoder.excessHandles.forEach((h) => h.close()); |
25 } | 29 } |
26 return result; | 30 return result; |
27 } | 31 } |
28 | 32 |
29 static _SharingServiceShareTextParams decode(bindings.Decoder decoder0) { | 33 static _SharingServiceShareTextParams decode(bindings.Decoder decoder0) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 Map toJson() { | 80 Map toJson() { |
77 Map map = new Map(); | 81 Map map = new Map(); |
78 map["text"] = text; | 82 map["text"] = text; |
79 return map; | 83 return map; |
80 } | 84 } |
81 } | 85 } |
82 | 86 |
83 const int _sharingServiceMethodShareTextName = 0; | 87 const int _sharingServiceMethodShareTextName = 0; |
84 | 88 |
85 class _SharingServiceServiceDescription implements service_describer.ServiceDesc
ription { | 89 class _SharingServiceServiceDescription implements service_describer.ServiceDesc
ription { |
86 dynamic getTopLevelInterface([Function responseFactory]) => | 90 void getTopLevelInterface(Function responder) { |
87 responseFactory(null); | 91 responder(null); |
| 92 } |
88 | 93 |
89 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 94 void getTypeDefinition(String typeKey, Function responder) { |
90 responseFactory(null); | 95 responder(null); |
| 96 } |
91 | 97 |
92 dynamic getAllTypeDefinitions([Function responseFactory]) => | 98 void getAllTypeDefinitions(Function responder) { |
93 responseFactory(null); | 99 responder(null); |
| 100 } |
94 } | 101 } |
95 | 102 |
96 abstract class SharingService { | 103 abstract class SharingService { |
97 static const String serviceName = "mojo::SharingService"; | 104 static const String serviceName = "mojo::SharingService"; |
98 | 105 |
99 static service_describer.ServiceDescription _cachedServiceDescription; | 106 static service_describer.ServiceDescription _cachedServiceDescription; |
100 static service_describer.ServiceDescription get serviceDescription { | 107 static service_describer.ServiceDescription get serviceDescription { |
101 if (_cachedServiceDescription == null) { | 108 if (_cachedServiceDescription == null) { |
102 _cachedServiceDescription = new _SharingServiceServiceDescription(); | 109 _cachedServiceDescription = new _SharingServiceServiceDescription(); |
103 } | 110 } |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 : super.fromHandle(handle, autoBegin: impl != null) { | 240 : super.fromHandle(handle, autoBegin: impl != null) { |
234 _impl = impl; | 241 _impl = impl; |
235 } | 242 } |
236 | 243 |
237 _SharingServiceStubControl.unbound([this._impl]) : super.unbound(); | 244 _SharingServiceStubControl.unbound([this._impl]) : super.unbound(); |
238 | 245 |
239 String get serviceName => SharingService.serviceName; | 246 String get serviceName => SharingService.serviceName; |
240 | 247 |
241 | 248 |
242 | 249 |
243 dynamic handleMessage(bindings.ServiceMessage message) { | 250 void handleMessage(bindings.ServiceMessage message) { |
244 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 251 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
245 return bindings.ControlMessageHandler.handleMessage(this, | 252 bindings.ControlMessageHandler.handleMessage( |
246 0, | 253 this, 0, message); |
247 message); | 254 return; |
248 } | 255 } |
249 if (_impl == null) { | 256 if (_impl == null) { |
250 throw new core.MojoApiError("$this has no implementation set"); | 257 throw new core.MojoApiError("$this has no implementation set"); |
251 } | 258 } |
252 switch (message.header.type) { | 259 switch (message.header.type) { |
253 case _sharingServiceMethodShareTextName: | 260 case _sharingServiceMethodShareTextName: |
254 var params = _SharingServiceShareTextParams.deserialize( | 261 var params = _SharingServiceShareTextParams.deserialize( |
255 message.payload); | 262 message.payload); |
256 _impl.shareText(params.text); | 263 _impl.shareText(params.text); |
257 break; | 264 break; |
258 default: | 265 default: |
259 throw new bindings.MojoCodecError("Unexpected message name"); | 266 throw new bindings.MojoCodecError("Unexpected message name"); |
260 break; | 267 break; |
261 } | 268 } |
262 return null; | |
263 } | 269 } |
264 | 270 |
265 SharingService get impl => _impl; | 271 SharingService get impl => _impl; |
266 set impl(SharingService d) { | 272 set impl(SharingService d) { |
267 if (d == null) { | 273 if (d == null) { |
268 throw new core.MojoApiError("$this: Cannot set a null implementation"); | 274 throw new core.MojoApiError("$this: Cannot set a null implementation"); |
269 } | 275 } |
270 if (isBound && (_impl == null)) { | 276 if (isBound && (_impl == null)) { |
271 beginHandlingEvents(); | 277 beginHandlingEvents(); |
272 } | 278 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 } | 319 } |
314 | 320 |
315 | 321 |
316 void shareText(String text) { | 322 void shareText(String text) { |
317 return impl.shareText(text); | 323 return impl.shareText(text); |
318 } | 324 } |
319 } | 325 } |
320 | 326 |
321 | 327 |
322 | 328 |
OLD | NEW |