Index: third_party/WebKit/Source/core/dom/IntersectionObserver.cpp |
diff --git a/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp b/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp |
index 1d9ec9809e2c2231d0ffc421f75a0024a7ad3529..2a9cd6f082099d2d6f1c4e72da891af2950a7052 100644 |
--- a/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp |
+++ b/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp |
@@ -317,22 +317,19 @@ |
|| m_leftMargin.type() == Percent); |
} |
+void IntersectionObserver::rootDisappearedCallback(Visitor* visitor, void* self) |
+{ |
+ IntersectionObserver* observer = static_cast<IntersectionObserver*>(self); |
+ observer->disconnect(); |
+} |
+ |
+DEFINE_TRACE(IntersectionObserver) |
+{ |
#if ENABLE(OILPAN) |
-void IntersectionObserver::clearWeakMembers(Visitor* visitor) |
-{ |
- if (Heap::isHeapObjectAlive(m_root)) |
- return; |
- disconnect(); |
- m_root = nullptr; |
-} |
-#endif |
- |
-DEFINE_TRACE(IntersectionObserver) |
-{ |
-#if ENABLE(OILPAN) |
- visitor->template registerWeakMembers<IntersectionObserver, &IntersectionObserver::clearWeakMembers>(this); |
+ visitor->registerWeakMembers(this, m_root.get(), IntersectionObserver::rootDisappearedCallback); |
#endif |
visitor->trace(m_callback); |
+ visitor->trace(m_root); |
visitor->trace(m_observations); |
visitor->trace(m_entries); |
} |