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