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

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

Issue 2626403002: Move Frame pointer to be held by DOMWindow base class. (Closed)
Patch Set: . Created 3 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
« 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 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() {
« 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