Chromium Code Reviews| Index: third_party/WebKit/Source/core/frame/RemoteFrame.cpp |
| diff --git a/third_party/WebKit/Source/core/frame/RemoteFrame.cpp b/third_party/WebKit/Source/core/frame/RemoteFrame.cpp |
| index c9c83df324d193830b541a5d379d2fa9b3f58416..652f8330f848be5177955976a48b4a501fada424 100644 |
| --- a/third_party/WebKit/Source/core/frame/RemoteFrame.cpp |
| +++ b/third_party/WebKit/Source/core/frame/RemoteFrame.cpp |
| @@ -103,6 +103,12 @@ void RemoteFrame::detach(FrameDetachType type) { |
| client()->willBeDetached(); |
| m_windowProxyManager->clearForClose(); |
| setView(nullptr); |
| + // ... the RemoteDOMWindow will need to be informed of detachment, |
| + // as otherwise it will keep a strong reference back to this RemoteFrame. |
| + // That combined with wrappers (owned and kept alive by RemoteFrame) keeping |
| + // persistent strong references to RemoteDOMWindow will prevent the GCing |
| + // of all these objects. Break the cycle by notifying of detachment. |
| + toRemoteDOMWindow(m_domWindow)->frameDetached(); |
|
dcheng
2017/01/13 03:38:22
I moved this out of setView() because it seems a l
|
| if (m_webLayer) |
| setWebLayer(nullptr); |
| Frame::detach(type); |
| @@ -144,14 +150,6 @@ void RemoteFrame::setView(RemoteFrameView* view) { |
| // Oilpan: as RemoteFrameView performs no finalization actions, |
| // no explicit dispose() of it needed here. (cf. FrameView::dispose().) |
| m_view = view; |
| - |
| - // ... the RemoteDOMWindow will need to be informed of detachment, |
| - // as otherwise it will keep a strong reference back to this RemoteFrame. |
| - // That combined with wrappers (owned and kept alive by RemoteFrame) keeping |
| - // persistent strong references to RemoteDOMWindow will prevent the GCing |
| - // of all these objects. Break the cycle by notifying of detachment. |
| - if (!m_view) |
| - toRemoteDOMWindow(m_domWindow)->frameDetached(); |
| } |
| void RemoteFrame::createView() { |