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

Unified Diff: net/base/file_stream_context.cc

Issue 23500006: URLFetcher won't call delegate until file is closed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 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
Index: net/base/file_stream_context.cc
diff --git a/net/base/file_stream_context.cc b/net/base/file_stream_context.cc
index abc058a9ca8dfa1f8c41536edb5e84ce2e017129..0d4f8d9b696a8139b255a38f53691cf39f0f11df 100644
--- a/net/base/file_stream_context.cc
+++ b/net/base/file_stream_context.cc
@@ -105,6 +105,21 @@ void FileStream::Context::CloseSync() {
}
}
+void FileStream::Context::CloseAsync(const CompletionCallback& callback) {
+ DCHECK(!async_in_progress_);
+ const bool posted = base::PostTaskAndReplyWithResult(
+ task_runner_.get(),
+ FROM_HERE,
+ base::Bind(&Context::CloseFileImpl, base::Unretained(this)),
+ base::Bind(&Context::ProcessAsyncResult,
+ base::Unretained(this),
+ IntToInt64(callback),
+ FILE_ERROR_SOURCE_CLOSE));
+ DCHECK(posted);
+
+ async_in_progress_ = true;
+}
+
void FileStream::Context::SeekAsync(Whence whence,
int64 offset,
const Int64CompletionCallback& callback) {

Powered by Google App Engine
This is Rietveld 408576698