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

Unified Diff: third_party/WebKit/Source/platform/wtf/text/StringImpl.h

Issue 2833123002: Replace ASSERT_NOT_REACHED, and RELEASE_ASSERT in platform/wtf (Closed)
Patch Set: wtf Created 3 years, 8 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: third_party/WebKit/Source/platform/wtf/text/StringImpl.h
diff --git a/third_party/WebKit/Source/platform/wtf/text/StringImpl.h b/third_party/WebKit/Source/platform/wtf/text/StringImpl.h
index 26a755e67cb810c8b1001a967dc7ad54148a2f22..f5de3819bb96e0a82607679aa78539ba742db97e 100644
--- a/third_party/WebKit/Source/platform/wtf/text/StringImpl.h
+++ b/third_party/WebKit/Source/platform/wtf/text/StringImpl.h
@@ -488,9 +488,9 @@ class WTF_EXPORT StringImpl {
private:
template <typename CharType>
static size_t AllocationSize(unsigned length) {
- RELEASE_ASSERT(
- length <= ((std::numeric_limits<unsigned>::max() - sizeof(StringImpl)) /
- sizeof(CharType)));
+ CHECK_LE(length,
+ ((std::numeric_limits<unsigned>::max() - sizeof(StringImpl)) /
+ sizeof(CharType)));
return sizeof(StringImpl) + length * sizeof(CharType);
}
@@ -758,7 +758,7 @@ inline unsigned LengthOfNullTerminatedString(const UChar* string) {
size_t length = 0;
while (string[length] != UChar(0))
++length;
- RELEASE_ASSERT(length <= std::numeric_limits<unsigned>::max());
+ CHECK_LE(length, std::numeric_limits<unsigned>::max());
return static_cast<unsigned>(length);
}

Powered by Google App Engine
This is Rietveld 408576698