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

Unified Diff: net/base/file_stream_context.cc

Issue 1148383003: Only support seeking file streams from the beginning of the file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Win DBG build by Pass()-ing file out of CreateForAsyncHandle. Created 5 years, 6 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 | « net/base/file_stream_context.h ('k') | net/base/file_stream_context_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/file_stream_context.cc
diff --git a/net/base/file_stream_context.cc b/net/base/file_stream_context.cc
index 888aec82917dfbc5b26c4fff8f5cfb2e7896b0ac..3ddf4bbf508ea596c6be81c0eb6b4e70a807149f 100644
--- a/net/base/file_stream_context.cc
+++ b/net/base/file_stream_context.cc
@@ -114,19 +114,14 @@ void FileStream::Context::Close(const CompletionCallback& callback) {
async_in_progress_ = true;
}
-void FileStream::Context::Seek(base::File::Whence whence,
- int64_t offset,
+void FileStream::Context::Seek(int64_t offset,
const Int64CompletionCallback& callback) {
DCHECK(!async_in_progress_);
bool posted = base::PostTaskAndReplyWithResult(
- task_runner_.get(),
- FROM_HERE,
- base::Bind(
- &Context::SeekFileImpl, base::Unretained(this), whence, offset),
- base::Bind(&Context::OnAsyncCompleted,
- base::Unretained(this),
- callback));
+ task_runner_.get(), FROM_HERE,
+ base::Bind(&Context::SeekFileImpl, base::Unretained(this), offset),
+ base::Bind(&Context::OnAsyncCompleted, base::Unretained(this), callback));
DCHECK(posted);
async_in_progress_ = true;
@@ -147,6 +142,10 @@ void FileStream::Context::Flush(const CompletionCallback& callback) {
async_in_progress_ = true;
}
+bool FileStream::Context::IsOpen() const {
+ return file_.IsValid();
+}
+
FileStream::Context::OpenResult FileStream::Context::OpenFileImpl(
const base::FilePath& path, int open_flags) {
#if defined(OS_POSIX)
« no previous file with comments | « net/base/file_stream_context.h ('k') | net/base/file_stream_context_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698