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

Unified Diff: third_party/WebKit/Source/platform/wtf/text/WTFString.cpp

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/WTFString.cpp
diff --git a/third_party/WebKit/Source/platform/wtf/text/WTFString.cpp b/third_party/WebKit/Source/platform/wtf/text/WTFString.cpp
index 59f814d344cc68a8877c1d3b8ba6e347355cb1e5..de5549254a46c191d00265fff3c55e7872d8cc12 100644
--- a/third_party/WebKit/Source/platform/wtf/text/WTFString.cpp
+++ b/third_party/WebKit/Source/platform/wtf/text/WTFString.cpp
@@ -103,8 +103,8 @@ void String::Append(const StringView& string) {
if (impl_->Is8Bit() && string.Is8Bit()) {
LChar* data;
- RELEASE_ASSERT(string.length() <=
- std::numeric_limits<unsigned>::max() - impl_->length());
+ CHECK_LE(string.length(),
+ std::numeric_limits<unsigned>::max() - impl_->length());
RefPtr<StringImpl> new_impl = StringImpl::CreateUninitialized(
impl_->length() + string.length(), data);
memcpy(data, impl_->Characters8(), impl_->length() * sizeof(LChar));
@@ -115,8 +115,8 @@ void String::Append(const StringView& string) {
}
UChar* data;
- RELEASE_ASSERT(string.length() <=
- std::numeric_limits<unsigned>::max() - impl_->length());
+ CHECK_LE(string.length(),
+ std::numeric_limits<unsigned>::max() - impl_->length());
RefPtr<StringImpl> new_impl =
StringImpl::CreateUninitialized(impl_->length() + string.length(), data);
@@ -148,7 +148,7 @@ inline void String::AppendInternal(CharacterType c) {
// FIXME: We should be able to create an 8 bit string via this code path.
UChar* data;
- RELEASE_ASSERT(impl_->length() < std::numeric_limits<unsigned>::max());
+ CHECK_LT(impl_->length(), std::numeric_limits<unsigned>::max());
RefPtr<StringImpl> new_impl =
StringImpl::CreateUninitialized(impl_->length() + 1, data);
if (impl_->Is8Bit())
@@ -186,8 +186,8 @@ PassRefPtr<StringImpl> InsertInternal(PassRefPtr<StringImpl> impl,
DCHECK(characters_to_insert);
UChar* data; // FIXME: We should be able to create an 8 bit string here.
- RELEASE_ASSERT(length_to_insert <=
- std::numeric_limits<unsigned>::max() - impl->length());
+ CHECK_LE(length_to_insert,
+ std::numeric_limits<unsigned>::max() - impl->length());
RefPtr<StringImpl> new_impl =
StringImpl::CreateUninitialized(impl->length() + length_to_insert, data);
@@ -739,7 +739,7 @@ String String::Make16BitFrom8BitSource(const LChar* source, size_t length) {
}
String String::FromUTF8(const LChar* string_start, size_t length) {
- RELEASE_ASSERT(length <= std::numeric_limits<unsigned>::max());
+ CHECK_LE(length, std::numeric_limits<unsigned>::max());
if (!string_start)
return String();

Powered by Google App Engine
This is Rietveld 408576698