| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2013 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2013 Apple Inc. All rights reserv
ed. |
| 3 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com> | 3 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com> |
| 4 * Copyright (C) 2012 Google Inc. All rights reserved. | 4 * Copyright (C) 2012 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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 | 426 |
| 427 PassRefPtr<StringImpl> AtomicString::addSlowCase(StringImpl* r) | 427 PassRefPtr<StringImpl> AtomicString::addSlowCase(StringImpl* r) |
| 428 { | 428 { |
| 429 if (!r->length()) | 429 if (!r->length()) |
| 430 return StringImpl::empty(); | 430 return StringImpl::empty(); |
| 431 | 431 |
| 432 AtomicStringTableLocker locker; | 432 AtomicStringTableLocker locker; |
| 433 StringImpl* result = *stringTable().add(r).iterator; | 433 StringImpl* result = *stringTable().add(r).iterator; |
| 434 if (result == r) | 434 if (result == r) |
| 435 r->setIsAtomic(true); | 435 r->setIsAtomic(true); |
| 436 ASSERT(!r->isStatic() || result->isStatic()); |
| 436 return result; | 437 return result; |
| 437 } | 438 } |
| 438 | 439 |
| 439 template<typename CharacterType> | 440 template<typename CharacterType> |
| 440 static inline HashSet<StringImpl*>::iterator findString(const StringImpl* string
Impl) | 441 static inline HashSet<StringImpl*>::iterator findString(const StringImpl* string
Impl) |
| 441 { | 442 { |
| 442 HashAndCharacters<CharacterType> buffer = { stringImpl->existingHash(), stri
ngImpl->getCharacters<CharacterType>(), stringImpl->length() }; | 443 HashAndCharacters<CharacterType> buffer = { stringImpl->existingHash(), stri
ngImpl->getCharacters<CharacterType>(), stringImpl->length() }; |
| 443 return stringTable().find<HashAndCharacters<CharacterType>, HashAndCharacter
sTranslator<CharacterType> >(buffer); | 444 return stringTable().find<HashAndCharacters<CharacterType>, HashAndCharacter
sTranslator<CharacterType> >(buffer); |
| 444 } | 445 } |
| 445 | 446 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 } | 496 } |
| 496 | 497 |
| 497 #ifndef NDEBUG | 498 #ifndef NDEBUG |
| 498 void AtomicString::show() const | 499 void AtomicString::show() const |
| 499 { | 500 { |
| 500 m_string.show(); | 501 m_string.show(); |
| 501 } | 502 } |
| 502 #endif | 503 #endif |
| 503 | 504 |
| 504 } // namespace WTF | 505 } // namespace WTF |
| OLD | NEW |