Commit d439986d authored by Thomas Guilbert's avatar Thomas Guilbert Committed by Chromium LUCI CQ

Convert CannedSyncableFileSystem to modern callbacks

This CL converts base::Callbacks in CannedSyncableFileSystem to their
Once or Repeating equivalents.

Bug: 1152272
Change-Id: Id0890a8f8f9c6c2807a821913b82fb3f90bb6034
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2575420
Commit-Queue: Thomas Guilbert <tguilbert@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#834281}
parent b230aecc
...@@ -55,8 +55,8 @@ class CannedSyncableFileSystem ...@@ -55,8 +55,8 @@ class CannedSyncableFileSystem
typedef base::OnceCallback< typedef base::OnceCallback<
void(const GURL& root, const std::string& name, base::File::Error result)> void(const GURL& root, const std::string& name, base::File::Error result)>
OpenFileSystemCallback; OpenFileSystemCallback;
typedef base::Callback<void(base::File::Error)> StatusCallback; typedef base::OnceCallback<void(base::File::Error)> StatusCallback;
typedef base::Callback<void(int64_t)> WriteCallback; typedef base::RepeatingCallback<void(int64_t)> WriteCallback;
typedef storage::FileSystemOperation::FileEntryList FileEntryList; typedef storage::FileSystemOperation::FileEntryList FileEntryList;
enum QuotaMode { enum QuotaMode {
...@@ -162,45 +162,43 @@ class CannedSyncableFileSystem ...@@ -162,45 +162,43 @@ class CannedSyncableFileSystem
// They can be also called directly if the caller is already on IO thread. // They can be also called directly if the caller is already on IO thread.
void DoOpenFileSystem(OpenFileSystemCallback callback); void DoOpenFileSystem(OpenFileSystemCallback callback);
void DoCreateDirectory(const storage::FileSystemURL& url, void DoCreateDirectory(const storage::FileSystemURL& url,
const StatusCallback& callback); StatusCallback callback);
void DoCreateFile(const storage::FileSystemURL& url, void DoCreateFile(const storage::FileSystemURL& url, StatusCallback callback);
const StatusCallback& callback);
void DoCopy(const storage::FileSystemURL& src_url, void DoCopy(const storage::FileSystemURL& src_url,
const storage::FileSystemURL& dest_url, const storage::FileSystemURL& dest_url,
const StatusCallback& callback); StatusCallback callback);
void DoMove(const storage::FileSystemURL& src_url, void DoMove(const storage::FileSystemURL& src_url,
const storage::FileSystemURL& dest_url, const storage::FileSystemURL& dest_url,
const StatusCallback& callback); StatusCallback callback);
void DoTruncateFile(const storage::FileSystemURL& url, void DoTruncateFile(const storage::FileSystemURL& url,
int64_t size, int64_t size,
const StatusCallback& callback); StatusCallback callback);
void DoTouchFile(const storage::FileSystemURL& url, void DoTouchFile(const storage::FileSystemURL& url,
const base::Time& last_access_time, const base::Time& last_access_time,
const base::Time& last_modified_time, const base::Time& last_modified_time,
const StatusCallback& callback); StatusCallback callback);
void DoRemove(const storage::FileSystemURL& url, void DoRemove(const storage::FileSystemURL& url,
bool recursive, bool recursive,
const StatusCallback& callback); StatusCallback callback);
void DoFileExists(const storage::FileSystemURL& url, void DoFileExists(const storage::FileSystemURL& url, StatusCallback callback);
const StatusCallback& callback);
void DoDirectoryExists(const storage::FileSystemURL& url, void DoDirectoryExists(const storage::FileSystemURL& url,
const StatusCallback& callback); StatusCallback callback);
void DoVerifyFile(const storage::FileSystemURL& url, void DoVerifyFile(const storage::FileSystemURL& url,
const std::string& expected_data, const std::string& expected_data,
const StatusCallback& callback); StatusCallback callback);
void DoGetMetadataAndPlatformPath(const storage::FileSystemURL& url, void DoGetMetadataAndPlatformPath(const storage::FileSystemURL& url,
base::File::Info* info, base::File::Info* info,
base::FilePath* platform_path, base::FilePath* platform_path,
const StatusCallback& callback); StatusCallback callback);
void DoReadDirectory(const storage::FileSystemURL& url, void DoReadDirectory(const storage::FileSystemURL& url,
FileEntryList* entries, FileEntryList* entries,
const StatusCallback& callback); StatusCallback callback);
void DoWrite(const storage::FileSystemURL& url, void DoWrite(const storage::FileSystemURL& url,
std::unique_ptr<storage::BlobDataHandle> blob_data_handle, std::unique_ptr<storage::BlobDataHandle> blob_data_handle,
const WriteCallback& callback); WriteCallback callback);
void DoWriteString(const storage::FileSystemURL& url, void DoWriteString(const storage::FileSystemURL& url,
const std::string& data, const std::string& data,
const WriteCallback& callback); WriteCallback callback);
void DoGetUsageAndQuota(int64_t* usage, void DoGetUsageAndQuota(int64_t* usage,
int64_t* quota, int64_t* quota,
storage::StatusCallback callback); storage::StatusCallback callback);
...@@ -211,11 +209,11 @@ class CannedSyncableFileSystem ...@@ -211,11 +209,11 @@ class CannedSyncableFileSystem
// Callbacks. // Callbacks.
void DidOpenFileSystem(base::SingleThreadTaskRunner* original_task_runner, void DidOpenFileSystem(base::SingleThreadTaskRunner* original_task_runner,
const base::Closure& quit_closure, base::OnceClosure quit_closure,
const GURL& root, const GURL& root,
const std::string& name, const std::string& name,
base::File::Error result); base::File::Error result);
void DidInitializeFileSystemContext(const base::Closure& quit_closure, void DidInitializeFileSystemContext(base::OnceClosure quit_closure,
sync_file_system::SyncStatusCode status); sync_file_system::SyncStatusCode status);
void InitializeSyncStatusObserver(); void InitializeSyncStatusObserver();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment