OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 David Smith <catfish.man@gmail.com> | 3 * Copyright (C) 2008 David Smith <catfish.man@gmail.com> |
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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 DECLARE_TRACE(); | 165 DECLARE_TRACE(); |
166 | 166 |
167 DECLARE_TRACE_WRAPPERS(); | 167 DECLARE_TRACE_WRAPPERS(); |
168 | 168 |
169 private: | 169 private: |
170 NodeListsNodeData() : m_childNodeList(nullptr) {} | 170 NodeListsNodeData() : m_childNodeList(nullptr) {} |
171 | 171 |
172 std::pair<unsigned char, StringImpl*> namedNodeListKey( | 172 std::pair<unsigned char, StringImpl*> namedNodeListKey( |
173 CollectionType type, | 173 CollectionType type, |
174 const AtomicString& name) { | 174 const AtomicString& name) { |
175 // Holding the raw StringImpl is safe because |name| is retained by the Node
List and the NodeList | 175 // Holding the raw StringImpl is safe because |name| is retained by the |
176 // is reponsible for removing itself from the cache on deletion. | 176 // NodeList and the NodeList is reponsible for removing itself from the |
| 177 // cache on deletion. |
177 return std::pair<unsigned char, StringImpl*>(type, name.impl()); | 178 return std::pair<unsigned char, StringImpl*>(type, name.impl()); |
178 } | 179 } |
179 | 180 |
180 // Can be a ChildNodeList or an EmptyNodeList. | 181 // Can be a ChildNodeList or an EmptyNodeList. |
181 WeakMember<NodeList> m_childNodeList; | 182 WeakMember<NodeList> m_childNodeList; |
182 NodeListAtomicNameCacheMap m_atomicNameCaches; | 183 NodeListAtomicNameCacheMap m_atomicNameCaches; |
183 TagCollectionCacheNS m_tagCollectionCacheNS; | 184 TagCollectionCacheNS m_tagCollectionCacheNS; |
184 }; | 185 }; |
185 | 186 |
186 template <typename Collection> | 187 template <typename Collection> |
(...skipping 19 matching lines...) Expand all Loading... |
206 | 207 |
207 template <typename Collection> | 208 template <typename Collection> |
208 inline Collection* ContainerNode::cachedCollection(CollectionType type) { | 209 inline Collection* ContainerNode::cachedCollection(CollectionType type) { |
209 NodeListsNodeData* nodeLists = this->nodeLists(); | 210 NodeListsNodeData* nodeLists = this->nodeLists(); |
210 return nodeLists ? nodeLists->cached<Collection>(type) : 0; | 211 return nodeLists ? nodeLists->cached<Collection>(type) : 0; |
211 } | 212 } |
212 | 213 |
213 } // namespace blink | 214 } // namespace blink |
214 | 215 |
215 #endif // NodeListsNodeData_h | 216 #endif // NodeListsNodeData_h |
OLD | NEW |