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

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

Issue 14051005: Remove deprecated CollectionSink and Stream.pipeInto. (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 | « no previous file | sdk/lib/async/async_sources.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/lib/src/multipart_request.dart
diff --git a/pkg/http/lib/src/multipart_request.dart b/pkg/http/lib/src/multipart_request.dart
index bc588713cf61d0bd2c4b4654e675bb5da6bbb583..bebc552fd3bfdf165b23b94cc9a9856e3b67a0d7 100644
--- a/pkg/http/lib/src/multipart_request.dart
+++ b/pkg/http/lib/src/multipart_request.dart
@@ -52,7 +52,7 @@ class MultipartRequest extends BaseRequest {
encodeUtf8(value).length + "\r\n".length;
});
- for (var file in _files.collection) {
+ for (var file in _files) {
length += "--".length + _BOUNDARY_LENGTH + "\r\n".length +
_headerForFile(file).length +
file.length + "\r\n".length;
@@ -73,17 +73,16 @@ class MultipartRequest extends BaseRequest {
///
/// This doesn't need to be closed. When the request is sent, whichever files
/// are written to this sink at that point will be used.
- CollectionSink<MultipartFile> get files => _files;
+ List<MultipartFile> get files => _files;
- /// The private version of [files], typed so that the underlying collection is
- /// accessible.
- final CollectionSink<MultipartFile> _files;
+ /// The private version of [files].
+ final List<MultipartFile> _files;
/// Creates a new [MultipartRequest].
MultipartRequest(String method, Uri url)
: super(method, url),
fields = {},
- _files = new CollectionSink<MultipartFile>(<MultipartFile>[]);
+ _files = <MultipartFile>[];
/// Freezes all mutable fields and returns a single-subscription [ByteStream]
/// that will emit the request body.
@@ -111,7 +110,7 @@ class MultipartRequest extends BaseRequest {
writeLine();
});
- Future.forEach(_files.collection, (file) {
+ Future.forEach(_files, (file) {
writeAscii('--$boundary\r\n');
writeAscii(_headerForFile(file));
return writeStreamToSink(file.finalize(), controller)
« no previous file with comments | « no previous file | sdk/lib/async/async_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698