| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SYNC_FILE_SYSTEM_LOCAL_SYNCABLE_FILE_SYSTEM_OPERATION_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNCABLE_FILE_SYSTEM_OPERATION_H_ |
| 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNCABLE_FILE_SYSTEM_OPERATION_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNCABLE_FILE_SYSTEM_OPERATION_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 namespace sync_file_system { | 23 namespace sync_file_system { |
| 24 | 24 |
| 25 class SyncableFileOperationRunner; | 25 class SyncableFileOperationRunner; |
| 26 | 26 |
| 27 // A wrapper class of FileSystemOperation for syncable file system. | 27 // A wrapper class of FileSystemOperation for syncable file system. |
| 28 class SyncableFileSystemOperation | 28 class SyncableFileSystemOperation |
| 29 : public NON_EXPORTED_BASE(storage::FileSystemOperation), | 29 : public NON_EXPORTED_BASE(storage::FileSystemOperation), |
| 30 public base::NonThreadSafe { | 30 public base::NonThreadSafe { |
| 31 public: | 31 public: |
| 32 virtual ~SyncableFileSystemOperation(); | 32 ~SyncableFileSystemOperation() override; |
| 33 | 33 |
| 34 // storage::FileSystemOperation overrides. | 34 // storage::FileSystemOperation overrides. |
| 35 virtual void CreateFile(const storage::FileSystemURL& url, | 35 void CreateFile(const storage::FileSystemURL& url, |
| 36 bool exclusive, | 36 bool exclusive, |
| 37 const StatusCallback& callback) override; | 37 const StatusCallback& callback) override; |
| 38 virtual void CreateDirectory(const storage::FileSystemURL& url, | 38 void CreateDirectory(const storage::FileSystemURL& url, |
| 39 bool exclusive, | 39 bool exclusive, |
| 40 bool recursive, | 40 bool recursive, |
| 41 const StatusCallback& callback) override; | 41 const StatusCallback& callback) override; |
| 42 virtual void Copy(const storage::FileSystemURL& src_url, | 42 void Copy(const storage::FileSystemURL& src_url, |
| 43 const storage::FileSystemURL& dest_url, | 43 const storage::FileSystemURL& dest_url, |
| 44 CopyOrMoveOption option, | 44 CopyOrMoveOption option, |
| 45 const CopyProgressCallback& progress_callback, | 45 const CopyProgressCallback& progress_callback, |
| 46 const StatusCallback& callback) override; | 46 const StatusCallback& callback) override; |
| 47 virtual void Move(const storage::FileSystemURL& src_url, | 47 void Move(const storage::FileSystemURL& src_url, |
| 48 const storage::FileSystemURL& dest_url, | 48 const storage::FileSystemURL& dest_url, |
| 49 CopyOrMoveOption option, | 49 CopyOrMoveOption option, |
| 50 const StatusCallback& callback) override; | 50 const StatusCallback& callback) override; |
| 51 virtual void DirectoryExists(const storage::FileSystemURL& url, | 51 void DirectoryExists(const storage::FileSystemURL& url, |
| 52 const StatusCallback& callback) override; | 52 const StatusCallback& callback) override; |
| 53 virtual void FileExists(const storage::FileSystemURL& url, | 53 void FileExists(const storage::FileSystemURL& url, |
| 54 const StatusCallback& callback) override; | 54 const StatusCallback& callback) override; |
| 55 virtual void GetMetadata(const storage::FileSystemURL& url, | 55 void GetMetadata(const storage::FileSystemURL& url, |
| 56 const GetMetadataCallback& callback) override; | 56 const GetMetadataCallback& callback) override; |
| 57 virtual void ReadDirectory(const storage::FileSystemURL& url, | 57 void ReadDirectory(const storage::FileSystemURL& url, |
| 58 const ReadDirectoryCallback& callback) override; | 58 const ReadDirectoryCallback& callback) override; |
| 59 virtual void Remove(const storage::FileSystemURL& url, | 59 void Remove(const storage::FileSystemURL& url, |
| 60 bool recursive, | 60 bool recursive, |
| 61 const StatusCallback& callback) override; | 61 const StatusCallback& callback) override; |
| 62 virtual void Write(const storage::FileSystemURL& url, | 62 void Write(const storage::FileSystemURL& url, |
| 63 scoped_ptr<storage::FileWriterDelegate> writer_delegate, | 63 scoped_ptr<storage::FileWriterDelegate> writer_delegate, |
| 64 scoped_ptr<net::URLRequest> blob_request, | 64 scoped_ptr<net::URLRequest> blob_request, |
| 65 const WriteCallback& callback) override; | 65 const WriteCallback& callback) override; |
| 66 virtual void Truncate(const storage::FileSystemURL& url, | 66 void Truncate(const storage::FileSystemURL& url, |
| 67 int64 length, | 67 int64 length, |
| 68 const StatusCallback& callback) override; | 68 const StatusCallback& callback) override; |
| 69 virtual void TouchFile(const storage::FileSystemURL& url, | 69 void TouchFile(const storage::FileSystemURL& url, |
| 70 const base::Time& last_access_time, | 70 const base::Time& last_access_time, |
| 71 const base::Time& last_modified_time, | 71 const base::Time& last_modified_time, |
| 72 const StatusCallback& callback) override; |
| 73 void OpenFile(const storage::FileSystemURL& url, |
| 74 int file_flags, |
| 75 const OpenFileCallback& callback) override; |
| 76 void Cancel(const StatusCallback& cancel_callback) override; |
| 77 void CreateSnapshotFile(const storage::FileSystemURL& path, |
| 78 const SnapshotFileCallback& callback) override; |
| 79 void CopyInForeignFile(const base::FilePath& src_local_disk_path, |
| 80 const storage::FileSystemURL& dest_url, |
| 72 const StatusCallback& callback) override; | 81 const StatusCallback& callback) override; |
| 73 virtual void OpenFile(const storage::FileSystemURL& url, | 82 void RemoveFile(const storage::FileSystemURL& url, |
| 74 int file_flags, | 83 const StatusCallback& callback) override; |
| 75 const OpenFileCallback& callback) override; | 84 void RemoveDirectory(const storage::FileSystemURL& url, |
| 76 virtual void Cancel(const StatusCallback& cancel_callback) override; | 85 const StatusCallback& callback) override; |
| 77 virtual void CreateSnapshotFile( | 86 void CopyFileLocal(const storage::FileSystemURL& src_url, |
| 78 const storage::FileSystemURL& path, | 87 const storage::FileSystemURL& dest_url, |
| 79 const SnapshotFileCallback& callback) override; | 88 CopyOrMoveOption option, |
| 80 virtual void CopyInForeignFile(const base::FilePath& src_local_disk_path, | 89 const CopyFileProgressCallback& progress_callback, |
| 81 const storage::FileSystemURL& dest_url, | 90 const StatusCallback& callback) override; |
| 82 const StatusCallback& callback) override; | 91 void MoveFileLocal(const storage::FileSystemURL& src_url, |
| 83 virtual void RemoveFile(const storage::FileSystemURL& url, | 92 const storage::FileSystemURL& dest_url, |
| 84 const StatusCallback& callback) override; | 93 CopyOrMoveOption option, |
| 85 virtual void RemoveDirectory(const storage::FileSystemURL& url, | 94 const StatusCallback& callback) override; |
| 86 const StatusCallback& callback) override; | 95 base::File::Error SyncGetPlatformPath(const storage::FileSystemURL& url, |
| 87 virtual void CopyFileLocal(const storage::FileSystemURL& src_url, | 96 base::FilePath* platform_path) override; |
| 88 const storage::FileSystemURL& dest_url, | |
| 89 CopyOrMoveOption option, | |
| 90 const CopyFileProgressCallback& progress_callback, | |
| 91 const StatusCallback& callback) override; | |
| 92 virtual void MoveFileLocal(const storage::FileSystemURL& src_url, | |
| 93 const storage::FileSystemURL& dest_url, | |
| 94 CopyOrMoveOption option, | |
| 95 const StatusCallback& callback) override; | |
| 96 virtual base::File::Error SyncGetPlatformPath( | |
| 97 const storage::FileSystemURL& url, | |
| 98 base::FilePath* platform_path) override; | |
| 99 | 97 |
| 100 private: | 98 private: |
| 101 typedef SyncableFileSystemOperation self; | 99 typedef SyncableFileSystemOperation self; |
| 102 class QueueableTask; | 100 class QueueableTask; |
| 103 | 101 |
| 104 // Only SyncFileSystemBackend can create a new operation directly. | 102 // Only SyncFileSystemBackend can create a new operation directly. |
| 105 friend class SyncFileSystemBackend; | 103 friend class SyncFileSystemBackend; |
| 106 | 104 |
| 107 SyncableFileSystemOperation( | 105 SyncableFileSystemOperation( |
| 108 const storage::FileSystemURL& url, | 106 const storage::FileSystemURL& url, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 126 StatusCallback completion_callback_; | 124 StatusCallback completion_callback_; |
| 127 | 125 |
| 128 base::WeakPtrFactory<SyncableFileSystemOperation> weak_factory_; | 126 base::WeakPtrFactory<SyncableFileSystemOperation> weak_factory_; |
| 129 | 127 |
| 130 DISALLOW_COPY_AND_ASSIGN(SyncableFileSystemOperation); | 128 DISALLOW_COPY_AND_ASSIGN(SyncableFileSystemOperation); |
| 131 }; | 129 }; |
| 132 | 130 |
| 133 } // namespace sync_file_system | 131 } // namespace sync_file_system |
| 134 | 132 |
| 135 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNCABLE_FILE_SYSTEM_OPERATION_
H_ | 133 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_SYNCABLE_FILE_SYSTEM_OPERATION_
H_ |
| OLD | NEW |