Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: omaha_hash_calculator.cc

Issue 3521016: AU: Start checkpointing update progress. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: address review comments Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « omaha_hash_calculator.h ('k') | omaha_hash_calculator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « omaha_hash_calculator.h ('k') | omaha_hash_calculator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698