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

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

Issue 1845923005: CL for perf tryjob on android Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | « third_party/WebKit/Source/wtf/text/TextCodecUTF16.cpp ('k') | tools/run-perf-test.cfg » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/text/WTFString.cpp
diff --git a/third_party/WebKit/Source/wtf/text/WTFString.cpp b/third_party/WebKit/Source/wtf/text/WTFString.cpp
index c69d61aec387077a596f77774e9b35ea966c7f23..269f943ca06407145ee39359a9e7907a3b0577ba 100644
--- a/third_party/WebKit/Source/wtf/text/WTFString.cpp
+++ b/third_party/WebKit/Source/wtf/text/WTFString.cpp
@@ -92,7 +92,7 @@ void String::append(const String& string)
if (m_impl->is8Bit() && string.m_impl->is8Bit()) {
LChar* data;
- CHECK_LE(string.length(), std::numeric_limits<unsigned>::max() - m_impl->length());
+ RELEASE_ASSERT(string.length() <= std::numeric_limits<unsigned>::max() - m_impl->length());
RefPtr<StringImpl> newImpl = StringImpl::createUninitialized(m_impl->length() + string.length(), data);
memcpy(data, m_impl->characters8(), m_impl->length() * sizeof(LChar));
memcpy(data + m_impl->length(), string.characters8(), string.length() * sizeof(LChar));
@@ -101,7 +101,7 @@ void String::append(const String& string)
}
UChar* data;
- CHECK_LE(string.length(), std::numeric_limits<unsigned>::max() - m_impl->length());
+ RELEASE_ASSERT(string.length() <= std::numeric_limits<unsigned>::max() - m_impl->length());
RefPtr<StringImpl> newImpl = StringImpl::createUninitialized(m_impl->length() + string.length(), data);
if (m_impl->is8Bit())
@@ -131,7 +131,7 @@ inline void String::appendInternal(CharacterType c)
// FIXME: We should be able to create an 8 bit string via this code path.
UChar* data;
- CHECK_LT(m_impl->length(), std::numeric_limits<unsigned>::max());
+ RELEASE_ASSERT(m_impl->length() < std::numeric_limits<unsigned>::max());
RefPtr<StringImpl> newImpl = StringImpl::createUninitialized(m_impl->length() + 1, data);
if (m_impl->is8Bit())
StringImpl::copyChars(data, m_impl->characters8(), m_impl->length());
@@ -189,7 +189,7 @@ void String::append(const LChar* charactersToAppend, unsigned lengthToAppend)
unsigned strLength = m_impl->length();
if (m_impl->is8Bit()) {
- CHECK_LE(lengthToAppend, std::numeric_limits<unsigned>::max() - strLength);
+ RELEASE_ASSERT(lengthToAppend <= std::numeric_limits<unsigned>::max() - strLength);
LChar* data;
RefPtr<StringImpl> newImpl = StringImpl::createUninitialized(strLength + lengthToAppend, data);
StringImpl::copyChars(data, m_impl->characters8(), strLength);
@@ -198,7 +198,7 @@ void String::append(const LChar* charactersToAppend, unsigned lengthToAppend)
return;
}
- CHECK_LE(lengthToAppend, std::numeric_limits<unsigned>::max() - strLength);
+ RELEASE_ASSERT(lengthToAppend <= std::numeric_limits<unsigned>::max() - strLength);
UChar* data;
RefPtr<StringImpl> newImpl = StringImpl::createUninitialized(length() + lengthToAppend, data);
StringImpl::copyChars(data, m_impl->characters16(), strLength);
@@ -221,7 +221,7 @@ void String::append(const UChar* charactersToAppend, unsigned lengthToAppend)
unsigned strLength = m_impl->length();
ASSERT(charactersToAppend);
- CHECK_LE(lengthToAppend, std::numeric_limits<unsigned>::max() - strLength);
+ RELEASE_ASSERT(lengthToAppend <= std::numeric_limits<unsigned>::max() - strLength);
UChar* data;
RefPtr<StringImpl> newImpl = StringImpl::createUninitialized(strLength + lengthToAppend, data);
if (m_impl->is8Bit())
@@ -240,7 +240,7 @@ PassRefPtr<StringImpl> insertInternal(PassRefPtr<StringImpl> impl, const CharTyp
ASSERT(charactersToInsert);
UChar* data; // FIXME: We should be able to create an 8 bit string here.
- CHECK_LE(lengthToInsert, std::numeric_limits<unsigned>::max() - impl->length());
+ RELEASE_ASSERT(lengthToInsert <= std::numeric_limits<unsigned>::max() - impl->length());
RefPtr<StringImpl> newImpl = StringImpl::createUninitialized(impl->length() + lengthToInsert, data);
if (impl->is8Bit())
@@ -432,7 +432,7 @@ Vector<UChar> String::charactersWithNullTermination() const
unsigned String::copyTo(UChar* buffer, unsigned pos, unsigned maxLength) const
{
unsigned length = this->length();
- CHECK_LE(pos, length);
+ RELEASE_ASSERT(pos <= length);
unsigned numCharacters = std::min(length - pos, maxLength);
if (!numCharacters)
return 0;
@@ -871,7 +871,7 @@ String String::make16BitFrom8BitSource(const LChar* source, size_t length)
String String::fromUTF8(const LChar* stringStart, size_t length)
{
- CHECK_LE(length, std::numeric_limits<unsigned>::max());
+ RELEASE_ASSERT(length <= std::numeric_limits<unsigned>::max());
if (!stringStart)
return String();
« no previous file with comments | « third_party/WebKit/Source/wtf/text/TextCodecUTF16.cpp ('k') | tools/run-perf-test.cfg » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698