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

Unified Diff: blimp/common/blob_cache/id_util.cc

Issue 1962193002: Add a integration test suite for BlobChannel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove redundant callback Created 4 years, 7 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 | « blimp/common/blob_cache/id_util.h ('k') | blimp/common/blob_cache/test_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/common/blob_cache/id_util.cc
diff --git a/blimp/common/blob_cache/id_util.cc b/blimp/common/blob_cache/id_util.cc
index 00014adb5c9b48d78e2ecebf64a84ec9cb37a3e2..f33c714b9fcef3db3d5a4b89bcf66f6abf79c423 100644
--- a/blimp/common/blob_cache/id_util.cc
+++ b/blimp/common/blob_cache/id_util.cc
@@ -17,8 +17,12 @@ const BlobId CalculateBlobId(const void* data, size_t data_size) {
base::StringPiece(reinterpret_cast<const char*>(data), data_size));
}
+const BlobId CalculateBlobId(const std::string& data) {
+ return crypto::SHA256HashString(data);
+}
+
const std::string BlobIdToString(const BlobId& id) {
- DCHECK(IsValidBlobId(id));
+ DCHECK(IsValidBlobId(id)) << "Invalid blob ID: " << id;
return base::ToLowerASCII(base::HexEncode(id.data(), id.length()));
}
« no previous file with comments | « blimp/common/blob_cache/id_util.h ('k') | blimp/common/blob_cache/test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698