| 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_CANNED_SYNCABLE_FILE_SYSTEM_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_CANNED_SYNCABLE_FILE_SYSTEM_H_ |
| 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_CANNED_SYNCABLE_FILE_SYSTEM_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_CANNED_SYNCABLE_FILE_SYSTEM_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 enum QuotaMode { | 68 enum QuotaMode { |
| 69 QUOTA_ENABLED, | 69 QUOTA_ENABLED, |
| 70 QUOTA_DISABLED, | 70 QUOTA_DISABLED, |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 CannedSyncableFileSystem( | 73 CannedSyncableFileSystem( |
| 74 const GURL& origin, | 74 const GURL& origin, |
| 75 leveldb::Env* env_override, | 75 leveldb::Env* env_override, |
| 76 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, | 76 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, |
| 77 const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner); | 77 const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner); |
| 78 virtual ~CannedSyncableFileSystem(); | 78 ~CannedSyncableFileSystem() override; |
| 79 | 79 |
| 80 // SetUp must be called before using this instance. | 80 // SetUp must be called before using this instance. |
| 81 void SetUp(QuotaMode quota_mode); | 81 void SetUp(QuotaMode quota_mode); |
| 82 | 82 |
| 83 // TearDown must be called before destructing this instance. | 83 // TearDown must be called before destructing this instance. |
| 84 void TearDown(); | 84 void TearDown(); |
| 85 | 85 |
| 86 // Creates a FileSystemURL for the given (utf8) path string. | 86 // Creates a FileSystemURL for the given (utf8) path string. |
| 87 storage::FileSystemURL URL(const std::string& path) const; | 87 storage::FileSystemURL URL(const std::string& path) const; |
| 88 | 88 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 // ChangeTracker related methods. They run on file task runner. | 152 // ChangeTracker related methods. They run on file task runner. |
| 153 void GetChangedURLsInTracker(storage::FileSystemURLSet* urls); | 153 void GetChangedURLsInTracker(storage::FileSystemURLSet* urls); |
| 154 void ClearChangeForURLInTracker(const storage::FileSystemURL& url); | 154 void ClearChangeForURLInTracker(const storage::FileSystemURL& url); |
| 155 void GetChangesForURLInTracker(const storage::FileSystemURL& url, | 155 void GetChangesForURLInTracker(const storage::FileSystemURL& url, |
| 156 FileChangeList* changes); | 156 FileChangeList* changes); |
| 157 | 157 |
| 158 SyncFileSystemBackend* backend(); | 158 SyncFileSystemBackend* backend(); |
| 159 storage::FileSystemOperationRunner* operation_runner(); | 159 storage::FileSystemOperationRunner* operation_runner(); |
| 160 | 160 |
| 161 // LocalFileSyncStatus::Observer overrides. | 161 // LocalFileSyncStatus::Observer overrides. |
| 162 virtual void OnSyncEnabled(const storage::FileSystemURL& url) override; | 162 void OnSyncEnabled(const storage::FileSystemURL& url) override; |
| 163 virtual void OnWriteEnabled(const storage::FileSystemURL& url) override; | 163 void OnWriteEnabled(const storage::FileSystemURL& url) override; |
| 164 | 164 |
| 165 // Operation methods body. | 165 // Operation methods body. |
| 166 // They can be also called directly if the caller is already on IO thread. | 166 // They can be also called directly if the caller is already on IO thread. |
| 167 void DoOpenFileSystem(const OpenFileSystemCallback& callback); | 167 void DoOpenFileSystem(const OpenFileSystemCallback& callback); |
| 168 void DoCreateDirectory(const storage::FileSystemURL& url, | 168 void DoCreateDirectory(const storage::FileSystemURL& url, |
| 169 const StatusCallback& callback); | 169 const StatusCallback& callback); |
| 170 void DoCreateFile(const storage::FileSystemURL& url, | 170 void DoCreateFile(const storage::FileSystemURL& url, |
| 171 const StatusCallback& callback); | 171 const StatusCallback& callback); |
| 172 void DoCopy(const storage::FileSystemURL& src_url, | 172 void DoCopy(const storage::FileSystemURL& src_url, |
| 173 const storage::FileSystemURL& dest_url, | 173 const storage::FileSystemURL& dest_url, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 bool is_filesystem_opened_; // Should be accessed only on the IO thread. | 244 bool is_filesystem_opened_; // Should be accessed only on the IO thread. |
| 245 | 245 |
| 246 scoped_refptr<ObserverList> sync_status_observers_; | 246 scoped_refptr<ObserverList> sync_status_observers_; |
| 247 | 247 |
| 248 DISALLOW_COPY_AND_ASSIGN(CannedSyncableFileSystem); | 248 DISALLOW_COPY_AND_ASSIGN(CannedSyncableFileSystem); |
| 249 }; | 249 }; |
| 250 | 250 |
| 251 } // namespace sync_file_system | 251 } // namespace sync_file_system |
| 252 | 252 |
| 253 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_CANNED_SYNCABLE_FILE_SYSTEM_H_ | 253 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_CANNED_SYNCABLE_FILE_SYSTEM_H_ |
| OLD | NEW |