| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_SYSTEM_OPERATION_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ |
| 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ | 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 const GURL& blob_url, | 77 const GURL& blob_url, |
| 78 int64 offset); | 78 int64 offset); |
| 79 void Truncate(const GURL& path, int64 length); | 79 void Truncate(const GURL& path, int64 length); |
| 80 void TouchFile(const GURL& path, | 80 void TouchFile(const GURL& path, |
| 81 const base::Time& last_access_time, | 81 const base::Time& last_access_time, |
| 82 const base::Time& last_modified_time); | 82 const base::Time& last_modified_time); |
| 83 void OpenFile( | 83 void OpenFile( |
| 84 const GURL& path, | 84 const GURL& path, |
| 85 int file_flags, | 85 int file_flags, |
| 86 base::ProcessHandle peer_handle); | 86 base::ProcessHandle peer_handle); |
| 87 void GetLocalPath(const GURL& path); |
| 87 | 88 |
| 88 // Try to cancel the current operation [we support cancelling write or | 89 // Try to cancel the current operation [we support cancelling write or |
| 89 // truncate only]. Report failure for the current operation, then tell the | 90 // truncate only]. Report failure for the current operation, then tell the |
| 90 // passed-in operation to report success. | 91 // passed-in operation to report success. |
| 91 void Cancel(FileSystemOperation* cancel_operation); | 92 void Cancel(FileSystemOperation* cancel_operation); |
| 92 | 93 |
| 93 private: | 94 private: |
| 94 FileSystemContext* file_system_context() const { | 95 FileSystemContext* file_system_context() const { |
| 95 return file_system_operation_context_.file_system_context(); | 96 return file_system_operation_context_.file_system_context(); |
| 96 } | 97 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 const std::vector<base::FileUtilProxy::Entry>& entries); | 132 const std::vector<base::FileUtilProxy::Entry>& entries); |
| 132 void DidWrite( | 133 void DidWrite( |
| 133 base::PlatformFileError rv, | 134 base::PlatformFileError rv, |
| 134 int64 bytes, | 135 int64 bytes, |
| 135 bool complete); | 136 bool complete); |
| 136 void DidTouchFile(base::PlatformFileError rv); | 137 void DidTouchFile(base::PlatformFileError rv); |
| 137 void DidOpenFile( | 138 void DidOpenFile( |
| 138 base::PlatformFileError rv, | 139 base::PlatformFileError rv, |
| 139 base::PassPlatformFile file, | 140 base::PassPlatformFile file, |
| 140 bool created); | 141 bool created); |
| 142 void DidGetLocalPath(base::PlatformFileError rv, |
| 143 const FilePath& local_path); |
| 141 | 144 |
| 142 // Helper for Write(). | 145 // Helper for Write(). |
| 143 void OnFileOpenedForWrite( | 146 void OnFileOpenedForWrite( |
| 144 base::PlatformFileError rv, | 147 base::PlatformFileError rv, |
| 145 base::PassPlatformFile file, | 148 base::PassPlatformFile file, |
| 146 bool created); | 149 bool created); |
| 147 | 150 |
| 148 // Checks the validity of a given |path| for reading, and cracks the path into | 151 // Checks the validity of a given |path| for reading, and cracks the path into |
| 149 // root URL and virtual path components. | 152 // root URL and virtual path components. |
| 150 // Returns true if the given |path| is a valid FileSystem path. | 153 // Returns true if the given |path| is a valid FileSystem path. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 kOperationMove, | 190 kOperationMove, |
| 188 kOperationDirectoryExists, | 191 kOperationDirectoryExists, |
| 189 kOperationFileExists, | 192 kOperationFileExists, |
| 190 kOperationGetMetadata, | 193 kOperationGetMetadata, |
| 191 kOperationReadDirectory, | 194 kOperationReadDirectory, |
| 192 kOperationRemove, | 195 kOperationRemove, |
| 193 kOperationWrite, | 196 kOperationWrite, |
| 194 kOperationTruncate, | 197 kOperationTruncate, |
| 195 kOperationTouchFile, | 198 kOperationTouchFile, |
| 196 kOperationOpenFile, | 199 kOperationOpenFile, |
| 200 kOperationGetLocalPath, |
| 197 kOperationCancel, | 201 kOperationCancel, |
| 198 }; | 202 }; |
| 199 | 203 |
| 200 // A flag to make sure we call operation only once per instance. | 204 // A flag to make sure we call operation only once per instance. |
| 201 OperationType pending_operation_; | 205 OperationType pending_operation_; |
| 202 #endif | 206 #endif |
| 203 | 207 |
| 204 // Proxy for calling file_util_proxy methods. | 208 // Proxy for calling file_util_proxy methods. |
| 205 scoped_refptr<base::MessageLoopProxy> proxy_; | 209 scoped_refptr<base::MessageLoopProxy> proxy_; |
| 206 | 210 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 219 // Used only by OpenFile, in order to clone the file handle back to the | 223 // Used only by OpenFile, in order to clone the file handle back to the |
| 220 // requesting process. | 224 // requesting process. |
| 221 base::ProcessHandle peer_handle_; | 225 base::ProcessHandle peer_handle_; |
| 222 | 226 |
| 223 DISALLOW_COPY_AND_ASSIGN(FileSystemOperation); | 227 DISALLOW_COPY_AND_ASSIGN(FileSystemOperation); |
| 224 }; | 228 }; |
| 225 | 229 |
| 226 } // namespace fileapi | 230 } // namespace fileapi |
| 227 | 231 |
| 228 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ | 232 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_OPERATION_H_ |
| OLD | NEW |