 Chromium Code Reviews
 Chromium Code Reviews Issue 2744483002:
  Move asserts for tracking global object detachment to WindowProxy.  (Closed)
    
  
    Issue 2744483002:
  Move asserts for tracking global object detachment to WindowProxy.  (Closed) 
  | Index: third_party/WebKit/Source/bindings/core/v8/LocalWindowProxy.cpp | 
| diff --git a/third_party/WebKit/Source/bindings/core/v8/LocalWindowProxy.cpp b/third_party/WebKit/Source/bindings/core/v8/LocalWindowProxy.cpp | 
| index efad7d6a828fab92d52b9714bba693e4a4a80078..f8bd774d197d965e457b44c890cc8c3eb991718e 100644 | 
| --- a/third_party/WebKit/Source/bindings/core/v8/LocalWindowProxy.cpp | 
| +++ b/third_party/WebKit/Source/bindings/core/v8/LocalWindowProxy.cpp | 
| @@ -92,6 +92,10 @@ void LocalWindowProxy::disposeContext(GlobalDetachmentBehavior behavior) { | 
| } | 
| V8DOMWrapper::clearNativeInfo(isolate(), context->Global()); | 
| m_scriptState->detachGlobalObject(); | 
| + | 
| +#if DCHECK_IS_ON() | 
| + didDetachGlobalProxy(); | 
| 
Yuki
2017/03/09 07:15:17
nit: Is this name appropriate?
The old implementa
 
dcheng
2017/03/09 07:19:56
Hmm... so what we want to track here is that the f
 
Yuki
2017/03/09 07:26:31
A global object of V8 must be tightly bound to a D
 
dcheng
2017/03/09 08:00:52
Remote contexts have an inner global object, so th
 | 
| +#endif | 
| } | 
| m_scriptState->disposePerContextData(); | 
| @@ -211,6 +215,10 @@ void LocalWindowProxy::setupWindowPrototypeChain() { | 
| // reference to the DOMWindow. | 
| m_globalProxy.get().SetWrapperClassId(wrapperTypeInfo->wrapperClassId); | 
| +#if DCHECK_IS_ON() | 
| + didAttachGlobalProxy(); | 
| +#endif | 
| + | 
| // The global object, aka window wrapper object. | 
| v8::Local<v8::Object> windowWrapper = | 
| globalProxy->GetPrototype().As<v8::Object>(); |