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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp

Issue 2439013002: Implement cross-origin attributes using access check interceptors. (Closed)
Patch Set: . Created 4 years, 1 month 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
Index: third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp
index edada54b4d3a554001d01677200f49bb29245970..622c5255e6ac5a472a7f8509e00a7bb16d091bf9 100644
--- a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp
@@ -115,8 +115,12 @@ void WindowProxy::disposeContext(GlobalDetachmentBehavior behavior) {
m_document.clear();
- if (behavior == DetachGlobal)
+ if (behavior == DetachGlobal) {
+ // Clean up state on the global proxy, which will be reused.
+ // TODO(dcheng): Check if this is needed.
dcheng 2016/11/02 01:46:42 We only detach globals on navigation, so the inter
haraken 2016/11/02 04:30:32 Makes sense. Let's make the change in a separate C
dcheng 2016/11/02 07:45:32 It kind of makes sense in this CL though? Previous
Yuki 2016/11/02 08:26:39 I vote to keep |clearNativeInfo| here. Just my pr
+ V8DOMWrapper::clearNativeInfo(m_isolate, context->Global());
m_scriptState->detachGlobalObject();
+ }
m_scriptState->disposePerContextData();
@@ -366,6 +370,11 @@ bool WindowProxy::setupWindowPrototypeChain() {
v8::Local<v8::Context> context = m_scriptState->context();
// The global proxy object. Note this is not the global object.
v8::Local<v8::Object> globalProxy = context->Global();
+ V8DOMWrapper::setNativeInfo(m_isolate, globalProxy, wrapperTypeInfo, window);
+ // Mark the handle to be traced by Oilpan, since the global proxy has a
+ // reference to the DOMWindow.
+ DCHECK(m_globalProxy == globalProxy);
+ m_globalProxy.get().SetWrapperClassId(wrapperTypeInfo->wrapperClassId);
haraken 2016/11/02 04:30:32 Can we call V8DOMWrapper::associateObjectWithWrapp
dcheng 2016/11/02 07:45:32 My concern with this is associateObjectWithWrapper
// The global object, aka window wrapper object.
v8::Local<v8::Object> windowWrapper =
globalProxy->GetPrototype().As<v8::Object>();

Powered by Google App Engine
This is Rietveld 408576698