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

Unified Diff: Source/core/svg/SVGElementInstance.cpp

Issue 262093006: Oilpan: Make the Node hierarchy RefCountedGarbageCollected instead of TreeShared. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Minor cleanup. 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
Index: Source/core/svg/SVGElementInstance.cpp
diff --git a/Source/core/svg/SVGElementInstance.cpp b/Source/core/svg/SVGElementInstance.cpp
index 9a14b1a4f8206a20c5f571d2c2f80fa909ca2c51..58751077fd4cb8edaeb326ec258a3fb2592cea24 100644
--- a/Source/core/svg/SVGElementInstance.cpp
+++ b/Source/core/svg/SVGElementInstance.cpp
@@ -86,14 +86,14 @@ PassRefPtr<SVGElementInstance> SVGElementInstance::create(SVGUseElement* corresp
}
SVGElementInstance::SVGElementInstance(SVGUseElement* correspondingUseElement, SVGUseElement* directUseElement, PassRefPtr<SVGElement> originalElement)
- : m_parentInstance(0)
+ : m_parentInstance(nullptr)
, m_correspondingUseElement(correspondingUseElement)
, m_directUseElement(directUseElement)
- , m_element(originalElement)
- , m_previousSibling(0)
- , m_nextSibling(0)
- , m_firstChild(0)
- , m_lastChild(0)
+ , m_element(originalElement.get()) // FIXME: Oilpan: Remove the .get() call.
sof 2014/05/05 11:27:48 Add m_shadowTreeElement(nullptr) for tidiness?
Mads Ager (chromium) 2014/05/05 11:35:54 You have good eyes! Done. :)
+ , m_previousSibling(nullptr)
+ , m_nextSibling(nullptr)
+ , m_firstChild(nullptr)
+ , m_lastChild(nullptr)
{
ASSERT(m_correspondingUseElement);
ASSERT(m_element);
@@ -106,14 +106,15 @@ SVGElementInstance::SVGElementInstance(SVGUseElement* correspondingUseElement, S
SVGElementInstance::~SVGElementInstance()
{
- // Call detach because we may be deleted directly if we are a child of a detached instance.
- detach();
-
#ifndef NDEBUG
instanceCounter.decrement();
#endif
+#if !ENABLE(OILPAN)
+ // Call detach because we may be deleted directly if we are a child of a detached instance.
+ detach();
m_element = nullptr;
+#endif
}
// It's important not to inline removedLastRef, because we don't want to inline the code to
@@ -247,6 +248,17 @@ EventTargetData& SVGElementInstance::ensureEventTargetData()
return *eventTargetData();
}
+void SVGElementInstance::trace(Visitor* visitor)
+{
+ visitor->trace(m_parentInstance);
+ visitor->trace(m_element);
+ visitor->trace(m_shadowTreeElement);
+ visitor->trace(m_previousSibling);
+ visitor->trace(m_nextSibling);
+ visitor->trace(m_firstChild);
+ visitor->trace(m_lastChild);
+}
+
SVGElementInstance::InstanceUpdateBlocker::InstanceUpdateBlocker(SVGElement* targetElement)
: m_targetElement(targetElement)
{

Powered by Google App Engine
This is Rietveld 408576698