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

Unified Diff: extensions/browser/computed_hashes.h

Issue 436563004: Fix for 0-length file problem in content verification (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes from review comments Created 6 years, 4 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 | « no previous file | extensions/browser/computed_hashes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/computed_hashes.h
diff --git a/extensions/browser/computed_hashes.h b/extensions/browser/computed_hashes.h
index c68175c8d2c832107335eb4d8abd60266b23540f..c5e2052b8602a678e8587a5d8b19f67bf587b74c 100644
--- a/extensions/browser/computed_hashes.h
+++ b/extensions/browser/computed_hashes.h
@@ -9,10 +9,11 @@
#include <string>
#include <vector>
-#include "base/values.h"
+#include "base/memory/scoped_ptr.h"
namespace base {
class FilePath;
+class ListValue;
}
namespace extensions {
@@ -54,9 +55,16 @@ class ComputedHashes {
bool WriteToFile(const base::FilePath& path);
private:
- // The top-level object that will be serialized as JSON.
- base::ListValue file_list_;
+ // Each element of this list contains the path and block hashes for one
+ // file.
+ scoped_ptr<base::ListValue> file_list_;
};
+
+ // Computes the SHA256 hash of each |block_size| chunk in |contents|, placing
+ // the results into |hashes|.
+ static void ComputeHashesForContent(const std::string& contents,
+ size_t block_size,
+ std::vector<std::string>* hashes);
};
} // namespace extensions
« no previous file with comments | « no previous file | extensions/browser/computed_hashes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698