| 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 |
| 11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 12 #include "base/files/scoped_temp_dir.h" | 12 #include "base/files/scoped_temp_dir.h" |
| 13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 14 #include "base/observer_list_threadsafe.h" | 14 #include "base/observer_list_threadsafe.h" |
| 15 #include "base/platform_file.h" | 15 #include "base/platform_file.h" |
| 16 #include "chrome/browser/sync_file_system/local/local_file_sync_status.h" | 16 #include "chrome/browser/sync_file_system/local/local_file_sync_status.h" |
| 17 #include "chrome/browser/sync_file_system/sync_status_code.h" | 17 #include "chrome/browser/sync_file_system/sync_status_code.h" |
| 18 #include "webkit/browser/blob/blob_data_handle.h" |
| 18 #include "webkit/browser/fileapi/file_system_operation.h" | 19 #include "webkit/browser/fileapi/file_system_operation.h" |
| 19 #include "webkit/browser/fileapi/file_system_url.h" | 20 #include "webkit/browser/fileapi/file_system_url.h" |
| 20 #include "webkit/browser/quota/quota_callbacks.h" | 21 #include "webkit/browser/quota/quota_callbacks.h" |
| 21 #include "webkit/common/fileapi/file_system_types.h" | 22 #include "webkit/common/fileapi/file_system_types.h" |
| 22 #include "webkit/common/fileapi/file_system_util.h" | 23 #include "webkit/common/fileapi/file_system_util.h" |
| 23 #include "webkit/common/quota/quota_types.h" | 24 #include "webkit/common/quota/quota_types.h" |
| 24 | 25 |
| 25 namespace base { | 26 namespace base { |
| 26 class MessageLoopProxy; | 27 class MessageLoopProxy; |
| 27 class SingleThreadTaskRunner; | 28 class SingleThreadTaskRunner; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 const std::string& expected_data); | 120 const std::string& expected_data); |
| 120 base::PlatformFileError GetMetadataAndPlatformPath( | 121 base::PlatformFileError GetMetadataAndPlatformPath( |
| 121 const fileapi::FileSystemURL& url, | 122 const fileapi::FileSystemURL& url, |
| 122 base::PlatformFileInfo* info, | 123 base::PlatformFileInfo* info, |
| 123 base::FilePath* platform_path); | 124 base::FilePath* platform_path); |
| 124 base::PlatformFileError ReadDirectory(const fileapi::FileSystemURL& url, | 125 base::PlatformFileError ReadDirectory(const fileapi::FileSystemURL& url, |
| 125 FileEntryList* entries); | 126 FileEntryList* entries); |
| 126 | 127 |
| 127 // Returns the # of bytes written (>=0) or an error code (<0). | 128 // Returns the # of bytes written (>=0) or an error code (<0). |
| 128 int64 Write(net::URLRequestContext* url_request_context, | 129 int64 Write(net::URLRequestContext* url_request_context, |
| 129 const fileapi::FileSystemURL& url, const GURL& blob_url); | 130 const fileapi::FileSystemURL& url, |
| 131 scoped_ptr<webkit_blob::BlobDataHandle> blob_data_handle); |
| 130 int64 WriteString(const fileapi::FileSystemURL& url, const std::string& data); | 132 int64 WriteString(const fileapi::FileSystemURL& url, const std::string& data); |
| 131 | 133 |
| 132 // Purges the file system local storage. | 134 // Purges the file system local storage. |
| 133 base::PlatformFileError DeleteFileSystem(); | 135 base::PlatformFileError DeleteFileSystem(); |
| 134 | 136 |
| 135 // Retrieves the quota and usage. | 137 // Retrieves the quota and usage. |
| 136 quota::QuotaStatusCode GetUsageAndQuota(int64* usage, int64* quota); | 138 quota::QuotaStatusCode GetUsageAndQuota(int64* usage, int64* quota); |
| 137 | 139 |
| 138 // ChangeTracker related methods. They run on file task runner. | 140 // ChangeTracker related methods. They run on file task runner. |
| 139 void GetChangedURLsInTracker(fileapi::FileSystemURLSet* urls); | 141 void GetChangedURLsInTracker(fileapi::FileSystemURLSet* urls); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 const StatusCallback& callback); | 179 const StatusCallback& callback); |
| 178 void DoGetMetadataAndPlatformPath(const fileapi::FileSystemURL& url, | 180 void DoGetMetadataAndPlatformPath(const fileapi::FileSystemURL& url, |
| 179 base::PlatformFileInfo* info, | 181 base::PlatformFileInfo* info, |
| 180 base::FilePath* platform_path, | 182 base::FilePath* platform_path, |
| 181 const StatusCallback& callback); | 183 const StatusCallback& callback); |
| 182 void DoReadDirectory(const fileapi::FileSystemURL& url, | 184 void DoReadDirectory(const fileapi::FileSystemURL& url, |
| 183 FileEntryList* entries, | 185 FileEntryList* entries, |
| 184 const StatusCallback& callback); | 186 const StatusCallback& callback); |
| 185 void DoWrite(net::URLRequestContext* url_request_context, | 187 void DoWrite(net::URLRequestContext* url_request_context, |
| 186 const fileapi::FileSystemURL& url, | 188 const fileapi::FileSystemURL& url, |
| 187 const GURL& blob_url, | 189 scoped_ptr<webkit_blob::BlobDataHandle> blob_data_handle, |
| 188 const WriteCallback& callback); | 190 const WriteCallback& callback); |
| 189 void DoWriteString(const fileapi::FileSystemURL& url, | 191 void DoWriteString(const fileapi::FileSystemURL& url, |
| 190 const std::string& data, | 192 const std::string& data, |
| 191 const WriteCallback& callback); | 193 const WriteCallback& callback); |
| 192 void DoGetUsageAndQuota(int64* usage, | 194 void DoGetUsageAndQuota(int64* usage, |
| 193 int64* quota, | 195 int64* quota, |
| 194 const quota::StatusCallback& callback); | 196 const quota::StatusCallback& callback); |
| 195 | 197 |
| 196 private: | 198 private: |
| 197 typedef ObserverListThreadSafe<LocalFileSyncStatus::Observer> ObserverList; | 199 typedef ObserverListThreadSafe<LocalFileSyncStatus::Observer> ObserverList; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 223 bool is_filesystem_opened_; | 225 bool is_filesystem_opened_; |
| 224 | 226 |
| 225 scoped_refptr<ObserverList> sync_status_observers_; | 227 scoped_refptr<ObserverList> sync_status_observers_; |
| 226 | 228 |
| 227 DISALLOW_COPY_AND_ASSIGN(CannedSyncableFileSystem); | 229 DISALLOW_COPY_AND_ASSIGN(CannedSyncableFileSystem); |
| 228 }; | 230 }; |
| 229 | 231 |
| 230 } // namespace sync_file_system | 232 } // namespace sync_file_system |
| 231 | 233 |
| 232 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_CANNED_SYNCABLE_FILE_SYSTEM_H_ | 234 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_CANNED_SYNCABLE_FILE_SYSTEM_H_ |
| OLD | NEW |