Chromium Code Reviews| Index: Source/core/dom/NodeListsNodeData.h |
| diff --git a/Source/core/dom/NodeListsNodeData.h b/Source/core/dom/NodeListsNodeData.h |
| index 8717d1ec0eca6af845f2d8e1477be06a566784d7..a601ab9475c2d7a96e8090143def2b480678763e 100644 |
| --- a/Source/core/dom/NodeListsNodeData.h |
| +++ b/Source/core/dom/NodeListsNodeData.h |
| @@ -236,6 +236,32 @@ inline bool NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLas |
| } |
| #endif |
| +template <typename Collection> |
| +inline PassRefPtrWillBeRawPtr<Collection> ContainerNode::ensureCachedCollection(CollectionType type) |
| +{ |
| + return ensureNodeLists().addCache<Collection>(*this, type); |
| +} |
| + |
| +template <typename Collection> |
| +inline PassRefPtrWillBeRawPtr<Collection> ContainerNode::ensureCachedCollection(CollectionType type, const AtomicString& name) |
| +{ |
| + return ensureNodeLists().addCache<Collection>(*this, type, name); |
| +} |
| + |
| +template <typename Collection> |
| +PassRefPtrWillBeRawPtr<Collection> ContainerNode::ensureCachedCollection(CollectionType type, const AtomicString& namespaceURI, const AtomicString& localName) |
|
adamk
2014/07/30 20:54:04
Missing inline?
Inactive
2014/07/30 21:03:46
Done.
|
| +{ |
| + ASSERT_UNUSED(type, type == TagCollectionType); |
| + return ensureNodeLists().addCache(*this, namespaceURI, localName); |
| +} |
| + |
| +template <typename Collection> |
| +inline Collection* ContainerNode::cachedCollection(CollectionType type) |
| +{ |
| + NodeListsNodeData* nodeLists = this->nodeLists(); |
| + return nodeLists ? nodeLists->cached<Collection>(type) : 0; |
| +} |
| + |
| } // namespace blink |
| #endif // NodeListsNodeData_h |