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

Side by Side Diff: Source/wtf/text/AtomicString.cpp

Issue 19804005: Remove AtomicStringImpl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/wtf/text/AtomicString.h ('k') | Source/wtf/text/AtomicStringImpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 return result; 397 return result;
398 } 398 }
399 399
400 template<typename CharacterType> 400 template<typename CharacterType>
401 static inline HashSet<StringImpl*>::iterator findString(const StringImpl* string Impl) 401 static inline HashSet<StringImpl*>::iterator findString(const StringImpl* string Impl)
402 { 402 {
403 HashAndCharacters<CharacterType> buffer = { stringImpl->existingHash(), stri ngImpl->getCharacters<CharacterType>(), stringImpl->length() }; 403 HashAndCharacters<CharacterType> buffer = { stringImpl->existingHash(), stri ngImpl->getCharacters<CharacterType>(), stringImpl->length() };
404 return stringTable().find<HashAndCharactersTranslator<CharacterType> >(buffe r); 404 return stringTable().find<HashAndCharactersTranslator<CharacterType> >(buffe r);
405 } 405 }
406 406
407 AtomicStringImpl* AtomicString::find(const StringImpl* stringImpl) 407 StringImpl* AtomicString::find(const StringImpl* stringImpl)
408 { 408 {
409 ASSERT(stringImpl); 409 ASSERT(stringImpl);
410 ASSERT(stringImpl->existingHash()); 410 ASSERT(stringImpl->existingHash());
411 411
412 if (!stringImpl->length()) 412 if (!stringImpl->length())
413 return static_cast<AtomicStringImpl*>(StringImpl::empty()); 413 return StringImpl::empty();
414 414
415 HashSet<StringImpl*>::iterator iterator; 415 HashSet<StringImpl*>::iterator iterator;
416 if (stringImpl->is8Bit()) 416 if (stringImpl->is8Bit())
417 iterator = findString<LChar>(stringImpl); 417 iterator = findString<LChar>(stringImpl);
418 else 418 else
419 iterator = findString<UChar>(stringImpl); 419 iterator = findString<UChar>(stringImpl);
420 if (iterator == stringTable().end()) 420 if (iterator == stringTable().end())
421 return 0; 421 return 0;
422 return static_cast<AtomicStringImpl*>(*iterator); 422 return *iterator;
423 } 423 }
424 424
425 void AtomicString::remove(StringImpl* r) 425 void AtomicString::remove(StringImpl* r)
426 { 426 {
427 HashSet<StringImpl*>::iterator iterator; 427 HashSet<StringImpl*>::iterator iterator;
428 if (r->is8Bit()) 428 if (r->is8Bit())
429 iterator = findString<LChar>(r); 429 iterator = findString<LChar>(r);
430 else 430 else
431 iterator = findString<UChar>(r); 431 iterator = findString<UChar>(r);
432 RELEASE_ASSERT(iterator != stringTable().end()); 432 RELEASE_ASSERT(iterator != stringTable().end());
(...skipping 27 matching lines...) Expand all
460 } 460 }
461 461
462 #ifndef NDEBUG 462 #ifndef NDEBUG
463 void AtomicString::show() const 463 void AtomicString::show() const
464 { 464 {
465 m_string.show(); 465 m_string.show();
466 } 466 }
467 #endif 467 #endif
468 468
469 } // namespace WTF 469 } // namespace WTF
OLDNEW
« no previous file with comments | « Source/wtf/text/AtomicString.h ('k') | Source/wtf/text/AtomicStringImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698