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_response_mojom; | 5 library http_response_mojom; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; |
8 | 9 |
9 import 'package:mojo/bindings.dart' as bindings; | 10 import 'package:mojo/bindings.dart' as bindings; |
10 import 'package:mojo/core.dart' as core; | 11 import 'package:mojo/core.dart' as core; |
| 12 import 'package:mojo/mojo/bindings/types/mojom_types.mojom.dart' as mojom_types; |
11 | 13 |
12 | 14 |
13 | 15 |
| 16 |
14 class HttpResponse extends bindings.Struct { | 17 class HttpResponse extends bindings.Struct { |
15 static const List<bindings.StructDataHeader> kVersions = const [ | 18 static const List<bindings.StructDataHeader> kVersions = const [ |
16 const bindings.StructDataHeader(40, 0) | 19 const bindings.StructDataHeader(40, 0) |
17 ]; | 20 ]; |
18 int statusCode = 200; | 21 int statusCode = 200; |
19 core.MojoDataPipeConsumer body = null; | 22 core.MojoDataPipeConsumer body = null; |
20 int contentLength = 0; | 23 int contentLength = 0; |
21 String contentType = "text/html; charset=utf-8"; | 24 String contentType = "text/html; charset=utf-8"; |
22 Map<String, String> customHeaders = null; | 25 Map<String, String> customHeaders = null; |
23 | 26 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 "contentLength: $contentLength" ", " | 159 "contentLength: $contentLength" ", " |
157 "contentType: $contentType" ", " | 160 "contentType: $contentType" ", " |
158 "customHeaders: $customHeaders" ")"; | 161 "customHeaders: $customHeaders" ")"; |
159 } | 162 } |
160 | 163 |
161 Map toJson() { | 164 Map toJson() { |
162 throw new bindings.MojoCodecError( | 165 throw new bindings.MojoCodecError( |
163 'Object containing handles cannot be encoded to JSON.'); | 166 'Object containing handles cannot be encoded to JSON.'); |
164 } | 167 } |
165 } | 168 } |
| 169 mojom_types.MojomStruct _http_response_HttpResponse__() { |
| 170 return new mojom_types.MojomStruct() |
| 171 ..declData = (new mojom_types.DeclarationData() |
| 172 ..shortName = 'HttpResponse' |
| 173 ..fullIdentifier = 'http_server.HttpResponse') |
| 174 ..fields = <mojom_types.StructField>[ |
| 175 new mojom_types.StructField() |
| 176 ..declData = (new mojom_types.DeclarationData()..shortName = 'StatusCode
') |
| 177 ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.ui
nt32), |
| 178 |
| 179 new mojom_types.StructField() |
| 180 ..declData = (new mojom_types.DeclarationData()..shortName = 'Body') |
| 181 ..type = (new mojom_types.Type() |
| 182 ..handleType = (new mojom_types.HandleType() |
| 183 ..kind = mojom_types.HandleTypeKind.dataPipeConsumer |
| 184 ..nullable = true)), |
| 185 |
| 186 new mojom_types.StructField() |
| 187 ..declData = (new mojom_types.DeclarationData()..shortName = 'ContentLen
gth') |
| 188 ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.in
t64), |
| 189 |
| 190 new mojom_types.StructField() |
| 191 ..declData = (new mojom_types.DeclarationData()..shortName = 'ContentTyp
e') |
| 192 ..type = (new mojom_types.Type() |
| 193 ..stringType = (new mojom_types.StringType()..nullable = false)), |
| 194 |
| 195 new mojom_types.StructField() |
| 196 ..declData = (new mojom_types.DeclarationData()..shortName = 'CustomHead
ers') |
| 197 ..type = (new mojom_types.Type()..mapType = (new mojom_types.MapType() |
| 198 ..nullable = true |
| 199 |
| 200 ..keyType = (new mojom_types.Type() |
| 201 ..stringType = (new mojom_types.StringType()..nullable = false)) |
| 202 ..valueType = (new mojom_types.Type() |
| 203 ..stringType = (new mojom_types.StringType()..nullable = false)))), |
| 204 ]; |
| 205 } |
166 | 206 |
167 | 207 |
| 208 |
| 209 |
| 210 |
| 211 |
| 212 |
| 213 |
| 214 Map<String, mojom_types.UserDefinedType> _initDescriptions() { |
| 215 var map = new HashMap<String, mojom_types.UserDefinedType>(); |
| 216 map["_http_response_HttpResponse__"] = |
| 217 new mojom_types.UserDefinedType() |
| 218 ..structType = _http_response_HttpResponse__(); |
| 219 |
| 220 return map; |
| 221 } |
| 222 |
| 223 var _MojomDesc; |
| 224 Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() { |
| 225 if (_MojomDesc == null) { |
| 226 _MojomDesc = _initDescriptions(); |
| 227 } |
| 228 return _MojomDesc; |
| 229 } |
| 230 |
OLD | NEW |