| 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 WEBKIT_BROWSER_FILEAPI_SYNCABLE_CANNED_SYNCABLE_FILE_SYSTEM_H_ | 5 #ifndef WEBKIT_BROWSER_FILEAPI_SYNCABLE_CANNED_SYNCABLE_FILE_SYSTEM_H_ |
| 6 #define WEBKIT_BROWSER_FILEAPI_SYNCABLE_CANNED_SYNCABLE_FILE_SYSTEM_H_ | 6 #define WEBKIT_BROWSER_FILEAPI_SYNCABLE_CANNED_SYNCABLE_FILE_SYSTEM_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 class URLRequestContext; | 38 class URLRequestContext; |
| 39 } | 39 } |
| 40 | 40 |
| 41 namespace quota { | 41 namespace quota { |
| 42 class QuotaManager; | 42 class QuotaManager; |
| 43 } | 43 } |
| 44 | 44 |
| 45 namespace sync_file_system { | 45 namespace sync_file_system { |
| 46 | 46 |
| 47 class LocalFileSyncContext; | 47 class LocalFileSyncContext; |
| 48 class SyncFileSystemBackend; |
| 48 | 49 |
| 49 // A canned syncable filesystem for testing. | 50 // A canned syncable filesystem for testing. |
| 50 // This internally creates its own QuotaManager and FileSystemContext | 51 // This internally creates its own QuotaManager and FileSystemContext |
| 51 // (as we do so for each isolated application). | 52 // (as we do so for each isolated application). |
| 52 class CannedSyncableFileSystem | 53 class CannedSyncableFileSystem |
| 53 : public LocalFileSyncStatus::Observer { | 54 : public LocalFileSyncStatus::Observer { |
| 54 public: | 55 public: |
| 55 typedef base::Callback<void(base::PlatformFileError)> StatusCallback; | 56 typedef base::Callback<void(base::PlatformFileError)> StatusCallback; |
| 56 typedef base::Callback<void(int64)> WriteCallback; | 57 typedef base::Callback<void(int64)> WriteCallback; |
| 57 typedef fileapi::FileSystemOperation::FileEntryList FileEntryList; | 58 typedef fileapi::FileSystemOperation::FileEntryList FileEntryList; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // Purges the file system local storage. | 132 // Purges the file system local storage. |
| 132 base::PlatformFileError DeleteFileSystem(); | 133 base::PlatformFileError DeleteFileSystem(); |
| 133 | 134 |
| 134 // Retrieves the quota and usage. | 135 // Retrieves the quota and usage. |
| 135 quota::QuotaStatusCode GetUsageAndQuota(int64* usage, int64* quota); | 136 quota::QuotaStatusCode GetUsageAndQuota(int64* usage, int64* quota); |
| 136 | 137 |
| 137 // ChangeTracker related methods. They run on file task runner. | 138 // ChangeTracker related methods. They run on file task runner. |
| 138 void GetChangedURLsInTracker(fileapi::FileSystemURLSet* urls); | 139 void GetChangedURLsInTracker(fileapi::FileSystemURLSet* urls); |
| 139 void ClearChangeForURLInTracker(const fileapi::FileSystemURL& url); | 140 void ClearChangeForURLInTracker(const fileapi::FileSystemURL& url); |
| 140 | 141 |
| 142 SyncFileSystemBackend* backend(); |
| 141 fileapi::FileSystemOperationRunner* operation_runner(); | 143 fileapi::FileSystemOperationRunner* operation_runner(); |
| 142 | 144 |
| 143 // LocalFileSyncStatus::Observer overrides. | 145 // LocalFileSyncStatus::Observer overrides. |
| 144 virtual void OnSyncEnabled(const fileapi::FileSystemURL& url) OVERRIDE; | 146 virtual void OnSyncEnabled(const fileapi::FileSystemURL& url) OVERRIDE; |
| 145 virtual void OnWriteEnabled(const fileapi::FileSystemURL& url) OVERRIDE; | 147 virtual void OnWriteEnabled(const fileapi::FileSystemURL& url) OVERRIDE; |
| 146 | 148 |
| 147 // Operation methods body. | 149 // Operation methods body. |
| 148 // They can be also called directly if the caller is already on IO thread. | 150 // They can be also called directly if the caller is already on IO thread. |
| 149 void DoCreateDirectory(const fileapi::FileSystemURL& url, | 151 void DoCreateDirectory(const fileapi::FileSystemURL& url, |
| 150 const StatusCallback& callback); | 152 const StatusCallback& callback); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 bool is_filesystem_opened_; | 223 bool is_filesystem_opened_; |
| 222 | 224 |
| 223 scoped_refptr<ObserverList> sync_status_observers_; | 225 scoped_refptr<ObserverList> sync_status_observers_; |
| 224 | 226 |
| 225 DISALLOW_COPY_AND_ASSIGN(CannedSyncableFileSystem); | 227 DISALLOW_COPY_AND_ASSIGN(CannedSyncableFileSystem); |
| 226 }; | 228 }; |
| 227 | 229 |
| 228 } // namespace sync_file_system | 230 } // namespace sync_file_system |
| 229 | 231 |
| 230 #endif // WEBKIT_BROWSER_FILEAPI_SYNCABLE_CANNED_SYNCABLE_FILE_SYSTEM_H_ | 232 #endif // WEBKIT_BROWSER_FILEAPI_SYNCABLE_CANNED_SYNCABLE_FILE_SYSTEM_H_ |
| OLD | NEW |