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

Side by Side Diff: Source/core/frame/Frame.h

Issue 517043003: Move Frame to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased past r181814 conflict 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 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999-2001 Lars Knoll <knoll@kde.org> 3 * 1999-2001 Lars Knoll <knoll@kde.org>
4 * 1999-2001 Antti Koivisto <koivisto@kde.org> 4 * 1999-2001 Antti Koivisto <koivisto@kde.org>
5 * 2000-2001 Simon Hausmann <hausmann@kde.org> 5 * 2000-2001 Simon Hausmann <hausmann@kde.org>
6 * 2000-2001 Dirk Mueller <mueller@kde.org> 6 * 2000-2001 Dirk Mueller <mueller@kde.org>
7 * 2000 Stefan Schimanski <1Stein@gmx.de> 7 * 2000 Stefan Schimanski <1Stein@gmx.de>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
9 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 10 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
(...skipping 16 matching lines...) Expand all
27 27
28 #ifndef Frame_h 28 #ifndef Frame_h
29 #define Frame_h 29 #define Frame_h
30 30
31 #include "core/page/FrameTree.h" 31 #include "core/page/FrameTree.h"
32 #include "platform/heap/Handle.h" 32 #include "platform/heap/Handle.h"
33 #include "wtf/Forward.h" 33 #include "wtf/Forward.h"
34 #include "wtf/RefCounted.h" 34 #include "wtf/RefCounted.h"
35 35
36 namespace blink { 36 namespace blink {
37 class WebLayer;
38 }
39
40 namespace blink {
41 37
42 class ChromeClient; 38 class ChromeClient;
43 class FrameClient; 39 class FrameClient;
44 class FrameHost; 40 class FrameHost;
45 class FrameOwner; 41 class FrameOwner;
46 class HTMLFrameOwnerElement; 42 class HTMLFrameOwnerElement;
47 class LocalDOMWindow; 43 class LocalDOMWindow;
48 class Page; 44 class Page;
49 class RenderPart; 45 class RenderPart;
50 class Settings; 46 class Settings;
47 class WebLayer;
51 48
52 class Frame : public RefCounted<Frame> { 49 class Frame : public RefCountedWillBeGarbageCollectedFinalized<Frame> {
53 public: 50 public:
54 virtual bool isLocalFrame() const { return false; } 51 virtual bool isLocalFrame() const { return false; }
55 virtual bool isRemoteFrame() const { return false; } 52 virtual bool isRemoteFrame() const { return false; }
56 53
57 virtual ~Frame(); 54 virtual ~Frame();
55 virtual void trace(Visitor*);
58 56
59 virtual void detach() = 0; 57 virtual void detach() = 0;
60 void detachChildren(); 58 void detachChildren();
61 59
62 FrameClient* client() const; 60 FrameClient* client() const;
63 void clearClient(); 61 void clearClient();
64 62
65 // NOTE: Page is moving out of Blink up into the browser process as 63 // NOTE: Page is moving out of Blink up into the browser process as
66 // part of the site-isolation (out of process iframes) work. 64 // part of the site-isolation (out of process iframes) work.
67 // FrameHost should be used instead where possible. 65 // FrameHost should be used instead where possible.
(...skipping 12 matching lines...) Expand all
80 // after RemoteFrame is complete enough to exist without them. 78 // after RemoteFrame is complete enough to exist without them.
81 virtual void setDOMWindow(PassRefPtrWillBeRawPtr<LocalDOMWindow>); 79 virtual void setDOMWindow(PassRefPtrWillBeRawPtr<LocalDOMWindow>);
82 LocalDOMWindow* domWindow() const; 80 LocalDOMWindow* domWindow() const;
83 81
84 FrameTree& tree() const; 82 FrameTree& tree() const;
85 ChromeClient& chromeClient() const; 83 ChromeClient& chromeClient() const;
86 84
87 RenderPart* ownerRenderer() const; // Renderer for the element that contains this frame. 85 RenderPart* ownerRenderer() const; // Renderer for the element that contains this frame.
88 86
89 // FIXME: These should move to RemoteFrame when that is instantiated. 87 // FIXME: These should move to RemoteFrame when that is instantiated.
90 void setRemotePlatformLayer(blink::WebLayer*); 88 void setRemotePlatformLayer(WebLayer*);
91 blink::WebLayer* remotePlatformLayer() const { return m_remotePlatformLayer; } 89 WebLayer* remotePlatformLayer() const { return m_remotePlatformLayer; }
92 90
93 Settings* settings() const; // can be null 91 Settings* settings() const; // can be null
94 92
95 // FIXME: This method identifies a LocalFrame that is acting as a RemoteFram e. 93 // FIXME: This method identifies a LocalFrame that is acting as a RemoteFram e.
96 // It is necessary only until we can instantiate a RemoteFrame, at which poi nt 94 // It is necessary only until we can instantiate a RemoteFrame, at which poi nt
97 // it can be removed and its callers can be converted to use the isRemoteFra me() 95 // it can be removed and its callers can be converted to use the isRemoteFra me()
98 // method. 96 // method.
99 bool isRemoteFrameTemporary() const { return m_remotePlatformLayer; } 97 bool isRemoteFrameTemporary() const { return m_remotePlatformLayer; }
100 98
99 bool hasBeenClosed() const { return m_hasBeenClosed; }
100 void setHasBeenClosed() { ASSERT(!m_hasBeenClosed); m_hasBeenClosed = true; }
101
101 protected: 102 protected:
102 Frame(FrameClient*, FrameHost*, FrameOwner*); 103 Frame(FrameClient*, FrameHost*, FrameOwner*);
103 104
104 mutable FrameTree m_treeNode; 105 mutable FrameTree m_treeNode;
105 106
106 FrameHost* m_host; 107 RawPtrWillBeMember<FrameHost> m_host;
107 FrameOwner* m_owner; 108 RawPtrWillBeMember<FrameOwner> m_owner;
108 109
109 RefPtrWillBePersistent<LocalDOMWindow> m_domWindow; 110 RefPtrWillBeMember<LocalDOMWindow> m_domWindow;
110 111
111 private: 112 private:
112 FrameClient* m_client; 113 FrameClient* m_client;
113 blink::WebLayer* m_remotePlatformLayer; 114 WebLayer* m_remotePlatformLayer;
115
116 void dispose();
117
118 // The closing of a frame from the embedder may not trigger the
119 // immediate release of this Frame object -- there might be
120 // other RefPtrs to the Frame, up the stack or elsewhere. For Oilpan,
121 // any release will only happen at the next GC.
122 //
123 // Hence, keep a separate flag that's set when the frame is
124 // closed. It is consulted by window.closed.
125 bool m_hasBeenClosed;
114 }; 126 };
115 127
116 inline FrameClient* Frame::client() const 128 inline FrameClient* Frame::client() const
117 { 129 {
118 return m_client; 130 return m_client;
119 } 131 }
120 132
121 inline void Frame::clearClient() 133 inline void Frame::clearClient()
122 { 134 {
123 m_client = 0; 135 m_client = 0;
(...skipping 13 matching lines...) Expand all
137 { 149 {
138 return m_treeNode; 150 return m_treeNode;
139 } 151 }
140 152
141 // Allow equality comparisons of Frames by reference or pointer, interchangeably . 153 // Allow equality comparisons of Frames by reference or pointer, interchangeably .
142 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES_REFCOUNTED(Frame) 154 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES_REFCOUNTED(Frame)
143 155
144 } // namespace blink 156 } // namespace blink
145 157
146 #endif // Frame_h 158 #endif // Frame_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698