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

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

Issue 890243003: Revert of Revert of Issue FrameDestructionObserver::frameDestroyed() notification on detach. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « Source/core/frame/FrameDestructionObserver.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 @@
#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 @@
// 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();
}
SecurityContext* LocalFrame::securityContext() const
« no previous file with comments | « Source/core/frame/FrameDestructionObserver.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698