Index: Source/core/frame/DOMWindowProperty.cpp |
diff --git a/Source/core/frame/DOMWindowProperty.cpp b/Source/core/frame/DOMWindowProperty.cpp |
index d64c29ae93e6c9337126c51b523faf92cfcf4b4f..c6f25305fff00e31fcb0242026b1fc8a878fc39b 100644 |
--- a/Source/core/frame/DOMWindowProperty.cpp |
+++ b/Source/core/frame/DOMWindowProperty.cpp |
@@ -34,39 +34,24 @@ namespace blink { |
DOMWindowProperty::DOMWindowProperty(LocalFrame* frame) |
: m_frame(frame) |
- , m_associatedDOMWindow(nullptr) |
{ |
// FIXME: For now it *is* acceptable for a DOMWindowProperty to be created with a null frame. |
// See fast/dom/navigator-detached-no-crash.html for the recipe. |
// We should fix that. <rdar://problem/11567132> |
- if (m_frame) { |
- m_associatedDOMWindow = m_frame->domWindow(); |
- m_associatedDOMWindow->registerProperty(this); |
- } |
+ if (m_frame) |
+ m_frame->domWindow()->registerProperty(this); |
} |
-#if !ENABLE(OILPAN) |
-DOMWindowProperty::~DOMWindowProperty() |
-{ |
- if (m_associatedDOMWindow) |
- m_associatedDOMWindow->unregisterProperty(this); |
- |
- m_associatedDOMWindow = nullptr; |
- m_frame = nullptr; |
-} |
-#endif |
+DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(DOMWindowProperty); |
void DOMWindowProperty::willDestroyGlobalObjectInFrame() |
{ |
// If the property is getting this callback it must have been created with a LocalFrame/LocalDOMWindow and it should still have them. |
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); |
- m_associatedDOMWindow = nullptr; |
+ // DOMWindowProperty's registered lifetime is controlled by LocalDOMWindow. After |
+ // the willDestroyGlobalObjectInFrame() notifications, LocalDOMWindow clears out |
+ // all registrations. Hence no need to unregister. |
m_frame = nullptr; |
} |
@@ -74,12 +59,6 @@ void DOMWindowProperty::willDetachGlobalObjectFromFrame() |
{ |
// If the property is getting this callback it must have been created with a LocalFrame/LocalDOMWindow and it should still have them. |
ASSERT(m_frame); |
- ASSERT(m_associatedDOMWindow); |
} |
-void DOMWindowProperty::trace(Visitor* visitor) |
-{ |
- visitor->trace(m_associatedDOMWindow); |
-} |
- |
-} |
+} // namespace blink |