Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
|
Vitaly Buka (NO REVIEWS)
2014/01/07 21:08:49
Do we use (c) again?
Noam Samuel
2014/01/07 22:10:59
No.
| |
| 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_ASYNC_FILE_UTIL_H_ | 5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_STORAGE_PRIVET_FILESYSTEM_ASYNC_UTIL_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_ASYNC_FILE_UTIL_H_ | 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_STORAGE_PRIVET_FILESYSTEM_ASYNC_UTIL_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/callback.h" | |
| 10 #include "webkit/browser/fileapi/async_file_util.h" | 8 #include "webkit/browser/fileapi/async_file_util.h" |
| 11 | 9 |
| 12 namespace drive { | 10 namespace local_discovery { |
| 13 | 11 |
| 14 class FileSystemInterface; | 12 class PrivetFileSystemAsyncUtil : public fileapi::AsyncFileUtil { |
| 15 | |
| 16 namespace internal { | |
| 17 | |
| 18 // The implementation of fileapi::AsyncFileUtil for Drive File System. | |
| 19 class AsyncFileUtil : public fileapi::AsyncFileUtil { | |
| 20 public: | 13 public: |
| 21 // Callback to return the FileSystemInterface instance. This is an | |
| 22 // injecting point for testing. | |
| 23 // Note that the callback will be copied between threads (IO and UI), and | |
| 24 // will be called on UI thread. | |
| 25 typedef base::Callback<FileSystemInterface*()> FileSystemGetter; | |
| 26 | |
| 27 explicit AsyncFileUtil(const FileSystemGetter& file_system_getter); | |
| 28 virtual ~AsyncFileUtil(); | |
| 29 | |
| 30 // fileapi::AsyncFileUtil overrides. | |
| 31 virtual void CreateOrOpen( | 14 virtual void CreateOrOpen( |
| 32 scoped_ptr<fileapi::FileSystemOperationContext> context, | 15 scoped_ptr<fileapi::FileSystemOperationContext> context, |
| 33 const fileapi::FileSystemURL& url, | 16 const fileapi::FileSystemURL& url, |
| 34 int file_flags, | 17 int file_flags, |
| 35 const CreateOrOpenCallback& callback) OVERRIDE; | 18 const CreateOrOpenCallback& callback) OVERRIDE; |
| 36 virtual void EnsureFileExists( | 19 virtual void EnsureFileExists( |
| 37 scoped_ptr<fileapi::FileSystemOperationContext> context, | 20 scoped_ptr<fileapi::FileSystemOperationContext> context, |
| 38 const fileapi::FileSystemURL& url, | 21 const fileapi::FileSystemURL& url, |
| 39 const EnsureFileExistsCallback& callback) OVERRIDE; | 22 const EnsureFileExistsCallback& callback) OVERRIDE; |
| 40 virtual void CreateDirectory( | 23 virtual void CreateDirectory( |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 69 CopyOrMoveOption option, | 52 CopyOrMoveOption option, |
| 70 const CopyFileProgressCallback& progress_callback, | 53 const CopyFileProgressCallback& progress_callback, |
| 71 const StatusCallback& callback) OVERRIDE; | 54 const StatusCallback& callback) OVERRIDE; |
| 72 virtual void MoveFileLocal( | 55 virtual void MoveFileLocal( |
| 73 scoped_ptr<fileapi::FileSystemOperationContext> context, | 56 scoped_ptr<fileapi::FileSystemOperationContext> context, |
| 74 const fileapi::FileSystemURL& src_url, | 57 const fileapi::FileSystemURL& src_url, |
| 75 const fileapi::FileSystemURL& dest_url, | 58 const fileapi::FileSystemURL& dest_url, |
| 76 CopyOrMoveOption option, | 59 CopyOrMoveOption option, |
| 77 const StatusCallback& callback) OVERRIDE; | 60 const StatusCallback& callback) OVERRIDE; |
| 78 virtual void CopyInForeignFile( | 61 virtual void CopyInForeignFile( |
| 79 scoped_ptr<fileapi::FileSystemOperationContext> context, | 62 scoped_ptr<fileapi::FileSystemOperationContext> context, |
| 80 const base::FilePath& src_file_path, | 63 const base::FilePath& src_file_path, |
|
Vitaly Buka (NO REVIEWS)
2014/01/07 21:08:49
missaligned
Noam Samuel
2014/01/07 22:10:59
Done.
| |
| 81 const fileapi::FileSystemURL& dest_url, | 64 const fileapi::FileSystemURL& dest_url, |
| 82 const StatusCallback& callback) OVERRIDE; | 65 const StatusCallback& callback) OVERRIDE; |
| 83 virtual void DeleteFile( | 66 virtual void DeleteFile( |
| 84 scoped_ptr<fileapi::FileSystemOperationContext> context, | 67 scoped_ptr<fileapi::FileSystemOperationContext> context, |
| 85 const fileapi::FileSystemURL& url, | 68 const fileapi::FileSystemURL& url, |
| 86 const StatusCallback& callback) OVERRIDE; | 69 const StatusCallback& callback) OVERRIDE; |
| 87 virtual void DeleteDirectory( | 70 virtual void DeleteDirectory( |
| 88 scoped_ptr<fileapi::FileSystemOperationContext> context, | 71 scoped_ptr<fileapi::FileSystemOperationContext> context, |
| 89 const fileapi::FileSystemURL& url, | 72 const fileapi::FileSystemURL& url, |
| 90 const StatusCallback& callback) OVERRIDE; | 73 const StatusCallback& callback) OVERRIDE; |
| 91 virtual void DeleteRecursively( | 74 virtual void DeleteRecursively( |
| 92 scoped_ptr<fileapi::FileSystemOperationContext> context, | 75 scoped_ptr<fileapi::FileSystemOperationContext> context, |
| 93 const fileapi::FileSystemURL& url, | 76 const fileapi::FileSystemURL& url, |
| 94 const StatusCallback& callback) OVERRIDE; | 77 const StatusCallback& callback) OVERRIDE; |
| 95 virtual void CreateSnapshotFile( | 78 virtual void CreateSnapshotFile( |
| 96 scoped_ptr<fileapi::FileSystemOperationContext> context, | 79 scoped_ptr<fileapi::FileSystemOperationContext> context, |
| 97 const fileapi::FileSystemURL& url, | 80 const fileapi::FileSystemURL& url, |
| 98 const CreateSnapshotFileCallback& callback) OVERRIDE; | 81 const CreateSnapshotFileCallback& callback) OVERRIDE; |
| 99 | |
| 100 private: | |
| 101 FileSystemGetter file_system_getter_; | |
| 102 | |
| 103 DISALLOW_COPY_AND_ASSIGN(AsyncFileUtil); | |
| 104 }; | 82 }; |
| 105 | 83 |
| 106 } // namespace internal | 84 } // namespace local_discovery |
| 107 } // namespace drive | |
| 108 | 85 |
| 109 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_ASYNC_FILE_UTIL_H_ | 86 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_STORAGE_PRIVET_FILESYSTEM_ASYNC_UTIL_H _ |
| OLD | NEW |