| 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);
|
| }
|
|
|