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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « omaha_hash_calculator.h ('k') | omaha_hash_calculator_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "update_engine/omaha_hash_calculator.h" 5 #include "update_engine/omaha_hash_calculator.h"
6 6
7 #include <openssl/bio.h> 7 #include <openssl/bio.h>
8 #include <openssl/buffer.h> 8 #include <openssl/buffer.h>
9 #include <openssl/evp.h> 9 #include <openssl/evp.h>
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 90 }
91 91
92 string OmahaHashCalculator::OmahaHashOfString(const string& str) { 92 string OmahaHashCalculator::OmahaHashOfString(const string& str) {
93 return OmahaHashOfBytes(str.data(), str.size()); 93 return OmahaHashOfBytes(str.data(), str.size());
94 } 94 }
95 95
96 string OmahaHashCalculator::OmahaHashOfData(const vector<char>& data) { 96 string OmahaHashCalculator::OmahaHashOfData(const vector<char>& data) {
97 return OmahaHashOfBytes(&data[0], data.size()); 97 return OmahaHashOfBytes(&data[0], data.size());
98 } 98 }
99 99
100 string OmahaHashCalculator::GetContext() const {
101 return string(reinterpret_cast<const char*>(&ctx_), sizeof(ctx_));
102 }
103
104 bool OmahaHashCalculator::SetContext(const std::string& context) {
105 TEST_AND_RETURN_FALSE(context.size() == sizeof(ctx_));
106 memcpy(&ctx_, context.data(), sizeof(ctx_));
107 return true;
108 }
109
100 } // namespace chromeos_update_engine 110 } // namespace chromeos_update_engine
OLDNEW
« 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