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

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: Add comment about IntersectionObsevation lifetime. 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 | « no previous file | third_party/WebKit/Source/core/dom/IntersectionObserver.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
dcheng 2016/01/11 22:29:42 It's not accurate to imply that an Element and any
+ // (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.
haraken 2016/01/12 00:01:37 Nit: This comment looks nice (so I want to keep it
Element* targetElement = target();
if (!targetElement || !isActive())
return;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/IntersectionObserver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698