OLD | NEW |
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 Loading... |
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; |
| 42 class FrameProtector; |
46 class HTMLFrameOwnerElement; | 43 class HTMLFrameOwnerElement; |
47 class LocalDOMWindow; | 44 class LocalDOMWindow; |
48 class Page; | 45 class Page; |
49 class RenderPart; | 46 class RenderPart; |
50 class Settings; | 47 class Settings; |
| 48 class WebLayer; |
51 | 49 |
52 class Frame : public RefCounted<Frame> { | 50 class Frame : public RefCountedWillBeGarbageCollectedFinalized<Frame> { |
53 public: | 51 public: |
54 virtual bool isLocalFrame() const { return false; } | 52 virtual bool isLocalFrame() const { return false; } |
55 virtual bool isRemoteFrame() const { return false; } | 53 virtual bool isRemoteFrame() const { return false; } |
56 | 54 |
57 virtual ~Frame(); | 55 virtual ~Frame(); |
| 56 virtual void trace(Visitor*); |
58 | 57 |
| 58 #if ENABLE(OILPAN) |
| 59 void willBeDestroyed(); |
| 60 #endif |
59 virtual void detach() = 0; | 61 virtual void detach() = 0; |
60 void detachChildren(); | 62 void detachChildren(); |
61 | 63 |
62 FrameClient* client() const; | 64 FrameClient* client() const; |
63 void clearClient(); | 65 void clearClient(); |
64 | 66 |
65 // NOTE: Page is moving out of Blink up into the browser process as | 67 // NOTE: Page is moving out of Blink up into the browser process as |
66 // part of the site-isolation (out of process iframes) work. | 68 // part of the site-isolation (out of process iframes) work. |
67 // FrameHost should be used instead where possible. | 69 // FrameHost should be used instead where possible. |
68 Page* page() const; | 70 Page* page() const; |
(...skipping 11 matching lines...) Expand all Loading... |
80 // after RemoteFrame is complete enough to exist without them. | 82 // after RemoteFrame is complete enough to exist without them. |
81 virtual void setDOMWindow(PassRefPtrWillBeRawPtr<LocalDOMWindow>); | 83 virtual void setDOMWindow(PassRefPtrWillBeRawPtr<LocalDOMWindow>); |
82 LocalDOMWindow* domWindow() const; | 84 LocalDOMWindow* domWindow() const; |
83 | 85 |
84 FrameTree& tree() const; | 86 FrameTree& tree() const; |
85 ChromeClient& chromeClient() const; | 87 ChromeClient& chromeClient() const; |
86 | 88 |
87 RenderPart* ownerRenderer() const; // Renderer for the element that contains
this frame. | 89 RenderPart* ownerRenderer() const; // Renderer for the element that contains
this frame. |
88 | 90 |
89 // FIXME: These should move to RemoteFrame when that is instantiated. | 91 // FIXME: These should move to RemoteFrame when that is instantiated. |
90 void setRemotePlatformLayer(blink::WebLayer*); | 92 void setRemotePlatformLayer(WebLayer*); |
91 blink::WebLayer* remotePlatformLayer() const { return m_remotePlatformLayer;
} | 93 WebLayer* remotePlatformLayer() const { return m_remotePlatformLayer; } |
92 | 94 |
93 Settings* settings() const; // can be null | 95 Settings* settings() const; // can be null |
94 | 96 |
95 // FIXME: This method identifies a LocalFrame that is acting as a RemoteFram
e. | 97 // 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 | 98 // 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() | 99 // it can be removed and its callers can be converted to use the isRemoteFra
me() |
98 // method. | 100 // method. |
99 bool isRemoteFrameTemporary() const { return m_remotePlatformLayer; } | 101 bool isRemoteFrameTemporary() const { return m_remotePlatformLayer; } |
100 | 102 |
| 103 #if ENABLE(OILPAN) |
| 104 bool hasBeenDisposed() const { return m_hasBeenDisposed; } |
| 105 |
| 106 int incrementDisposeProtectionCount() { return m_disposeProtectionCount++; } |
| 107 int decrementDisposeProtectionCount() { ASSERT(m_disposeProtectionCount > 0)
; return --m_disposeProtectionCount; } |
| 108 #endif |
| 109 |
101 protected: | 110 protected: |
102 Frame(FrameClient*, FrameHost*, FrameOwner*); | 111 Frame(FrameClient*, FrameHost*, FrameOwner*); |
103 | 112 |
| 113 virtual void dispose(); |
| 114 |
| 115 #if ENABLE(OILPAN) |
| 116 friend class FrameProtector; |
| 117 |
| 118 void setHasBeenDisposed() { m_hasBeenDisposed = true; } |
| 119 #endif |
| 120 |
104 mutable FrameTree m_treeNode; | 121 mutable FrameTree m_treeNode; |
105 | 122 |
106 FrameHost* m_host; | 123 FrameHost* m_host; |
107 FrameOwner* m_owner; | 124 RawPtrWillBeMember<FrameOwner> m_owner; |
108 | 125 |
109 RefPtrWillBePersistent<LocalDOMWindow> m_domWindow; | 126 RefPtrWillBeMember<LocalDOMWindow> m_domWindow; |
110 | 127 |
111 private: | 128 private: |
112 FrameClient* m_client; | 129 FrameClient* m_client; |
113 blink::WebLayer* m_remotePlatformLayer; | 130 WebLayer* m_remotePlatformLayer; |
| 131 |
| 132 #if ENABLE(OILPAN) |
| 133 // If > 0, the LocalFrame has existing stack references and |
| 134 // its disposing should be delayed until the stack has unwound |
| 135 // past all of them. The FrameProtector class handles |
| 136 // the details. |
| 137 int m_disposeProtectionCount; |
| 138 |
| 139 // The flag will be set to true when the frame is informed of |
| 140 // pending destruction. All Frame owners must explicitly signal |
| 141 // this (through Frame::willBeDestroyed()) so that timely |
| 142 // finalization actions can be performed then; this cannot be |
| 143 // reliably done when the GCed object is later on swept. |
| 144 bool m_hasBeenDisposed; |
| 145 #endif |
114 }; | 146 }; |
115 | 147 |
116 inline FrameClient* Frame::client() const | 148 inline FrameClient* Frame::client() const |
117 { | 149 { |
118 return m_client; | 150 return m_client; |
119 } | 151 } |
120 | 152 |
121 inline void Frame::clearClient() | 153 inline void Frame::clearClient() |
122 { | 154 { |
123 m_client = 0; | 155 m_client = 0; |
(...skipping 13 matching lines...) Expand all Loading... |
137 { | 169 { |
138 return m_treeNode; | 170 return m_treeNode; |
139 } | 171 } |
140 | 172 |
141 // Allow equality comparisons of Frames by reference or pointer, interchangeably
. | 173 // Allow equality comparisons of Frames by reference or pointer, interchangeably
. |
142 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES_REFCOUNTED(Frame) | 174 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES_REFCOUNTED(Frame) |
143 | 175 |
144 } // namespace blink | 176 } // namespace blink |
145 | 177 |
146 #endif // Frame_h | 178 #endif // Frame_h |
OLD | NEW |