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

Side by Side Diff: webkit/fileapi/file_writer.h

Issue 10447055: Move fileapi into its own component (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup Created 8 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « webkit/fileapi/file_util_helper.h ('k') | webkit/fileapi/file_writer_delegate.h » ('j') | 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 WEBKIT_FILEAPI_FILE_WRITER_H_ 5 #ifndef WEBKIT_FILEAPI_FILE_WRITER_H_
6 #define WEBKIT_FILEAPI_FILE_WRITER_H_ 6 #define WEBKIT_FILEAPI_FILE_WRITER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "net/base/completion_callback.h" 10 #include "net/base/completion_callback.h"
11 #include "webkit/fileapi/fileapi_export.h"
11 12
12 namespace net { 13 namespace net {
13 class IOBuffer; 14 class IOBuffer;
14 } 15 }
15 16
16 namespace fileapi { 17 namespace fileapi {
17 18
18 // A generic interface for writing to a file-like object. 19 // A generic interface for writing to a file-like object.
19 // 20 //
20 // TODO(kinuko): Consider better naming. (http://crbug.com/128483) 21 // TODO(kinuko): Consider better naming. (http://crbug.com/128483)
21 // Note: this does not directly correspond to FileWriter in File API (which 22 // Note: this does not directly correspond to FileWriter in File API (which
22 // is implemented by WebCore::FileWriter), though this class is used to 23 // is implemented by WebCore::FileWriter), though this class is used to
23 // implement a part of it. FileWriterDelegate is NOT a delegate of this 24 // implement a part of it. FileWriterDelegate is NOT a delegate of this
24 // class either. 25 // class either.
25 class FileWriter { 26 class FILEAPI_EXPORT_PRIVATE FileWriter {
26 public: 27 public:
27 // Closes the file. If there's an in-flight operation, it is canceled (i.e., 28 // Closes the file. If there's an in-flight operation, it is canceled (i.e.,
28 // the callback function associated with the operation is not called). 29 // the callback function associated with the operation is not called).
29 virtual ~FileWriter() {} 30 virtual ~FileWriter() {}
30 31
31 // Writes to the current cursor position asynchronously. 32 // Writes to the current cursor position asynchronously.
32 // 33 //
33 // Up to buf_len bytes will be written. (In other words, partial 34 // Up to buf_len bytes will be written. (In other words, partial
34 // writes are allowed.) If the write completed synchronously, it returns 35 // writes are allowed.) If the write completed synchronously, it returns
35 // the number of bytes written. If the operation could not be performed, it 36 // the number of bytes written. If the operation could not be performed, it
(...skipping 23 matching lines...) Expand all
59 // 60 //
60 // In either case, the callback function passed to the in-flight async 61 // In either case, the callback function passed to the in-flight async
61 // operation is dismissed immediately when Cancel() is called, and thus 62 // operation is dismissed immediately when Cancel() is called, and thus
62 // will never be called. 63 // will never be called.
63 virtual int Cancel(const net::CompletionCallback& callback) = 0; 64 virtual int Cancel(const net::CompletionCallback& callback) = 0;
64 }; 65 };
65 66
66 } // namespace fileapi 67 } // namespace fileapi
67 68
68 #endif // WEBKIT_FILEAPI_FILE_WRITER_H_ 69 #endif // WEBKIT_FILEAPI_FILE_WRITER_H_
OLDNEW
« no previous file with comments | « webkit/fileapi/file_util_helper.h ('k') | webkit/fileapi/file_writer_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698