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

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

Issue 261763002: Rip out the last dart:io dependency from pkg/http. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 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 | « pkg/http/lib/browser_client.dart ('k') | pkg/http/lib/src/client.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/lib/src/byte_stream.dart
diff --git a/pkg/http/lib/src/byte_stream.dart b/pkg/http/lib/src/byte_stream.dart
index d4e7f70b57e559356d4e022e3fdda2d3ad8400dc..f3546c73e9920d2667815d14e1b2e7880a31e579 100644
--- a/pkg/http/lib/src/byte_stream.dart
+++ b/pkg/http/lib/src/byte_stream.dart
@@ -23,7 +23,8 @@ class ByteStream extends StreamView<List<int>> {
/// Collects the data of this stream in a [Uint8List].
Future<Uint8List> toBytes() {
var completer = new Completer();
- var sink = new ByteConversionSink.withCallback(completer.complete);
+ var sink = new ByteConversionSink.withCallback((bytes) =>
+ completer.complete(new Uint8List.fromList(bytes)));
listen(sink.add, onError: completer.completeError, onDone: sink.close,
cancelOnError: true);
return completer.future;
« no previous file with comments | « pkg/http/lib/browser_client.dart ('k') | pkg/http/lib/src/client.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698