OLD | NEW |
---|---|
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 Loading... | |
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() will be called unless the flushing on | |
hashimoto
2014/10/16 21:39:03
How about replacing "will be" with "must be"?
IIUC
mtomasz
2014/10/17 00:26:07
Done.
| |
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 Loading... | |
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_ |
OLD | NEW |