| Index: third_party/WebKit/Source/platform/text/StringTruncator.cpp
|
| diff --git a/third_party/WebKit/Source/platform/text/StringTruncator.cpp b/third_party/WebKit/Source/platform/text/StringTruncator.cpp
|
| index 89eab0c4bb5fee78054034887bcafa4fafe28da3..02563a5b81061eb37a24342c9f6610a569bd497e 100644
|
| --- a/third_party/WebKit/Source/platform/text/StringTruncator.cpp
|
| +++ b/third_party/WebKit/Source/platform/text/StringTruncator.cpp
|
| @@ -65,8 +65,8 @@ static unsigned centerTruncateToBuffer(const String& string,
|
| unsigned length,
|
| unsigned keepCount,
|
| UChar* buffer) {
|
| - ASSERT(keepCount < length);
|
| - ASSERT(keepCount < STRING_BUFFER_SIZE);
|
| + DCHECK_LT(keepCount, length);
|
| + DCHECK(keepCount < STRING_BUFFER_SIZE);
|
|
|
| unsigned omitStart = (keepCount + 1) / 2;
|
| NonSharedCharacterBreakIterator it(string);
|
| @@ -75,7 +75,7 @@ static unsigned centerTruncateToBuffer(const String& string,
|
| omitStart = textBreakAtOrPreceding(it, omitStart);
|
|
|
| unsigned truncatedLength = omitStart + 1 + (length - omitEnd);
|
| - ASSERT(truncatedLength <= length);
|
| + DCHECK_LE(truncatedLength, length);
|
|
|
| string.copyTo(buffer, 0, omitStart);
|
| buffer[omitStart] = horizontalEllipsisCharacter;
|
| @@ -88,8 +88,8 @@ static unsigned rightTruncateToBuffer(const String& string,
|
| unsigned length,
|
| unsigned keepCount,
|
| UChar* buffer) {
|
| - ASSERT(keepCount < length);
|
| - ASSERT(keepCount < STRING_BUFFER_SIZE);
|
| + DCHECK_LT(keepCount, length);
|
| + DCHECK(keepCount < STRING_BUFFER_SIZE);
|
|
|
| NonSharedCharacterBreakIterator it(string);
|
| unsigned keepLength = textBreakAtOrPreceding(it, keepCount);
|
| @@ -120,7 +120,7 @@ static String truncateString(const String& string,
|
| if (string.isEmpty())
|
| return string;
|
|
|
| - ASSERT(maxWidth >= 0);
|
| + DCHECK_GE(maxWidth, 0);
|
|
|
| float currentEllipsisWidth =
|
| stringWidth(font, &horizontalEllipsisCharacter, 1);
|
| @@ -157,8 +157,8 @@ static String truncateString(const String& string,
|
|
|
| while (keepCountForLargestKnownToFit + 1 <
|
| keepCountForSmallestKnownToNotFit) {
|
| - ASSERT(widthForLargestKnownToFit <= maxWidth);
|
| - ASSERT(widthForSmallestKnownToNotFit > maxWidth);
|
| + DCHECK_LE(widthForLargestKnownToFit, maxWidth);
|
| + DCHECK_GT(widthForSmallestKnownToNotFit, maxWidth);
|
|
|
| float ratio =
|
| (keepCountForSmallestKnownToNotFit - keepCountForLargestKnownToFit) /
|
| @@ -171,10 +171,10 @@ static String truncateString(const String& string,
|
| keepCount = keepCountForSmallestKnownToNotFit - 1;
|
| }
|
|
|
| - ASSERT(keepCount < length);
|
| - ASSERT(keepCount > 0);
|
| - ASSERT(keepCount < keepCountForSmallestKnownToNotFit);
|
| - ASSERT(keepCount > keepCountForLargestKnownToFit);
|
| + DCHECK_LT(keepCount, length);
|
| + DCHECK_GT(keepCount, 0u);
|
| + DCHECK_LT(keepCount, keepCountForSmallestKnownToNotFit);
|
| + DCHECK_GT(keepCount, keepCountForLargestKnownToFit);
|
|
|
| truncatedLength = truncateToBuffer(string, length, keepCount, stringBuffer);
|
|
|
|
|