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

Unified Diff: webkit/fileapi/local_file_stream_writer.h

Issue 10986045: Flush at the end of local file writing in FileWriter API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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: webkit/fileapi/local_file_stream_writer.h
diff --git a/webkit/fileapi/local_file_stream_writer.h b/webkit/fileapi/local_file_stream_writer.h
index 8962bd21b3e2092c0911a8cfcd4abbeaf83485e5..41b9f88f47eda9f5da14513e349308f1c79abbf8 100644
--- a/webkit/fileapi/local_file_stream_writer.h
+++ b/webkit/fileapi/local_file_stream_writer.h
@@ -30,10 +30,11 @@ class FILEAPI_EXPORT_PRIVATE LocalFileStreamWriter : public FileStreamWriter {
LocalFileStreamWriter(const FilePath& file_path, int64 initial_offset);
virtual ~LocalFileStreamWriter();
- // FileStreamWriteroverrides.
+ // FileStreamWriter overrides.
virtual int Write(net::IOBuffer* buf, int buf_len,
const net::CompletionCallback& callback) OVERRIDE;
virtual int Cancel(const net::CompletionCallback& callback) OVERRIDE;
+ virtual int Flush(const net::CompletionCallback& callback) OVERRIDE;
private:
// Opens |file_path_| and if it succeeds, proceeds to InitiateSeek().
@@ -61,6 +62,10 @@ class FILEAPI_EXPORT_PRIVATE LocalFileStreamWriter : public FileStreamWriter {
const net::CompletionCallback& callback);
void DidWrite(const net::CompletionCallback& callback, int result);
+ // Flushes asynchronously to the file.
+ int InitiateFlush(const net::CompletionCallback& callback);
+ void DidFlush(const net::CompletionCallback& callback, int result);
+
// Stops the in-flight operation and calls |cancel_callback_| if it has been
// set by Cancel() for the current operation.
bool CancelIfRequested();

Powered by Google App Engine
This is Rietveld 408576698