Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Unified Diff: sdk/lib/io/http_body_impl.dart

Issue 13950015: Fix bugs in HttpBody detected by the analyzer (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/io/http_body.dart ('k') | tests/standalone/io/http_body_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/http_body_impl.dart
diff --git a/sdk/lib/io/http_body_impl.dart b/sdk/lib/io/http_body_impl.dart
index 214daa3240767f17ef874206c1f572ec765507ca..095b74e7048799b86c14d6e39d8fe32d35018a35 100644
--- a/sdk/lib/io/http_body_impl.dart
+++ b/sdk/lib/io/http_body_impl.dart
@@ -12,11 +12,7 @@ class _HttpBodyHandlerTransformer
}
}
-class _HttpBodyHandler implements HttpBodyHandler {
- Stream<HttpRequestBody> bind(Stream<HttpRequest> stream) {
- return new _HttpBodyHandlerTransformer().bind(stream);
- }
-
+class _HttpBodyHandler {
static Future<HttpRequestBody> processRequest(HttpRequest request) {
return process(request, request.headers)
.then((body) => new _HttpRequestBody(request, body),
@@ -110,13 +106,15 @@ class _HttpRequestBody extends _HttpBody implements HttpRequestBody {
class _HttpClientResponseBody
extends _HttpBody implements HttpClientResponseBody {
- final int statusCode;
- final String reasonPhrase;
- final HttpHeaders headers;
+ final HttpClientResponse response;
_HttpClientResponseBody(HttpClientResponse response, HttpBody body)
: super(body.mimeType, body.type, body.body),
- statusCode = response.statusCode,
- reasonPhrase = response.reasonPhrase,
- headers = response.headers;
+ this.response = response;
+
+ int get statusCode => response.statusCode;
+
+ String get reasonPhrase => response.reasonPhrase;
+
+ HttpHeaders get headers => response.headers;
}
« no previous file with comments | « sdk/lib/io/http_body.dart ('k') | tests/standalone/io/http_body_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698