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

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

Issue 21274008: Remove ASCIILiteral optimization from StringImpl (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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/tests/StringImpl.cpp ('k') | Source/wtf/text/StringImpl.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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 return StringHasher::computeHashAndMaskTop8Bits(reinterpret_cast<const L Char*>(buf.s), buf.length); 351 return StringHasher::computeHashAndMaskTop8Bits(reinterpret_cast<const L Char*>(buf.s), buf.length);
352 } 352 }
353 353
354 static bool equal(StringImpl* const& str, const CharBuffer& buf) 354 static bool equal(StringImpl* const& str, const CharBuffer& buf)
355 { 355 {
356 return WTF::equal(str, buf.s, buf.length); 356 return WTF::equal(str, buf.s, buf.length);
357 } 357 }
358 358
359 static void translate(StringImpl*& location, const CharBuffer& buf, unsigned hash) 359 static void translate(StringImpl*& location, const CharBuffer& buf, unsigned hash)
360 { 360 {
361 location = StringImpl::createFromLiteral(buf.s, buf.length).leakRef(); 361 location = StringImpl::create(buf.s, buf.length).leakRef();
362 location->setHash(hash); 362 location->setHash(hash);
363 location->setIsAtomic(true); 363 location->setIsAtomic(true);
364 } 364 }
365 }; 365 };
366 366
367 PassRefPtr<StringImpl> AtomicString::add(const LChar* s, unsigned length) 367 PassRefPtr<StringImpl> AtomicString::add(const LChar* s, unsigned length)
368 { 368 {
369 if (!s) 369 if (!s)
370 return 0; 370 return 0;
371 371
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
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/tests/StringImpl.cpp ('k') | Source/wtf/text/StringImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698