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

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

Issue 20300002: Fix trailing whitespace in .cpp, .h, and .idl files (ex. Source/core) (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/AtomicStringHash.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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 } 236 }
237 }; 237 };
238 238
239 PassRefPtr<StringImpl> AtomicString::add(const UChar* s, unsigned length) 239 PassRefPtr<StringImpl> AtomicString::add(const UChar* s, unsigned length)
240 { 240 {
241 if (!s) 241 if (!s)
242 return 0; 242 return 0;
243 243
244 if (!length) 244 if (!length)
245 return StringImpl::empty(); 245 return StringImpl::empty();
246 246
247 UCharBuffer buffer = { s, length }; 247 UCharBuffer buffer = { s, length };
248 return addToStringTable<UCharBuffer, UCharBufferTranslator>(buffer); 248 return addToStringTable<UCharBuffer, UCharBufferTranslator>(buffer);
249 } 249 }
250 250
251 PassRefPtr<StringImpl> AtomicString::add(const UChar* s, unsigned length, unsign ed existingHash) 251 PassRefPtr<StringImpl> AtomicString::add(const UChar* s, unsigned length, unsign ed existingHash)
252 { 252 {
253 ASSERT(s); 253 ASSERT(s);
254 ASSERT(existingHash); 254 ASSERT(existingHash);
255 255
256 if (!length) 256 if (!length)
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 unsigned maxLength = baseString->length() - start; 316 unsigned maxLength = baseString->length() - start;
317 if (length >= maxLength) { 317 if (length >= maxLength) {
318 if (!start) 318 if (!start)
319 return add(baseString); 319 return add(baseString);
320 length = maxLength; 320 length = maxLength;
321 } 321 }
322 322
323 SubstringLocation buffer = { baseString, start, length }; 323 SubstringLocation buffer = { baseString, start, length };
324 return addToStringTable<SubstringLocation, SubstringTranslator>(buffer); 324 return addToStringTable<SubstringLocation, SubstringTranslator>(buffer);
325 } 325 }
326 326
327 typedef HashTranslatorCharBuffer<LChar> LCharBuffer; 327 typedef HashTranslatorCharBuffer<LChar> LCharBuffer;
328 struct LCharBufferTranslator { 328 struct LCharBufferTranslator {
329 static unsigned hash(const LCharBuffer& buf) 329 static unsigned hash(const LCharBuffer& buf)
330 { 330 {
331 return StringHasher::computeHashAndMaskTop8Bits(buf.s, buf.length); 331 return StringHasher::computeHashAndMaskTop8Bits(buf.s, buf.length);
332 } 332 }
333 333
334 static bool equal(StringImpl* const& str, const LCharBuffer& buf) 334 static bool equal(StringImpl* const& str, const LCharBuffer& buf)
335 { 335 {
336 return WTF::equal(str, buf.s, buf.length); 336 return WTF::equal(str, buf.s, buf.length);
(...skipping 123 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/text/AtomicString.h ('k') | Source/wtf/text/AtomicStringHash.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698