Chromium Code Reviews| 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 831460a2baca733a3cd921b9204c230d89fc9d23..860139d6a08d9aba65cf14749ff1c96842c621ab 100644 |
| --- a/third_party/WebKit/Source/core/frame/DOMWindow.cpp |
| +++ b/third_party/WebKit/Source/core/frame/DOMWindow.cpp |
| @@ -5,6 +5,8 @@ |
| #include "core/frame/DOMWindow.h" |
| #include <memory> |
| + |
| +#include "bindings/core/v8/WindowProxyManager.h" |
| #include "core/dom/Document.h" |
| #include "core/dom/ExecutionContext.h" |
| #include "core/dom/SecurityContext.h" |
| @@ -29,7 +31,10 @@ |
| 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. |
| @@ -415,6 +420,11 @@ void DOMWindow::focus(ExecutionContext* context) { |
| page->focusController().focusDocumentView(frame(), true /* notifyEmbedder */); |
| } |
| +v8::Local<v8::Object> DOMWindow::globalProxy(DOMWrapperWorld& world) { |
| + DCHECK(!m_windowProxyManager); |
|
dcheng
2017/04/07 18:48:48
I think this check is backwards (we want to assert
Yuki
2017/04/10 09:43:32
I was silly. X(
|
| + return m_windowProxyManager->windowProxy(world)->globalProxyIfNotDetached(); |
| +} |
| + |
| InputDeviceCapabilitiesConstants* DOMWindow::getInputDeviceCapabilities() { |
| if (!m_inputCapabilities) |
| m_inputCapabilities = new InputDeviceCapabilitiesConstants; |
| @@ -423,6 +433,7 @@ InputDeviceCapabilitiesConstants* DOMWindow::getInputDeviceCapabilities() { |
| DEFINE_TRACE(DOMWindow) { |
| visitor->trace(m_frame); |
| + visitor->trace(m_windowProxyManager); |
| visitor->trace(m_inputCapabilities); |
| visitor->trace(m_location); |
| EventTargetWithInlineData::trace(visitor); |