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_message_mojom; | 4 library http_message_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 import 'package:mojo/mojo/http_header.mojom.dart' as http_header_mojom; | 8 import 'package:mojo/mojo/http_header.mojom.dart' as http_header_mojom; |
9 | 9 |
10 | 10 |
11 | 11 |
12 class HttpRequest extends bindings.Struct { | 12 class HttpRequest extends bindings.Struct { |
13 static const List<bindings.StructDataHeader> kVersions = const [ | 13 static const List<bindings.StructDataHeader> kVersions = const [ |
14 const bindings.StructDataHeader(40, 0) | 14 const bindings.StructDataHeader(40, 0) |
15 ]; | 15 ]; |
16 String method = "GET"; | 16 String method = "GET"; |
17 String url = null; | 17 String url = null; |
18 List<http_header_mojom.HttpHeader> headers = null; | 18 List<http_header_mojom.HttpHeader> headers = null; |
19 core.MojoDataPipeConsumer body = null; | 19 core.MojoDataPipeConsumer body = null; |
20 | 20 |
21 HttpRequest() : super(kVersions.last.size); | 21 HttpRequest() : super(kVersions.last.size); |
22 | 22 |
| 23 HttpRequest.init( |
| 24 String this.method, |
| 25 String this.url, |
| 26 List<http_header_mojom.HttpHeader> this.headers, |
| 27 core.MojoDataPipeConsumer this.body |
| 28 ) : super(kVersions.last.size); |
| 29 |
23 static HttpRequest deserialize(bindings.Message message) { | 30 static HttpRequest deserialize(bindings.Message message) { |
24 var decoder = new bindings.Decoder(message); | 31 var decoder = new bindings.Decoder(message); |
25 var result = decode(decoder); | 32 var result = decode(decoder); |
26 if (decoder.excessHandles != null) { | 33 if (decoder.excessHandles != null) { |
27 decoder.excessHandles.forEach((h) => h.close()); | 34 decoder.excessHandles.forEach((h) => h.close()); |
28 } | 35 } |
29 return result; | 36 return result; |
30 } | 37 } |
31 | 38 |
32 static HttpRequest decode(bindings.Decoder decoder0) { | 39 static HttpRequest decode(bindings.Decoder decoder0) { |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 class HttpResponse extends bindings.Struct { | 147 class HttpResponse extends bindings.Struct { |
141 static const List<bindings.StructDataHeader> kVersions = const [ | 148 static const List<bindings.StructDataHeader> kVersions = const [ |
142 const bindings.StructDataHeader(24, 0) | 149 const bindings.StructDataHeader(24, 0) |
143 ]; | 150 ]; |
144 int statusCode = 200; | 151 int statusCode = 200; |
145 core.MojoDataPipeConsumer body = null; | 152 core.MojoDataPipeConsumer body = null; |
146 List<http_header_mojom.HttpHeader> headers = null; | 153 List<http_header_mojom.HttpHeader> headers = null; |
147 | 154 |
148 HttpResponse() : super(kVersions.last.size); | 155 HttpResponse() : super(kVersions.last.size); |
149 | 156 |
| 157 HttpResponse.init( |
| 158 int this.statusCode, |
| 159 core.MojoDataPipeConsumer this.body, |
| 160 List<http_header_mojom.HttpHeader> this.headers |
| 161 ) : super(kVersions.last.size); |
| 162 |
150 static HttpResponse deserialize(bindings.Message message) { | 163 static HttpResponse deserialize(bindings.Message message) { |
151 var decoder = new bindings.Decoder(message); | 164 var decoder = new bindings.Decoder(message); |
152 var result = decode(decoder); | 165 var result = decode(decoder); |
153 if (decoder.excessHandles != null) { | 166 if (decoder.excessHandles != null) { |
154 decoder.excessHandles.forEach((h) => h.close()); | 167 decoder.excessHandles.forEach((h) => h.close()); |
155 } | 168 } |
156 return result; | 169 return result; |
157 } | 170 } |
158 | 171 |
159 static HttpResponse decode(bindings.Decoder decoder0) { | 172 static HttpResponse decode(bindings.Decoder decoder0) { |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 } | 259 } |
247 | 260 |
248 Map toJson() { | 261 Map toJson() { |
249 throw new bindings.MojoCodecError( | 262 throw new bindings.MojoCodecError( |
250 'Object containing handles cannot be encoded to JSON.'); | 263 'Object containing handles cannot be encoded to JSON.'); |
251 } | 264 } |
252 } | 265 } |
253 | 266 |
254 | 267 |
255 | 268 |
OLD | NEW |