| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> |
| 10 #include <string> | 11 #include <string> |
| 11 #include <vector> | 12 #include <vector> |
| 12 | 13 |
| 13 #include "base/callback_forward.h" | 14 #include "base/callback_forward.h" |
| 14 #include "base/files/file.h" | 15 #include "base/files/file.h" |
| 15 #include "base/files/scoped_temp_dir.h" | 16 #include "base/files/scoped_temp_dir.h" |
| 16 #include "base/macros.h" | 17 #include "base/macros.h" |
| 17 #include "base/memory/scoped_ptr.h" | |
| 18 #include "base/observer_list_threadsafe.h" | 18 #include "base/observer_list_threadsafe.h" |
| 19 #include "chrome/browser/sync_file_system/local/local_file_sync_status.h" | 19 #include "chrome/browser/sync_file_system/local/local_file_sync_status.h" |
| 20 #include "chrome/browser/sync_file_system/sync_status_code.h" | 20 #include "chrome/browser/sync_file_system/sync_status_code.h" |
| 21 #include "storage/browser/blob/blob_data_handle.h" | 21 #include "storage/browser/blob/blob_data_handle.h" |
| 22 #include "storage/browser/fileapi/file_system_operation.h" | 22 #include "storage/browser/fileapi/file_system_operation.h" |
| 23 #include "storage/browser/fileapi/file_system_url.h" | 23 #include "storage/browser/fileapi/file_system_url.h" |
| 24 #include "storage/browser/quota/quota_callbacks.h" | 24 #include "storage/browser/quota/quota_callbacks.h" |
| 25 #include "storage/common/fileapi/file_system_types.h" | 25 #include "storage/common/fileapi/file_system_types.h" |
| 26 #include "storage/common/fileapi/file_system_util.h" | 26 #include "storage/common/fileapi/file_system_util.h" |
| 27 #include "storage/common/quota/quota_types.h" | 27 #include "storage/common/quota/quota_types.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 base::File::Error GetMetadataAndPlatformPath( | 138 base::File::Error GetMetadataAndPlatformPath( |
| 139 const storage::FileSystemURL& url, | 139 const storage::FileSystemURL& url, |
| 140 base::File::Info* info, | 140 base::File::Info* info, |
| 141 base::FilePath* platform_path); | 141 base::FilePath* platform_path); |
| 142 base::File::Error ReadDirectory(const storage::FileSystemURL& url, | 142 base::File::Error ReadDirectory(const storage::FileSystemURL& url, |
| 143 FileEntryList* entries); | 143 FileEntryList* entries); |
| 144 | 144 |
| 145 // Returns the # of bytes written (>=0) or an error code (<0). | 145 // Returns the # of bytes written (>=0) or an error code (<0). |
| 146 int64_t Write(net::URLRequestContext* url_request_context, | 146 int64_t Write(net::URLRequestContext* url_request_context, |
| 147 const storage::FileSystemURL& url, | 147 const storage::FileSystemURL& url, |
| 148 scoped_ptr<storage::BlobDataHandle> blob_data_handle); | 148 std::unique_ptr<storage::BlobDataHandle> blob_data_handle); |
| 149 int64_t WriteString(const storage::FileSystemURL& url, | 149 int64_t WriteString(const storage::FileSystemURL& url, |
| 150 const std::string& data); | 150 const std::string& data); |
| 151 | 151 |
| 152 // Purges the file system local storage. | 152 // Purges the file system local storage. |
| 153 base::File::Error DeleteFileSystem(); | 153 base::File::Error DeleteFileSystem(); |
| 154 | 154 |
| 155 // Retrieves the quota and usage. | 155 // Retrieves the quota and usage. |
| 156 storage::QuotaStatusCode GetUsageAndQuota(int64_t* usage, int64_t* quota); | 156 storage::QuotaStatusCode GetUsageAndQuota(int64_t* usage, int64_t* quota); |
| 157 | 157 |
| 158 // ChangeTracker related methods. They run on file task runner. | 158 // ChangeTracker related methods. They run on file task runner. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 const StatusCallback& callback); | 200 const StatusCallback& callback); |
| 201 void DoGetMetadataAndPlatformPath(const storage::FileSystemURL& url, | 201 void DoGetMetadataAndPlatformPath(const storage::FileSystemURL& url, |
| 202 base::File::Info* info, | 202 base::File::Info* info, |
| 203 base::FilePath* platform_path, | 203 base::FilePath* platform_path, |
| 204 const StatusCallback& callback); | 204 const StatusCallback& callback); |
| 205 void DoReadDirectory(const storage::FileSystemURL& url, | 205 void DoReadDirectory(const storage::FileSystemURL& url, |
| 206 FileEntryList* entries, | 206 FileEntryList* entries, |
| 207 const StatusCallback& callback); | 207 const StatusCallback& callback); |
| 208 void DoWrite(net::URLRequestContext* url_request_context, | 208 void DoWrite(net::URLRequestContext* url_request_context, |
| 209 const storage::FileSystemURL& url, | 209 const storage::FileSystemURL& url, |
| 210 scoped_ptr<storage::BlobDataHandle> blob_data_handle, | 210 std::unique_ptr<storage::BlobDataHandle> blob_data_handle, |
| 211 const WriteCallback& callback); | 211 const WriteCallback& callback); |
| 212 void DoWriteString(const storage::FileSystemURL& url, | 212 void DoWriteString(const storage::FileSystemURL& url, |
| 213 const std::string& data, | 213 const std::string& data, |
| 214 const WriteCallback& callback); | 214 const WriteCallback& callback); |
| 215 void DoGetUsageAndQuota(int64_t* usage, | 215 void DoGetUsageAndQuota(int64_t* usage, |
| 216 int64_t* quota, | 216 int64_t* quota, |
| 217 const storage::StatusCallback& callback); | 217 const storage::StatusCallback& callback); |
| 218 | 218 |
| 219 private: | 219 private: |
| 220 typedef base::ObserverListThreadSafe<LocalFileSyncStatus::Observer> | 220 typedef base::ObserverListThreadSafe<LocalFileSyncStatus::Observer> |
| (...skipping 30 matching lines...) Expand all Loading... |
| 251 bool is_filesystem_opened_; // Should be accessed only on the IO thread. | 251 bool is_filesystem_opened_; // Should be accessed only on the IO thread. |
| 252 | 252 |
| 253 scoped_refptr<ObserverList> sync_status_observers_; | 253 scoped_refptr<ObserverList> sync_status_observers_; |
| 254 | 254 |
| 255 DISALLOW_COPY_AND_ASSIGN(CannedSyncableFileSystem); | 255 DISALLOW_COPY_AND_ASSIGN(CannedSyncableFileSystem); |
| 256 }; | 256 }; |
| 257 | 257 |
| 258 } // namespace sync_file_system | 258 } // namespace sync_file_system |
| 259 | 259 |
| 260 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_CANNED_SYNCABLE_FILE_SYSTEM_H_ | 260 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_LOCAL_CANNED_SYNCABLE_FILE_SYSTEM_H_ |
| OLD | NEW |