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_CHROMEOS_FILEAPI_REMOTE_FILE_SYSTEM_OPERATION_H_ | 5 #ifndef WEBKIT_CHROMEOS_FILEAPI_REMOTE_FILE_SYSTEM_OPERATION_H_ |
6 #define WEBKIT_CHROMEOS_FILEAPI_REMOTE_FILE_SYSTEM_OPERATION_H_ | 6 #define WEBKIT_CHROMEOS_FILEAPI_REMOTE_FILE_SYSTEM_OPERATION_H_ |
7 | 7 |
8 #include "webkit/chromeos/fileapi/remote_file_system_proxy.h" | 8 #include "webkit/chromeos/fileapi/remote_file_system_proxy.h" |
9 #include "webkit/fileapi/file_system_operation.h" | 9 #include "webkit/fileapi/file_system_operation.h" |
| 10 #include "webkit/fileapi/file_writer_delegate.h" |
10 | 11 |
11 namespace base { | 12 namespace base { |
12 class Value; | 13 class Value; |
13 } | 14 } |
14 | 15 |
15 namespace fileapi { | 16 namespace fileapi { |
16 class FileWriterDelegate; | 17 class FileWriterDelegate; |
17 class LocalFileSystemOperation; | 18 class LocalFileSystemOperation; |
18 } | 19 } |
19 | 20 |
20 namespace chromeos { | 21 namespace chromeos { |
21 | 22 |
22 // FileSystemOperation implementation for local file systems. | 23 // FileSystemOperation implementation for local file systems. |
23 class RemoteFileSystemOperation : public fileapi::FileSystemOperation { | 24 class RemoteFileSystemOperation : public fileapi::FileSystemOperation { |
24 public: | 25 public: |
| 26 typedef fileapi::FileWriterDelegate FileWriterDelegate; |
25 virtual ~RemoteFileSystemOperation(); | 27 virtual ~RemoteFileSystemOperation(); |
26 | 28 |
27 // FileSystemOperation overrides. | 29 // FileSystemOperation overrides. |
28 virtual void CreateFile(const fileapi::FileSystemURL& url, | 30 virtual void CreateFile(const fileapi::FileSystemURL& url, |
29 bool exclusive, | 31 bool exclusive, |
30 const StatusCallback& callback) OVERRIDE; | 32 const StatusCallback& callback) OVERRIDE; |
31 virtual void CreateDirectory(const fileapi::FileSystemURL& url, | 33 virtual void CreateDirectory(const fileapi::FileSystemURL& url, |
32 bool exclusive, | 34 bool exclusive, |
33 bool recursive, | 35 bool recursive, |
34 const StatusCallback& callback) OVERRIDE; | 36 const StatusCallback& callback) OVERRIDE; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 base::PlatformFileError rv, | 97 base::PlatformFileError rv, |
96 const base::PlatformFileInfo& file_info, | 98 const base::PlatformFileInfo& file_info, |
97 const FilePath& platform_path); | 99 const FilePath& platform_path); |
98 void DidReadDirectory( | 100 void DidReadDirectory( |
99 const ReadDirectoryCallback& callback, | 101 const ReadDirectoryCallback& callback, |
100 base::PlatformFileError rv, | 102 base::PlatformFileError rv, |
101 const std::vector<base::FileUtilProxy::Entry>& entries, | 103 const std::vector<base::FileUtilProxy::Entry>& entries, |
102 bool has_more); | 104 bool has_more); |
103 void DidWrite(base::PlatformFileError result, | 105 void DidWrite(base::PlatformFileError result, |
104 int64 bytes, | 106 int64 bytes, |
105 bool complete); | 107 FileWriterDelegate::WriteProgressStatus write_status); |
106 void DidFinishFileOperation(const StatusCallback& callback, | 108 void DidFinishFileOperation(const StatusCallback& callback, |
107 base::PlatformFileError rv); | 109 base::PlatformFileError rv); |
108 void DidCreateSnapshotFile( | 110 void DidCreateSnapshotFile( |
109 const SnapshotFileCallback& callback, | 111 const SnapshotFileCallback& callback, |
110 base::PlatformFileError result, | 112 base::PlatformFileError result, |
111 const base::PlatformFileInfo& file_info, | 113 const base::PlatformFileInfo& file_info, |
112 const FilePath& platform_path, | 114 const FilePath& platform_path, |
113 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); | 115 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); |
114 void DidOpenFile( | 116 void DidOpenFile( |
115 const OpenFileCallback& callback, | 117 const OpenFileCallback& callback, |
116 base::PlatformFileError result, | 118 base::PlatformFileError result, |
117 base::PlatformFile file, | 119 base::PlatformFile file, |
118 base::ProcessHandle peer_handle); | 120 base::ProcessHandle peer_handle); |
119 | 121 |
120 | 122 |
121 scoped_refptr<fileapi::RemoteFileSystemProxyInterface> remote_proxy_; | 123 scoped_refptr<fileapi::RemoteFileSystemProxyInterface> remote_proxy_; |
122 // A flag to make sure we call operation only once per instance. | 124 // A flag to make sure we call operation only once per instance. |
123 OperationType pending_operation_; | 125 OperationType pending_operation_; |
124 scoped_ptr<fileapi::FileWriterDelegate> file_writer_delegate_; | 126 scoped_ptr<fileapi::FileWriterDelegate> file_writer_delegate_; |
125 | 127 |
126 WriteCallback write_callback_; | 128 WriteCallback write_callback_; |
127 StatusCallback cancel_callback_; | 129 StatusCallback cancel_callback_; |
128 | 130 |
129 DISALLOW_COPY_AND_ASSIGN(RemoteFileSystemOperation); | 131 DISALLOW_COPY_AND_ASSIGN(RemoteFileSystemOperation); |
130 }; | 132 }; |
131 | 133 |
132 } // namespace chromeos | 134 } // namespace chromeos |
133 | 135 |
134 #endif // WEBKIT_CHROMEOS_FILEAPI_REMOTE_FILE_SYSTEM_OPERATION_H_ | 136 #endif // WEBKIT_CHROMEOS_FILEAPI_REMOTE_FILE_SYSTEM_OPERATION_H_ |
OLD | NEW |