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 19 matching lines...) Expand all Loading... |
30 #include "platform/heap/Handle.h" | 30 #include "platform/heap/Handle.h" |
31 #include "wtf/text/AtomicString.h" | 31 #include "wtf/text/AtomicString.h" |
32 #include "wtf/text/StringHash.h" | 32 #include "wtf/text/StringHash.h" |
33 | 33 |
34 namespace blink { | 34 namespace blink { |
35 | 35 |
36 class NodeListsNodeData FINAL : public NoBaseWillBeGarbageCollectedFinalized<Nod
eListsNodeData> { | 36 class NodeListsNodeData FINAL : public NoBaseWillBeGarbageCollectedFinalized<Nod
eListsNodeData> { |
37 WTF_MAKE_NONCOPYABLE(NodeListsNodeData); | 37 WTF_MAKE_NONCOPYABLE(NodeListsNodeData); |
38 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; | 38 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
39 public: | 39 public: |
40 void clearChildNodeListCache() | 40 ChildNodeList* childNodeList(ContainerNode& node) |
41 { | 41 { |
42 if (m_childNodeList && m_childNodeList->isChildNodeList()) | 42 ASSERT_UNUSED(node, !m_childNodeList || node == m_childNodeList->virtual
OwnerNode()); |
43 toChildNodeList(m_childNodeList)->invalidateCache(); | 43 return toChildNodeList(m_childNodeList); |
44 } | 44 } |
45 | 45 |
46 PassRefPtrWillBeRawPtr<ChildNodeList> ensureChildNodeList(ContainerNode& nod
e) | 46 PassRefPtrWillBeRawPtr<ChildNodeList> ensureChildNodeList(ContainerNode& nod
e) |
47 { | 47 { |
48 if (m_childNodeList) | 48 if (m_childNodeList) |
49 return toChildNodeList(m_childNodeList); | 49 return toChildNodeList(m_childNodeList); |
50 RefPtrWillBeRawPtr<ChildNodeList> list = ChildNodeList::create(node); | 50 RefPtrWillBeRawPtr<ChildNodeList> list = ChildNodeList::create(node); |
51 m_childNodeList = list.get(); | 51 m_childNodeList = list.get(); |
52 return list.release(); | 52 return list.release(); |
53 } | 53 } |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 if ((m_childNodeList ? 1 : 0) + m_atomicNameCaches.size() + m_tagCollectionC
acheNS.size() != 1) | 232 if ((m_childNodeList ? 1 : 0) + m_atomicNameCaches.size() + m_tagCollectionC
acheNS.size() != 1) |
233 return false; | 233 return false; |
234 ownerNode.clearNodeLists(); | 234 ownerNode.clearNodeLists(); |
235 return true; | 235 return true; |
236 } | 236 } |
237 #endif | 237 #endif |
238 | 238 |
239 } // namespace blink | 239 } // namespace blink |
240 | 240 |
241 #endif // NodeListsNodeData_h | 241 #endif // NodeListsNodeData_h |
OLD | NEW |