OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU Library General Public License | 14 * You should have received a copy of the GNU Library General Public License |
15 * along with this library; see the file COPYING.LIB. If not, write to | 15 * along with this library; see the file COPYING.LIB. If not, write to |
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
18 */ | 18 */ |
19 | 19 |
20 #include "config.h" | 20 #include "config.h" |
21 | 21 |
22 #ifdef SKIP_STATIC_CONSTRUCTORS_ON_GCC | 22 #ifdef SKIP_STATIC_CONSTRUCTORS_ON_GCC |
23 #define WEBCORE_QUALIFIEDNAME_HIDE_GLOBALS 1 | 23 #define WEBCORE_QUALIFIEDNAME_HIDE_GLOBALS 1 |
24 #else | 24 #else |
25 #define QNAME_DEFAULT_CONSTRUCTOR | 25 #define QNAME_DEFAULT_CONSTRUCTOR |
26 #endif | 26 #endif |
27 | 27 |
28 #include "QualifiedName.h" | 28 #include "QualifiedName.h" |
29 #include "HTMLNames.h" | 29 #include "HTMLNames.h" |
30 #include "WebCoreMemoryInstrumentation.h" | |
31 #include "XLinkNames.h" | 30 #include "XLinkNames.h" |
32 #include "XMLNSNames.h" | 31 #include "XMLNSNames.h" |
33 #include "XMLNames.h" | 32 #include "XMLNames.h" |
34 #include <wtf/Assertions.h> | 33 #include <wtf/Assertions.h> |
35 #include <wtf/HashSet.h> | 34 #include <wtf/HashSet.h> |
36 #include <wtf/StaticConstructors.h> | 35 #include <wtf/StaticConstructors.h> |
37 | 36 |
38 #if ENABLE(MATHML) | 37 #if ENABLE(MATHML) |
39 #include "MathMLNames.h" | 38 #include "MathMLNames.h" |
40 #endif | 39 #endif |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 return nullName; | 141 return nullName; |
143 } | 142 } |
144 | 143 |
145 const AtomicString& QualifiedName::localNameUpper() const | 144 const AtomicString& QualifiedName::localNameUpper() const |
146 { | 145 { |
147 if (!m_impl->m_localNameUpper) | 146 if (!m_impl->m_localNameUpper) |
148 m_impl->m_localNameUpper = m_impl->m_localName.upper(); | 147 m_impl->m_localNameUpper = m_impl->m_localName.upper(); |
149 return m_impl->m_localNameUpper; | 148 return m_impl->m_localNameUpper; |
150 } | 149 } |
151 | 150 |
152 void QualifiedName::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const | |
153 { | |
154 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); | |
155 info.addMember(m_impl, "impl"); | |
156 } | |
157 | |
158 | |
159 void QualifiedName::QualifiedNameImpl::reportMemoryUsage(MemoryObjectInfo* memor
yObjectInfo) const | |
160 { | |
161 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::DOM); | |
162 info.addMember(m_prefix, "prefix"); | |
163 info.addMember(m_localName, "localName"); | |
164 info.addMember(m_namespace, "namespace"); | |
165 info.addMember(m_localNameUpper, "localNameUpper"); | |
166 } | |
167 | |
168 unsigned QualifiedName::QualifiedNameImpl::computeHash() const | 151 unsigned QualifiedName::QualifiedNameImpl::computeHash() const |
169 { | 152 { |
170 QualifiedNameComponents components = { m_prefix.impl(), m_localName.impl(),
m_namespace.impl() }; | 153 QualifiedNameComponents components = { m_prefix.impl(), m_localName.impl(),
m_namespace.impl() }; |
171 return hashComponents(components); | 154 return hashComponents(components); |
172 } | 155 } |
173 | 156 |
174 void createQualifiedName(void* targetAddress, StringImpl* name, const AtomicStri
ng& nameNamespace) | 157 void createQualifiedName(void* targetAddress, StringImpl* name, const AtomicStri
ng& nameNamespace) |
175 { | 158 { |
176 new (reinterpret_cast<void*>(targetAddress)) QualifiedName(nullAtom, AtomicS
tring(name), nameNamespace); | 159 new (reinterpret_cast<void*>(targetAddress)) QualifiedName(nullAtom, AtomicS
tring(name), nameNamespace); |
177 } | 160 } |
178 | 161 |
179 void createQualifiedName(void* targetAddress, StringImpl* name) | 162 void createQualifiedName(void* targetAddress, StringImpl* name) |
180 { | 163 { |
181 new (reinterpret_cast<void*>(targetAddress)) QualifiedName(nullAtom, AtomicS
tring(name), nullAtom); | 164 new (reinterpret_cast<void*>(targetAddress)) QualifiedName(nullAtom, AtomicS
tring(name), nullAtom); |
182 } | 165 } |
183 | 166 |
184 } | 167 } |
OLD | NEW |