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

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

Issue 1594813002: 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 2a9cd6f082099d2d6f1c4e72da891af2950a7052..1d9ec9809e2c2231d0ffc421f75a0024a7ad3529 100644
--- a/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
+++ b/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
@@ -317,19 +317,22 @@ bool IntersectionObserver::hasPercentMargin() const
|| m_leftMargin.type() == Percent);
}
-void IntersectionObserver::rootDisappearedCallback(Visitor* visitor, void* self)
+#if ENABLE(OILPAN)
+void IntersectionObserver::clearWeakMembers(Visitor* visitor)
{
- IntersectionObserver* observer = static_cast<IntersectionObserver*>(self);
- observer->disconnect();
+ if (Heap::isHeapObjectAlive(m_root))
+ return;
+ disconnect();
+ m_root = nullptr;
}
+#endif
DEFINE_TRACE(IntersectionObserver)
{
#if ENABLE(OILPAN)
- visitor->registerWeakMembers(this, m_root.get(), IntersectionObserver::rootDisappearedCallback);
+ visitor->template registerWeakMembers<IntersectionObserver, &IntersectionObserver::clearWeakMembers>(this);
#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