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

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

Issue 881683003: Issue FrameDestructionObserver::frameDestroyed() notification on detach. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: inline temporary helper, tidy Created 5 years, 11 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/LocalFrame.cpp
diff --git a/Source/core/frame/LocalFrame.cpp b/Source/core/frame/LocalFrame.cpp
index 59c68fb30f1656f1e87a4186e7e690d9dae676e4..a26e93efdc70c55ceac931965c7913172a1ece68 100644
--- a/Source/core/frame/LocalFrame.cpp
+++ b/Source/core/frame/LocalFrame.cpp
@@ -206,15 +206,7 @@ LocalFrame::~LocalFrame()
#if !ENABLE(OILPAN)
// Oilpan: see setDOMWindow() comment why it is acceptable not to
// mirror the non-Oilpan call below.
- //
- // Also, FrameDestructionObservers that live longer than this
- // frame object keep weak references to the frame; those will be
- // automatically cleared by the garbage collector. Hence, explicit
- // frameDestroyed() notifications aren't needed.
setDOMWindow(nullptr);
-
- for (const auto& frameDestructionObserver : m_destructionObservers)
- frameDestructionObserver->frameDestroyed();
#endif
}
@@ -291,6 +283,11 @@ void LocalFrame::detach()
// finalization. Too late to access various heap objects at that
// stage.
m_loader.clear();
+
+ // Signal frame destruction here rather than in the destructor.
+ // Main motivation is to avoid being dependent on its exact timing (Oilpan.)
+ for (const auto& frameDestructionObserver : m_destructionObservers)
+ frameDestructionObserver->frameDestroyed();
haraken 2015/01/31 01:30:01 Nit: In a follow-up CL, we might want to replace F
}
SecurityContext* LocalFrame::securityContext() const

Powered by Google App Engine
This is Rietveld 408576698