| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_BROWSER_FILEAPI_ASYNC_FILE_UTIL_H_ | 5 #ifndef WEBKIT_BROWSER_FILEAPI_ASYNC_FILE_UTIL_H_ |
| 6 #define WEBKIT_BROWSER_FILEAPI_ASYNC_FILE_UTIL_H_ | 6 #define WEBKIT_BROWSER_FILEAPI_ASYNC_FILE_UTIL_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 AsyncFileUtil() {} | 93 AsyncFileUtil() {} |
| 94 virtual ~AsyncFileUtil() {} | 94 virtual ~AsyncFileUtil() {} |
| 95 | 95 |
| 96 // Creates or opens a file with the given flags. | 96 // Creates or opens a file with the given flags. |
| 97 // If PLATFORM_FILE_CREATE is set in |file_flags| it always tries to create | 97 // If PLATFORM_FILE_CREATE is set in |file_flags| it always tries to create |
| 98 // a new file at the given |url| and calls back with | 98 // a new file at the given |url| and calls back with |
| 99 // PLATFORM_FILE_ERROR_FILE_EXISTS if the |url| already exists. | 99 // PLATFORM_FILE_ERROR_FILE_EXISTS if the |url| already exists. |
| 100 // | 100 // |
| 101 // FileSystemOperationImpl::OpenFile calls this. | 101 // FileSystemOperationImpl::OpenFile calls this. |
| 102 // This is used only by Pepper/NaCL File API. | 102 // This is used only by Pepper/NaCl File API. |
| 103 // | 103 // |
| 104 virtual void CreateOrOpen( | 104 virtual void CreateOrOpen( |
| 105 scoped_ptr<FileSystemOperationContext> context, | 105 scoped_ptr<FileSystemOperationContext> context, |
| 106 const FileSystemURL& url, | 106 const FileSystemURL& url, |
| 107 int file_flags, | 107 int file_flags, |
| 108 const CreateOrOpenCallback& callback) = 0; | 108 const CreateOrOpenCallback& callback) = 0; |
| 109 | 109 |
| 110 // Ensures that the given |url| exist. This creates a empty new file | 110 // Ensures that the given |url| exist. This creates a empty new file |
| 111 // at |url| if the |url| does not exist. | 111 // at |url| if the |url| does not exist. |
| 112 // | 112 // |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 virtual void ReadDirectory( | 178 virtual void ReadDirectory( |
| 179 scoped_ptr<FileSystemOperationContext> context, | 179 scoped_ptr<FileSystemOperationContext> context, |
| 180 const FileSystemURL& url, | 180 const FileSystemURL& url, |
| 181 const ReadDirectoryCallback& callback) = 0; | 181 const ReadDirectoryCallback& callback) = 0; |
| 182 | 182 |
| 183 // Modifies timestamps of a file or directory at |url| with | 183 // Modifies timestamps of a file or directory at |url| with |
| 184 // |last_access_time| and |last_modified_time|. The function DOES NOT | 184 // |last_access_time| and |last_modified_time|. The function DOES NOT |
| 185 // create a file unlike 'touch' command on Linux. | 185 // create a file unlike 'touch' command on Linux. |
| 186 // | 186 // |
| 187 // FileSystemOperationImpl::TouchFile calls this. | 187 // FileSystemOperationImpl::TouchFile calls this. |
| 188 // This is used only by Pepper/NaCL File API. | 188 // This is used only by Pepper/NaCl File API. |
| 189 // | 189 // |
| 190 virtual void Touch( | 190 virtual void Touch( |
| 191 scoped_ptr<FileSystemOperationContext> context, | 191 scoped_ptr<FileSystemOperationContext> context, |
| 192 const FileSystemURL& url, | 192 const FileSystemURL& url, |
| 193 const base::Time& last_access_time, | 193 const base::Time& last_access_time, |
| 194 const base::Time& last_modified_time, | 194 const base::Time& last_modified_time, |
| 195 const StatusCallback& callback) = 0; | 195 const StatusCallback& callback) = 0; |
| 196 | 196 |
| 197 // Truncates a file at |path| to |length|. If |length| is larger than | 197 // Truncates a file at |path| to |length|. If |length| is larger than |
| 198 // the original file size, the file will be extended, and the extended | 198 // the original file size, the file will be extended, and the extended |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 const FileSystemURL& url, | 360 const FileSystemURL& url, |
| 361 const CreateSnapshotFileCallback& callback) = 0; | 361 const CreateSnapshotFileCallback& callback) = 0; |
| 362 | 362 |
| 363 private: | 363 private: |
| 364 DISALLOW_COPY_AND_ASSIGN(AsyncFileUtil); | 364 DISALLOW_COPY_AND_ASSIGN(AsyncFileUtil); |
| 365 }; | 365 }; |
| 366 | 366 |
| 367 } // namespace fileapi | 367 } // namespace fileapi |
| 368 | 368 |
| 369 #endif // WEBKIT_BROWSER_FILEAPI_ASYNC_FILE_UTIL_H_ | 369 #endif // WEBKIT_BROWSER_FILEAPI_ASYNC_FILE_UTIL_H_ |
| OLD | NEW |