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_response_mojom; | 4 library http_response_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 HttpResponse extends bindings.Struct { | 11 class HttpResponse 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 int statusCode = 200; | 15 int statusCode = 200; |
16 core.MojoDataPipeConsumer body = null; | 16 core.MojoDataPipeConsumer body = null; |
17 int contentLength = 0; | 17 int contentLength = 0; |
18 String contentType = "text/html; charset=utf-8"; | 18 String contentType = "text/html; charset=utf-8"; |
19 Map<String, String> customHeaders = null; | 19 Map<String, String> customHeaders = null; |
20 | 20 |
21 HttpResponse() : super(kVersions.last.size); | 21 HttpResponse() : super(kVersions.last.size); |
22 | 22 |
| 23 HttpResponse.init( |
| 24 int this.statusCode, |
| 25 core.MojoDataPipeConsumer this.body, |
| 26 int this.contentLength, |
| 27 String this.contentType, |
| 28 Map<String, String> this.customHeaders |
| 29 ) : super(kVersions.last.size); |
| 30 |
23 static HttpResponse deserialize(bindings.Message message) { | 31 static HttpResponse deserialize(bindings.Message message) { |
24 var decoder = new bindings.Decoder(message); | 32 var decoder = new bindings.Decoder(message); |
25 var result = decode(decoder); | 33 var result = decode(decoder); |
26 if (decoder.excessHandles != null) { | 34 if (decoder.excessHandles != null) { |
27 decoder.excessHandles.forEach((h) => h.close()); | 35 decoder.excessHandles.forEach((h) => h.close()); |
28 } | 36 } |
29 return result; | 37 return result; |
30 } | 38 } |
31 | 39 |
32 static HttpResponse decode(bindings.Decoder decoder0) { | 40 static HttpResponse decode(bindings.Decoder decoder0) { |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 } | 186 } |
179 | 187 |
180 Map toJson() { | 188 Map toJson() { |
181 throw new bindings.MojoCodecError( | 189 throw new bindings.MojoCodecError( |
182 'Object containing handles cannot be encoded to JSON.'); | 190 'Object containing handles cannot be encoded to JSON.'); |
183 } | 191 } |
184 } | 192 } |
185 | 193 |
186 | 194 |
187 | 195 |
OLD | NEW |