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

Unified Diff: chrome/common/visitedlink_common.cc

Issue 7466003: MD5Update function uses StringPiece instead of raw buffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added valid license Created 9 years, 5 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: chrome/common/visitedlink_common.cc
diff --git a/chrome/common/visitedlink_common.cc b/chrome/common/visitedlink_common.cc
index 7fb254e745382183394f69165ac1b3e50a09b6eb..7c21054a6f1fa0de65d843e82af60b8d5fe7620c 100644
--- a/chrome/common/visitedlink_common.cc
+++ b/chrome/common/visitedlink_common.cc
@@ -81,8 +81,9 @@ VisitedLinkCommon::Fingerprint VisitedLinkCommon::ComputeURLFingerprint(
base::MD5Context ctx;
base::MD5Init(&ctx);
- base::MD5Update(&ctx, salt, LINK_SALT_LENGTH * sizeof(uint8));
- base::MD5Update(&ctx, canonical_url, url_len * sizeof(char));
+ base::MD5Update(&ctx, base::StringPiece(reinterpret_cast<const char*>(salt),
+ LINK_SALT_LENGTH));
+ base::MD5Update(&ctx, base::StringPiece(canonical_url, url_len));
base::MD5Digest digest;
base::MD5Final(&digest, &ctx);

Powered by Google App Engine
This is Rietveld 408576698