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..a543afdc4e4926e9e320bce44324b29d73354f45 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())); |
+ WeakSVGElementSet* 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<Member<SVGElement> > SVGElementSet; |
haraken
2014/06/09 09:33:58
This should be WillBeHeapHashSet<RawPtrWillBeMembe
|
+ 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) { |
+ WeakSVGElementSet::iterator end = dependencies->end(); |
+ for (WeakSVGElementSet::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); |
} |
} |
} |