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

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

Issue 1177333002: Revert of 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(FrameDetachType type) 86 void RemoteFrame::detach()
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(type); 99 Frame::detach();
100 }
101
102 bool RemoteFrame::prepareForCommit()
103 {
104 detachChildren();
105 return !!host();
106 } 100 }
107 101
108 RemoteSecurityContext* RemoteFrame::securityContext() const 102 RemoteSecurityContext* RemoteFrame::securityContext() const
109 { 103 {
110 return m_securityContext.get(); 104 return m_securityContext.get();
111 } 105 }
112 106
113 void RemoteFrame::disconnectOwnerElement() 107 void RemoteFrame::disconnectOwnerElement()
114 { 108 {
115 // The RemotePlatformLayer needs to be cleared in disconnectOwnerElement() 109 // The RemotePlatformLayer needs to be cleared in disconnectOwnerElement()
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 if (m_remotePlatformLayer) 165 if (m_remotePlatformLayer)
172 GraphicsLayer::registerContentsLayer(layer); 166 GraphicsLayer::registerContentsLayer(layer);
173 167
174 ASSERT(owner()); 168 ASSERT(owner());
175 toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate(); 169 toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate();
176 if (LayoutPart* layoutObject = ownerLayoutObject()) 170 if (LayoutPart* layoutObject = ownerLayoutObject())
177 layoutObject->layer()->updateSelfPaintingLayer(); 171 layoutObject->layer()->updateSelfPaintingLayer();
178 } 172 }
179 173
180 } // namespace blink 174 } // 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