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

Unified Diff: net/base/file_stream_context.h

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: Add comment about ownership and "would be nice to check FLAG_OVERLAPPED". Created 5 years, 7 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.h
diff --git a/net/base/file_stream_context.h b/net/base/file_stream_context.h
index 74677fe8fb9edfdb86fd861121d451e6a5000e9f..a7f26f1b55722c47667bd06fdf4d0a06231b5dca 100644
--- a/net/base/file_stream_context.h
+++ b/net/base/file_stream_context.h
@@ -74,7 +74,6 @@ class FileStream::Context {
int buf_len,
const CompletionCallback& callback);
- const base::File& file() const { return file_; }
bool async_in_progress() const { return async_in_progress_; }
////////////////////////////////////////////////////////////////////////////
@@ -92,12 +91,13 @@ class FileStream::Context {
void Close(const CompletionCallback& callback);
- void Seek(base::File::Whence whence,
- int64 offset,
- const Int64CompletionCallback& callback);
+ // Seeks |offset| bytes from the start of the file.
+ void Seek(int64 offset, const Int64CompletionCallback& callback);
void Flush(const CompletionCallback& callback);
+ bool IsOpen() const;
+
private:
struct IOResult {
IOResult();
@@ -149,7 +149,7 @@ class FileStream::Context {
////////////////////////////////////////////////////////////////////////////
// Adjusts the position from where the data is read.
- IOResult SeekFileImpl(base::File::Whence whence, int64 offset);
+ IOResult SeekFileImpl(int64 offset);
void OnFileOpened();

Powered by Google App Engine
This is Rietveld 408576698