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

Unified Diff: third_party/WebKit/Source/core/frame/DOMWindow.cpp

Issue 2630693002: Make ScriptController inherit LocalWindowProxyManager
Patch Set: rebase 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
« no previous file with comments | « third_party/WebKit/Source/core/frame/DOMWindow.h ('k') | third_party/WebKit/Source/core/frame/Frame.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/frame/DOMWindow.cpp
diff --git a/third_party/WebKit/Source/core/frame/DOMWindow.cpp b/third_party/WebKit/Source/core/frame/DOMWindow.cpp
index 2e3704b1996e71a73ee3de270a67bf39c85bb79c..dbbedca9273ed76c01b2c10fbfc1682c49bc470f 100644
--- a/third_party/WebKit/Source/core/frame/DOMWindow.cpp
+++ b/third_party/WebKit/Source/core/frame/DOMWindow.cpp
@@ -4,6 +4,7 @@
#include "core/frame/DOMWindow.h"
+#include "bindings/core/v8/WindowProxyManager.h"
#include "core/dom/Document.h"
#include "core/dom/ExceptionCode.h"
#include "core/dom/ExecutionContext.h"
@@ -34,13 +35,20 @@
namespace blink {
-DOMWindow::DOMWindow(Frame& frame) : m_frame(frame), m_windowIsClosing(false) {}
+DOMWindow::DOMWindow(Frame& frame)
+ : m_frame(frame),
+ m_windowProxyManager(frame.getWindowProxyManager()),
+ m_windowIsClosing(false) {}
DOMWindow::~DOMWindow() {
// The frame must be disconnected before finalization.
DCHECK(!m_frame);
}
+v8::Local<v8::Object> DOMWindow::globalProxy(DOMWrapperWorld& world) {
+ return m_windowProxyManager->globalProxy(world);
+}
+
v8::Local<v8::Object> DOMWindow::wrap(v8::Isolate*,
v8::Local<v8::Object> creationContext) {
LOG(FATAL) << "DOMWindow must never be wrapped with wrap method. The "
@@ -81,10 +89,6 @@ unsigned DOMWindow::length() const {
return frame() ? frame()->tree().scopedChildCount() : 0;
}
-v8::Local<v8::Object> DOMWindow::self(ScriptState* scriptState) const {
- return scriptState->context()->Global();
-}
-
DOMWindow* DOMWindow::opener() const {
// FIXME: Use FrameTree to get opener as well, to simplify logic here.
if (!frame() || !frame()->client())
@@ -94,12 +98,14 @@ DOMWindow* DOMWindow::opener() const {
return opener ? opener->domWindow() : nullptr;
}
-DOMWindow* DOMWindow::parent() const {
+DOMWindow* DOMWindow::parent() {
+ // TODO(dcheng): Per the spec, this should only return null if there is no
+ // browsing context with the window proxy as its WindowProxy object.
if (!frame())
return nullptr;
Frame* parent = frame()->tree().parent();
- return parent ? parent->domWindow() : frame()->domWindow();
+ return parent ? parent->domWindow() : this;
}
DOMWindow* DOMWindow::top() const {
@@ -435,6 +441,7 @@ void DOMWindow::focus(ExecutionContext* context) {
DEFINE_TRACE(DOMWindow) {
visitor->trace(m_frame);
+ visitor->trace(m_windowProxyManager);
visitor->trace(m_location);
EventTargetWithInlineData::trace(visitor);
}
« no previous file with comments | « third_party/WebKit/Source/core/frame/DOMWindow.h ('k') | third_party/WebKit/Source/core/frame/Frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698