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

Unified Diff: third_party/WebKit/Source/core/frame/RemoteFrame.cpp

Issue 1487253006: Explicitly detach remote window from its frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « third_party/WebKit/Source/core/frame/RemoteDOMWindow.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 88ba74565b4c8961e920dd91f3fc55af2e000ec8..444e796189cb4eaa879abe371b86e5cc018444f1 100644
--- a/third_party/WebKit/Source/core/frame/RemoteFrame.cpp
+++ b/third_party/WebKit/Source/core/frame/RemoteFrame.cpp
@@ -145,6 +145,14 @@ void RemoteFrame::setView(PassRefPtrWillBeRawPtr<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)
+ m_domWindow->frameDetached();
}
void RemoteFrame::createView()
« no previous file with comments | « third_party/WebKit/Source/core/frame/RemoteDOMWindow.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698