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

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

Issue 2713623002: v8binding: Makes ToV8(window) work without a frame. (Closed)
Patch Set: Addressed a review comment. Created 3 years, 8 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') | no next file » | 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 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);
« no previous file with comments | « third_party/WebKit/Source/core/frame/DOMWindow.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698