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/fileapi/file_system_operation.h" | 8 #include "webkit/fileapi/file_system_operation.h" |
9 #include "webkit/fileapi/file_writer_delegate.h" | 9 #include "webkit/fileapi/file_writer_delegate.h" |
10 #include "webkit/fileapi/remote_file_system_proxy.h" | 10 #include "webkit/fileapi/remote_file_system_proxy.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 scoped_refptr<fileapi::RemoteFileSystemProxyInterface> remote_proxy); | 81 scoped_refptr<fileapi::RemoteFileSystemProxyInterface> remote_proxy); |
82 | 82 |
83 // Used only for internal assertions. | 83 // Used only for internal assertions. |
84 // Returns false if there's another inflight pending operation. | 84 // Returns false if there's another inflight pending operation. |
85 bool SetPendingOperationType(OperationType type); | 85 bool SetPendingOperationType(OperationType type); |
86 | 86 |
87 // Generic callback that translates platform errors to WebKit error codes. | 87 // Generic callback that translates platform errors to WebKit error codes. |
88 void DidDirectoryExists(const StatusCallback& callback, | 88 void DidDirectoryExists(const StatusCallback& callback, |
89 base::PlatformFileError rv, | 89 base::PlatformFileError rv, |
90 const base::PlatformFileInfo& file_info, | 90 const base::PlatformFileInfo& file_info, |
91 const FilePath& unused); | 91 const base::FilePath& unused); |
92 void DidFileExists(const StatusCallback& callback, | 92 void DidFileExists(const StatusCallback& callback, |
93 base::PlatformFileError rv, | 93 base::PlatformFileError rv, |
94 const base::PlatformFileInfo& file_info, | 94 const base::PlatformFileInfo& file_info, |
95 const FilePath& unused); | 95 const base::FilePath& unused); |
96 void DidGetMetadata(const GetMetadataCallback& callback, | 96 void DidGetMetadata(const GetMetadataCallback& callback, |
97 base::PlatformFileError rv, | 97 base::PlatformFileError rv, |
98 const base::PlatformFileInfo& file_info, | 98 const base::PlatformFileInfo& file_info, |
99 const FilePath& platform_path); | 99 const base::FilePath& platform_path); |
100 void DidReadDirectory( | 100 void DidReadDirectory( |
101 const ReadDirectoryCallback& callback, | 101 const ReadDirectoryCallback& callback, |
102 base::PlatformFileError rv, | 102 base::PlatformFileError rv, |
103 const std::vector<base::FileUtilProxy::Entry>& entries, | 103 const std::vector<base::FileUtilProxy::Entry>& entries, |
104 bool has_more); | 104 bool has_more); |
105 void DidWrite(base::PlatformFileError result, | 105 void DidWrite(base::PlatformFileError result, |
106 int64 bytes, | 106 int64 bytes, |
107 FileWriterDelegate::WriteProgressStatus write_status); | 107 FileWriterDelegate::WriteProgressStatus write_status); |
108 void DidFinishFileOperation(const StatusCallback& callback, | 108 void DidFinishFileOperation(const StatusCallback& callback, |
109 base::PlatformFileError rv); | 109 base::PlatformFileError rv); |
110 void DidCreateSnapshotFile( | 110 void DidCreateSnapshotFile( |
111 const SnapshotFileCallback& callback, | 111 const SnapshotFileCallback& callback, |
112 base::PlatformFileError result, | 112 base::PlatformFileError result, |
113 const base::PlatformFileInfo& file_info, | 113 const base::PlatformFileInfo& file_info, |
114 const FilePath& platform_path, | 114 const base::FilePath& platform_path, |
115 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); | 115 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref); |
116 void DidOpenFile( | 116 void DidOpenFile( |
117 const OpenFileCallback& callback, | 117 const OpenFileCallback& callback, |
118 base::PlatformFileError result, | 118 base::PlatformFileError result, |
119 base::PlatformFile file, | 119 base::PlatformFile file, |
120 base::ProcessHandle peer_handle); | 120 base::ProcessHandle peer_handle); |
121 | 121 |
122 | 122 |
123 scoped_refptr<fileapi::RemoteFileSystemProxyInterface> remote_proxy_; | 123 scoped_refptr<fileapi::RemoteFileSystemProxyInterface> remote_proxy_; |
124 // 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. |
125 OperationType pending_operation_; | 125 OperationType pending_operation_; |
126 scoped_ptr<fileapi::FileWriterDelegate> file_writer_delegate_; | 126 scoped_ptr<fileapi::FileWriterDelegate> file_writer_delegate_; |
127 | 127 |
128 WriteCallback write_callback_; | 128 WriteCallback write_callback_; |
129 StatusCallback cancel_callback_; | 129 StatusCallback cancel_callback_; |
130 | 130 |
131 DISALLOW_COPY_AND_ASSIGN(RemoteFileSystemOperation); | 131 DISALLOW_COPY_AND_ASSIGN(RemoteFileSystemOperation); |
132 }; | 132 }; |
133 | 133 |
134 } // namespace chromeos | 134 } // namespace chromeos |
135 | 135 |
136 #endif // WEBKIT_CHROMEOS_FILEAPI_REMOTE_FILE_SYSTEM_OPERATION_H_ | 136 #endif // WEBKIT_CHROMEOS_FILEAPI_REMOTE_FILE_SYSTEM_OPERATION_H_ |
OLD | NEW |