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

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

Issue 2600143002: Revert of IntersectionObserverCallbackImpl should use Member<ExecutionContext> (Closed)
Patch Set: Created 4 years 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 | 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 5dc179ae350bbd66009dd9a5bb19d467b3400d3b..eade5171943781f148713d6be880359e56c06682 100644
--- a/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
+++ b/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
@@ -54,7 +54,7 @@
}
private:
- Member<ExecutionContext> m_context;
+ WeakMember<ExecutionContext> m_context;
std::unique_ptr<IntersectionObserver::EventCallback> m_callback;
};
@@ -222,6 +222,7 @@
Document& IntersectionObserver::trackingDocument() const {
Document* document = nullptr;
if (rootIsImplicit()) {
+ DCHECK(m_callback->getExecutionContext());
document = toDocument(m_callback->getExecutionContext());
} else {
DCHECK(root());
@@ -309,8 +310,10 @@
void IntersectionObserver::computeIntersectionObservations() {
if (!rootIsValid())
return;
- LocalDOMWindow* callbackDOMWindow =
- toDocument(m_callback->getExecutionContext())->domWindow();
+ Document* callbackDocument = toDocument(m_callback->getExecutionContext());
+ if (!callbackDocument)
+ return;
+ LocalDOMWindow* callbackDOMWindow = callbackDocument->domWindow();
if (!callbackDOMWindow)
return;
DOMHighResTimeStamp timestamp =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698