OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "core/frame/RemoteFrame.h" | 6 #include "core/frame/RemoteFrame.h" |
7 | 7 |
8 #include "bindings/core/v8/WindowProxy.h" | 8 #include "bindings/core/v8/WindowProxy.h" |
9 #include "bindings/core/v8/WindowProxyManager.h" | 9 #include "bindings/core/v8/WindowProxyManager.h" |
10 #include "core/dom/RemoteSecurityContext.h" | 10 #include "core/dom/RemoteSecurityContext.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 void RemoteFrame::frameRectsChanged(const IntRect& frameRect) | 138 void RemoteFrame::frameRectsChanged(const IntRect& frameRect) |
139 { | 139 { |
140 remoteFrameClient()->frameRectsChanged(frameRect); | 140 remoteFrameClient()->frameRectsChanged(frameRect); |
141 } | 141 } |
142 | 142 |
143 void RemoteFrame::setView(PassRefPtrWillBeRawPtr<RemoteFrameView> view) | 143 void RemoteFrame::setView(PassRefPtrWillBeRawPtr<RemoteFrameView> view) |
144 { | 144 { |
145 // Oilpan: as RemoteFrameView performs no finalization actions, | 145 // Oilpan: as RemoteFrameView performs no finalization actions, |
146 // no explicit dispose() of it needed here. (cf. FrameView::dispose().) | 146 // no explicit dispose() of it needed here. (cf. FrameView::dispose().) |
147 m_view = view; | 147 m_view = view; |
| 148 |
| 149 // ... the RemoteDOMWindow will need to be informed of detachment, |
| 150 // as otherwise it will keep a strong reference back to this RemoteFrame. |
| 151 // That combined with wrappers (owned and kept alive by RemoteFrame) keeping |
| 152 // persistent strong references to RemoteDOMWindow will prevent the GCing |
| 153 // of all these objects. Break the cycle by notifying of detachment. |
| 154 if (!m_view) |
| 155 m_domWindow->frameDetached(); |
148 } | 156 } |
149 | 157 |
150 void RemoteFrame::createView() | 158 void RemoteFrame::createView() |
151 { | 159 { |
152 // If the RemoteFrame does not have a LocalFrame parent, there's no need to | 160 // If the RemoteFrame does not have a LocalFrame parent, there's no need to |
153 // create a widget for it. | 161 // create a widget for it. |
154 if (!deprecatedLocalOwner()) | 162 if (!deprecatedLocalOwner()) |
155 return; | 163 return; |
156 | 164 |
157 ASSERT(!deprecatedLocalOwner()->ownedWidget()); | 165 ASSERT(!deprecatedLocalOwner()->ownedWidget()); |
(...skipping 15 matching lines...) Expand all Loading... |
173 GraphicsLayer::unregisterContentsLayer(m_remotePlatformLayer); | 181 GraphicsLayer::unregisterContentsLayer(m_remotePlatformLayer); |
174 m_remotePlatformLayer = layer; | 182 m_remotePlatformLayer = layer; |
175 if (m_remotePlatformLayer) | 183 if (m_remotePlatformLayer) |
176 GraphicsLayer::registerContentsLayer(layer); | 184 GraphicsLayer::registerContentsLayer(layer); |
177 | 185 |
178 ASSERT(owner()); | 186 ASSERT(owner()); |
179 toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate(); | 187 toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate(); |
180 } | 188 } |
181 | 189 |
182 } // namespace blink | 190 } // namespace blink |
OLD | NEW |