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

Side by Side Diff: Source/core/frame/RemoteFrame.cpp

Issue 1041473002: Detach old frame on WebFrame::swap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « Source/core/frame/RemoteFrame.h ('k') | Source/core/html/HTMLFrameOwnerElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 { 76 {
77 UserGestureStatus gesture = UserGestureIndicator::processingUserGesture() ? UserGestureStatus::Active : UserGestureStatus::None; 77 UserGestureStatus gesture = UserGestureIndicator::processingUserGesture() ? UserGestureStatus::Active : UserGestureStatus::None;
78 navigate(*passedRequest.originDocument(), passedRequest.resourceRequest().ur l(), passedRequest.lockBackForwardList(), gesture); 78 navigate(*passedRequest.originDocument(), passedRequest.resourceRequest().ur l(), passedRequest.lockBackForwardList(), gesture);
79 } 79 }
80 80
81 void RemoteFrame::reload(FrameLoadType frameLoadType, ClientRedirectPolicy clien tRedirectPolicy) 81 void RemoteFrame::reload(FrameLoadType frameLoadType, ClientRedirectPolicy clien tRedirectPolicy)
82 { 82 {
83 remoteFrameClient()->reload(frameLoadType, clientRedirectPolicy); 83 remoteFrameClient()->reload(frameLoadType, clientRedirectPolicy);
84 } 84 }
85 85
86 void RemoteFrame::detach() 86 void RemoteFrame::detach(FrameDetachType type)
87 { 87 {
88 PluginScriptForbiddenScope forbidPluginDestructorScripting; 88 PluginScriptForbiddenScope forbidPluginDestructorScripting;
89 // Frame::detach() requires the caller to keep a reference to this, since 89 // Frame::detach() requires the caller to keep a reference to this, since
90 // otherwise it may clear the last reference to this, causing it to be 90 // otherwise it may clear the last reference to this, causing it to be
91 // deleted, which can cause a use-after-free. 91 // deleted, which can cause a use-after-free.
92 RefPtrWillBeRawPtr<RemoteFrame> protect(this); 92 RefPtrWillBeRawPtr<RemoteFrame> protect(this);
93 detachChildren(); 93 detachChildren();
94 if (!client()) 94 if (!client())
95 return; 95 return;
96 client()->willBeDetached(); 96 client()->willBeDetached();
97 m_windowProxyManager->clearForClose(); 97 m_windowProxyManager->clearForClose();
98 setView(nullptr); 98 setView(nullptr);
99 Frame::detach(); 99 Frame::detach(type);
100 }
101
102 bool RemoteFrame::prepareForCommit()
103 {
104 detachChildren();
105 return !!host();
100 } 106 }
101 107
102 RemoteSecurityContext* RemoteFrame::securityContext() const 108 RemoteSecurityContext* RemoteFrame::securityContext() const
103 { 109 {
104 return m_securityContext.get(); 110 return m_securityContext.get();
105 } 111 }
106 112
107 void RemoteFrame::disconnectOwnerElement() 113 void RemoteFrame::disconnectOwnerElement()
108 { 114 {
109 // The RemotePlatformLayer needs to be cleared in disconnectOwnerElement() 115 // The RemotePlatformLayer needs to be cleared in disconnectOwnerElement()
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 if (m_remotePlatformLayer) 171 if (m_remotePlatformLayer)
166 GraphicsLayer::registerContentsLayer(layer); 172 GraphicsLayer::registerContentsLayer(layer);
167 173
168 ASSERT(owner()); 174 ASSERT(owner());
169 toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate(); 175 toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate();
170 if (LayoutPart* layoutObject = ownerLayoutObject()) 176 if (LayoutPart* layoutObject = ownerLayoutObject())
171 layoutObject->layer()->updateSelfPaintingLayer(); 177 layoutObject->layer()->updateSelfPaintingLayer();
172 } 178 }
173 179
174 } // namespace blink 180 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/RemoteFrame.h ('k') | Source/core/html/HTMLFrameOwnerElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698