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

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

Issue 2769803003: v8binding: Initializes WindowProxy iff it's uninitialized. (Closed)
Patch Set: . Created 3 years, 9 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
Index: third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp b/third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp
index c60566d5abe83d86e490e13ef07d00382df0cc0e..dbd60210f791289c1072487ea3600eaded60d7ec 100644
--- a/third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/RemoteWindowProxy.cpp
@@ -61,8 +61,9 @@ void RemoteWindowProxy::disposeContext(GlobalDetachmentBehavior behavior) {
#endif
}
- DCHECK(m_lifecycle == Lifecycle::ContextInitialized);
- m_lifecycle = Lifecycle::ContextDetached;
+ DCHECK_EQ(m_lifecycle, Lifecycle::ContextInitialized);
+ m_lifecycle = behavior == DetachGlobal ? Lifecycle::GlobalObjectDetached
+ : Lifecycle::ContextDetachedFromFrame;
}
void RemoteWindowProxy::initialize() {
@@ -101,9 +102,8 @@ void RemoteWindowProxy::createContext() {
didAttachGlobalObject();
#endif
- // TODO(haraken): Currently we cannot enable the following DCHECK because
- // an already detached window proxy can be re-initialized. This is wrong.
- // DCHECK(m_lifecycle == Lifecycle::ContextUninitialized);
+ DCHECK(m_lifecycle == Lifecycle::ContextUninitialized ||
+ m_lifecycle == Lifecycle::GlobalObjectDetached);
m_lifecycle = Lifecycle::ContextInitialized;
}

Powered by Google App Engine
This is Rietveld 408576698