| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 David Smith (catfish.man@gmail.com) | 2 * Copyright (C) 2007 David Smith (catfish.man@gmail.com) |
| 3 * Copyright (C) 2007, 2008, 2011, 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2007, 2008, 2011, 2012 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 } | 144 } |
| 145 return changed; | 145 return changed; |
| 146 } | 146 } |
| 147 | 147 |
| 148 SpaceSplitString::DataMap& SpaceSplitString::sharedDataMap() | 148 SpaceSplitString::DataMap& SpaceSplitString::sharedDataMap() |
| 149 { | 149 { |
| 150 DEFINE_STATIC_LOCAL(DataMap, map, ()); | 150 DEFINE_STATIC_LOCAL(DataMap, map, ()); |
| 151 return map; | 151 return map; |
| 152 } | 152 } |
| 153 | 153 |
| 154 void SpaceSplitString::set(const AtomicString& inputString, bool shouldFoldCase) | 154 void SpaceSplitString::set(const AtomicString& inputString, CaseFolding caseFold
ing) |
| 155 { | 155 { |
| 156 if (inputString.isNull()) { | 156 if (inputString.isNull()) { |
| 157 clear(); | 157 clear(); |
| 158 return; | 158 return; |
| 159 } | 159 } |
| 160 | 160 |
| 161 String string(inputString.string()); | 161 String string(inputString.string()); |
| 162 if (shouldFoldCase && hasNonASCIIOrUpper(string)) | 162 if (caseFolding == ShouldFoldCase && hasNonASCIIOrUpper(string)) |
| 163 string = string.foldCase(); | 163 string = string.foldCase(); |
| 164 | 164 |
| 165 m_data = Data::create(AtomicString(string)); | 165 m_data = Data::create(AtomicString(string)); |
| 166 } | 166 } |
| 167 | 167 |
| 168 SpaceSplitString::Data::~Data() | 168 SpaceSplitString::Data::~Data() |
| 169 { | 169 { |
| 170 if (!m_keyString.isNull()) | 170 if (!m_keyString.isNull()) |
| 171 sharedDataMap().remove(m_keyString); | 171 sharedDataMap().remove(m_keyString); |
| 172 } | 172 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 195 | 195 |
| 196 SpaceSplitString::Data::Data(const SpaceSplitString::Data& other) | 196 SpaceSplitString::Data::Data(const SpaceSplitString::Data& other) |
| 197 : RefCounted<Data>() | 197 : RefCounted<Data>() |
| 198 , m_vector(other.m_vector) | 198 , m_vector(other.m_vector) |
| 199 { | 199 { |
| 200 // Note that we don't copy m_keyString to indicate to the destructor that th
ere's nothing | 200 // Note that we don't copy m_keyString to indicate to the destructor that th
ere's nothing |
| 201 // to be removed from the sharedDataMap(). | 201 // to be removed from the sharedDataMap(). |
| 202 } | 202 } |
| 203 | 203 |
| 204 } // namespace blink | 204 } // namespace blink |
| OLD | NEW |