Index: omaha_hash_calculator.cc |
diff --git a/omaha_hash_calculator.cc b/omaha_hash_calculator.cc |
index 0df83bcd99598ba99f1a0697a6b16657401ae71e..bc7147602abefe4e39407063654f4722576e8802 100644 |
--- a/omaha_hash_calculator.cc |
+++ b/omaha_hash_calculator.cc |
@@ -97,4 +97,14 @@ string OmahaHashCalculator::OmahaHashOfData(const vector<char>& data) { |
return OmahaHashOfBytes(&data[0], data.size()); |
} |
+string OmahaHashCalculator::GetContext() const { |
+ return string(reinterpret_cast<const char*>(&ctx_), sizeof(ctx_)); |
+} |
+ |
+bool OmahaHashCalculator::SetContext(const std::string& context) { |
+ TEST_AND_RETURN_FALSE(context.size() == sizeof(ctx_)); |
+ memcpy(&ctx_, context.data(), sizeof(ctx_)); |
+ return true; |
+} |
+ |
} // namespace chromeos_update_engine |