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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_store_file.cc

Issue 7466003: MD5Update function uses StringPiece instead of raw buffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove line from 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
« no previous file with comments | « chrome/browser/safe_browsing/prefix_set_unittest.cc ('k') | chrome/browser/sync/util/user_settings.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/safe_browsing_store_file.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_store_file.cc b/chrome/browser/safe_browsing/safe_browsing_store_file.cc
index 110fa5431fed7b0e100159139dc012cfce655e60..af3e3dfed33efadbcd349199f7f0bc7bdc7fdfe5 100644
--- a/chrome/browser/safe_browsing/safe_browsing_store_file.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_store_file.cc
@@ -58,8 +58,11 @@ bool ReadArray(T* ptr, size_t nmemb, FILE* fp, base::MD5Context* context) {
if (ret != nmemb)
return false;
- if (context)
- base::MD5Update(context, ptr, sizeof(T) * nmemb);
+ if (context) {
+ base::MD5Update(context,
+ base::StringPiece(reinterpret_cast<char*>(ptr),
+ sizeof(T) * nmemb));
+ }
return true;
}
@@ -73,8 +76,11 @@ bool WriteArray(const T* ptr, size_t nmemb, FILE* fp,
if (ret != nmemb)
return false;
- if (context)
- base::MD5Update(context, ptr, sizeof(T) * nmemb);
+ if (context) {
+ base::MD5Update(context,
+ base::StringPiece(reinterpret_cast<const char*>(ptr),
+ sizeof(T) * nmemb));
+ }
return true;
}
« no previous file with comments | « chrome/browser/safe_browsing/prefix_set_unittest.cc ('k') | chrome/browser/sync/util/user_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698