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

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

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 "core/frame/RemoteFrame.h" 5 #include "core/frame/RemoteFrame.h"
6 6
7 #include "bindings/core/v8/WindowProxy.h" 7 #include "bindings/core/v8/WindowProxy.h"
8 #include "bindings/core/v8/WindowProxyManager.h" 8 #include "bindings/core/v8/WindowProxyManager.h"
9 #include "core/dom/RemoteSecurityContext.h" 9 #include "core/dom/RemoteSecurityContext.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
(...skipping 15 matching lines...) Expand all
26 inline RemoteFrame::RemoteFrame(RemoteFrameClient* client, FrameHost* host, Fram eOwner* owner) 26 inline RemoteFrame::RemoteFrame(RemoteFrameClient* client, FrameHost* host, Fram eOwner* owner)
27 : Frame(client, host, owner) 27 : Frame(client, host, owner)
28 , m_view(nullptr) 28 , m_view(nullptr)
29 , m_securityContext(RemoteSecurityContext::create()) 29 , m_securityContext(RemoteSecurityContext::create())
30 , m_domWindow(RemoteDOMWindow::create(*this)) 30 , m_domWindow(RemoteDOMWindow::create(*this))
31 , m_windowProxyManager(WindowProxyManager::create(*this)) 31 , m_windowProxyManager(WindowProxyManager::create(*this))
32 , m_remotePlatformLayer(nullptr) 32 , m_remotePlatformLayer(nullptr)
33 { 33 {
34 } 34 }
35 35
36 PassRefPtrWillBeRawPtr<RemoteFrame> RemoteFrame::create(RemoteFrameClient* clien t, FrameHost* host, FrameOwner* owner) 36 RawPtr<RemoteFrame> RemoteFrame::create(RemoteFrameClient* client, FrameHost* ho st, FrameOwner* owner)
37 { 37 {
38 return adoptRefWillBeNoop(new RemoteFrame(client, host, owner)); 38 return (new RemoteFrame(client, host, owner));
39 } 39 }
40 40
41 RemoteFrame::~RemoteFrame() 41 RemoteFrame::~RemoteFrame()
42 { 42 {
43 ASSERT(!m_view); 43 ASSERT(!m_view);
44 } 44 }
45 45
46 DEFINE_TRACE(RemoteFrame) 46 DEFINE_TRACE(RemoteFrame)
47 { 47 {
48 visitor->trace(m_view); 48 visitor->trace(m_view);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 { 85 {
86 remoteFrameClient()->reload(frameLoadType, clientRedirectPolicy); 86 remoteFrameClient()->reload(frameLoadType, clientRedirectPolicy);
87 } 87 }
88 88
89 void RemoteFrame::detach(FrameDetachType type) 89 void RemoteFrame::detach(FrameDetachType type)
90 { 90 {
91 PluginScriptForbiddenScope forbidPluginDestructorScripting; 91 PluginScriptForbiddenScope forbidPluginDestructorScripting;
92 // Frame::detach() requires the caller to keep a reference to this, since 92 // Frame::detach() requires the caller to keep a reference to this, since
93 // otherwise it may clear the last reference to this, causing it to be 93 // otherwise it may clear the last reference to this, causing it to be
94 // deleted, which can cause a use-after-free. 94 // deleted, which can cause a use-after-free.
95 RefPtrWillBeRawPtr<RemoteFrame> protect(this); 95 RawPtr<RemoteFrame> protect(this);
96 detachChildren(); 96 detachChildren();
97 if (!client()) 97 if (!client())
98 return; 98 return;
99 99
100 // Clean up the frame's view if needed. A remote frame only has a view if 100 // Clean up the frame's view if needed. A remote frame only has a view if
101 // the parent is a local frame. 101 // the parent is a local frame.
102 if (m_view) 102 if (m_view)
103 m_view->dispose(); 103 m_view->dispose();
104 client()->willBeDetached(); 104 client()->willBeDetached();
105 m_windowProxyManager->clearForClose(); 105 m_windowProxyManager->clearForClose();
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 { 144 {
145 remoteFrameClient()->frameRectsChanged(frameRect); 145 remoteFrameClient()->frameRectsChanged(frameRect);
146 } 146 }
147 147
148 void RemoteFrame::visibilityChanged(bool visible) 148 void RemoteFrame::visibilityChanged(bool visible)
149 { 149 {
150 if (remoteFrameClient()) 150 if (remoteFrameClient())
151 remoteFrameClient()->visibilityChanged(visible); 151 remoteFrameClient()->visibilityChanged(visible);
152 } 152 }
153 153
154 void RemoteFrame::setView(PassRefPtrWillBeRawPtr<RemoteFrameView> view) 154 void RemoteFrame::setView(RawPtr<RemoteFrameView> view)
155 { 155 {
156 // Oilpan: as RemoteFrameView performs no finalization actions, 156 // Oilpan: as RemoteFrameView performs no finalization actions,
157 // no explicit dispose() of it needed here. (cf. FrameView::dispose().) 157 // no explicit dispose() of it needed here. (cf. FrameView::dispose().)
158 m_view = view; 158 m_view = view;
159 159
160 // ... the RemoteDOMWindow will need to be informed of detachment, 160 // ... the RemoteDOMWindow will need to be informed of detachment,
161 // as otherwise it will keep a strong reference back to this RemoteFrame. 161 // as otherwise it will keep a strong reference back to this RemoteFrame.
162 // That combined with wrappers (owned and kept alive by RemoteFrame) keeping 162 // That combined with wrappers (owned and kept alive by RemoteFrame) keeping
163 // persistent strong references to RemoteDOMWindow will prevent the GCing 163 // persistent strong references to RemoteDOMWindow will prevent the GCing
164 // of all these objects. Break the cycle by notifying of detachment. 164 // of all these objects. Break the cycle by notifying of detachment.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 ASSERT(owner()); 197 ASSERT(owner());
198 toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate(); 198 toHTMLFrameOwnerElement(owner())->setNeedsCompositingUpdate();
199 } 199 }
200 200
201 void RemoteFrame::advanceFocus(WebFocusType type, LocalFrame* source) 201 void RemoteFrame::advanceFocus(WebFocusType type, LocalFrame* source)
202 { 202 {
203 remoteFrameClient()->advanceFocus(type, source); 203 remoteFrameClient()->advanceFocus(type, source);
204 } 204 }
205 205
206 } // namespace blink 206 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698