| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_ASYNC_FILE_UTIL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_ASYNC_FILE_UTIL_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_ASYNC_FILE_UTIL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_ASYNC_FILE_UTIL_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "storage/browser/fileapi/async_file_util.h" | 10 #include "storage/browser/fileapi/async_file_util.h" |
| 11 | 11 |
| 12 namespace drive { | 12 namespace drive { |
| 13 | 13 |
| 14 class FileSystemInterface; | 14 class FileSystemInterface; |
| 15 | 15 |
| 16 namespace internal { | 16 namespace internal { |
| 17 | 17 |
| 18 // The implementation of storage::AsyncFileUtil for Drive File System. | 18 // The implementation of storage::AsyncFileUtil for Drive File System. |
| 19 class AsyncFileUtil : public storage::AsyncFileUtil { | 19 class AsyncFileUtil : public storage::AsyncFileUtil { |
| 20 public: | 20 public: |
| 21 AsyncFileUtil(); | 21 AsyncFileUtil(); |
| 22 virtual ~AsyncFileUtil(); | 22 ~AsyncFileUtil() override; |
| 23 | 23 |
| 24 // storage::AsyncFileUtil overrides. | 24 // storage::AsyncFileUtil overrides. |
| 25 virtual void CreateOrOpen( | 25 void CreateOrOpen(scoped_ptr<storage::FileSystemOperationContext> context, |
| 26 scoped_ptr<storage::FileSystemOperationContext> context, | 26 const storage::FileSystemURL& url, |
| 27 const storage::FileSystemURL& url, | 27 int file_flags, |
| 28 int file_flags, | 28 const CreateOrOpenCallback& callback) override; |
| 29 const CreateOrOpenCallback& callback) override; | 29 void EnsureFileExists(scoped_ptr<storage::FileSystemOperationContext> context, |
| 30 virtual void EnsureFileExists( | 30 const storage::FileSystemURL& url, |
| 31 scoped_ptr<storage::FileSystemOperationContext> context, | 31 const EnsureFileExistsCallback& callback) override; |
| 32 const storage::FileSystemURL& url, | 32 void CreateDirectory(scoped_ptr<storage::FileSystemOperationContext> context, |
| 33 const EnsureFileExistsCallback& callback) override; | 33 const storage::FileSystemURL& url, |
| 34 virtual void CreateDirectory( | 34 bool exclusive, |
| 35 scoped_ptr<storage::FileSystemOperationContext> context, | 35 bool recursive, |
| 36 const storage::FileSystemURL& url, | 36 const StatusCallback& callback) override; |
| 37 bool exclusive, | 37 void GetFileInfo(scoped_ptr<storage::FileSystemOperationContext> context, |
| 38 bool recursive, | 38 const storage::FileSystemURL& url, |
| 39 const StatusCallback& callback) override; | 39 const GetFileInfoCallback& callback) override; |
| 40 virtual void GetFileInfo( | 40 void ReadDirectory(scoped_ptr<storage::FileSystemOperationContext> context, |
| 41 scoped_ptr<storage::FileSystemOperationContext> context, | |
| 42 const storage::FileSystemURL& url, | |
| 43 const GetFileInfoCallback& callback) override; | |
| 44 virtual void ReadDirectory( | |
| 45 scoped_ptr<storage::FileSystemOperationContext> context, | |
| 46 const storage::FileSystemURL& url, | |
| 47 const ReadDirectoryCallback& callback) override; | |
| 48 virtual void Touch(scoped_ptr<storage::FileSystemOperationContext> context, | |
| 49 const storage::FileSystemURL& url, | 41 const storage::FileSystemURL& url, |
| 50 const base::Time& last_access_time, | 42 const ReadDirectoryCallback& callback) override; |
| 51 const base::Time& last_modified_time, | 43 void Touch(scoped_ptr<storage::FileSystemOperationContext> context, |
| 44 const storage::FileSystemURL& url, |
| 45 const base::Time& last_access_time, |
| 46 const base::Time& last_modified_time, |
| 47 const StatusCallback& callback) override; |
| 48 void Truncate(scoped_ptr<storage::FileSystemOperationContext> context, |
| 49 const storage::FileSystemURL& url, |
| 50 int64 length, |
| 51 const StatusCallback& callback) override; |
| 52 void CopyFileLocal(scoped_ptr<storage::FileSystemOperationContext> context, |
| 53 const storage::FileSystemURL& src_url, |
| 54 const storage::FileSystemURL& dest_url, |
| 55 CopyOrMoveOption option, |
| 56 const CopyFileProgressCallback& progress_callback, |
| 52 const StatusCallback& callback) override; | 57 const StatusCallback& callback) override; |
| 53 virtual void Truncate(scoped_ptr<storage::FileSystemOperationContext> context, | 58 void MoveFileLocal(scoped_ptr<storage::FileSystemOperationContext> context, |
| 54 const storage::FileSystemURL& url, | 59 const storage::FileSystemURL& src_url, |
| 55 int64 length, | 60 const storage::FileSystemURL& dest_url, |
| 56 const StatusCallback& callback) override; | 61 CopyOrMoveOption option, |
| 57 virtual void CopyFileLocal( | 62 const StatusCallback& callback) override; |
| 58 scoped_ptr<storage::FileSystemOperationContext> context, | 63 void CopyInForeignFile( |
| 59 const storage::FileSystemURL& src_url, | |
| 60 const storage::FileSystemURL& dest_url, | |
| 61 CopyOrMoveOption option, | |
| 62 const CopyFileProgressCallback& progress_callback, | |
| 63 const StatusCallback& callback) override; | |
| 64 virtual void MoveFileLocal( | |
| 65 scoped_ptr<storage::FileSystemOperationContext> context, | |
| 66 const storage::FileSystemURL& src_url, | |
| 67 const storage::FileSystemURL& dest_url, | |
| 68 CopyOrMoveOption option, | |
| 69 const StatusCallback& callback) override; | |
| 70 virtual void CopyInForeignFile( | |
| 71 scoped_ptr<storage::FileSystemOperationContext> context, | 64 scoped_ptr<storage::FileSystemOperationContext> context, |
| 72 const base::FilePath& src_file_path, | 65 const base::FilePath& src_file_path, |
| 73 const storage::FileSystemURL& dest_url, | 66 const storage::FileSystemURL& dest_url, |
| 74 const StatusCallback& callback) override; | 67 const StatusCallback& callback) override; |
| 75 virtual void DeleteFile( | 68 void DeleteFile(scoped_ptr<storage::FileSystemOperationContext> context, |
| 69 const storage::FileSystemURL& url, |
| 70 const StatusCallback& callback) override; |
| 71 void DeleteDirectory(scoped_ptr<storage::FileSystemOperationContext> context, |
| 72 const storage::FileSystemURL& url, |
| 73 const StatusCallback& callback) override; |
| 74 void DeleteRecursively( |
| 76 scoped_ptr<storage::FileSystemOperationContext> context, | 75 scoped_ptr<storage::FileSystemOperationContext> context, |
| 77 const storage::FileSystemURL& url, | 76 const storage::FileSystemURL& url, |
| 78 const StatusCallback& callback) override; | 77 const StatusCallback& callback) override; |
| 79 virtual void DeleteDirectory( | 78 void CreateSnapshotFile( |
| 80 scoped_ptr<storage::FileSystemOperationContext> context, | |
| 81 const storage::FileSystemURL& url, | |
| 82 const StatusCallback& callback) override; | |
| 83 virtual void DeleteRecursively( | |
| 84 scoped_ptr<storage::FileSystemOperationContext> context, | |
| 85 const storage::FileSystemURL& url, | |
| 86 const StatusCallback& callback) override; | |
| 87 virtual void CreateSnapshotFile( | |
| 88 scoped_ptr<storage::FileSystemOperationContext> context, | 79 scoped_ptr<storage::FileSystemOperationContext> context, |
| 89 const storage::FileSystemURL& url, | 80 const storage::FileSystemURL& url, |
| 90 const CreateSnapshotFileCallback& callback) override; | 81 const CreateSnapshotFileCallback& callback) override; |
| 91 | 82 |
| 92 private: | 83 private: |
| 93 DISALLOW_COPY_AND_ASSIGN(AsyncFileUtil); | 84 DISALLOW_COPY_AND_ASSIGN(AsyncFileUtil); |
| 94 }; | 85 }; |
| 95 | 86 |
| 96 } // namespace internal | 87 } // namespace internal |
| 97 } // namespace drive | 88 } // namespace drive |
| 98 | 89 |
| 99 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_ASYNC_FILE_UTIL_H_ | 90 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILEAPI_ASYNC_FILE_UTIL_H_ |
| OLD | NEW |