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

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

Issue 1850413002: Improve DEFINE_STATIC_LOCAL()'s handling of Blink GCed objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address compilation failure Created 4 years, 8 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: third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp b/third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp
index 8208b740c14b8857eea6fa04543bd5163c0b2bde..0df9aadd41bc195898124d0afaa92c93c0624a5f 100644
--- a/third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp
+++ b/third_party/WebKit/Source/core/svg/animation/SVGSMILElement.cpp
@@ -81,26 +81,26 @@ inline RepeatEvent* toRepeatEvent(Event* event)
static SMILEventSender& smilEndEventSender()
{
- DEFINE_STATIC_LOCAL(Persistent<SMILEventSender>, sender, (SMILEventSender::create(EventTypeNames::endEvent)));
- return *sender;
+ DEFINE_STATIC_LOCAL(SMILEventSender, sender, (SMILEventSender::create(EventTypeNames::endEvent)));
+ return sender;
}
static SMILEventSender& smilBeginEventSender()
{
- DEFINE_STATIC_LOCAL(Persistent<SMILEventSender>, sender, (SMILEventSender::create(EventTypeNames::beginEvent)));
- return *sender;
+ DEFINE_STATIC_LOCAL(SMILEventSender, sender, (SMILEventSender::create(EventTypeNames::beginEvent)));
+ return sender;
}
static SMILEventSender& smilRepeatEventSender()
{
- DEFINE_STATIC_LOCAL(Persistent<SMILEventSender>, sender, (SMILEventSender::create(EventTypeNames::repeatEvent)));
- return *sender;
+ DEFINE_STATIC_LOCAL(SMILEventSender, sender, (SMILEventSender::create(EventTypeNames::repeatEvent)));
+ return sender;
}
static SMILEventSender& smilRepeatNEventSender()
{
- DEFINE_STATIC_LOCAL(Persistent<SMILEventSender>, sender, (SMILEventSender::create(AtomicString("repeatn"))));
- return *sender;
+ DEFINE_STATIC_LOCAL(SMILEventSender, sender, (SMILEventSender::create(AtomicString("repeatn"))));
+ return sender;
}
// This is used for duration type time values that can't be negative.
@@ -1233,14 +1233,14 @@ void SVGSMILElement::notifyDependentsIntervalChanged()
// |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(Persistent<HeapHashSet<Member<SVGSMILElement>>>, loopBreaker, (new HeapHashSet<Member<SVGSMILElement>>()));
- if (!loopBreaker->add(this).isNewEntry)
+ DEFINE_STATIC_LOCAL(HeapHashSet<Member<SVGSMILElement>>, loopBreaker, (new HeapHashSet<Member<SVGSMILElement>>));
+ if (!loopBreaker.add(this).isNewEntry)
return;
for (SVGSMILElement* element : m_syncBaseDependents)
element->createInstanceTimesFromSyncbase(this);
- loopBreaker->remove(this);
+ loopBreaker.remove(this);
}
void SVGSMILElement::createInstanceTimesFromSyncbase(SVGSMILElement* syncBase)
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGUseElement.cpp ('k') | third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698