| 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_SYSTEM_FILE_UTIL_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ |
| 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ | 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ |
| 7 | 7 |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 // current length of the file, the file will be extended with zeroes. | 152 // current length of the file, the file will be extended with zeroes. |
| 153 virtual base::PlatformFileError Truncate( | 153 virtual base::PlatformFileError Truncate( |
| 154 FileSystemOperationContext* context, | 154 FileSystemOperationContext* context, |
| 155 const FileSystemURL& url, | 155 const FileSystemURL& url, |
| 156 int64 length) = 0; | 156 int64 length) = 0; |
| 157 | 157 |
| 158 // Copies or moves a single file from |src_url| to |dest_url|. | 158 // Copies or moves a single file from |src_url| to |dest_url|. |
| 159 // The filesystem type of |src_url| and |dest_url| MUST be same. | 159 // The filesystem type of |src_url| and |dest_url| MUST be same. |
| 160 // | 160 // |
| 161 // This returns: | 161 // This returns: |
| 162 // - PLATFORM_FILE_ERROR_NOT_FOUND if |src_file_path| | 162 // - PLATFORM_FILE_ERROR_NOT_FOUND if |src_url| |
| 163 // or the parent directory of |dest_url| does not exist. | 163 // or the parent directory of |dest_url| does not exist. |
| 164 // - PLATFORM_FILE_ERROR_NOT_A_FILE if |src_url| exists but is not a file. | 164 // - PLATFORM_FILE_ERROR_NOT_A_FILE if |src_url| exists but is not a file. |
| 165 // - PLATFORM_FILE_ERROR_INVALID_OPERATION if |dest_url| exists and | 165 // - PLATFORM_FILE_ERROR_INVALID_OPERATION if |dest_url| exists and |
| 166 // is not a file. | 166 // is not a file. |
| 167 // - PLATFORM_FILE_ERROR_FAILED if |dest_url| does not exist and | 167 // - PLATFORM_FILE_ERROR_FAILED if |dest_url| does not exist and |
| 168 // its parent path is a file. | 168 // its parent path is a file. |
| 169 // | 169 // |
| 170 virtual base::PlatformFileError CopyOrMoveFile( | 170 virtual base::PlatformFileError CopyOrMoveFile( |
| 171 FileSystemOperationContext* context, | 171 FileSystemOperationContext* context, |
| 172 const FileSystemURL& src_url, | 172 const FileSystemURL& src_url, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 // | 219 // |
| 220 // |file_info| is the metadata of the snapshot file created. | 220 // |file_info| is the metadata of the snapshot file created. |
| 221 // |platform_path| is the path to the snapshot file created. | 221 // |platform_path| is the path to the snapshot file created. |
| 222 // |policy| should indicate the policy how the fileapi backend | 222 // |policy| should indicate the policy how the fileapi backend |
| 223 // should handle the returned file. | 223 // should handle the returned file. |
| 224 // | 224 // |
| 225 // This returns: | 225 // This returns: |
| 226 // - PLATFORM_FILE_ERROR_NOT_FOUND if |url| does not exist. | 226 // - PLATFORM_FILE_ERROR_NOT_FOUND if |url| does not exist. |
| 227 // - PLATFORM_FILE_ERROR_NOT_A_FILE if |url| is not a file. | 227 // - PLATFORM_FILE_ERROR_NOT_A_FILE if |url| is not a file. |
| 228 // | 228 // |
| 229 // The field values of |file_info| are undefined (implementation |
| 230 // dependent) in error cases, and the caller should always |
| 231 // check the return code. |
| 232 // |
| 229 virtual base::PlatformFileError CreateSnapshotFile( | 233 virtual base::PlatformFileError CreateSnapshotFile( |
| 230 FileSystemOperationContext* context, | 234 FileSystemOperationContext* context, |
| 231 const FileSystemURL& url, | 235 const FileSystemURL& url, |
| 232 base::PlatformFileInfo* file_info, | 236 base::PlatformFileInfo* file_info, |
| 233 FilePath* platform_path, | 237 FilePath* platform_path, |
| 234 SnapshotFilePolicy* policy) = 0; | 238 SnapshotFilePolicy* policy) = 0; |
| 235 | 239 |
| 236 protected: | 240 protected: |
| 237 FileSystemFileUtil() {} | 241 FileSystemFileUtil() {} |
| 238 | 242 |
| 239 private: | 243 private: |
| 240 DISALLOW_COPY_AND_ASSIGN(FileSystemFileUtil); | 244 DISALLOW_COPY_AND_ASSIGN(FileSystemFileUtil); |
| 241 }; | 245 }; |
| 242 | 246 |
| 243 } // namespace fileapi | 247 } // namespace fileapi |
| 244 | 248 |
| 245 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ | 249 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ |
| OLD | NEW |