summaryrefslogtreecommitdiffstats
path: root/base/sha1_win.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-25 02:12:09 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-25 02:12:09 +0000
commitda7d86e75fe4a37ef12f3ae4bd28b043932d2aa0 (patch)
tree5e8bfb0503ab08a672054fa34e04ef7cce3d0d2f /base/sha1_win.cc
parent6c293a7baba7aa1d998e2680492246f239a7015d (diff)
downloadchromium_src-da7d86e75fe4a37ef12f3ae4bd28b043932d2aa0.zip
chromium_src-da7d86e75fe4a37ef12f3ae4bd28b043932d2aa0.tar.gz
chromium_src-da7d86e75fe4a37ef12f3ae4bd28b043932d2aa0.tar.bz2
Replace most LOG/CHECK statements with DLOG/DCHECK statements in base.
I tried hard not to change CHECKs that had side effects. I kept fatal checks that seemed security or debugging-info (in crash reports) sensitive, and ones that seems particularly well-conceived. Review URL: http://codereview.chromium.org/8368009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107042 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/sha1_win.cc')
-rw-r--r--base/sha1_win.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/base/sha1_win.cc b/base/sha1_win.cc
index 2edfb3d..626f41b 100644
--- a/base/sha1_win.cc
+++ b/base/sha1_win.cc
@@ -18,20 +18,20 @@ std::string SHA1HashString(const std::string& str) {
ScopedHCRYPTPROV provider;
if (!CryptAcquireContext(provider.receive(), NULL, NULL, PROV_RSA_FULL,
CRYPT_VERIFYCONTEXT)) {
- LOG(ERROR) << "CryptAcquireContext failed: " << GetLastError();
+ DLOG(ERROR) << "CryptAcquireContext failed: " << GetLastError();
return std::string(kSHA1Length, '\0');
}
{
ScopedHCRYPTHASH hash;
if (!CryptCreateHash(provider, CALG_SHA1, 0, 0, hash.receive())) {
- LOG(ERROR) << "CryptCreateHash failed: " << GetLastError();
+ DLOG(ERROR) << "CryptCreateHash failed: " << GetLastError();
return std::string(kSHA1Length, '\0');
}
if (!CryptHashData(hash, reinterpret_cast<CONST BYTE*>(str.data()),
static_cast<DWORD>(str.length()), 0)) {
- LOG(ERROR) << "CryptHashData failed: " << GetLastError();
+ DLOG(ERROR) << "CryptHashData failed: " << GetLastError();
return std::string(kSHA1Length, '\0');
}
@@ -40,7 +40,8 @@ std::string SHA1HashString(const std::string& str) {
if (!CryptGetHashParam(hash, HP_HASHSIZE,
reinterpret_cast<unsigned char*>(&hash_len),
&buffer_size, 0)) {
- LOG(ERROR) << "CryptGetHashParam(HP_HASHSIZE) failed: " << GetLastError();
+ DLOG(ERROR) << "CryptGetHashParam(HP_HASHSIZE) failed: "
+ << GetLastError();
return std::string(kSHA1Length, '\0');
}
@@ -50,13 +51,14 @@ std::string SHA1HashString(const std::string& str) {
// but so that result.length() is correctly set to |hash_len|.
reinterpret_cast<BYTE*>(WriteInto(&result, hash_len + 1)), &hash_len,
0))) {
- LOG(ERROR) << "CryptGetHashParam(HP_HASHVAL) failed: " << GetLastError();
+ DLOG(ERROR) << "CryptGetHashParam(HP_HASHVAL) failed: "
+ << GetLastError();
return std::string(kSHA1Length, '\0');
}
if (hash_len != kSHA1Length) {
- LOG(ERROR) << "Returned hash value is wrong length: " << hash_len
- << " should be " << kSHA1Length;
+ DLOG(ERROR) << "Returned hash value is wrong length: " << hash_len
+ << " should be " << kSHA1Length;
return std::string(kSHA1Length, '\0');
}