Chromium Code Reviews| 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 = |