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

Unified Diff: net/base/file_stream.h

Issue 11030044: Merge 159454 - Flush at the end of local file writing in FileWriter API. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1271/src/
Patch Set: Created 8 years, 2 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 | « content/browser/download/base_file.cc ('k') | net/base/file_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/file_stream.h
===================================================================
--- net/base/file_stream.h (revision 160294)
+++ net/base/file_stream.h (working copy)
@@ -197,11 +197,32 @@
// not have to be called, it just forces one to happen at the time of
// calling.
//
- /// Returns an error code if the operation could not be performed.
+ // The file must be opened with PLATFORM_FILE_ASYNC, and a non-null
+ // callback must be passed to this method. If the write could not
+ // complete synchronously, then ERR_IO_PENDING is returned, and the
+ // callback will be run on the thread where Flush() was called when
+ // the write has completed.
//
+ // It is valid to destroy or close the file stream while there is an
+ // asynchronous flush in progress. That will cancel the flush and allow
+ // the buffer to be freed.
+ //
+ // It is invalid to request any asynchronous operations while there is an
+ // in-flight asynchronous operation.
+ //
// This method should not be called if the stream was opened READ_ONLY.
- virtual int Flush();
+ virtual int Flush(const CompletionCallback& callback);
+ // Forces out a filesystem sync on this file to make sure that the file was
+ // written out to disk and is not currently sitting in the buffer. This does
+ // not have to be called, it just forces one to happen at the time of
+ // calling.
+ //
+ // Returns an error code if the operation could not be performed.
+ //
+ // This method should not be called if the stream was opened READ_ONLY.
+ virtual int FlushSync();
+
// Turns on UMA error statistics gathering.
void EnableErrorStatistics();
« no previous file with comments | « content/browser/download/base_file.cc ('k') | net/base/file_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698