| 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_LOCAL_DISCOVERY_STORAGE_PRIVET_FILESYSTEM_ASYNC_UTIL_H_ | 5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_STORAGE_PRIVET_FILESYSTEM_ASYNC_UTIL_H_ |
| 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_STORAGE_PRIVET_FILESYSTEM_ASYNC_UTIL_H_ | 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_STORAGE_PRIVET_FILESYSTEM_ASYNC_UTIL_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/local_discovery/storage/privet_filesystem_attribute_cac
he.h" | 8 #include "chrome/browser/local_discovery/storage/privet_filesystem_attribute_cac
he.h" |
| 9 #include "chrome/browser/local_discovery/storage/privet_filesystem_operations.h" | 9 #include "chrome/browser/local_discovery/storage/privet_filesystem_operations.h" |
| 10 #include "content/public/browser/browser_context.h" | 10 #include "content/public/browser/browser_context.h" |
| 11 #include "webkit/browser/fileapi/async_file_util.h" | 11 #include "storage/browser/fileapi/async_file_util.h" |
| 12 | 12 |
| 13 namespace local_discovery { | 13 namespace local_discovery { |
| 14 | 14 |
| 15 class PrivetFileSystemAsyncUtil : public fileapi::AsyncFileUtil { | 15 class PrivetFileSystemAsyncUtil : public storage::AsyncFileUtil { |
| 16 public: | 16 public: |
| 17 explicit PrivetFileSystemAsyncUtil(content::BrowserContext* browser_context); | 17 explicit PrivetFileSystemAsyncUtil(content::BrowserContext* browser_context); |
| 18 virtual ~PrivetFileSystemAsyncUtil(); | 18 virtual ~PrivetFileSystemAsyncUtil(); |
| 19 | 19 |
| 20 virtual void CreateOrOpen( | 20 virtual void CreateOrOpen( |
| 21 scoped_ptr<fileapi::FileSystemOperationContext> context, | 21 scoped_ptr<storage::FileSystemOperationContext> context, |
| 22 const fileapi::FileSystemURL& url, | 22 const storage::FileSystemURL& url, |
| 23 int file_flags, | 23 int file_flags, |
| 24 const CreateOrOpenCallback& callback) OVERRIDE; | 24 const CreateOrOpenCallback& callback) OVERRIDE; |
| 25 virtual void EnsureFileExists( | 25 virtual void EnsureFileExists( |
| 26 scoped_ptr<fileapi::FileSystemOperationContext> context, | 26 scoped_ptr<storage::FileSystemOperationContext> context, |
| 27 const fileapi::FileSystemURL& url, | 27 const storage::FileSystemURL& url, |
| 28 const EnsureFileExistsCallback& callback) OVERRIDE; | 28 const EnsureFileExistsCallback& callback) OVERRIDE; |
| 29 virtual void CreateDirectory( | 29 virtual void CreateDirectory( |
| 30 scoped_ptr<fileapi::FileSystemOperationContext> context, | 30 scoped_ptr<storage::FileSystemOperationContext> context, |
| 31 const fileapi::FileSystemURL& url, | 31 const storage::FileSystemURL& url, |
| 32 bool exclusive, | 32 bool exclusive, |
| 33 bool recursive, | 33 bool recursive, |
| 34 const StatusCallback& callback) OVERRIDE; | 34 const StatusCallback& callback) OVERRIDE; |
| 35 virtual void GetFileInfo( | 35 virtual void GetFileInfo( |
| 36 scoped_ptr<fileapi::FileSystemOperationContext> context, | 36 scoped_ptr<storage::FileSystemOperationContext> context, |
| 37 const fileapi::FileSystemURL& url, | 37 const storage::FileSystemURL& url, |
| 38 const GetFileInfoCallback& callback) OVERRIDE; | 38 const GetFileInfoCallback& callback) OVERRIDE; |
| 39 virtual void ReadDirectory( | 39 virtual void ReadDirectory( |
| 40 scoped_ptr<fileapi::FileSystemOperationContext> context, | 40 scoped_ptr<storage::FileSystemOperationContext> context, |
| 41 const fileapi::FileSystemURL& url, | 41 const storage::FileSystemURL& url, |
| 42 const ReadDirectoryCallback& callback) OVERRIDE; | 42 const ReadDirectoryCallback& callback) OVERRIDE; |
| 43 virtual void Touch( | 43 virtual void Touch(scoped_ptr<storage::FileSystemOperationContext> context, |
| 44 scoped_ptr<fileapi::FileSystemOperationContext> context, | 44 const storage::FileSystemURL& url, |
| 45 const fileapi::FileSystemURL& url, | 45 const base::Time& last_access_time, |
| 46 const base::Time& last_access_time, | 46 const base::Time& last_modified_time, |
| 47 const base::Time& last_modified_time, | 47 const StatusCallback& callback) OVERRIDE; |
| 48 const StatusCallback& callback) OVERRIDE; | 48 virtual void Truncate(scoped_ptr<storage::FileSystemOperationContext> context, |
| 49 virtual void Truncate( | 49 const storage::FileSystemURL& url, |
| 50 scoped_ptr<fileapi::FileSystemOperationContext> context, | 50 int64 length, |
| 51 const fileapi::FileSystemURL& url, | 51 const StatusCallback& callback) OVERRIDE; |
| 52 int64 length, | |
| 53 const StatusCallback& callback) OVERRIDE; | |
| 54 virtual void CopyFileLocal( | 52 virtual void CopyFileLocal( |
| 55 scoped_ptr<fileapi::FileSystemOperationContext> context, | 53 scoped_ptr<storage::FileSystemOperationContext> context, |
| 56 const fileapi::FileSystemURL& src_url, | 54 const storage::FileSystemURL& src_url, |
| 57 const fileapi::FileSystemURL& dest_url, | 55 const storage::FileSystemURL& dest_url, |
| 58 CopyOrMoveOption option, | 56 CopyOrMoveOption option, |
| 59 const CopyFileProgressCallback& progress_callback, | 57 const CopyFileProgressCallback& progress_callback, |
| 60 const StatusCallback& callback) OVERRIDE; | 58 const StatusCallback& callback) OVERRIDE; |
| 61 virtual void MoveFileLocal( | 59 virtual void MoveFileLocal( |
| 62 scoped_ptr<fileapi::FileSystemOperationContext> context, | 60 scoped_ptr<storage::FileSystemOperationContext> context, |
| 63 const fileapi::FileSystemURL& src_url, | 61 const storage::FileSystemURL& src_url, |
| 64 const fileapi::FileSystemURL& dest_url, | 62 const storage::FileSystemURL& dest_url, |
| 65 CopyOrMoveOption option, | 63 CopyOrMoveOption option, |
| 66 const StatusCallback& callback) OVERRIDE; | 64 const StatusCallback& callback) OVERRIDE; |
| 67 virtual void CopyInForeignFile( | 65 virtual void CopyInForeignFile( |
| 68 scoped_ptr<fileapi::FileSystemOperationContext> context, | 66 scoped_ptr<storage::FileSystemOperationContext> context, |
| 69 const base::FilePath& src_file_path, | 67 const base::FilePath& src_file_path, |
| 70 const fileapi::FileSystemURL& dest_url, | 68 const storage::FileSystemURL& dest_url, |
| 71 const StatusCallback& callback) OVERRIDE; | 69 const StatusCallback& callback) OVERRIDE; |
| 72 virtual void DeleteFile( | 70 virtual void DeleteFile( |
| 73 scoped_ptr<fileapi::FileSystemOperationContext> context, | 71 scoped_ptr<storage::FileSystemOperationContext> context, |
| 74 const fileapi::FileSystemURL& url, | 72 const storage::FileSystemURL& url, |
| 75 const StatusCallback& callback) OVERRIDE; | 73 const StatusCallback& callback) OVERRIDE; |
| 76 virtual void DeleteDirectory( | 74 virtual void DeleteDirectory( |
| 77 scoped_ptr<fileapi::FileSystemOperationContext> context, | 75 scoped_ptr<storage::FileSystemOperationContext> context, |
| 78 const fileapi::FileSystemURL& url, | 76 const storage::FileSystemURL& url, |
| 79 const StatusCallback& callback) OVERRIDE; | 77 const StatusCallback& callback) OVERRIDE; |
| 80 virtual void DeleteRecursively( | 78 virtual void DeleteRecursively( |
| 81 scoped_ptr<fileapi::FileSystemOperationContext> context, | 79 scoped_ptr<storage::FileSystemOperationContext> context, |
| 82 const fileapi::FileSystemURL& url, | 80 const storage::FileSystemURL& url, |
| 83 const StatusCallback& callback) OVERRIDE; | 81 const StatusCallback& callback) OVERRIDE; |
| 84 virtual void CreateSnapshotFile( | 82 virtual void CreateSnapshotFile( |
| 85 scoped_ptr<fileapi::FileSystemOperationContext> context, | 83 scoped_ptr<storage::FileSystemOperationContext> context, |
| 86 const fileapi::FileSystemURL& url, | 84 const storage::FileSystemURL& url, |
| 87 const CreateSnapshotFileCallback& callback) OVERRIDE; | 85 const CreateSnapshotFileCallback& callback) OVERRIDE; |
| 88 | 86 |
| 89 private: | 87 private: |
| 90 PrivetFileSystemOperationFactory* operation_factory_; | 88 PrivetFileSystemOperationFactory* operation_factory_; |
| 91 }; | 89 }; |
| 92 | 90 |
| 93 } // namespace local_discovery | 91 } // namespace local_discovery |
| 94 | 92 |
| 95 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_STORAGE_PRIVET_FILESYSTEM_ASYNC_UTIL_H
_ | 93 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_STORAGE_PRIVET_FILESYSTEM_ASYNC_UTIL_H
_ |
| OLD | NEW |