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