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

Unified Diff: Source/core/frame/DOMWindowProperty.cpp

Issue 569643002: Simplify and weaken DOMWindowProperty unregistration (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add test Created 6 years, 3 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: Source/core/frame/DOMWindowProperty.cpp
diff --git a/Source/core/frame/DOMWindowProperty.cpp b/Source/core/frame/DOMWindowProperty.cpp
index d64c29ae93e6c9337126c51b523faf92cfcf4b4f..d1c4226a29e98e018c40ef753181987fe7cdee98 100644
--- a/Source/core/frame/DOMWindowProperty.cpp
+++ b/Source/core/frame/DOMWindowProperty.cpp
@@ -50,9 +50,6 @@ DOMWindowProperty::~DOMWindowProperty()
{
if (m_associatedDOMWindow)
m_associatedDOMWindow->unregisterProperty(this);
-
- m_associatedDOMWindow = nullptr;
- m_frame = nullptr;
}
#endif
@@ -62,10 +59,10 @@ void DOMWindowProperty::willDestroyGlobalObjectInFrame()
ASSERT(m_frame);
ASSERT(m_associatedDOMWindow);
- // DOMWindowProperty lifetime isn't tied directly to the LocalDOMWindow itself so it is important that it unregister
- // itself from any LocalDOMWindow it is associated with if that LocalDOMWindow is going away.
- if (m_associatedDOMWindow)
- m_associatedDOMWindow->unregisterProperty(this);
+ // LocalDOMWindow will along with notifying DOMWindowProperty objects of
+ // impending destruction, unilaterally clear out its registered set.
+ // Consequently, no explicit unregisteration required by DOMWindowProperty;
+ // here or when finalized.
m_associatedDOMWindow = nullptr;
m_frame = nullptr;
}

Powered by Google App Engine
This is Rietveld 408576698