Chromium Code Reviews| Index: third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp |
| diff --git a/third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp b/third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp |
| index 24fcf42d9f4b506da5f42dddf9ec8a94d279ff71..69af15230e33d59b4070c849d7d87bad6966edcf 100644 |
| --- a/third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp |
| +++ b/third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp |
| @@ -9,6 +9,25 @@ |
| namespace blink { |
| +ContextObserver::ContextObserver(LocalFrame* frame) |
| + : m_executionContext(frame ? frame->document() : nullptr) {} |
|
sof
2016/12/19 09:14:03
Can BarProp be changed to be over Document* instea
haraken
2016/12/19 09:58:15
I can, but as far as I grep the code base, there a
|
| + |
| +ExecutionContext* ContextObserver::getExecutionContext() const { |
| + return m_executionContext && !m_executionContext->isContextDestroyed() |
| + ? m_executionContext |
| + : nullptr; |
| +} |
| + |
| +LocalFrame* ContextObserver::frame() const { |
| + return m_executionContext && m_executionContext->isDocument() |
| + ? toDocument(m_executionContext)->frame() |
| + : nullptr; |
| +} |
| + |
| +DEFINE_TRACE(ContextObserver) { |
| + visitor->trace(m_executionContext); |
| +} |
| + |
| LocalFrame* ContextLifecycleObserver::frame() const { |
| return getExecutionContext() && getExecutionContext()->isDocument() |
| ? toDocument(getExecutionContext())->frame() |