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

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

Issue 2713623002: v8binding: Makes ToV8(window) work without a frame. (Closed)
Patch Set: Added a TODO 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 fa9d7601038597b8aaacb573e1d15af92a3308b4..0b845ff7637092285067bc2a20118bff2aa355dd 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) : frame_(frame), window_is_closing_(false) {}
+DOMWindow::DOMWindow(Frame& frame)
+ : frame_(frame),
+ window_proxy_manager_(frame.GetWindowProxyManager()),
+ window_is_closing_(false) {}
DOMWindow::~DOMWindow() {
// The frame must be disconnected before finalization.
@@ -420,6 +425,14 @@ void DOMWindow::focus(ExecutionContext* context) {
true /* notifyEmbedder */);
}
+v8::Local<v8::Object> DOMWindow::GlobalProxy(DOMWrapperWorld& world) {
+ // TODO(yukishiino): Make this function always return the non-empty handle
+ // even if the frame is detached because the global proxy must always exist
+ // per spec.
+ return window_proxy_manager_->GetWindowProxy(world)
+ ->GlobalProxyIfNotDetached();
+}
+
InputDeviceCapabilitiesConstants* DOMWindow::GetInputDeviceCapabilities() {
if (!input_capabilities_)
input_capabilities_ = new InputDeviceCapabilitiesConstants;
@@ -428,6 +441,7 @@ InputDeviceCapabilitiesConstants* DOMWindow::GetInputDeviceCapabilities() {
DEFINE_TRACE(DOMWindow) {
visitor->Trace(frame_);
+ visitor->Trace(window_proxy_manager_);
visitor->Trace(input_capabilities_);
visitor->Trace(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