Commit 7f14b776 authored by kouhei@chromium.org's avatar kouhei@chromium.org

SVG: Add comment to |loopbreaker| local static var that it is safe

This is a follow up CL to https://codereview.chromium.org/305783004/

BUG=357163
NOTRY=true

Review URL: https://codereview.chromium.org/308793003

git-svn-id: svn://svn.chromium.org/blink/trunk@175093 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent c5cb95f0
......@@ -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:
// |notifyDependentsIntervalChanged| -> |createInstanceTimesFromSyncbase| -> |add{Begin,End}Time| -> |{begin,end}TimeChanged| -> |notifyDependentsIntervalChanged|
// |loopBreaker| is defined as a Persistent<HeapHashSet<Member<SVGSMILElement> > >. This won't cause leaks because it is guaranteed to be empty after the root |notifyDependentsIntervalChanged| has exited.
DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<WillBeHeapHashSet<RawPtrWillBeMember<SVGSMILElement> > >, loopBreaker, (adoptPtrWillBeNoop(new WillBeHeapHashSet<RawPtrWillBeMember<SVGSMILElement> >())));
if (!loopBreaker->add(this).isNewEntry)
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment