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

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

Issue 1170413003: Add a scoping object to help block scripting during plugin destruction. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rename static counter 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/LocalFrame.cpp ('k') | Source/core/loader/FrameLoader.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"
11 #include "core/frame/RemoteDOMWindow.h" 11 #include "core/frame/RemoteDOMWindow.h"
12 #include "core/frame/RemoteFrameClient.h" 12 #include "core/frame/RemoteFrameClient.h"
13 #include "core/frame/RemoteFrameView.h" 13 #include "core/frame/RemoteFrameView.h"
14 #include "core/html/HTMLFrameOwnerElement.h" 14 #include "core/html/HTMLFrameOwnerElement.h"
15 #include "core/layout/LayoutPart.h" 15 #include "core/layout/LayoutPart.h"
16 #include "core/loader/FrameLoadRequest.h" 16 #include "core/loader/FrameLoadRequest.h"
17 #include "core/paint/DeprecatedPaintLayer.h" 17 #include "core/paint/DeprecatedPaintLayer.h"
18 #include "platform/PluginScriptForbiddenScope.h"
18 #include "platform/UserGestureIndicator.h" 19 #include "platform/UserGestureIndicator.h"
19 #include "platform/graphics/GraphicsLayer.h" 20 #include "platform/graphics/GraphicsLayer.h"
20 #include "platform/weborigin/SecurityPolicy.h" 21 #include "platform/weborigin/SecurityPolicy.h"
21 #include "public/platform/WebLayer.h" 22 #include "public/platform/WebLayer.h"
22 23
23 namespace blink { 24 namespace blink {
24 25
25 inline RemoteFrame::RemoteFrame(RemoteFrameClient* client, FrameHost* host, Fram eOwner* owner) 26 inline RemoteFrame::RemoteFrame(RemoteFrameClient* client, FrameHost* host, Fram eOwner* owner)
26 : Frame(client, host, owner) 27 : Frame(client, host, owner)
27 , m_securityContext(RemoteSecurityContext::create()) 28 , m_securityContext(RemoteSecurityContext::create())
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 navigate(*passedRequest.originDocument(), passedRequest.resourceRequest().ur l(), passedRequest.lockBackForwardList(), gesture); 78 navigate(*passedRequest.originDocument(), passedRequest.resourceRequest().ur l(), passedRequest.lockBackForwardList(), gesture);
78 } 79 }
79 80
80 void RemoteFrame::reload(FrameLoadType frameLoadType, ClientRedirectPolicy clien tRedirectPolicy) 81 void RemoteFrame::reload(FrameLoadType frameLoadType, ClientRedirectPolicy clien tRedirectPolicy)
81 { 82 {
82 remoteFrameClient()->reload(frameLoadType, clientRedirectPolicy); 83 remoteFrameClient()->reload(frameLoadType, clientRedirectPolicy);
83 } 84 }
84 85
85 void RemoteFrame::detach() 86 void RemoteFrame::detach()
86 { 87 {
88 PluginScriptForbiddenScope forbidPluginDestructorScripting;
87 // 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
88 // 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
89 // deleted, which can cause a use-after-free. 91 // deleted, which can cause a use-after-free.
90 RefPtrWillBeRawPtr<RemoteFrame> protect(this); 92 RefPtrWillBeRawPtr<RemoteFrame> protect(this);
91 detachChildren(); 93 detachChildren();
92 if (!client()) 94 if (!client())
93 return; 95 return;
94 client()->willBeDetached(); 96 client()->willBeDetached();
95 m_windowProxyManager->clearForClose(); 97 m_windowProxyManager->clearForClose();
96 setView(nullptr); 98 setView(nullptr);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 if (m_remotePlatformLayer) 165 if (m_remotePlatformLayer)
164 GraphicsLayer::registerContentsLayer(layer); 166 GraphicsLayer::registerContentsLayer(layer);
165 167
166 ASSERT(owner()); 168 ASSERT(owner());
167 toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate(); 169 toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate();
168 if (LayoutPart* layoutObject = ownerLayoutObject()) 170 if (LayoutPart* layoutObject = ownerLayoutObject())
169 layoutObject->layer()->updateSelfPaintingLayer(); 171 layoutObject->layer()->updateSelfPaintingLayer();
170 } 172 }
171 173
172 } // namespace blink 174 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/LocalFrame.cpp ('k') | Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698