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

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

Issue 2769803003: v8binding: Initializes WindowProxy iff it's uninitialized. (Closed)
Patch Set: Synced. 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/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 761b4a5c50260087de64d90bd90070998e813310..41f622d56314beea627d92fd40648d18562322ff 100644
--- a/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp
@@ -140,9 +140,8 @@ void WindowProxy::setGlobal(v8::Local<v8::Object> global) {
// If there are JS code holds a closure to the old inner window,
// it won't be able to reach the outer window via its global object.
void WindowProxy::initializeIfNeeded() {
- // TODO(haraken): It is wrong to re-initialize an already detached window
- // proxy. This must be 'if(m_lifecycle == Lifecycle::ContextUninitialized)'.
- if (m_lifecycle != Lifecycle::ContextInitialized) {
+ if (m_lifecycle == Lifecycle::ContextUninitialized ||
+ m_lifecycle == Lifecycle::GlobalObjectDetached) {
initialize();
}
}

Powered by Google App Engine
This is Rietveld 408576698