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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 } | 99 } |
100 | 100 |
101 void SpaceSplitString::Data::add(const AtomicString& string) { | 101 void SpaceSplitString::Data::add(const AtomicString& string) { |
102 DCHECK(hasOneRef()); | 102 DCHECK(hasOneRef()); |
103 DCHECK(!contains(string)); | 103 DCHECK(!contains(string)); |
104 m_vector.push_back(string); | 104 m_vector.push_back(string); |
105 } | 105 } |
106 | 106 |
107 void SpaceSplitString::Data::remove(unsigned index) { | 107 void SpaceSplitString::Data::remove(unsigned index) { |
108 DCHECK(hasOneRef()); | 108 DCHECK(hasOneRef()); |
109 m_vector.remove(index); | 109 m_vector.erase(index); |
110 } | 110 } |
111 | 111 |
112 void SpaceSplitString::add(const AtomicString& string) { | 112 void SpaceSplitString::add(const AtomicString& string) { |
113 // FIXME: add() does not allow duplicates but createVector() does. | 113 // FIXME: add() does not allow duplicates but createVector() does. |
114 if (contains(string)) | 114 if (contains(string)) |
115 return; | 115 return; |
116 ensureUnique(); | 116 ensureUnique(); |
117 if (m_data) | 117 if (m_data) |
118 m_data->add(string); | 118 m_data->add(string); |
119 } | 119 } |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 createVector(string); | 183 createVector(string); |
184 } | 184 } |
185 | 185 |
186 SpaceSplitString::Data::Data(const SpaceSplitString::Data& other) | 186 SpaceSplitString::Data::Data(const SpaceSplitString::Data& other) |
187 : RefCounted<Data>(), m_vector(other.m_vector) { | 187 : RefCounted<Data>(), m_vector(other.m_vector) { |
188 // Note that we don't copy m_keyString to indicate to the destructor that | 188 // Note that we don't copy m_keyString to indicate to the destructor that |
189 // there's nothing to be removed from the sharedDataMap(). | 189 // there's nothing to be removed from the sharedDataMap(). |
190 } | 190 } |
191 | 191 |
192 } // namespace blink | 192 } // namespace blink |
OLD | NEW |