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

Make CopyEntry D-Bus timeout infinite

This change makes the D-Bus timeout for the CopyEntry method
infinite since currently each CopyEntry call can take an
undefined amount of time on the SmbProvider daemon side.

BUG=chromium:757625
TEST=none

Change-Id: I6da15c49a80062fa05f8c622e3ea3c402f69d8f2
Reviewed-on: https://chromium-review.googlesource.com/1054200Reviewed-by: default avatarZentaro Kavanagh <zentaro@chromium.org>
Commit-Queue: Zentaro Kavanagh <zentaro@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557612}
parent 66a8e2e8
...@@ -236,7 +236,7 @@ class SmbProviderClientImpl : public SmbProviderClient { ...@@ -236,7 +236,7 @@ class SmbProviderClientImpl : public SmbProviderClient {
options.set_mount_id(mount_id); options.set_mount_id(mount_id);
options.set_source_path(source_path.value()); options.set_source_path(source_path.value());
options.set_target_path(target_path.value()); options.set_target_path(target_path.value());
CallDefaultMethod(smbprovider::kCopyEntryMethod, options, &callback); CallCopyEntryMethod(options, std::move(callback));
} }
void GetDeleteList(int32_t mount_id, void GetDeleteList(int32_t mount_id,
...@@ -328,6 +328,21 @@ class SmbProviderClientImpl : public SmbProviderClient { ...@@ -328,6 +328,21 @@ class SmbProviderClientImpl : public SmbProviderClient {
std::move(*callback))); std::move(*callback)));
} }
// Calls the CopyEntry D-Bus method with no timeout, passing the |protobuf| as
// an argument. Uses the default callback handler to process |callback|.
void CallCopyEntryMethod(const google::protobuf::MessageLite& protobuf,
StatusCallback callback) {
dbus::MethodCall method_call(smbprovider::kSmbProviderInterface,
smbprovider::kCopyEntryMethod);
dbus::MessageWriter writer(&method_call);
writer.AppendProtoAsArrayOfBytes(protobuf);
proxy_->CallMethod(
&method_call, dbus::ObjectProxy::TIMEOUT_INFINITE,
base::BindOnce(&SmbProviderClientImpl::HandleDefaultCallback,
GetWeakPtr(), method_call.GetMember(),
std::move(callback)));
}
// Handles D-Bus callback for mount. // Handles D-Bus callback for mount.
void HandleMountCallback(MountCallback callback, dbus::Response* response) { void HandleMountCallback(MountCallback callback, dbus::Response* response) {
if (!response) { if (!response) {
......
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