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 import 'package:mojo/bindings.dart' as bindings; | 6 import 'package:mojo/bindings.dart' as bindings; |
7 import 'package:mojo/core.dart' as core; | 7 import 'package:mojo/core.dart' as core; |
8 | 8 |
9 import 'package:mojo/mojo/http_header.mojom.dart' as http_header_mojom; | 9 import 'package:mojo/mojo/http_header.mojom.dart' as http_header_mojom; |
10 | 10 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 "body: $body" ")"; | 131 "body: $body" ")"; |
132 } | 132 } |
133 | 133 |
134 Map toJson() { | 134 Map toJson() { |
135 throw new bindings.MojoCodecError( | 135 throw new bindings.MojoCodecError( |
136 'Object containing handles cannot be encoded to JSON.'); | 136 'Object containing handles cannot be encoded to JSON.'); |
137 } | 137 } |
138 } | 138 } |
139 | 139 |
140 | 140 |
141 | |
142 | |
143 class HttpResponse extends bindings.Struct { | 141 class HttpResponse extends bindings.Struct { |
144 static const List<bindings.StructDataHeader> kVersions = const [ | 142 static const List<bindings.StructDataHeader> kVersions = const [ |
145 const bindings.StructDataHeader(24, 0) | 143 const bindings.StructDataHeader(24, 0) |
146 ]; | 144 ]; |
147 int statusCode = 200; | 145 int statusCode = 200; |
148 core.MojoDataPipeConsumer body = null; | 146 core.MojoDataPipeConsumer body = null; |
149 List<http_header_mojom.HttpHeader> headers = null; | 147 List<http_header_mojom.HttpHeader> headers = null; |
150 | 148 |
151 HttpResponse() : super(kVersions.last.size); | 149 HttpResponse() : super(kVersions.last.size); |
152 | 150 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 } | 247 } |
250 | 248 |
251 Map toJson() { | 249 Map toJson() { |
252 throw new bindings.MojoCodecError( | 250 throw new bindings.MojoCodecError( |
253 'Object containing handles cannot be encoded to JSON.'); | 251 'Object containing handles cannot be encoded to JSON.'); |
254 } | 252 } |
255 } | 253 } |
256 | 254 |
257 | 255 |
258 | 256 |
259 | |
260 | |
261 | |
OLD | NEW |