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

Unified Diff: Source/core/svg/animation/SVGSMILElement.cpp

Issue 308793003: SVG: Add comment to |loopbreaker| local static var that it is safe (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/animation/SVGSMILElement.cpp
diff --git a/Source/core/svg/animation/SVGSMILElement.cpp b/Source/core/svg/animation/SVGSMILElement.cpp
index 3a914e8d23c01755a6d61dc60287753ed5350176..f15005ddae124af748cbb134ab13b7d3a102f91f 100644
--- a/Source/core/svg/animation/SVGSMILElement.cpp
+++ b/Source/core/svg/animation/SVGSMILElement.cpp
@@ -1247,6 +1247,9 @@ bool SVGSMILElement::progress(SMILTime elapsed, SVGSMILElement* resultElement, b
void SVGSMILElement::notifyDependentsIntervalChanged()
{
ASSERT(m_intervalBegin.isFinite());
+ // |loopbreaker| is used to avoid infinite recursions which may be caused from:
haraken 2014/05/30 01:39:45 loopBreaker
+ // |notifyDependentsIntervalChanged| -> |createInstanceTimesFromSyncbase| -> |add{Begin,End}Time| -> |{begin,end}TimeChanged| -> |notifyDependentsIntervalChanged|
+ // |loopbreaker| is defined as a Persistent<HeapHashSet<Member<SVGSMILElement> > >. This is safe because it is guaranteed to be empty after the root |notifyDependentsIntervalChanged| has exit.
haraken 2014/05/30 01:39:45 this is safe => this won't cause leaks has exit =>
DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<WillBeHeapHashSet<RawPtrWillBeMember<SVGSMILElement> > >, loopBreaker, (adoptPtrWillBeNoop(new WillBeHeapHashSet<RawPtrWillBeMember<SVGSMILElement> >())));
if (!loopBreaker->add(this).isNewEntry)
return;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698