0

[Storage management] Change spaced DBus response type

Since crrev.com/c/3260777, spaced returns int64_t instead of uint64_t.
Fix the spaced client and the storage page accordingly.

Bug: b:177966496, b:173086361
Change-Id: Ia9577444b795e9d12135c3edff5d8ac1ffb29972
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3291259
Reviewed-by: Jimmy Gong <jimmyxgong@chromium.org>
Commit-Queue: Jeremie Boulic <jboulic@chromium.org>
Cr-Commit-Position: refs/heads/main@{#944836}
This commit is contained in:
Jérémie Boulic
2021-11-24 04:46:50 +00:00
committed by Chromium LUCI CQ
parent e14c858514
commit 343147b06b
4 changed files with 6 additions and 6 deletions
chrome/browser/ui/webui/settings/chromeos/calculator
chromeos/dbus/spaced

@ -103,9 +103,9 @@ void TotalDiskSpaceCalculator::GetRootDeviceSize() {
}
void TotalDiskSpaceCalculator::OnGetRootDeviceSize(
absl::optional<uint64_t> reply) {
absl::optional<int64_t> reply) {
if (reply.has_value()) {
NotifySizeCalculated(static_cast<int64_t>(reply.value()));
NotifySizeCalculated(reply.value());
return;
}

@ -103,7 +103,7 @@ class TotalDiskSpaceCalculator : public SizeCalculator {
void GetRootDeviceSize();
void OnGetRootDeviceSize(absl::optional<uint64_t> reply);
void OnGetRootDeviceSize(absl::optional<int64_t> reply);
void GetTotalDiskSpace();

@ -80,9 +80,9 @@ class SpacedClientImpl : public SpacedClient {
}
dbus::MessageReader reader(response);
uint64_t size = 0;
int64_t size = 0;
if (!reader.PopUint64(&size)) {
if (!reader.PopInt64(&size)) {
LOG(ERROR) << "Spaced D-Bus method " << response->GetMember()
<< ": Invalid response. " + response->ToString();
std::move(callback).Run(absl::nullopt);

@ -19,7 +19,7 @@ namespace chromeos {
// A class to make DBus calls for the org.chromium.Spaced service.
class COMPONENT_EXPORT(SPACED_CLIENT) SpacedClient {
public:
using GetSizeCallback = DBusMethodCallback<uint64_t>;
using GetSizeCallback = DBusMethodCallback<int64_t>;
SpacedClient(const SpacedClient&) = delete;
SpacedClient& operator=(const SpacedClient&) = delete;