| 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_FILE_SYSTEM_PROVIDER_FILEAPI_PROVIDER_ASYNC_FILE
_UTIL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FILEAPI_PROVIDER_ASYNC_FILE
_UTIL_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FILEAPI_PROVIDER_ASYNC_FILE
_UTIL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FILEAPI_PROVIDER_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 "webkit/browser/fileapi/async_file_util.h" | 10 #include "storage/browser/fileapi/async_file_util.h" |
| 11 | 11 |
| 12 namespace chromeos { | 12 namespace chromeos { |
| 13 namespace file_system_provider { | 13 namespace file_system_provider { |
| 14 | 14 |
| 15 class FileSystemInterface; | 15 class FileSystemInterface; |
| 16 | 16 |
| 17 namespace internal { | 17 namespace internal { |
| 18 | 18 |
| 19 // The implementation of fileapi::AsyncFileUtil for provided file systems. It is | 19 // The implementation of storage::AsyncFileUtil for provided file systems. It is |
| 20 // created one per Chrome process. It is responsible for routing calls to the | 20 // created one per Chrome process. It is responsible for routing calls to the |
| 21 // correct profile, and then to the correct profided file system. | 21 // correct profile, and then to the correct profided file system. |
| 22 // | 22 // |
| 23 // This class should be called AsyncFileUtil, without the Provided prefix. This | 23 // This class should be called AsyncFileUtil, without the Provided prefix. This |
| 24 // is impossible, though because of GYP limitations. There must not be two files | 24 // is impossible, though because of GYP limitations. There must not be two files |
| 25 // with the same name in a Chromium tree. | 25 // with the same name in a Chromium tree. |
| 26 // See: https://code.google.com/p/gyp/issues/detail?id=384 | 26 // See: https://code.google.com/p/gyp/issues/detail?id=384 |
| 27 // | 27 // |
| 28 // All of the methods should be called on the IO thread. | 28 // All of the methods should be called on the IO thread. |
| 29 class ProviderAsyncFileUtil : public fileapi::AsyncFileUtil { | 29 class ProviderAsyncFileUtil : public storage::AsyncFileUtil { |
| 30 public: | 30 public: |
| 31 ProviderAsyncFileUtil(); | 31 ProviderAsyncFileUtil(); |
| 32 virtual ~ProviderAsyncFileUtil(); | 32 virtual ~ProviderAsyncFileUtil(); |
| 33 | 33 |
| 34 // fileapi::AsyncFileUtil overrides. | 34 // storage::AsyncFileUtil overrides. |
| 35 virtual void CreateOrOpen( | 35 virtual void CreateOrOpen( |
| 36 scoped_ptr<fileapi::FileSystemOperationContext> context, | 36 scoped_ptr<storage::FileSystemOperationContext> context, |
| 37 const fileapi::FileSystemURL& url, | 37 const storage::FileSystemURL& url, |
| 38 int file_flags, | 38 int file_flags, |
| 39 const CreateOrOpenCallback& callback) OVERRIDE; | 39 const CreateOrOpenCallback& callback) OVERRIDE; |
| 40 virtual void EnsureFileExists( | 40 virtual void EnsureFileExists( |
| 41 scoped_ptr<fileapi::FileSystemOperationContext> context, | 41 scoped_ptr<storage::FileSystemOperationContext> context, |
| 42 const fileapi::FileSystemURL& url, | 42 const storage::FileSystemURL& url, |
| 43 const EnsureFileExistsCallback& callback) OVERRIDE; | 43 const EnsureFileExistsCallback& callback) OVERRIDE; |
| 44 virtual void CreateDirectory( | 44 virtual void CreateDirectory( |
| 45 scoped_ptr<fileapi::FileSystemOperationContext> context, | 45 scoped_ptr<storage::FileSystemOperationContext> context, |
| 46 const fileapi::FileSystemURL& url, | 46 const storage::FileSystemURL& url, |
| 47 bool exclusive, | 47 bool exclusive, |
| 48 bool recursive, | 48 bool recursive, |
| 49 const StatusCallback& callback) OVERRIDE; | 49 const StatusCallback& callback) OVERRIDE; |
| 50 virtual void GetFileInfo( | 50 virtual void GetFileInfo( |
| 51 scoped_ptr<fileapi::FileSystemOperationContext> context, | 51 scoped_ptr<storage::FileSystemOperationContext> context, |
| 52 const fileapi::FileSystemURL& url, | 52 const storage::FileSystemURL& url, |
| 53 const GetFileInfoCallback& callback) OVERRIDE; | 53 const GetFileInfoCallback& callback) OVERRIDE; |
| 54 virtual void ReadDirectory( | 54 virtual void ReadDirectory( |
| 55 scoped_ptr<fileapi::FileSystemOperationContext> context, | 55 scoped_ptr<storage::FileSystemOperationContext> context, |
| 56 const fileapi::FileSystemURL& url, | 56 const storage::FileSystemURL& url, |
| 57 const ReadDirectoryCallback& callback) OVERRIDE; | 57 const ReadDirectoryCallback& callback) OVERRIDE; |
| 58 virtual void Touch(scoped_ptr<fileapi::FileSystemOperationContext> context, | 58 virtual void Touch(scoped_ptr<storage::FileSystemOperationContext> context, |
| 59 const fileapi::FileSystemURL& url, | 59 const storage::FileSystemURL& url, |
| 60 const base::Time& last_access_time, | 60 const base::Time& last_access_time, |
| 61 const base::Time& last_modified_time, | 61 const base::Time& last_modified_time, |
| 62 const StatusCallback& callback) OVERRIDE; | 62 const StatusCallback& callback) OVERRIDE; |
| 63 virtual void Truncate(scoped_ptr<fileapi::FileSystemOperationContext> context, | 63 virtual void Truncate(scoped_ptr<storage::FileSystemOperationContext> context, |
| 64 const fileapi::FileSystemURL& url, | 64 const storage::FileSystemURL& url, |
| 65 int64 length, | 65 int64 length, |
| 66 const StatusCallback& callback) OVERRIDE; | 66 const StatusCallback& callback) OVERRIDE; |
| 67 virtual void CopyFileLocal( | 67 virtual void CopyFileLocal( |
| 68 scoped_ptr<fileapi::FileSystemOperationContext> context, | 68 scoped_ptr<storage::FileSystemOperationContext> context, |
| 69 const fileapi::FileSystemURL& src_url, | 69 const storage::FileSystemURL& src_url, |
| 70 const fileapi::FileSystemURL& dest_url, | 70 const storage::FileSystemURL& dest_url, |
| 71 CopyOrMoveOption option, | 71 CopyOrMoveOption option, |
| 72 const CopyFileProgressCallback& progress_callback, | 72 const CopyFileProgressCallback& progress_callback, |
| 73 const StatusCallback& callback) OVERRIDE; | 73 const StatusCallback& callback) OVERRIDE; |
| 74 virtual void MoveFileLocal( | 74 virtual void MoveFileLocal( |
| 75 scoped_ptr<fileapi::FileSystemOperationContext> context, | 75 scoped_ptr<storage::FileSystemOperationContext> context, |
| 76 const fileapi::FileSystemURL& src_url, | 76 const storage::FileSystemURL& src_url, |
| 77 const fileapi::FileSystemURL& dest_url, | 77 const storage::FileSystemURL& dest_url, |
| 78 CopyOrMoveOption option, | 78 CopyOrMoveOption option, |
| 79 const StatusCallback& callback) OVERRIDE; | 79 const StatusCallback& callback) OVERRIDE; |
| 80 virtual void CopyInForeignFile( | 80 virtual void CopyInForeignFile( |
| 81 scoped_ptr<fileapi::FileSystemOperationContext> context, | 81 scoped_ptr<storage::FileSystemOperationContext> context, |
| 82 const base::FilePath& src_file_path, | 82 const base::FilePath& src_file_path, |
| 83 const fileapi::FileSystemURL& dest_url, | 83 const storage::FileSystemURL& dest_url, |
| 84 const StatusCallback& callback) OVERRIDE; | 84 const StatusCallback& callback) OVERRIDE; |
| 85 virtual void DeleteFile( | 85 virtual void DeleteFile( |
| 86 scoped_ptr<fileapi::FileSystemOperationContext> context, | 86 scoped_ptr<storage::FileSystemOperationContext> context, |
| 87 const fileapi::FileSystemURL& url, | 87 const storage::FileSystemURL& url, |
| 88 const StatusCallback& callback) OVERRIDE; | 88 const StatusCallback& callback) OVERRIDE; |
| 89 virtual void DeleteDirectory( | 89 virtual void DeleteDirectory( |
| 90 scoped_ptr<fileapi::FileSystemOperationContext> context, | 90 scoped_ptr<storage::FileSystemOperationContext> context, |
| 91 const fileapi::FileSystemURL& url, | 91 const storage::FileSystemURL& url, |
| 92 const StatusCallback& callback) OVERRIDE; | 92 const StatusCallback& callback) OVERRIDE; |
| 93 virtual void DeleteRecursively( | 93 virtual void DeleteRecursively( |
| 94 scoped_ptr<fileapi::FileSystemOperationContext> context, | 94 scoped_ptr<storage::FileSystemOperationContext> context, |
| 95 const fileapi::FileSystemURL& url, | 95 const storage::FileSystemURL& url, |
| 96 const StatusCallback& callback) OVERRIDE; | 96 const StatusCallback& callback) OVERRIDE; |
| 97 virtual void CreateSnapshotFile( | 97 virtual void CreateSnapshotFile( |
| 98 scoped_ptr<fileapi::FileSystemOperationContext> context, | 98 scoped_ptr<storage::FileSystemOperationContext> context, |
| 99 const fileapi::FileSystemURL& url, | 99 const storage::FileSystemURL& url, |
| 100 const CreateSnapshotFileCallback& callback) OVERRIDE; | 100 const CreateSnapshotFileCallback& callback) OVERRIDE; |
| 101 | 101 |
| 102 private: | 102 private: |
| 103 DISALLOW_COPY_AND_ASSIGN(ProviderAsyncFileUtil); | 103 DISALLOW_COPY_AND_ASSIGN(ProviderAsyncFileUtil); |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 } // namespace internal | 106 } // namespace internal |
| 107 } // namespace file_system_provider | 107 } // namespace file_system_provider |
| 108 } // namespace chromeos | 108 } // namespace chromeos |
| 109 | 109 |
| 110 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FILEAPI_PROVIDER_ASYNC_F
ILE_UTIL_H_ | 110 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_FILEAPI_PROVIDER_ASYNC_F
ILE_UTIL_H_ |
| OLD | NEW |