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

Side by Side Diff: Source/web/WebRemoteFrameImpl.h

Issue 517043003: Move Frame to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Back out non-Oilpan experiment + tidy up by adding frame() ref accessors Created 6 years, 3 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 #ifndef WebRemoteFrameImpl_h 5 #ifndef WebRemoteFrameImpl_h
6 #define WebRemoteFrameImpl_h 6 #define WebRemoteFrameImpl_h
7 7
8 #include "platform/heap/Handle.h"
8 #include "public/web/WebRemoteFrame.h" 9 #include "public/web/WebRemoteFrame.h"
9 #include "public/web/WebRemoteFrameClient.h" 10 #include "public/web/WebRemoteFrameClient.h"
10 #include "web/RemoteFrameClient.h" 11 #include "web/RemoteFrameClient.h"
11 #include "wtf/HashMap.h" 12 #include "wtf/HashMap.h"
12 #include "wtf/OwnPtr.h" 13 #include "wtf/OwnPtr.h"
13 #include "wtf/RefCounted.h" 14 #include "wtf/RefCounted.h"
14 15
15 namespace blink { 16 namespace blink {
16 17
17 class FrameHost; 18 class FrameHost;
18 class FrameOwner; 19 class FrameOwner;
19 class RemoteFrame; 20 class RemoteFrame;
21 class WebViewImpl;
20 22
21 class WebRemoteFrameImpl : public WebRemoteFrame, public RefCounted<WebRemoteFra meImpl> { 23 class WebRemoteFrameImpl FINAL : public RefCountedWillBeGarbageCollectedFinalize d<WebRemoteFrameImpl>, public WebRemoteFrame {
22 public: 24 public:
23 WebRemoteFrameImpl(WebRemoteFrameClient*); 25 explicit WebRemoteFrameImpl(WebRemoteFrameClient*);
24 virtual ~WebRemoteFrameImpl(); 26 virtual ~WebRemoteFrameImpl();
25 27
26 // WebRemoteFrame methods. 28 // WebRemoteFrame methods.
27 virtual bool isWebLocalFrame() const OVERRIDE; 29 virtual bool isWebLocalFrame() const OVERRIDE;
28 virtual WebLocalFrame* toWebLocalFrame() OVERRIDE; 30 virtual WebLocalFrame* toWebLocalFrame() OVERRIDE;
29 virtual bool isWebRemoteFrame() const OVERRIDE; 31 virtual bool isWebRemoteFrame() const OVERRIDE;
30 virtual WebRemoteFrame* toWebRemoteFrame() OVERRIDE; 32 virtual WebRemoteFrame* toWebRemoteFrame() OVERRIDE;
31 virtual void close() OVERRIDE; 33 virtual void close() OVERRIDE;
32 virtual WebString uniqueName() const OVERRIDE; 34 virtual WebString uniqueName() const OVERRIDE;
33 virtual WebString assignedName() const OVERRIDE; 35 virtual WebString assignedName() const OVERRIDE;
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 virtual WebRect selectionBoundsRect() const OVERRIDE; 173 virtual WebRect selectionBoundsRect() const OVERRIDE;
172 174
173 virtual bool selectionStartHasSpellingMarkerFor(int from, int length) const OVERRIDE; 175 virtual bool selectionStartHasSpellingMarkerFor(int from, int length) const OVERRIDE;
174 virtual WebString layerTreeAsText(bool showDebugInfo = false) const OVERRIDE ; 176 virtual WebString layerTreeAsText(bool showDebugInfo = false) const OVERRIDE ;
175 177
176 virtual WebLocalFrame* createLocalChild(const WebString& name, WebFrameClien t*) OVERRIDE; 178 virtual WebLocalFrame* createLocalChild(const WebString& name, WebFrameClien t*) OVERRIDE;
177 virtual WebRemoteFrame* createRemoteChild(const WebString& name, WebRemoteFr ameClient*) OVERRIDE; 179 virtual WebRemoteFrame* createRemoteChild(const WebString& name, WebRemoteFr ameClient*) OVERRIDE;
178 180
179 void initializeCoreFrame(FrameHost*, FrameOwner*, const AtomicString& name); 181 void initializeCoreFrame(FrameHost*, FrameOwner*, const AtomicString& name);
180 182
181 void setCoreFrame(PassRefPtr<RemoteFrame>); 183 void setCoreFrame(PassRefPtrWillBeRawPtr<RemoteFrame>);
182 RemoteFrame* frame() const { return m_frame.get(); } 184 RemoteFrame* frame() const { return m_frame.get(); }
183 185
184 WebRemoteFrameClient* client() const { return m_client; } 186 WebRemoteFrameClient* client() const { return m_client; }
185 187
186 static WebRemoteFrameImpl* fromFrame(RemoteFrame&); 188 static WebRemoteFrameImpl* fromFrame(RemoteFrame&);
187 189
190 virtual void trace(Visitor*);
191
188 private: 192 private:
189 RemoteFrameClient m_frameClient; 193 RemoteFrameClient m_frameClient;
190 RefPtr<RemoteFrame> m_frame; 194 RefPtrWillBeMember<RemoteFrame> m_frame;
191 WebRemoteFrameClient* m_client; 195 WebRemoteFrameClient* m_client;
192 196
193 HashMap<WebFrame*, OwnPtr<FrameOwner> > m_ownersForChildren; 197 WebViewImpl* viewImpl() const;
198
199 WillBeHeapHashMap<WebFrame*, OwnPtrWillBeMember<FrameOwner> > m_ownersForChi ldren;
200
201 #if ENABLE(OILPAN)
202 // Oilpan: to provide the guarantee of having the frame live until
203 // close() is called, an instance keep a self-persistent. It is
204 // cleared upon calling close(). This avoids having to assume that
205 // an embedder's WebFrame references are all discovered via thread
206 // state (stack, registers) should an Oilpan GC strike while we're
207 // in the process of detaching.
208 GC_PLUGIN_IGNORE("340522")
209 Persistent<WebRemoteFrameImpl> m_selfKeepAlive;
210 #endif
194 }; 211 };
195 212
196 DEFINE_TYPE_CASTS(WebRemoteFrameImpl, WebFrame, frame, frame->isWebRemoteFrame() , frame.isWebRemoteFrame()); 213 DEFINE_TYPE_CASTS(WebRemoteFrameImpl, WebFrame, frame, frame->isWebRemoteFrame() , frame.isWebRemoteFrame());
197 214
198 } // namespace blink 215 } // namespace blink
199 216
200 #endif // WebRemoteFrameImpl_h 217 #endif // WebRemoteFrameImpl_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698