| 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) {}
|
| +
|
| +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()
|
|
|