Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(602)

Unified Diff: Source/core/dom/Document.cpp

Issue 342283005: Make collection caching code more consistent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Stop including NodeListsNodeData.h in ContainerNode.h Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 996a28e911bf13003b2f50d01cf4cf77b99a505b..77d998bbe47feb5036b49868bde0ed50db692b7c 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -4545,44 +4545,39 @@ bool Document::hasSVGRootNode() const
return isSVGSVGElement(documentElement());
}
-PassRefPtrWillBeRawPtr<HTMLCollection> Document::ensureCachedCollection(CollectionType type)
-{
- return ensureRareData().ensureNodeLists().addCache<HTMLCollection>(*this, type);
-}
-
PassRefPtrWillBeRawPtr<HTMLCollection> Document::images()
{
- return ensureCachedCollection(DocImages);
+ return ensureCachedCollection<HTMLCollection>(DocImages);
}
PassRefPtrWillBeRawPtr<HTMLCollection> Document::applets()
{
- return ensureCachedCollection(DocApplets);
+ return ensureCachedCollection<HTMLCollection>(DocApplets);
}
PassRefPtrWillBeRawPtr<HTMLCollection> Document::embeds()
{
- return ensureCachedCollection(DocEmbeds);
+ return ensureCachedCollection<HTMLCollection>(DocEmbeds);
}
PassRefPtrWillBeRawPtr<HTMLCollection> Document::scripts()
{
- return ensureCachedCollection(DocScripts);
+ return ensureCachedCollection<HTMLCollection>(DocScripts);
}
PassRefPtrWillBeRawPtr<HTMLCollection> Document::links()
{
- return ensureCachedCollection(DocLinks);
+ return ensureCachedCollection<HTMLCollection>(DocLinks);
}
PassRefPtrWillBeRawPtr<HTMLCollection> Document::forms()
{
- return ensureCachedCollection(DocForms);
+ return ensureCachedCollection<HTMLCollection>(DocForms);
}
PassRefPtrWillBeRawPtr<HTMLCollection> Document::anchors()
{
- return ensureCachedCollection(DocAnchors);
+ return ensureCachedCollection<HTMLCollection>(DocAnchors);
}
PassRefPtrWillBeRawPtr<HTMLAllCollection> Document::allForBinding()
@@ -4593,17 +4588,17 @@ PassRefPtrWillBeRawPtr<HTMLAllCollection> Document::allForBinding()
PassRefPtrWillBeRawPtr<HTMLAllCollection> Document::all()
{
- return ensureRareData().ensureNodeLists().addCache<HTMLAllCollection>(*this, DocAll);
+ return ensureCachedCollection<HTMLAllCollection>(DocAll);
}
PassRefPtrWillBeRawPtr<HTMLCollection> Document::windowNamedItems(const AtomicString& name)
{
- return ensureRareData().ensureNodeLists().addCache<WindowNameCollection>(*this, WindowNamedItems, name);
+ return ensureCachedCollection<WindowNameCollection>(WindowNamedItems, name);
}
PassRefPtrWillBeRawPtr<HTMLCollection> Document::documentNamedItems(const AtomicString& name)
{
- return ensureRareData().ensureNodeLists().addCache<DocumentNameCollection>(*this, DocumentNamedItems, name);
+ return ensureCachedCollection<DocumentNameCollection>(DocumentNamedItems, name);
}
void Document::finishedParsing()

Powered by Google App Engine
This is Rietveld 408576698