| 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..829c1c0cc3bd92784cb35a71907eb64849b8e5d9 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 {
|
|
|
| +ContextClient::ContextClient(LocalFrame* frame)
|
| + : m_executionContext(frame ? frame->document() : nullptr) {}
|
| +
|
| +ExecutionContext* ContextClient::getExecutionContext() const {
|
| + return m_executionContext && !m_executionContext->isContextDestroyed()
|
| + ? m_executionContext
|
| + : nullptr;
|
| +}
|
| +
|
| +LocalFrame* ContextClient::frame() const {
|
| + return m_executionContext && m_executionContext->isDocument()
|
| + ? toDocument(m_executionContext)->frame()
|
| + : nullptr;
|
| +}
|
| +
|
| +DEFINE_TRACE(ContextClient) {
|
| + visitor->trace(m_executionContext);
|
| +}
|
| +
|
| LocalFrame* ContextLifecycleObserver::frame() const {
|
| return getExecutionContext() && getExecutionContext()->isDocument()
|
| ? toDocument(getExecutionContext())->frame()
|
|
|