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

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: Fix nits 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
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 52fd7f81b58d4e4bb15fe3608861981a2db6cfbd..119200bbab8c9615e2c51ec9eb173f850432607c 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -4551,44 +4551,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()
@@ -4599,17 +4594,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()
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698