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

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

Issue 94093007: Add stack chain support to pkg/watcher and pkg/http. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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
Index: pkg/http/lib/src/multipart_file.dart
diff --git a/pkg/http/lib/src/multipart_file.dart b/pkg/http/lib/src/multipart_file.dart
index 19c03bf12ce2158ae40d2a8d7be2ac40dbf6edf2..d316e2acf4792f131c6c92be414bb68f654f3ae2 100644
--- a/pkg/http/lib/src/multipart_file.dart
+++ b/pkg/http/lib/src/multipart_file.dart
@@ -9,6 +9,7 @@ import 'dart:convert';
import 'dart:io';
import 'package:path/path.dart' as path;
+import 'package:stack_trace/stack_trace.dart';
import 'byte_stream.dart';
import 'utils.dart';
@@ -93,8 +94,8 @@ class MultipartFile {
{String filename, ContentType contentType}) {
if (filename == null) filename = path.basename(filePath);
var file = new File(filePath);
- return file.length().then((length) {
- var stream = new ByteStream(file.openRead());
+ return Chain.track(file.length()).then((length) {
+ var stream = new ByteStream(Chain.track(file.openRead()));
return new MultipartFile(field, stream, length,
filename: filename,
contentType: contentType);

Powered by Google App Engine
This is Rietveld 408576698