Commit 1ae35411 authored by Bailey Berro's avatar Bailey Berro Committed by Commit Bot

Add SmbProviderClient weak getter

This change adds a SmbFileSystem::GetWeakSmbProviderClient() method for
getting a weak_ptr to the SmbProviderClient singleton. This weak_ptr will
be used for posting tasks in the form of base::OnceClosure to the SmbTaskQueue.

Bug: chromium:757625
Change-Id: I4e10bfd3b10a243cc65303a15e8f2e1249d1560b
Reviewed-on: https://chromium-review.googlesource.com/957307
Commit-Queue: Bailey Berro <baileyberro@chromium.org>
Reviewed-by: default avatarZentaro Kavanagh <zentaro@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542952}
parent c69f26f4
......@@ -148,6 +148,11 @@ SmbProviderClient* SmbFileSystem::GetSmbProviderClient() const {
return chromeos::DBusThreadManager::Get()->GetSmbProviderClient();
}
base::WeakPtr<SmbProviderClient> SmbFileSystem::GetWeakSmbProviderClient()
const {
return GetSmbProviderClient()->AsWeakPtr();
}
void SmbFileSystem::Abort() {
// TODO(zentaro): To implement Abort() fully will require storing a
// request id unique to each method call and also passing it to the daemon.
......
......@@ -228,6 +228,7 @@ class SmbFileSystem : public file_system_provider::ProvidedFileSystemInterface,
int32_t GetMountId() const;
SmbProviderClient* GetSmbProviderClient() const;
base::WeakPtr<SmbProviderClient> GetWeakSmbProviderClient() const;
file_system_provider::ProvidedFileSystemInfo file_system_info_;
file_system_provider::OpenedFiles opened_files_;
......
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