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_request_mojom; | 4 library http_request_mojom; |
5 import 'package:mojo/bindings.dart' as bindings; | 5 import 'package:mojo/bindings.dart' as bindings; |
6 import 'package:mojo/core.dart' as core; | 6 import 'package:mojo/core.dart' as core; |
7 | 7 |
8 | 8 |
9 | 9 |
10 | 10 |
11 class HttpRequest extends bindings.Struct { | 11 class HttpRequest extends bindings.Struct { |
12 static const List<bindings.StructDataHeader> kVersions = const [ | 12 static const List<bindings.StructDataHeader> kVersions = const [ |
13 const bindings.StructDataHeader(40, 0) | 13 const bindings.StructDataHeader(40, 0) |
14 ]; | 14 ]; |
15 String relativeUrl = null; | 15 String relativeUrl = null; |
16 String method = "GET"; | 16 String method = "GET"; |
17 Map<String, String> headers = null; | 17 Map<String, String> headers = null; |
18 core.MojoDataPipeConsumer body = null; | 18 core.MojoDataPipeConsumer body = null; |
19 | 19 |
20 HttpRequest() : super(kVersions.last.size); | 20 HttpRequest() : super(kVersions.last.size); |
21 | 21 |
| 22 HttpRequest.init( |
| 23 String this.relativeUrl, |
| 24 String this.method, |
| 25 Map<String, String> this.headers, |
| 26 core.MojoDataPipeConsumer this.body |
| 27 ) : super(kVersions.last.size); |
| 28 |
22 static HttpRequest deserialize(bindings.Message message) { | 29 static HttpRequest deserialize(bindings.Message message) { |
23 var decoder = new bindings.Decoder(message); | 30 var decoder = new bindings.Decoder(message); |
24 var result = decode(decoder); | 31 var result = decode(decoder); |
25 if (decoder.excessHandles != null) { | 32 if (decoder.excessHandles != null) { |
26 decoder.excessHandles.forEach((h) => h.close()); | 33 decoder.excessHandles.forEach((h) => h.close()); |
27 } | 34 } |
28 return result; | 35 return result; |
29 } | 36 } |
30 | 37 |
31 static HttpRequest decode(bindings.Decoder decoder0) { | 38 static HttpRequest decode(bindings.Decoder decoder0) { |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 } | 172 } |
166 | 173 |
167 Map toJson() { | 174 Map toJson() { |
168 throw new bindings.MojoCodecError( | 175 throw new bindings.MojoCodecError( |
169 'Object containing handles cannot be encoded to JSON.'); | 176 'Object containing handles cannot be encoded to JSON.'); |
170 } | 177 } |
171 } | 178 } |
172 | 179 |
173 | 180 |
174 | 181 |
OLD | NEW |