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

Unified Diff: Source/core/css/resolver/ScopedStyleTree.cpp

Issue 415743005: Move ScopedStyleResolver and ScopedStyleTree to oilpan's heap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/css/resolver/ScopedStyleTree.cpp
diff --git a/Source/core/css/resolver/ScopedStyleTree.cpp b/Source/core/css/resolver/ScopedStyleTree.cpp
index 19c6335bba0094774fc4c2b4cf71e8458f672650..66bc5428e630d3f15e19f566297303c36dcbdb2e 100644
--- a/Source/core/css/resolver/ScopedStyleTree.cpp
+++ b/Source/core/css/resolver/ScopedStyleTree.cpp
@@ -42,8 +42,10 @@ ScopedStyleTree::ScopedStyleTree()
ScopedStyleTree::~ScopedStyleTree()
{
- for (HashMap<const ContainerNode*, ScopedStyleResolver*>::iterator it = m_authorStyles.begin(); it != m_authorStyles.end(); ++it)
+#if !ENABLE(OILPAN)
+ for (HashMap<RawPtr<const ContainerNode>, RawPtr<ScopedStyleResolver> >::iterator it = m_authorStyles.begin(); it != m_authorStyles.end(); ++it)
it->key->treeScope().clearScopedStyleResolver();
+#endif
}
ScopedStyleResolver* ScopedStyleTree::ensureScopedStyleResolver(ContainerNode& scopingNode)
@@ -63,13 +65,13 @@ ScopedStyleResolver* ScopedStyleTree::scopedStyleResolverFor(const ContainerNode
return scopingNode.treeScope().scopedStyleResolver();
}
-void ScopedStyleTree::resolveScopedStyles(const Element* element, Vector<ScopedStyleResolver*, 8>& resolvers)
+void ScopedStyleTree::resolveScopedStyles(const Element* element, WillBeHeapVector<RawPtrWillBeMember<ScopedStyleResolver>, 8>& resolvers)
{
for (ScopedStyleResolver* scopedResolver = scopedResolverFor(element); scopedResolver; scopedResolver = scopedResolver->parent())
resolvers.append(scopedResolver);
}
-void ScopedStyleTree::collectScopedResolversForHostedShadowTrees(const Element* element, Vector<ScopedStyleResolver*, 8>& resolvers)
+void ScopedStyleTree::collectScopedResolversForHostedShadowTrees(const Element* element, WillBeHeapVector<RawPtrWillBeMember<ScopedStyleResolver>, 8>& resolvers)
{
ElementShadow* shadow = element->shadow();
if (!shadow)
@@ -84,7 +86,7 @@ void ScopedStyleTree::collectScopedResolversForHostedShadowTrees(const Element*
}
}
-void ScopedStyleTree::resolveScopedKeyframesRules(const Element* element, Vector<ScopedStyleResolver*, 8>& resolvers)
+void ScopedStyleTree::resolveScopedKeyframesRules(const Element* element, WillBeHeapVector<RawPtrWillBeMember<ScopedStyleResolver>, 8>& resolvers)
{
Document& document = element->document();
TreeScope& treeScope = element->treeScope();
@@ -144,7 +146,7 @@ void ScopedStyleTree::popStyleCache(const ContainerNode& scopingNode)
void ScopedStyleTree::collectFeaturesTo(RuleFeatureSet& features)
{
HashSet<const StyleSheetContents*> visitedSharedStyleSheetContents;
- for (HashMap<const ContainerNode*, ScopedStyleResolver*>::iterator it = m_authorStyles.begin(); it != m_authorStyles.end(); ++it)
+ for (WillBeHeapHashMap<RawPtrWillBeMember<const ContainerNode>, RawPtrWillBeMember<ScopedStyleResolver> >::iterator it = m_authorStyles.begin(); it != m_authorStyles.end(); ++it)
it->value->collectFeaturesTo(features, visitedSharedStyleSheetContents);
}
@@ -166,4 +168,10 @@ void ScopedStyleTree::remove(const ContainerNode* scopingNode)
scopingNode->treeScope().clearScopedStyleResolver();
}
+void ScopedStyleTree::trace(Visitor* visitor)
+{
+ visitor->trace(m_authorStyles);
+ visitor->trace(m_cache);
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698