Commit 963756a3 authored by Donna Wu's avatar Donna Wu Committed by Commit Bot

Migrate MtpDeviceManager to OnceCallback.

This CL migrated to as many OnceCallback(s) as possible in
services/device/media_transfer_protocol directory. Due to some
unchanged DBus interfaces, there are still several base::Bind()
left in the implementation.

BUG=714018

Change-Id: Iceb2558f45a54e43503fc67fe40380cc9baef248
Reviewed-on: https://chromium-review.googlesource.com/1111693Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Commit-Queue: Donna Wu <donna.wu@intel.com>
Cr-Commit-Position: refs/heads/master@{#570676}
parent 033617cc
...@@ -38,50 +38,51 @@ namespace device { ...@@ -38,50 +38,51 @@ namespace device {
class MediaTransferProtocolDaemonClient { class MediaTransferProtocolDaemonClient {
public: public:
// A callback to be called when DBus method call fails. // A callback to be called when DBus method call fails.
using ErrorCallback = base::Closure; using ErrorCallback = base::OnceClosure;
// A callback to handle the result of EnumerateAutoMountableDevices. // A callback to handle the result of EnumerateAutoMountableDevices.
// The argument is the enumerated storage names. // The argument is the enumerated storage names.
using EnumerateStoragesCallback = using EnumerateStoragesCallback =
base::Callback<void(const std::vector<std::string>& storage_names)>; base::OnceCallback<void(const std::vector<std::string>& storage_names)>;
// A callback to handle the result of GetStorageInfo. // A callback to handle the result of GetStorageInfo.
// The argument is the information about the specified storage. // The argument is the information about the specified storage.
using GetStorageInfoCallback = using GetStorageInfoCallback =
base::Callback<void(const mojom::MtpStorageInfo& storage_info)>; base::OnceCallback<void(const mojom::MtpStorageInfo& storage_info)>;
// A callback to handle the result of OpenStorage. // A callback to handle the result of OpenStorage.
// The argument is the returned handle. // The argument is the returned handle.
using OpenStorageCallback = base::Callback<void(const std::string& handle)>; using OpenStorageCallback =
base::OnceCallback<void(const std::string& handle)>;
// A callback to handle the result of CloseStorage. // A callback to handle the result of CloseStorage.
using CloseStorageCallback = base::Closure; using CloseStorageCallback = base::OnceClosure;
// A callback to handle the result of CreateDirectory. // A callback to handle the result of CreateDirectory.
using CreateDirectoryCallback = base::Closure; using CreateDirectoryCallback = base::OnceClosure;
// A callback to handle the result of ReadDirectoryEntryIds. // A callback to handle the result of ReadDirectoryEntryIds.
// The argument is a vector of file ids. // The argument is a vector of file ids.
using ReadDirectoryEntryIdsCallback = using ReadDirectoryEntryIdsCallback =
base::Callback<void(const std::vector<uint32_t>& file_ids)>; base::OnceCallback<void(const std::vector<uint32_t>& file_ids)>;
// A callback to handle the result of GetFileInfo. // A callback to handle the result of GetFileInfo.
// The argument is a vector of file entries. // The argument is a vector of file entries.
using GetFileInfoCallback = base::Callback<void( using GetFileInfoCallback = base::OnceCallback<void(
const std::vector<mojom::MtpFileEntry>& file_entries)>; const std::vector<mojom::MtpFileEntry>& file_entries)>;
// A callback to handle the result of ReadFileChunkById. // A callback to handle the result of ReadFileChunkById.
// The argument is a string containing the file data. // The argument is a string containing the file data.
using ReadFileCallback = base::Callback<void(const std::string& data)>; using ReadFileCallback = base::OnceCallback<void(const std::string& data)>;
// A callback to handle the result of RenameObject. // A callback to handle the result of RenameObject.
using RenameObjectCallback = base::Closure; using RenameObjectCallback = base::OnceClosure;
// A callback to handle the result of CopyFileFromLocal. // A callback to handle the result of CopyFileFromLocal.
using CopyFileFromLocalCallback = base::Closure; using CopyFileFromLocalCallback = base::OnceClosure;
// A callback to handle the result of DeleteObject. // A callback to handle the result of DeleteObject.
using DeleteObjectCallback = base::Closure; using DeleteObjectCallback = base::OnceClosure;
// A callback to handle storage attach/detach events. // A callback to handle storage attach/detach events.
// The first argument is true for attach, false for detach. // The first argument is true for attach, false for detach.
...@@ -93,37 +94,35 @@ class MediaTransferProtocolDaemonClient { ...@@ -93,37 +94,35 @@ class MediaTransferProtocolDaemonClient {
// Calls EnumerateStorages method. |callback| is called after the // Calls EnumerateStorages method. |callback| is called after the
// method call succeeds, otherwise, |error_callback| is called. // method call succeeds, otherwise, |error_callback| is called.
virtual void EnumerateStorages( virtual void EnumerateStorages(EnumerateStoragesCallback callback,
const EnumerateStoragesCallback& callback, ErrorCallback error_callback) = 0;
const ErrorCallback& error_callback) = 0;
// Calls GetStorageInfo method. |callback| is called after the method call // Calls GetStorageInfo method. |callback| is called after the method call
// succeeds, otherwise, |error_callback| is called. // succeeds, otherwise, |error_callback| is called.
virtual void GetStorageInfo(const std::string& storage_name, virtual void GetStorageInfo(const std::string& storage_name,
const GetStorageInfoCallback& callback, GetStorageInfoCallback callback,
const ErrorCallback& error_callback) = 0; ErrorCallback error_callback) = 0;
// Calls GetStorageInfoFromDevice method. |callback| is called after the // Calls GetStorageInfoFromDevice method. |callback| is called after the
// method call succeeds, otherwise, |error_callback| is called. // method call succeeds, otherwise, |error_callback| is called.
virtual void GetStorageInfoFromDevice( virtual void GetStorageInfoFromDevice(const std::string& storage_name,
const std::string& storage_name, GetStorageInfoCallback callback,
const GetStorageInfoCallback& callback, ErrorCallback error_callback) = 0;
const ErrorCallback& error_callback) = 0;
// Calls OpenStorage method. |callback| is called after the method call // Calls OpenStorage method. |callback| is called after the method call
// succeeds, otherwise, |error_callback| is called. // succeeds, otherwise, |error_callback| is called.
// OpenStorage returns a handle in |callback|. // OpenStorage returns a handle in |callback|.
virtual void OpenStorage(const std::string& storage_name, virtual void OpenStorage(const std::string& storage_name,
const std::string& mode, const std::string& mode,
const OpenStorageCallback& callback, OpenStorageCallback callback,
const ErrorCallback& error_callback) = 0; ErrorCallback error_callback) = 0;
// Calls CloseStorage method. |callback| is called after the method call // Calls CloseStorage method. |callback| is called after the method call
// succeeds, otherwise, |error_callback| is called. // succeeds, otherwise, |error_callback| is called.
// |handle| comes from a OpenStorageCallback. // |handle| comes from a OpenStorageCallback.
virtual void CloseStorage(const std::string& handle, virtual void CloseStorage(const std::string& handle,
const CloseStorageCallback& callback, CloseStorageCallback callback,
const ErrorCallback& error_callback) = 0; ErrorCallback error_callback) = 0;
// Calls CreateDirectory method. |callback| is called after the method call // Calls CreateDirectory method. |callback| is called after the method call
// succeeds, otherwise, |error_callback| is called. // succeeds, otherwise, |error_callback| is called.
...@@ -132,25 +131,24 @@ class MediaTransferProtocolDaemonClient { ...@@ -132,25 +131,24 @@ class MediaTransferProtocolDaemonClient {
virtual void CreateDirectory(const std::string& handle, virtual void CreateDirectory(const std::string& handle,
const uint32_t parent_id, const uint32_t parent_id,
const std::string& directory_name, const std::string& directory_name,
const CreateDirectoryCallback& callback, CreateDirectoryCallback callback,
const ErrorCallback& error_callback) = 0; ErrorCallback error_callback) = 0;
// Calls ReadDirectoryEntryIds method. |callback| is called after the method // Calls ReadDirectoryEntryIds method. |callback| is called after the method
// call succeeds, otherwise, |error_callback| is called. // call succeeds, otherwise, |error_callback| is called.
// |file_id| is a MTP-device specific id for a file. // |file_id| is a MTP-device specific id for a file.
virtual void ReadDirectoryEntryIds( virtual void ReadDirectoryEntryIds(const std::string& handle,
const std::string& handle, uint32_t file_id,
uint32_t file_id, ReadDirectoryEntryIdsCallback callback,
const ReadDirectoryEntryIdsCallback& callback, ErrorCallback error_callback) = 0;
const ErrorCallback& error_callback) = 0;
// Calls GetFileInfo method. |callback| is called after the method // Calls GetFileInfo method. |callback| is called after the method
// call succeeds, otherwise, |error_callback| is called. // call succeeds, otherwise, |error_callback| is called.
// |file_ids| is a list of MTP-device specific file ids. // |file_ids| is a list of MTP-device specific file ids.
virtual void GetFileInfo(const std::string& handle, virtual void GetFileInfo(const std::string& handle,
const std::vector<uint32_t>& file_ids, const std::vector<uint32_t>& file_ids,
const GetFileInfoCallback& callback, GetFileInfoCallback callback,
const ErrorCallback& error_callback) = 0; ErrorCallback error_callback) = 0;
// Calls ReadFileChunk method. |callback| is called after the method call // Calls ReadFileChunk method. |callback| is called after the method call
// succeeds, otherwise, |error_callback| is called. // succeeds, otherwise, |error_callback| is called.
...@@ -161,8 +159,8 @@ class MediaTransferProtocolDaemonClient { ...@@ -161,8 +159,8 @@ class MediaTransferProtocolDaemonClient {
uint32_t file_id, uint32_t file_id,
uint32_t offset, uint32_t offset,
uint32_t bytes_to_read, uint32_t bytes_to_read,
const ReadFileCallback& callback, ReadFileCallback callback,
const ErrorCallback& error_callback) = 0; ErrorCallback error_callback) = 0;
// Calls RenameObject method. |callback| is called after the method call // Calls RenameObject method. |callback| is called after the method call
// succeeds, otherwise, |error_callback| is called. // succeeds, otherwise, |error_callback| is called.
...@@ -171,8 +169,8 @@ class MediaTransferProtocolDaemonClient { ...@@ -171,8 +169,8 @@ class MediaTransferProtocolDaemonClient {
virtual void RenameObject(const std::string& handle, virtual void RenameObject(const std::string& handle,
const uint32_t object_id, const uint32_t object_id,
const std::string& new_name, const std::string& new_name,
const RenameObjectCallback& callback, RenameObjectCallback callback,
const ErrorCallback& error_callback) = 0; ErrorCallback error_callback) = 0;
// Calls CopyFileFromLocal method. |callback| is called after the method call // Calls CopyFileFromLocal method. |callback| is called after the method call
// succeeds, otherwise, |error_callback| is called. // succeeds, otherwise, |error_callback| is called.
...@@ -183,16 +181,16 @@ class MediaTransferProtocolDaemonClient { ...@@ -183,16 +181,16 @@ class MediaTransferProtocolDaemonClient {
const int source_file_descriptor, const int source_file_descriptor,
const uint32_t parent_id, const uint32_t parent_id,
const std::string& file_name, const std::string& file_name,
const CopyFileFromLocalCallback& callback, CopyFileFromLocalCallback callback,
const ErrorCallback& error_callback) = 0; ErrorCallback error_callback) = 0;
// Calls DeleteObject method. |callback| is called after the method call // Calls DeleteObject method. |callback| is called after the method call
// succeeds, otherwise, |error_callback| is called. // succeeds, otherwise, |error_callback| is called.
// |object_id| is an object id of a file or directory which is deleted. // |object_id| is an object id of a file or directory which is deleted.
virtual void DeleteObject(const std::string& handle, virtual void DeleteObject(const std::string& handle,
const uint32_t object_id, const uint32_t object_id,
const DeleteObjectCallback& callback, DeleteObjectCallback callback,
const ErrorCallback& error_callback) = 0; ErrorCallback error_callback) = 0;
// Registers given callback for events. Should only be called once. // Registers given callback for events. Should only be called once.
// |storage_event_handler| is called when a mtp storage attach or detach // |storage_event_handler| is called when a mtp storage attach or detach
......
...@@ -92,10 +92,10 @@ void MtpDeviceManager::GetStorageInfoFromDevice( ...@@ -92,10 +92,10 @@ void MtpDeviceManager::GetStorageInfoFromDevice(
get_storage_info_from_device_callbacks_.push(std::move(callback)); get_storage_info_from_device_callbacks_.push(std::move(callback));
mtp_client_->GetStorageInfoFromDevice( mtp_client_->GetStorageInfoFromDevice(
storage_name, storage_name,
base::Bind(&MtpDeviceManager::OnGetStorageInfoFromDevice, base::BindOnce(&MtpDeviceManager::OnGetStorageInfoFromDevice,
weak_ptr_factory_.GetWeakPtr()), weak_ptr_factory_.GetWeakPtr()),
base::Bind(&MtpDeviceManager::OnGetStorageInfoFromDeviceError, base::BindOnce(&MtpDeviceManager::OnGetStorageInfoFromDeviceError,
weak_ptr_factory_.GetWeakPtr())); weak_ptr_factory_.GetWeakPtr()));
} }
void MtpDeviceManager::OpenStorage(const std::string& storage_name, void MtpDeviceManager::OpenStorage(const std::string& storage_name,
...@@ -108,10 +108,10 @@ void MtpDeviceManager::OpenStorage(const std::string& storage_name, ...@@ -108,10 +108,10 @@ void MtpDeviceManager::OpenStorage(const std::string& storage_name,
} }
open_storage_callbacks_.push(std::move(callback)); open_storage_callbacks_.push(std::move(callback));
mtp_client_->OpenStorage(storage_name, mode, mtp_client_->OpenStorage(storage_name, mode,
base::Bind(&MtpDeviceManager::OnOpenStorage, base::BindOnce(&MtpDeviceManager::OnOpenStorage,
weak_ptr_factory_.GetWeakPtr()), weak_ptr_factory_.GetWeakPtr()),
base::Bind(&MtpDeviceManager::OnOpenStorageError, base::BindOnce(&MtpDeviceManager::OnOpenStorageError,
weak_ptr_factory_.GetWeakPtr())); weak_ptr_factory_.GetWeakPtr()));
} }
void MtpDeviceManager::CloseStorage(const std::string& storage_handle, void MtpDeviceManager::CloseStorage(const std::string& storage_handle,
...@@ -123,11 +123,12 @@ void MtpDeviceManager::CloseStorage(const std::string& storage_handle, ...@@ -123,11 +123,12 @@ void MtpDeviceManager::CloseStorage(const std::string& storage_handle,
} }
close_storage_callbacks_.push( close_storage_callbacks_.push(
std::make_pair(std::move(callback), storage_handle)); std::make_pair(std::move(callback), storage_handle));
mtp_client_->CloseStorage(storage_handle, mtp_client_->CloseStorage(
base::Bind(&MtpDeviceManager::OnCloseStorage, storage_handle,
weak_ptr_factory_.GetWeakPtr()), base::BindOnce(&MtpDeviceManager::OnCloseStorage,
base::Bind(&MtpDeviceManager::OnCloseStorageError, weak_ptr_factory_.GetWeakPtr()),
weak_ptr_factory_.GetWeakPtr())); base::BindOnce(&MtpDeviceManager::OnCloseStorageError,
weak_ptr_factory_.GetWeakPtr()));
} }
void MtpDeviceManager::CreateDirectory(const std::string& storage_handle, void MtpDeviceManager::CreateDirectory(const std::string& storage_handle,
...@@ -142,10 +143,10 @@ void MtpDeviceManager::CreateDirectory(const std::string& storage_handle, ...@@ -142,10 +143,10 @@ void MtpDeviceManager::CreateDirectory(const std::string& storage_handle,
create_directory_callbacks_.push(std::move(callback)); create_directory_callbacks_.push(std::move(callback));
mtp_client_->CreateDirectory( mtp_client_->CreateDirectory(
storage_handle, parent_id, directory_name, storage_handle, parent_id, directory_name,
base::Bind(&MtpDeviceManager::OnCreateDirectory, base::BindOnce(&MtpDeviceManager::OnCreateDirectory,
weak_ptr_factory_.GetWeakPtr()), weak_ptr_factory_.GetWeakPtr()),
base::Bind(&MtpDeviceManager::OnCreateDirectoryError, base::BindOnce(&MtpDeviceManager::OnCreateDirectoryError,
weak_ptr_factory_.GetWeakPtr())); weak_ptr_factory_.GetWeakPtr()));
} }
void MtpDeviceManager::ReadDirectoryEntryIds( void MtpDeviceManager::ReadDirectoryEntryIds(
...@@ -160,10 +161,10 @@ void MtpDeviceManager::ReadDirectoryEntryIds( ...@@ -160,10 +161,10 @@ void MtpDeviceManager::ReadDirectoryEntryIds(
read_directory_callbacks_.push(std::move(callback)); read_directory_callbacks_.push(std::move(callback));
mtp_client_->ReadDirectoryEntryIds( mtp_client_->ReadDirectoryEntryIds(
storage_handle, file_id, storage_handle, file_id,
base::Bind(&MtpDeviceManager::OnReadDirectoryEntryIds, base::BindOnce(&MtpDeviceManager::OnReadDirectoryEntryIds,
weak_ptr_factory_.GetWeakPtr()), weak_ptr_factory_.GetWeakPtr()),
base::Bind(&MtpDeviceManager::OnReadDirectoryError, base::BindOnce(&MtpDeviceManager::OnReadDirectoryError,
weak_ptr_factory_.GetWeakPtr())); weak_ptr_factory_.GetWeakPtr()));
} }
void MtpDeviceManager::ReadFileChunk(const std::string& storage_handle, void MtpDeviceManager::ReadFileChunk(const std::string& storage_handle,
...@@ -177,11 +178,11 @@ void MtpDeviceManager::ReadFileChunk(const std::string& storage_handle, ...@@ -177,11 +178,11 @@ void MtpDeviceManager::ReadFileChunk(const std::string& storage_handle,
return; return;
} }
read_file_callbacks_.push(std::move(callback)); read_file_callbacks_.push(std::move(callback));
mtp_client_->ReadFileChunk( mtp_client_->ReadFileChunk(storage_handle, file_id, offset, count,
storage_handle, file_id, offset, count, base::BindOnce(&MtpDeviceManager::OnReadFile,
base::Bind(&MtpDeviceManager::OnReadFile, weak_ptr_factory_.GetWeakPtr()), weak_ptr_factory_.GetWeakPtr()),
base::Bind(&MtpDeviceManager::OnReadFileError, base::BindOnce(&MtpDeviceManager::OnReadFileError,
weak_ptr_factory_.GetWeakPtr())); weak_ptr_factory_.GetWeakPtr()));
} }
void MtpDeviceManager::GetFileInfo(const std::string& storage_handle, void MtpDeviceManager::GetFileInfo(const std::string& storage_handle,
...@@ -195,10 +196,10 @@ void MtpDeviceManager::GetFileInfo(const std::string& storage_handle, ...@@ -195,10 +196,10 @@ void MtpDeviceManager::GetFileInfo(const std::string& storage_handle,
} }
get_file_info_callbacks_.push(std::move(callback)); get_file_info_callbacks_.push(std::move(callback));
mtp_client_->GetFileInfo(storage_handle, file_ids, mtp_client_->GetFileInfo(storage_handle, file_ids,
base::Bind(&MtpDeviceManager::OnGetFileInfo, base::BindOnce(&MtpDeviceManager::OnGetFileInfo,
weak_ptr_factory_.GetWeakPtr()), weak_ptr_factory_.GetWeakPtr()),
base::Bind(&MtpDeviceManager::OnGetFileInfoError, base::BindOnce(&MtpDeviceManager::OnGetFileInfoError,
weak_ptr_factory_.GetWeakPtr())); weak_ptr_factory_.GetWeakPtr()));
} }
void MtpDeviceManager::RenameObject(const std::string& storage_handle, void MtpDeviceManager::RenameObject(const std::string& storage_handle,
...@@ -211,11 +212,12 @@ void MtpDeviceManager::RenameObject(const std::string& storage_handle, ...@@ -211,11 +212,12 @@ void MtpDeviceManager::RenameObject(const std::string& storage_handle,
return; return;
} }
rename_object_callbacks_.push(std::move(callback)); rename_object_callbacks_.push(std::move(callback));
mtp_client_->RenameObject(storage_handle, object_id, new_name, mtp_client_->RenameObject(
base::Bind(&MtpDeviceManager::OnRenameObject, storage_handle, object_id, new_name,
weak_ptr_factory_.GetWeakPtr()), base::BindOnce(&MtpDeviceManager::OnRenameObject,
base::Bind(&MtpDeviceManager::OnRenameObjectError, weak_ptr_factory_.GetWeakPtr()),
weak_ptr_factory_.GetWeakPtr())); base::BindOnce(&MtpDeviceManager::OnRenameObjectError,
weak_ptr_factory_.GetWeakPtr()));
} }
void MtpDeviceManager::CopyFileFromLocal(const std::string& storage_handle, void MtpDeviceManager::CopyFileFromLocal(const std::string& storage_handle,
...@@ -231,10 +233,10 @@ void MtpDeviceManager::CopyFileFromLocal(const std::string& storage_handle, ...@@ -231,10 +233,10 @@ void MtpDeviceManager::CopyFileFromLocal(const std::string& storage_handle,
copy_file_from_local_callbacks_.push(std::move(callback)); copy_file_from_local_callbacks_.push(std::move(callback));
mtp_client_->CopyFileFromLocal( mtp_client_->CopyFileFromLocal(
storage_handle, source_file_descriptor, parent_id, file_name, storage_handle, source_file_descriptor, parent_id, file_name,
base::Bind(&MtpDeviceManager::OnCopyFileFromLocal, base::BindOnce(&MtpDeviceManager::OnCopyFileFromLocal,
weak_ptr_factory_.GetWeakPtr()), weak_ptr_factory_.GetWeakPtr()),
base::Bind(&MtpDeviceManager::OnCopyFileFromLocalError, base::BindOnce(&MtpDeviceManager::OnCopyFileFromLocalError,
weak_ptr_factory_.GetWeakPtr())); weak_ptr_factory_.GetWeakPtr()));
} }
void MtpDeviceManager::DeleteObject(const std::string& storage_handle, void MtpDeviceManager::DeleteObject(const std::string& storage_handle,
...@@ -246,20 +248,22 @@ void MtpDeviceManager::DeleteObject(const std::string& storage_handle, ...@@ -246,20 +248,22 @@ void MtpDeviceManager::DeleteObject(const std::string& storage_handle,
return; return;
} }
delete_object_callbacks_.push(std::move(callback)); delete_object_callbacks_.push(std::move(callback));
mtp_client_->DeleteObject(storage_handle, object_id, mtp_client_->DeleteObject(
base::Bind(&MtpDeviceManager::OnDeleteObject, storage_handle, object_id,
weak_ptr_factory_.GetWeakPtr()), base::BindOnce(&MtpDeviceManager::OnDeleteObject,
base::Bind(&MtpDeviceManager::OnDeleteObjectError, weak_ptr_factory_.GetWeakPtr()),
weak_ptr_factory_.GetWeakPtr())); base::BindOnce(&MtpDeviceManager::OnDeleteObjectError,
weak_ptr_factory_.GetWeakPtr()));
} }
// private methods // private methods
void MtpDeviceManager::OnStorageAttached(const std::string& storage_name) { void MtpDeviceManager::OnStorageAttached(const std::string& storage_name) {
DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(thread_checker_.CalledOnValidThread());
mtp_client_->GetStorageInfo(storage_name, mtp_client_->GetStorageInfo(
base::Bind(&MtpDeviceManager::OnGetStorageInfo, storage_name,
weak_ptr_factory_.GetWeakPtr()), base::BindOnce(&MtpDeviceManager::OnGetStorageInfo,
base::DoNothing()); weak_ptr_factory_.GetWeakPtr()),
base::DoNothing::Once());
} }
void MtpDeviceManager::OnStorageDetached(const std::string& storage_name) { void MtpDeviceManager::OnStorageDetached(const std::string& storage_name) {
...@@ -504,9 +508,9 @@ void MtpDeviceManager::FinishSetupOnOriginThread( ...@@ -504,9 +508,9 @@ void MtpDeviceManager::FinishSetupOnOriginThread(
mtp_client_->ListenForChanges(base::Bind(&MtpDeviceManager::OnStorageChanged, mtp_client_->ListenForChanges(base::Bind(&MtpDeviceManager::OnStorageChanged,
weak_ptr_factory_.GetWeakPtr())); weak_ptr_factory_.GetWeakPtr()));
mtp_client_->EnumerateStorages( mtp_client_->EnumerateStorages(
base::Bind(&MtpDeviceManager::OnEnumerateStorages, base::BindOnce(&MtpDeviceManager::OnEnumerateStorages,
weak_ptr_factory_.GetWeakPtr()), weak_ptr_factory_.GetWeakPtr()),
base::DoNothing()); base::DoNothing::Once());
} }
// static // static
......
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