OLD | NEW |
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 r
ights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All r
ights reserved. |
6 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) | 6 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 | 390 |
391 ASSERT(isMainThread()); | 391 ASSERT(isMainThread()); |
392 m_highestStaticStringLength = std::max(m_highestStaticStringLength, length); | 392 m_highestStaticStringLength = std::max(m_highestStaticStringLength, length); |
393 staticStrings().add(hash, impl); | 393 staticStrings().add(hash, impl); |
394 WTF_ANNOTATE_BENIGN_RACE(impl, | 394 WTF_ANNOTATE_BENIGN_RACE(impl, |
395 "Benign race on the reference counter of a static string created by Stri
ngImpl::createStatic"); | 395 "Benign race on the reference counter of a static string created by Stri
ngImpl::createStatic"); |
396 | 396 |
397 return impl; | 397 return impl; |
398 } | 398 } |
399 | 399 |
| 400 void StringImpl::reserveStaticStringsCapacityForSize(unsigned size) |
| 401 { |
| 402 ASSERT(s_allowCreationOfStaticStrings); |
| 403 staticStrings().reserveCapacityForSize(size); |
| 404 } |
| 405 |
400 PassRefPtr<StringImpl> StringImpl::create(const UChar* characters, unsigned leng
th) | 406 PassRefPtr<StringImpl> StringImpl::create(const UChar* characters, unsigned leng
th) |
401 { | 407 { |
402 if (!characters || !length) | 408 if (!characters || !length) |
403 return empty(); | 409 return empty(); |
404 | 410 |
405 UChar* data; | 411 UChar* data; |
406 RefPtr<StringImpl> string = createUninitialized(length, data); | 412 RefPtr<StringImpl> string = createUninitialized(length, data); |
407 memcpy(data, characters, length * sizeof(UChar)); | 413 memcpy(data, characters, length * sizeof(UChar)); |
408 return string.release(); | 414 return string.release(); |
409 } | 415 } |
(...skipping 1710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2120 } else if (localeIdMatchesLang(localeIdentifier, "lt")) { | 2126 } else if (localeIdMatchesLang(localeIdentifier, "lt")) { |
2121 // TODO(rob.buis) implement upper-casing rules for lt | 2127 // TODO(rob.buis) implement upper-casing rules for lt |
2122 // like in StringImpl::upper(locale). | 2128 // like in StringImpl::upper(locale). |
2123 } | 2129 } |
2124 } | 2130 } |
2125 | 2131 |
2126 return toUpper(c); | 2132 return toUpper(c); |
2127 } | 2133 } |
2128 | 2134 |
2129 } // namespace WTF | 2135 } // namespace WTF |
OLD | NEW |