Chromium Code Reviews| 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 |