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

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

Issue 2601733002: 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 eade5171943781f148713d6be880359e56c06682..5dc179ae350bbd66009dd9a5bb19d467b3400d3b 100644
--- a/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
+++ b/third_party/WebKit/Source/core/dom/IntersectionObserver.cpp
@@ -54,7 +54,7 @@ class IntersectionObserverCallbackImpl final
}
private:
- WeakMember<ExecutionContext> m_context;
+ Member<ExecutionContext> m_context;
sof 2016/12/26 07:28:04 The use of WeakMember<> comes from https://coder
std::unique_ptr<IntersectionObserver::EventCallback> m_callback;
};
@@ -222,7 +222,6 @@ bool IntersectionObserver::rootIsValid() const {
Document& IntersectionObserver::trackingDocument() const {
Document* document = nullptr;
if (rootIsImplicit()) {
- DCHECK(m_callback->getExecutionContext());
document = toDocument(m_callback->getExecutionContext());
} else {
DCHECK(root());
@@ -310,10 +309,8 @@ void IntersectionObserver::unobserve(Element* target,
void IntersectionObserver::computeIntersectionObservations() {
if (!rootIsValid())
return;
- Document* callbackDocument = toDocument(m_callback->getExecutionContext());
- if (!callbackDocument)
- return;
- LocalDOMWindow* callbackDOMWindow = callbackDocument->domWindow();
+ LocalDOMWindow* callbackDOMWindow =
+ toDocument(m_callback->getExecutionContext())->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