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 WEBKIT_FILEAPI_FILE_STREAM_WRITER_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_STREAM_WRITER_H_ |
6 #define WEBKIT_FILEAPI_FILE_STREAM_WRITER_H_ | 6 #define WEBKIT_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 "webkit/fileapi/fileapi_export.h" | 10 #include "webkit/fileapi/fileapi_export.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // cancel could not be performed, it returns an error code. Especially when | 48 // cancel could not be performed, it returns an error code. Especially when |
49 // there is no in-flight operation, net::ERR_UNEXPECTED is returned. | 49 // there is no in-flight operation, net::ERR_UNEXPECTED is returned. |
50 // Otherwise, net::ERR_IO_PENDING is returned, and the callback will be run on | 50 // Otherwise, net::ERR_IO_PENDING is returned, and the callback will be run on |
51 // the thread where Cancel() was called when the cancel has completed. It is | 51 // the thread where Cancel() was called when the cancel has completed. It is |
52 // invalid to call Cancel() more than once on the same async operation. | 52 // invalid to call Cancel() more than once on the same async operation. |
53 // | 53 // |
54 // In either case, the callback function passed to the in-flight async | 54 // In either case, the callback function passed to the in-flight async |
55 // operation is dismissed immediately when Cancel() is called, and thus | 55 // operation is dismissed immediately when Cancel() is called, and thus |
56 // will never be called. | 56 // will never be called. |
57 virtual int Cancel(const net::CompletionCallback& callback) = 0; | 57 virtual int Cancel(const net::CompletionCallback& callback) = 0; |
| 58 |
| 59 // Flushes the data written so far. |
| 60 virtual int Flush(const net::CompletionCallback& callback) = 0; |
58 }; | 61 }; |
59 | 62 |
60 } // namespace fileapi | 63 } // namespace fileapi |
61 | 64 |
62 #endif // WEBKIT_FILEAPI_FILE_STREAM_WRITER_H_ | 65 #endif // WEBKIT_FILEAPI_FILE_STREAM_WRITER_H_ |
OLD | NEW |