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

Unified Diff: pkg/http/lib/src/request.dart

Issue 11825010: Update pkg/http to use the new async APIs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 7 years, 11 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 | « pkg/http/lib/src/multipart_request.dart ('k') | pkg/http/lib/src/response.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/lib/src/request.dart
diff --git a/pkg/http/lib/src/request.dart b/pkg/http/lib/src/request.dart
index 574070a3103e6338b722ec19975a12f77528383a..670bc4837228ec756b1caf6ae70ac963d80003b3 100644
--- a/pkg/http/lib/src/request.dart
+++ b/pkg/http/lib/src/request.dart
@@ -4,11 +4,13 @@
library request;
+import 'dart:async';
import 'dart:io';
import 'dart:scalarlist';
import 'dart:uri';
import 'base_request.dart';
+import 'byte_stream.dart';
import 'utils.dart';
/// An HTTP request where the entire request body is known in advance.
@@ -131,15 +133,11 @@ class Request extends BaseRequest {
_defaultEncoding = Encoding.UTF_8,
_bodyBytes = new Uint8List(0);
- /// Freeze all mutable fields and return an [InputStream] containing the
- /// request body.
- InputStream finalize() {
+ /// Freezes all mutable fields and returns a single-subscription [ByteStream]
+ /// containing the request body.
+ ByteStream finalize() {
super.finalize();
-
- var stream = new ListInputStream();
- stream.write(bodyBytes);
- stream.markEndOfStream();
- return stream;
+ return new ByteStream.fromBytes(bodyBytes);
}
/// The `Content-Type` header of the request (if it exists) as a
« no previous file with comments | « pkg/http/lib/src/multipart_request.dart ('k') | pkg/http/lib/src/response.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698