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

Unified Diff: third_party/WebKit/Source/wtf/StringHasher.h

Issue 2585673002: Replace ASSERT, ENABLE(ASSERT), and ASSERT_NOT_REACHED in wtf (Closed)
Patch Set: Fix an Asan issue with LinkedHashSetNodeBase::unlink Created 4 years 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: third_party/WebKit/Source/wtf/StringHasher.h
diff --git a/third_party/WebKit/Source/wtf/StringHasher.h b/third_party/WebKit/Source/wtf/StringHasher.h
index af1136f2ff4641cabe97808d4cece1e15b4d3a61..728ce37ec7bd8ec5b2e25b789581136c1125622d 100644
--- a/third_party/WebKit/Source/wtf/StringHasher.h
+++ b/third_party/WebKit/Source/wtf/StringHasher.h
@@ -56,7 +56,7 @@ class StringHasher {
// always add characters two at a time can use the "assuming aligned"
// functions.
void addCharactersAssumingAligned(UChar a, UChar b) {
- ASSERT(!m_hasPendingCharacter);
+ DCHECK(!m_hasPendingCharacter);
m_hash += a;
m_hash = (m_hash << 16) ^ ((b << 11) ^ m_hash);
m_hash += m_hash >> 11;
@@ -75,12 +75,12 @@ class StringHasher {
void addCharacters(UChar a, UChar b) {
if (m_hasPendingCharacter) {
-#if ENABLE(ASSERT)
+#if DCHECK_IS_ON()
m_hasPendingCharacter = false;
#endif
addCharactersAssumingAligned(m_pendingCharacter, a);
m_pendingCharacter = b;
-#if ENABLE(ASSERT)
+#if DCHECK_IS_ON()
m_hasPendingCharacter = true;
#endif
return;
@@ -91,7 +91,7 @@ class StringHasher {
template <typename T, UChar Converter(T)>
void addCharactersAssumingAligned(const T* data, unsigned length) {
- ASSERT(!m_hasPendingCharacter);
+ DCHECK(!m_hasPendingCharacter);
bool remainder = length & 1;
length >>= 1;
@@ -184,7 +184,7 @@ class StringHasher {
// top 8 bits? We want that for all string hashing so we can use those
// bits in StringImpl and hash strings consistently, but I don't see why
// we'd want that for general memory hashing.
- ASSERT(!(length % 2));
+ DCHECK(!(length % 2));
return computeHashAndMaskTop8Bits<UChar>(static_cast<const UChar*>(data),
length / sizeof(UChar));
}
« no previous file with comments | « third_party/WebKit/Source/wtf/StdLibExtras.h ('k') | third_party/WebKit/Source/wtf/TerminatedArrayBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698