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

Side by Side Diff: third_party/WebKit/Source/wtf/text/StringImpl.h

Issue 2016223002: Revert of Replace all occurrences of RELEASE_ASSERT in wtf with CHECK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve conflict in StringImpl.cpp. Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Google Inc. All rights reserved. 4 * Copyright (C) 2009 Google Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 #endif 417 #endif
418 418
419 #ifdef STRING_STATS 419 #ifdef STRING_STATS
420 ALWAYS_INLINE static StringStats& stringStats() { return m_stringStats; } 420 ALWAYS_INLINE static StringStats& stringStats() { return m_stringStats; }
421 #endif 421 #endif
422 static const UChar latin1CaseFoldTable[256]; 422 static const UChar latin1CaseFoldTable[256];
423 423
424 private: 424 private:
425 template<typename CharType> static size_t allocationSize(unsigned length) 425 template<typename CharType> static size_t allocationSize(unsigned length)
426 { 426 {
427 CHECK_LE(length, (std::numeric_limits<unsigned>::max() - sizeof(StringIm pl)) / sizeof(CharType)); 427 RELEASE_ASSERT(length <= ((std::numeric_limits<unsigned>::max() - sizeof (StringImpl)) / sizeof(CharType)));
428 return sizeof(StringImpl) + length * sizeof(CharType); 428 return sizeof(StringImpl) + length * sizeof(CharType);
429 } 429 }
430 430
431 template <class UCharPredicate> PassRefPtr<StringImpl> stripMatchedCharacter s(UCharPredicate); 431 template <class UCharPredicate> PassRefPtr<StringImpl> stripMatchedCharacter s(UCharPredicate);
432 template <typename CharType, class UCharPredicate> PassRefPtr<StringImpl> si mplifyMatchedCharactersToSpace(UCharPredicate, StripBehavior); 432 template <typename CharType, class UCharPredicate> PassRefPtr<StringImpl> si mplifyMatchedCharactersToSpace(UCharPredicate, StripBehavior);
433 NEVER_INLINE unsigned hashSlowCase() const; 433 NEVER_INLINE unsigned hashSlowCase() const;
434 434
435 #ifdef STRING_STATS 435 #ifdef STRING_STATS
436 static StringStats m_stringStats; 436 static StringStats m_stringStats;
437 #endif 437 #endif
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 if (is8Bit()) 658 if (is8Bit())
659 return WTF::find(characters8(), m_length, character, start); 659 return WTF::find(characters8(), m_length, character, start);
660 return WTF::find(characters16(), m_length, character, start); 660 return WTF::find(characters16(), m_length, character, start);
661 } 661 }
662 662
663 inline unsigned lengthOfNullTerminatedString(const UChar* string) 663 inline unsigned lengthOfNullTerminatedString(const UChar* string)
664 { 664 {
665 size_t length = 0; 665 size_t length = 0;
666 while (string[length] != UChar(0)) 666 while (string[length] != UChar(0))
667 ++length; 667 ++length;
668 CHECK_LE(length, std::numeric_limits<unsigned>::max()); 668 RELEASE_ASSERT(length <= std::numeric_limits<unsigned>::max());
669 return static_cast<unsigned>(length); 669 return static_cast<unsigned>(length);
670 } 670 }
671 671
672 template<size_t inlineCapacity> 672 template<size_t inlineCapacity>
673 bool equalIgnoringNullity(const Vector<UChar, inlineCapacity>& a, StringImpl* b) 673 bool equalIgnoringNullity(const Vector<UChar, inlineCapacity>& a, StringImpl* b)
674 { 674 {
675 if (!b) 675 if (!b)
676 return !a.size(); 676 return !a.size();
677 if (a.size() != b->length()) 677 if (a.size() != b->length())
678 return false; 678 return false;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 769
770 using WTF::StringImpl; 770 using WTF::StringImpl;
771 using WTF::equal; 771 using WTF::equal;
772 using WTF::equalNonNull; 772 using WTF::equalNonNull;
773 using WTF::TextCaseSensitivity; 773 using WTF::TextCaseSensitivity;
774 using WTF::TextCaseSensitive; 774 using WTF::TextCaseSensitive;
775 using WTF::TextCaseASCIIInsensitive; 775 using WTF::TextCaseASCIIInsensitive;
776 using WTF::TextCaseInsensitive; 776 using WTF::TextCaseInsensitive;
777 777
778 #endif 778 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringConcatenate.cpp ('k') | third_party/WebKit/Source/wtf/text/StringImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698