| OLD | NEW |
| 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 Loading... |
| 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 RELEASE_ASSERT(length <= ((std::numeric_limits<unsigned>::max() - sizeof
(StringImpl)) / sizeof(CharType))); | 427 CHECK_LE(length, (std::numeric_limits<unsigned>::max() - sizeof(StringIm
pl)) / 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 if (is8Bit()) | 651 if (is8Bit()) |
| 652 return WTF::find(characters8(), m_length, character, start); | 652 return WTF::find(characters8(), m_length, character, start); |
| 653 return WTF::find(characters16(), m_length, character, start); | 653 return WTF::find(characters16(), m_length, character, start); |
| 654 } | 654 } |
| 655 | 655 |
| 656 inline unsigned lengthOfNullTerminatedString(const UChar* string) | 656 inline unsigned lengthOfNullTerminatedString(const UChar* string) |
| 657 { | 657 { |
| 658 size_t length = 0; | 658 size_t length = 0; |
| 659 while (string[length] != UChar(0)) | 659 while (string[length] != UChar(0)) |
| 660 ++length; | 660 ++length; |
| 661 RELEASE_ASSERT(length <= std::numeric_limits<unsigned>::max()); | 661 CHECK_LE(length, std::numeric_limits<unsigned>::max()); |
| 662 return static_cast<unsigned>(length); | 662 return static_cast<unsigned>(length); |
| 663 } | 663 } |
| 664 | 664 |
| 665 template<size_t inlineCapacity> | 665 template<size_t inlineCapacity> |
| 666 bool equalIgnoringNullity(const Vector<UChar, inlineCapacity>& a, StringImpl* b) | 666 bool equalIgnoringNullity(const Vector<UChar, inlineCapacity>& a, StringImpl* b) |
| 667 { | 667 { |
| 668 if (!b) | 668 if (!b) |
| 669 return !a.size(); | 669 return !a.size(); |
| 670 if (a.size() != b->length()) | 670 if (a.size() != b->length()) |
| 671 return false; | 671 return false; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 | 762 |
| 763 using WTF::StringImpl; | 763 using WTF::StringImpl; |
| 764 using WTF::equal; | 764 using WTF::equal; |
| 765 using WTF::equalNonNull; | 765 using WTF::equalNonNull; |
| 766 using WTF::TextCaseSensitivity; | 766 using WTF::TextCaseSensitivity; |
| 767 using WTF::TextCaseSensitive; | 767 using WTF::TextCaseSensitive; |
| 768 using WTF::TextCaseASCIIInsensitive; | 768 using WTF::TextCaseASCIIInsensitive; |
| 769 using WTF::TextCaseInsensitive; | 769 using WTF::TextCaseInsensitive; |
| 770 | 770 |
| 771 #endif | 771 #endif |
| OLD | NEW |