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

Unified Diff: omaha_hash_calculator.h

Issue 3588015: AU: Include the old/new kernel/rootfs size/hash in the update metadata. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: no need to close negative handles 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
Index: omaha_hash_calculator.h
diff --git a/omaha_hash_calculator.h b/omaha_hash_calculator.h
index 7aa37e4338f71ba1eb1a4545d93a89c03761789a..5daba78b38f099e857a83a9771a05990d2fe1a1c 100644
--- a/omaha_hash_calculator.h
+++ b/omaha_hash_calculator.h
@@ -7,9 +7,10 @@
#include <string>
#include <vector>
+
#include <openssl/sha.h>
-#include "base/basictypes.h"
-#include "base/logging.h"
+#include <base/basictypes.h>
+#include <base/logging.h>
// Omaha uses base64 encoded SHA-256 as the hash. This class provides a simple
// wrapper around OpenSSL providing such a formatted hash of data passed in.
@@ -28,6 +29,11 @@ class OmahaHashCalculator {
// Returns true on success.
bool Update(const char* data, size_t length);
+ // Updates the hash with up to |length| bytes of data from |file|. If |length|
+ // is negative, reads in and updates with the whole file. Returns the number
+ // of bytes that the hash was updated with, or -1 on error.
+ off_t UpdateFile(const std::string& name, off_t length);
+
// Call Finalize() when all data has been passed in. This method tells
// OpenSSl that no more data will come in and base64 encodes the resulting
// hash.
« no previous file with comments | « delta_performer_unittest.cc ('k') | omaha_hash_calculator.cc » ('j') | omaha_hash_calculator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698