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

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

Issue 2629493004: Introduce DOMWindowClient (Closed)
Patch Set: Created 3 years, 11 months 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
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 829c1c0cc3bd92784cb35a71907eb64849b8e5d9..654398a35b80ae4c3f144b2390a3ead74169e713 100644
--- a/third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp
+++ b/third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp
@@ -5,10 +5,14 @@
#include "core/dom/ContextLifecycleObserver.h"
#include "core/dom/Document.h"
+#include "core/frame/LocalDOMWindow.h"
#include "core/frame/LocalFrame.h"
namespace blink {
+ContextClient::ContextClient(ExecutionContext* executionContext)
+ : m_executionContext(executionContext) {}
+
ContextClient::ContextClient(LocalFrame* frame)
: m_executionContext(frame ? frame->document() : nullptr) {}
@@ -33,4 +37,22 @@ LocalFrame* ContextLifecycleObserver::frame() const {
? toDocument(getExecutionContext())->frame()
: nullptr;
}
+
+DOMWindowClient::DOMWindowClient(LocalDOMWindow* window)
+ : m_domWindow(window) {}
+
+DOMWindowClient::DOMWindowClient(LocalFrame* frame)
+ : m_domWindow(frame ? frame->domWindow() : nullptr) {}
+
+LocalDOMWindow* DOMWindowClient::domWindow() const {
+ return m_domWindow && m_domWindow->frame() ? m_domWindow : nullptr;
+}
+
+LocalFrame* DOMWindowClient::frame() const {
+ return m_domWindow ? m_domWindow->frame() : nullptr;
+}
+
+DEFINE_TRACE(DOMWindowClient) {
+ visitor->trace(m_domWindow);
+}
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/ContextLifecycleObserver.h ('k') | third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698