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_request_mojom; | 5 library http_request_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/mojom_types.mojom.dart' as mojom_types; |
11 | 12 |
12 | 13 |
13 | 14 |
| 15 |
14 class HttpRequest extends bindings.Struct { | 16 class HttpRequest extends bindings.Struct { |
15 static const List<bindings.StructDataHeader> kVersions = const [ | 17 static const List<bindings.StructDataHeader> kVersions = const [ |
16 const bindings.StructDataHeader(40, 0) | 18 const bindings.StructDataHeader(40, 0) |
17 ]; | 19 ]; |
18 String relativeUrl = null; | 20 String relativeUrl = null; |
19 String method = "GET"; | 21 String method = "GET"; |
20 Map<String, String> headers = null; | 22 Map<String, String> headers = null; |
21 core.MojoDataPipeConsumer body = null; | 23 core.MojoDataPipeConsumer body = null; |
22 | 24 |
23 HttpRequest() : super(kVersions.last.size); | 25 HttpRequest() : super(kVersions.last.size); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 "headers: $headers" ", " | 151 "headers: $headers" ", " |
150 "body: $body" ")"; | 152 "body: $body" ")"; |
151 } | 153 } |
152 | 154 |
153 Map toJson() { | 155 Map toJson() { |
154 throw new bindings.MojoCodecError( | 156 throw new bindings.MojoCodecError( |
155 'Object containing handles cannot be encoded to JSON.'); | 157 'Object containing handles cannot be encoded to JSON.'); |
156 } | 158 } |
157 } | 159 } |
158 | 160 |
| 161 mojom_types.MojomStruct _http_request_HttpRequest__() { |
| 162 return new mojom_types.MojomStruct() |
| 163 ..declData = (new mojom_types.DeclarationData()..shortName = 'HttpRequest') |
| 164 ..fields = <mojom_types.StructField>[ |
| 165 new mojom_types.StructField() |
| 166 ..declData = (new mojom_types.DeclarationData()..shortName = 'RelativeUr
l') |
| 167 ..type = (new mojom_types.Type() |
| 168 ..stringType = (new mojom_types.StringType()..nullable = false)), |
| 169 |
| 170 new mojom_types.StructField() |
| 171 ..declData = (new mojom_types.DeclarationData()..shortName = 'Method') |
| 172 ..type = (new mojom_types.Type() |
| 173 ..stringType = (new mojom_types.StringType()..nullable = false)), |
| 174 |
| 175 new mojom_types.StructField() |
| 176 ..declData = (new mojom_types.DeclarationData()..shortName = 'Headers') |
| 177 ..type = (new mojom_types.Type()..mapType = (new mojom_types.MapType() |
| 178 ..nullable = true |
| 179 |
| 180 ..keyType = (new mojom_types.Type() |
| 181 ..stringType = (new mojom_types.StringType()..nullable = false)) |
| 182 ..valueType = (new mojom_types.Type() |
| 183 ..stringType = (new mojom_types.StringType()..nullable = false)))), |
| 184 |
| 185 new mojom_types.StructField() |
| 186 ..declData = (new mojom_types.DeclarationData()..shortName = 'Body') |
| 187 ..type = (new mojom_types.Type() |
| 188 ..handleType = (new mojom_types.HandleType() |
| 189 ..kind = mojom_types.HandleTypeKind.DATA_PIPE_CONSUMER |
| 190 ..nullable = true)), |
| 191 ]; |
| 192 } |
159 | 193 |
| 194 |
| 195 |
| 196 |
| 197 |
| 198 |
| 199 |
| 200 |
| 201 |
| 202 var _MojomDesc__ = _initDescriptions(); |
| 203 |
| 204 Map<String, mojom_types.UserDefinedType> _initDescriptions() { |
| 205 var map = new Map<String, mojom_types.UserDefinedType>(); |
| 206 |
| 207 map["_http_request_HttpRequest__"] = |
| 208 new mojom_types.UserDefinedType() |
| 209 ..structType = _http_request_HttpRequest__(); |
| 210 |
| 211 |
| 212 |
| 213 |
| 214 |
| 215 |
| 216 |
| 217 |
| 218 |
| 219 |
| 220 return map; |
| 221 } |
| 222 |
| 223 Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() { |
| 224 return _MojomDesc__; |
| 225 } |
| 226 |
| 227 |
OLD | NEW |