Commit 2a7abddb authored by Bailey Berro's avatar Bailey Berro Committed by Commit Bot

Add SmbTaskQueue to SmbFileSystem

This change switches SmbFileSystem to routing all calls to
SmbProviderClient through an SmbTaskQueue.

Test: verified manually on eve
Bug: chromium:757625
Change-Id: Id3466a5cbd0858070bf7170f1358d88bd8d32334
Reviewed-on: https://chromium-review.googlesource.com/957477
Commit-Queue: Bailey Berro <baileyberro@chromium.org>
Reviewed-by: default avatarZentaro Kavanagh <zentaro@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543842}
parent a3c8efc9
......@@ -22,6 +22,7 @@
#include "chrome/browser/chromeos/file_system_provider/provided_file_system_interface.h"
#include "chrome/browser/chromeos/file_system_provider/watcher.h"
#include "chrome/browser/chromeos/smb_client/smb_service.h"
#include "chrome/browser/chromeos/smb_client/smb_task_queue.h"
#include "chrome/browser/chromeos/smb_client/temp_file_manager.h"
#include "chromeos/dbus/smb_provider_client.h"
#include "storage/browser/fileapi/async_file_util.h"
......@@ -176,7 +177,10 @@ class SmbFileSystem : public file_system_provider::ProvidedFileSystemInterface,
base::WeakPtr<ProvidedFileSystemInterface> GetWeakPtr() override;
private:
void Abort();
void Abort(OperationId operation_id);
file_system_provider::AbortCallback CreateAbortCallback(
OperationId operation_id);
file_system_provider::AbortCallback CreateAbortCallback();
......@@ -216,6 +220,7 @@ class SmbFileSystem : public file_system_provider::ProvidedFileSystemInterface,
void HandleGetDeleteListCallback(
storage::AsyncFileUtil::StatusCallback callback,
OperationId operation_id,
smbprovider::ErrorType list_error,
const smbprovider::DeleteListProto& delete_list);
......@@ -230,6 +235,17 @@ class SmbFileSystem : public file_system_provider::ProvidedFileSystemInterface,
SmbProviderClient* GetSmbProviderClient() const;
base::WeakPtr<SmbProviderClient> GetWeakSmbProviderClient() const;
// Gets a new OperationId and adds |task| to the task_queue_ with it. Returns
// an AbortCallback to abort the newly created operation.
file_system_provider::AbortCallback EnqueueTaskAndGetCallback(SmbTask task);
// Adds |task| to the task_queue_ for |operation_id|.
void EnqueueTask(SmbTask task, OperationId operation_id);
// Gets a new OperationId and adds |task| to the task_queue_ with it. Returns
// the OperationId for the newly created Operation.
OperationId EnqueueTaskAndGetOperationId(SmbTask task);
file_system_provider::ProvidedFileSystemInfo file_system_info_;
file_system_provider::OpenedFiles opened_files_;
storage::AsyncFileUtil::EntryList entry_list_;
......@@ -237,6 +253,7 @@ class SmbFileSystem : public file_system_provider::ProvidedFileSystemInterface,
UnmountCallback unmount_callback_;
TempFileManager temp_file_manager_;
mutable SmbTaskQueue task_queue_;
DISALLOW_COPY_AND_ASSIGN(SmbFileSystem);
};
......
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