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

Unified Diff: Source/core/rendering/svg/RenderSVGResource.cpp

Issue 327473002: Prepare SVGDocumentExtensions::m_elementDependencies for oilpan (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: No OwnPtr for maps Created 6 years, 6 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 | « no previous file | Source/core/svg/SVGDocumentExtensions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/RenderSVGResource.cpp
diff --git a/Source/core/rendering/svg/RenderSVGResource.cpp b/Source/core/rendering/svg/RenderSVGResource.cpp
index 09b7dfa3b3aaa55bf37965983202338e6ac7763e..cf0fbf32c702b22f93a222db386de33a72bc7a2d 100644
--- a/Source/core/rendering/svg/RenderSVGResource.cpp
+++ b/Source/core/rendering/svg/RenderSVGResource.cpp
@@ -183,24 +183,27 @@ static inline void removeFromCacheAndInvalidateDependencies(RenderObject* object
if (!object->node() || !object->node()->isSVGElement())
return;
- HashSet<SVGElement*>* dependencies = object->document().accessSVGExtensions().setOfElementsReferencingTarget(toSVGElement(object->node()));
+ SVGElementSet* dependencies = object->document().accessSVGExtensions().setOfElementsReferencingTarget(toSVGElement(object->node()));
if (!dependencies)
return;
// We allow cycles in SVGDocumentExtensions reference sets in order to avoid expensive
// reference graph adjustments on changes, so we need to break possible cycles here.
- DEFINE_STATIC_LOCAL(HashSet<SVGElement*>, invalidatingDependencies, ());
+ // This strong reference is safe, as it is guaranteed that this set will be emptied
+ // at the end of recursion.
+ typedef WillBeHeapHashSet<RawPtrWillBeMember<SVGElement> > SVGElementSet;
+ DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<SVGElementSet>, invalidatingDependencies, (adoptPtrWillBeNoop(new SVGElementSet)));
- HashSet<SVGElement*>::iterator end = dependencies->end();
- for (HashSet<SVGElement*>::iterator it = dependencies->begin(); it != end; ++it) {
+ SVGElementSet::iterator end = dependencies->end();
+ for (SVGElementSet::iterator it = dependencies->begin(); it != end; ++it) {
if (RenderObject* renderer = (*it)->renderer()) {
- if (UNLIKELY(!invalidatingDependencies.add(*it).isNewEntry)) {
+ if (UNLIKELY(!invalidatingDependencies->add(*it).isNewEntry)) {
// Reference cycle: we are in process of invalidating this dependant.
continue;
}
RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer, needsLayout);
- invalidatingDependencies.remove(*it);
+ invalidatingDependencies->remove(*it);
}
}
}
« no previous file with comments | « no previous file | Source/core/svg/SVGDocumentExtensions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698