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

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
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 request.setHTTPReferrer(SecurityPolicy::generateReferrer(originDocument.refe rrerPolicy(), url, originDocument.outgoingReferrer())); 67 request.setHTTPReferrer(SecurityPolicy::generateReferrer(originDocument.refe rrerPolicy(), url, originDocument.outgoingReferrer()));
68 request.setHasUserGesture(userGestureStatus == UserGestureStatus::Active); 68 request.setHasUserGesture(userGestureStatus == UserGestureStatus::Active);
69 remoteFrameClient()->navigate(request, lockBackForwardList); 69 remoteFrameClient()->navigate(request, lockBackForwardList);
70 } 70 }
71 71
72 void RemoteFrame::reload(ReloadPolicy reloadPolicy, ClientRedirectPolicy clientR edirectPolicy) 72 void RemoteFrame::reload(ReloadPolicy reloadPolicy, ClientRedirectPolicy clientR edirectPolicy)
73 { 73 {
74 remoteFrameClient()->reload(reloadPolicy, clientRedirectPolicy); 74 remoteFrameClient()->reload(reloadPolicy, clientRedirectPolicy);
75 } 75 }
76 76
77 void RemoteFrame::detach() 77 void RemoteFrame::detach(FrameDetachType type)
78 { 78 {
79 // Frame::detach() requires the caller to keep a reference to this, since 79 // Frame::detach() requires the caller to keep a reference to this, since
80 // otherwise it may clear the last reference to this, causing it to be 80 // otherwise it may clear the last reference to this, causing it to be
81 // deleted, which can cause a use-after-free. 81 // deleted, which can cause a use-after-free.
82 RefPtrWillBeRawPtr<RemoteFrame> protect(this); 82 RefPtrWillBeRawPtr<RemoteFrame> protect(this);
83 detachChildren(); 83 detachChildren();
84 if (!client()) 84 if (!client())
85 return; 85 return;
86 client()->willBeDetached(); 86 client()->willBeDetached();
87 m_windowProxyManager->clearForClose(); 87 m_windowProxyManager->clearForClose();
88 setView(nullptr); 88 setView(nullptr);
89 Frame::detach(); 89 Frame::detach(type);
90 } 90 }
91 91
92 RemoteSecurityContext* RemoteFrame::securityContext() const 92 RemoteSecurityContext* RemoteFrame::securityContext() const
93 { 93 {
94 return m_securityContext.get(); 94 return m_securityContext.get();
95 } 95 }
96 96
97 void RemoteFrame::disconnectOwnerElement() 97 void RemoteFrame::disconnectOwnerElement()
98 { 98 {
99 // The RemotePlatformLayer needs to be cleared in disconnectOwnerElement() 99 // The RemotePlatformLayer needs to be cleared in disconnectOwnerElement()
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 if (m_remotePlatformLayer) 155 if (m_remotePlatformLayer)
156 GraphicsLayer::registerContentsLayer(layer); 156 GraphicsLayer::registerContentsLayer(layer);
157 157
158 ASSERT(owner()); 158 ASSERT(owner());
159 toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate(); 159 toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate();
160 if (LayoutPart* layoutObject = ownerLayoutObject()) 160 if (LayoutPart* layoutObject = ownerLayoutObject())
161 layoutObject->layer()->updateSelfPaintingLayer(); 161 layoutObject->layer()->updateSelfPaintingLayer();
162 } 162 }
163 163
164 } // namespace blink 164 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698