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

Side by Side Diff: third_party/WebKit/Source/wtf/text/StringImpl.cpp

Issue 2693433002: Migrate WTF::HashMap::add() to ::insert() [final] (Closed)
Patch Set: more platform-specific references Created 3 years, 10 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
« no previous file with comments | « third_party/WebKit/Source/wtf/HashMap.h ('k') | no next file » | 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller ( mueller@kde.org ) 4 * (C) 2001 Dirk Mueller ( mueller@kde.org )
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All
6 * rights reserved. 6 * rights reserved.
7 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) 7 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 443
444 LChar* data = reinterpret_cast<LChar*>(impl + 1); 444 LChar* data = reinterpret_cast<LChar*>(impl + 1);
445 impl = new (impl) StringImpl(length, hash, StaticString); 445 impl = new (impl) StringImpl(length, hash, StaticString);
446 memcpy(data, string, length * sizeof(LChar)); 446 memcpy(data, string, length * sizeof(LChar));
447 #if DCHECK_IS_ON() 447 #if DCHECK_IS_ON()
448 impl->assertHashIsCorrect(); 448 impl->assertHashIsCorrect();
449 #endif 449 #endif
450 450
451 DCHECK(isMainThread()); 451 DCHECK(isMainThread());
452 m_highestStaticStringLength = std::max(m_highestStaticStringLength, length); 452 m_highestStaticStringLength = std::max(m_highestStaticStringLength, length);
453 staticStrings().add(hash, impl); 453 staticStrings().insert(hash, impl);
454 WTF_ANNOTATE_BENIGN_RACE(impl, 454 WTF_ANNOTATE_BENIGN_RACE(impl,
455 "Benign race on the reference counter of a static " 455 "Benign race on the reference counter of a static "
456 "string created by StringImpl::createStatic"); 456 "string created by StringImpl::createStatic");
457 457
458 return impl; 458 return impl;
459 } 459 }
460 460
461 void StringImpl::reserveStaticStringsCapacityForSize(unsigned size) { 461 void StringImpl::reserveStaticStringsCapacityForSize(unsigned size) {
462 #if DCHECK_IS_ON() 462 #if DCHECK_IS_ON()
463 DCHECK(s_allowCreationOfStaticStrings); 463 DCHECK(s_allowCreationOfStaticStrings);
(...skipping 1749 matching lines...) Expand 10 before | Expand all | Expand 10 after
2213 } else if (localeIdMatchesLang(localeIdentifier, "lt")) { 2213 } else if (localeIdMatchesLang(localeIdentifier, "lt")) {
2214 // TODO(rob.buis) implement upper-casing rules for lt 2214 // TODO(rob.buis) implement upper-casing rules for lt
2215 // like in StringImpl::upper(locale). 2215 // like in StringImpl::upper(locale).
2216 } 2216 }
2217 } 2217 }
2218 2218
2219 return toUpper(c); 2219 return toUpper(c);
2220 } 2220 }
2221 2221
2222 } // namespace WTF 2222 } // namespace WTF
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/HashMap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698