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

Unified Diff: third_party/WebKit/Source/core/dom/IntersectionObserver.cpp

Issue 1596333002: Revert of Oilpan: Fix weak processing for IntersectionObserver::m_root (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « third_party/WebKit/Source/core/dom/IntersectionObserver.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/IntersectionObserver.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698