| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_FILEAPI_SYNCABLE_CANNED_SYNCABLE_FILE_SYSTEM_H_ | 5 #ifndef WEBKIT_FILEAPI_SYNCABLE_CANNED_SYNCABLE_FILE_SYSTEM_H_ |
| 6 #define WEBKIT_FILEAPI_SYNCABLE_CANNED_SYNCABLE_FILE_SYSTEM_H_ | 6 #define WEBKIT_FILEAPI_SYNCABLE_CANNED_SYNCABLE_FILE_SYSTEM_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 class FileSystemURL; | 32 class FileSystemURL; |
| 33 } | 33 } |
| 34 | 34 |
| 35 namespace net { | 35 namespace net { |
| 36 class URLRequestContext; | 36 class URLRequestContext; |
| 37 } | 37 } |
| 38 | 38 |
| 39 namespace quota { | 39 namespace quota { |
| 40 class QuotaManager; | 40 class QuotaManager; |
| 41 } | 41 } |
| 42 namespace webkit_blob { |
| 43 class BlobDataHandle; |
| 44 } |
| 42 | 45 |
| 43 namespace sync_file_system { | 46 namespace sync_file_system { |
| 44 | 47 |
| 45 class LocalFileSyncContext; | 48 class LocalFileSyncContext; |
| 46 | 49 |
| 47 // A canned syncable filesystem for testing. | 50 // A canned syncable filesystem for testing. |
| 48 // This internally creates its own QuotaManager and FileSystemContext | 51 // This internally creates its own QuotaManager and FileSystemContext |
| 49 // (as we do so for each isolated application). | 52 // (as we do so for each isolated application). |
| 50 class CannedSyncableFileSystem | 53 class CannedSyncableFileSystem |
| 51 : public LocalFileSyncStatus::Observer { | 54 : public LocalFileSyncStatus::Observer { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 base::PlatformFileError FileExists(const fileapi::FileSystemURL& url); | 116 base::PlatformFileError FileExists(const fileapi::FileSystemURL& url); |
| 114 base::PlatformFileError DirectoryExists(const fileapi::FileSystemURL& url); | 117 base::PlatformFileError DirectoryExists(const fileapi::FileSystemURL& url); |
| 115 base::PlatformFileError VerifyFile(const fileapi::FileSystemURL& url, | 118 base::PlatformFileError VerifyFile(const fileapi::FileSystemURL& url, |
| 116 const std::string& expected_data); | 119 const std::string& expected_data); |
| 117 base::PlatformFileError GetMetadata(const fileapi::FileSystemURL& url, | 120 base::PlatformFileError GetMetadata(const fileapi::FileSystemURL& url, |
| 118 base::PlatformFileInfo* info, | 121 base::PlatformFileInfo* info, |
| 119 base::FilePath* platform_path); | 122 base::FilePath* platform_path); |
| 120 | 123 |
| 121 // Returns the # of bytes written (>=0) or an error code (<0). | 124 // Returns the # of bytes written (>=0) or an error code (<0). |
| 122 int64 Write(net::URLRequestContext* url_request_context, | 125 int64 Write(net::URLRequestContext* url_request_context, |
| 123 const fileapi::FileSystemURL& url, const GURL& blob_url); | 126 const fileapi::FileSystemURL& url, |
| 127 scoped_ptr<webkit_blob::BlobDataHandle> blob_data_handle); |
| 124 int64 WriteString(const fileapi::FileSystemURL& url, const std::string& data); | 128 int64 WriteString(const fileapi::FileSystemURL& url, const std::string& data); |
| 125 | 129 |
| 126 // Purges the file system local storage. | 130 // Purges the file system local storage. |
| 127 base::PlatformFileError DeleteFileSystem(); | 131 base::PlatformFileError DeleteFileSystem(); |
| 128 | 132 |
| 129 // Retrieves the quota and usage. | 133 // Retrieves the quota and usage. |
| 130 quota::QuotaStatusCode GetUsageAndQuota(int64* usage, int64* quota); | 134 quota::QuotaStatusCode GetUsageAndQuota(int64* usage, int64* quota); |
| 131 | 135 |
| 132 // ChangeTracker related methods. They run on file task runner. | 136 // ChangeTracker related methods. They run on file task runner. |
| 133 void GetChangedURLsInTracker(fileapi::FileSystemURLSet* urls); | 137 void GetChangedURLsInTracker(fileapi::FileSystemURLSet* urls); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 const StatusCallback& callback); | 179 const StatusCallback& callback); |
| 176 void DoVerifyFile(const fileapi::FileSystemURL& url, | 180 void DoVerifyFile(const fileapi::FileSystemURL& url, |
| 177 const std::string& expected_data, | 181 const std::string& expected_data, |
| 178 const StatusCallback& callback); | 182 const StatusCallback& callback); |
| 179 void DoGetMetadata(const fileapi::FileSystemURL& url, | 183 void DoGetMetadata(const fileapi::FileSystemURL& url, |
| 180 base::PlatformFileInfo* info, | 184 base::PlatformFileInfo* info, |
| 181 base::FilePath* platform_path, | 185 base::FilePath* platform_path, |
| 182 const StatusCallback& callback); | 186 const StatusCallback& callback); |
| 183 void DoWrite(net::URLRequestContext* url_request_context, | 187 void DoWrite(net::URLRequestContext* url_request_context, |
| 184 const fileapi::FileSystemURL& url, | 188 const fileapi::FileSystemURL& url, |
| 185 const GURL& blob_url, | 189 scoped_ptr<webkit_blob::BlobDataHandle> blob_data_handle, |
| 186 const WriteCallback& callback); | 190 const WriteCallback& callback); |
| 187 void DoWriteString(const fileapi::FileSystemURL& url, | 191 void DoWriteString(const fileapi::FileSystemURL& url, |
| 188 const std::string& data, | 192 const std::string& data, |
| 189 const WriteCallback& callback); | 193 const WriteCallback& callback); |
| 190 void DoGetUsageAndQuota(int64* usage, | 194 void DoGetUsageAndQuota(int64* usage, |
| 191 int64* quota, | 195 int64* quota, |
| 192 const quota::StatusCallback& callback); | 196 const quota::StatusCallback& callback); |
| 193 | 197 |
| 194 private: | 198 private: |
| 195 typedef ObserverListThreadSafe<LocalFileSyncStatus::Observer> ObserverList; | 199 typedef ObserverListThreadSafe<LocalFileSyncStatus::Observer> ObserverList; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 221 bool is_filesystem_opened_; | 225 bool is_filesystem_opened_; |
| 222 | 226 |
| 223 scoped_refptr<ObserverList> sync_status_observers_; | 227 scoped_refptr<ObserverList> sync_status_observers_; |
| 224 | 228 |
| 225 DISALLOW_COPY_AND_ASSIGN(CannedSyncableFileSystem); | 229 DISALLOW_COPY_AND_ASSIGN(CannedSyncableFileSystem); |
| 226 }; | 230 }; |
| 227 | 231 |
| 228 } // namespace sync_file_system | 232 } // namespace sync_file_system |
| 229 | 233 |
| 230 #endif // WEBKIT_FILEAPI_SYNCABLE_CANNED_SYNCABLE_FILE_SYSTEM_H_ | 234 #endif // WEBKIT_FILEAPI_SYNCABLE_CANNED_SYNCABLE_FILE_SYSTEM_H_ |
| OLD | NEW |