PolicyManager: Move payload_size to int64_t.
Code style encourages signed types instead of unsigned types and the
value being exposed is already signed. This patch fixes that for the
payload_size variable and adapts the BoxedValue::ValuePrinter
implementations to use the int64_t and uint64_t types.
BUG=None
TEST=Unit tests updated
Change-Id: I21310c59d8c2654c43cac27265055c8577341562
Reviewed-on: https://chromium-review.googlesource.com/198269
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
diff --git a/policy_manager/real_updater_provider.cc b/policy_manager/real_updater_provider.cc
index bc1350b..4455e7f 100644
--- a/policy_manager/real_updater_provider.cc
+++ b/policy_manager/real_updater_provider.cc
@@ -180,12 +180,12 @@
};
// A variable reporting the size of the update being processed in bytes.
-class PayloadSizeVariable : public UpdaterVariableBase<size_t> {
+class PayloadSizeVariable : public UpdaterVariableBase<int64_t> {
public:
- using UpdaterVariableBase<size_t>::UpdaterVariableBase;
+ using UpdaterVariableBase<int64_t>::UpdaterVariableBase;
private:
- virtual const size_t* GetValue(TimeDelta /* timeout */,
+ virtual const int64_t* GetValue(TimeDelta /* timeout */,
string* errmsg) override {
GetStatusHelper raw(system_state(), errmsg);
if (!raw.is_success())
@@ -197,7 +197,7 @@
return NULL;
}
- return new size_t(static_cast<size_t>(raw.payload_size()));
+ return new int64_t(raw.payload_size());
}
DISALLOW_COPY_AND_ASSIGN(PayloadSizeVariable);