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

Side by Side Diff: storage/browser/fileapi/file_stream_writer.h

Issue 502973005: [fsp] Buffer consecutive Write() calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments. Created 6 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 unified diff | Download patch
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef STORAGE_BROWSER_FILEAPI_FILE_STREAM_WRITER_H_ 5 #ifndef STORAGE_BROWSER_FILEAPI_FILE_STREAM_WRITER_H_
6 #define STORAGE_BROWSER_FILEAPI_FILE_STREAM_WRITER_H_ 6 #define STORAGE_BROWSER_FILEAPI_FILE_STREAM_WRITER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "net/base/completion_callback.h" 9 #include "net/base/completion_callback.h"
10 #include "storage/browser/storage_browser_export.h" 10 #include "storage/browser/storage_browser_export.h"
(...skipping 28 matching lines...) Expand all
39 39
40 // Writes to the current cursor position asynchronously. 40 // Writes to the current cursor position asynchronously.
41 // 41 //
42 // Up to buf_len bytes will be written. (In other words, partial 42 // Up to buf_len bytes will be written. (In other words, partial
43 // writes are allowed.) If the write completed synchronously, it returns 43 // writes are allowed.) If the write completed synchronously, it returns
44 // the number of bytes written. If the operation could not be performed, it 44 // the number of bytes written. If the operation could not be performed, it
45 // returns an error code. Otherwise, net::ERR_IO_PENDING is returned, and the 45 // returns an error code. Otherwise, net::ERR_IO_PENDING is returned, and the
46 // callback will be run on the thread where Write() was called when the write 46 // callback will be run on the thread where Write() was called when the write
47 // has completed. 47 // has completed.
48 // 48 //
49 // After the last write, Flush() must be called unless the flushing on
50 // completion is explicitly disabled for the file system type, the writer is
51 // created for. See FileSystemContext::ShouldFlushOnWriteCompletion().
52 //
49 // This errors out (either synchronously or via callback) with: 53 // This errors out (either synchronously or via callback) with:
50 // net::ERR_FILE_NOT_FOUND: When the target file is not found. 54 // net::ERR_FILE_NOT_FOUND: When the target file is not found.
51 // net::ERR_ACCESS_DENIED: When the target file is a directory or 55 // net::ERR_ACCESS_DENIED: When the target file is a directory or
52 // the writer has no permission on the file. 56 // the writer has no permission on the file.
53 // net::ERR_FILE_NO_SPACE: When the write will result in out of quota 57 // net::ERR_FILE_NO_SPACE: When the write will result in out of quota
54 // or there is not enough room left on the disk. 58 // or there is not enough room left on the disk.
55 // 59 //
56 // It is invalid to call Write while there is an in-flight async operation. 60 // It is invalid to call Write while there is an in-flight async operation.
57 virtual int Write(net::IOBuffer* buf, int buf_len, 61 virtual int Write(net::IOBuffer* buf, int buf_len,
58 const net::CompletionCallback& callback) = 0; 62 const net::CompletionCallback& callback) = 0;
(...skipping 19 matching lines...) Expand all
78 // is returned, and the callback will be run on the thread where Flush() was 82 // is returned, and the callback will be run on the thread where Flush() was
79 // called when the flush has completed. 83 // called when the flush has completed.
80 // 84 //
81 // It is invalid to call Flush while there is an in-flight async operation. 85 // It is invalid to call Flush while there is an in-flight async operation.
82 virtual int Flush(const net::CompletionCallback& callback) = 0; 86 virtual int Flush(const net::CompletionCallback& callback) = 0;
83 }; 87 };
84 88
85 } // namespace storage 89 } // namespace storage
86 90
87 #endif // STORAGE_BROWSER_FILEAPI_FILE_STREAM_WRITER_H_ 91 #endif // STORAGE_BROWSER_FILEAPI_FILE_STREAM_WRITER_H_
OLDNEW
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698