OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 library http_message_mojom; | 5 library http_message_mojom; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:mojo/bindings.dart' as bindings; | 9 import 'package:mojo/bindings.dart' as bindings; |
10 import 'package:mojo/core.dart' as core; | 10 import 'package:mojo/core.dart' as core; |
| 11 import 'package:mojo/mojo/bindings/types/mojom_types.mojom.dart' as mojom_types; |
| 12 |
11 import 'package:mojo/mojo/http_header.mojom.dart' as http_header_mojom; | 13 import 'package:mojo/mojo/http_header.mojom.dart' as http_header_mojom; |
12 | 14 |
13 | 15 |
14 | 16 |
15 class HttpRequest extends bindings.Struct { | 17 class HttpRequest extends bindings.Struct { |
16 static const List<bindings.StructDataHeader> kVersions = const [ | 18 static const List<bindings.StructDataHeader> kVersions = const [ |
17 const bindings.StructDataHeader(40, 0) | 19 const bindings.StructDataHeader(40, 0) |
18 ]; | 20 ]; |
19 String method = "GET"; | 21 String method = "GET"; |
20 String url = null; | 22 String url = null; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 "body: $body" ")"; | 116 "body: $body" ")"; |
115 } | 117 } |
116 | 118 |
117 Map toJson() { | 119 Map toJson() { |
118 throw new bindings.MojoCodecError( | 120 throw new bindings.MojoCodecError( |
119 'Object containing handles cannot be encoded to JSON.'); | 121 'Object containing handles cannot be encoded to JSON.'); |
120 } | 122 } |
121 } | 123 } |
122 | 124 |
123 | 125 |
| 126 |
| 127 |
124 class HttpResponse extends bindings.Struct { | 128 class HttpResponse extends bindings.Struct { |
125 static const List<bindings.StructDataHeader> kVersions = const [ | 129 static const List<bindings.StructDataHeader> kVersions = const [ |
126 const bindings.StructDataHeader(24, 0) | 130 const bindings.StructDataHeader(24, 0) |
127 ]; | 131 ]; |
128 int statusCode = 200; | 132 int statusCode = 200; |
129 core.MojoDataPipeConsumer body = null; | 133 core.MojoDataPipeConsumer body = null; |
130 List<http_header_mojom.HttpHeader> headers = null; | 134 List<http_header_mojom.HttpHeader> headers = null; |
131 | 135 |
132 HttpResponse() : super(kVersions.last.size); | 136 HttpResponse() : super(kVersions.last.size); |
133 | 137 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 "headers: $headers" ")"; | 219 "headers: $headers" ")"; |
216 } | 220 } |
217 | 221 |
218 Map toJson() { | 222 Map toJson() { |
219 throw new bindings.MojoCodecError( | 223 throw new bindings.MojoCodecError( |
220 'Object containing handles cannot be encoded to JSON.'); | 224 'Object containing handles cannot be encoded to JSON.'); |
221 } | 225 } |
222 } | 226 } |
223 | 227 |
224 | 228 |
| 229 |
| 230 |
| 231 |
| 232 |
OLD | NEW |