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

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

Issue 1580503003: Eliminate superfluous clearing of weak pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Eliminate superfluous WeakPtrFactory::clear() 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
Index: third_party/WebKit/Source/core/dom/IntersectionObservation.cpp
diff --git a/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp b/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp
index 055c6f956ec22224c3c8f142a4fb242a28e23b90..1a7b4c6f6f23b94ed91a2b847032eb19f0501304 100644
--- a/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp
+++ b/third_party/WebKit/Source/core/dom/IntersectionObservation.cpp
@@ -116,6 +116,11 @@ bool IntersectionObservation::computeGeometry(IntersectionGeometry& geometry)
void IntersectionObservation::computeIntersectionObservations(double timestamp)
{
+ // Pre-oilpan, there will be a delay between the time when the target Element gets deleted
+ // (because its ref count dropped to zero) and when this IntersectionObservation gets
+ // deleted (during the next gc run, because the target Element is the only thing keeping
+ // the IntersectionObservation alive). During that interval, we need to check that m_target
+ // hasn't been cleared.
Element* targetElement = target();
if (!targetElement || !isActive())
return;

Powered by Google App Engine
This is Rietveld 408576698