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

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

Issue 603193005: Move the Widget hierarchy to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Switch LocalFrame::m_pluginElements rep to HashSet<HTMLPlugInElement*> Created 6 years, 2 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 class DragImage; 44 class DragImage;
45 class Editor; 45 class Editor;
46 class Element; 46 class Element;
47 class EventHandler; 47 class EventHandler;
48 class FetchContext; 48 class FetchContext;
49 class FloatSize; 49 class FloatSize;
50 class FrameConsole; 50 class FrameConsole;
51 class FrameDestructionObserver; 51 class FrameDestructionObserver;
52 class FrameSelection; 52 class FrameSelection;
53 class FrameView; 53 class FrameView;
54 class HTMLPlugInElement;
54 class InputMethodController; 55 class InputMethodController;
55 class IntPoint; 56 class IntPoint;
56 class IntSize; 57 class IntSize;
57 class Node; 58 class Node;
58 class Range; 59 class Range;
59 class RenderView; 60 class RenderView;
60 class TreeScope; 61 class TreeScope;
61 class ScriptController; 62 class ScriptController;
62 class SpellChecker; 63 class SpellChecker;
63 class TreeScope; 64 class TreeScope;
64 class VisiblePosition; 65 class VisiblePosition;
65 66
66 class LocalFrame : public Frame, public WillBeHeapSupplementable<LocalFrame> { 67 class LocalFrame : public Frame, public WillBeHeapSupplementable<LocalFrame> {
67 public: 68 public:
68 static PassRefPtrWillBeRawPtr<LocalFrame> create(FrameLoaderClient*, Fra meHost*, FrameOwner*); 69 static PassRefPtrWillBeRawPtr<LocalFrame> create(FrameLoaderClient*, Fra meHost*, FrameOwner*);
69 70
70 virtual bool isLocalFrame() const override { return true; } 71 virtual bool isLocalFrame() const override { return true; }
71 72
72 void init(); 73 void init();
73 void setView(PassRefPtr<FrameView>); 74 void setView(PassRefPtrWillBeRawPtr<FrameView>);
74 void createView(const IntSize&, const Color&, bool, 75 void createView(const IntSize&, const Color&, bool,
75 ScrollbarMode = ScrollbarAuto, bool horizontalLock = false, 76 ScrollbarMode = ScrollbarAuto, bool horizontalLock = false,
76 ScrollbarMode = ScrollbarAuto, bool verticalLock = false); 77 ScrollbarMode = ScrollbarAuto, bool verticalLock = false);
77 78
78 virtual ~LocalFrame(); 79 virtual ~LocalFrame();
79 virtual void trace(Visitor*) override; 80 virtual void trace(Visitor*) override;
80 81
81 virtual void navigate(Document& originDocument, const KURL&, bool lockBa ckForwardList) override; 82 virtual void navigate(Document& originDocument, const KURL&, bool lockBa ckForwardList) override;
82 virtual void detach() override; 83 virtual void detach() override;
83 84
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 String selectedTextForClipboard() const; 151 String selectedTextForClipboard() const;
151 152
152 VisiblePosition visiblePositionForPoint(const IntPoint& framePoint); 153 VisiblePosition visiblePositionForPoint(const IntPoint& framePoint);
153 Document* documentAtPoint(const IntPoint& windowPoint); 154 Document* documentAtPoint(const IntPoint& windowPoint);
154 PassRefPtrWillBeRawPtr<Range> rangeForPoint(const IntPoint& framePoint); 155 PassRefPtrWillBeRawPtr<Range> rangeForPoint(const IntPoint& framePoint);
155 156
156 bool isURLAllowed(const KURL&) const; 157 bool isURLAllowed(const KURL&) const;
157 bool shouldReuseDefaultView(const KURL&) const; 158 bool shouldReuseDefaultView(const KURL&) const;
158 void removeSpellingMarkersUnderWords(const Vector<String>& words); 159 void removeSpellingMarkersUnderWords(const Vector<String>& words);
159 160
161 #if ENABLE(OILPAN)
162 void registerPluginElement(HTMLPlugInElement*);
163 void unregisterPluginElement(HTMLPlugInElement*);
164 void clearWeakMembers(Visitor*);
165 #endif
166
160 // ======== 167 // ========
161 168
162 private: 169 private:
163 LocalFrame(FrameLoaderClient*, FrameHost*, FrameOwner*); 170 LocalFrame(FrameLoaderClient*, FrameHost*, FrameOwner*);
164 171
165 String localLayerTreeAsText(unsigned flags) const; 172 String localLayerTreeAsText(unsigned flags) const;
166 173
167 void detachView(); 174 void detachView();
168 175
169 WillBeHeapHashSet<RawPtrWillBeWeakMember<FrameDestructionObserver> > m_d estructionObservers; 176 WillBeHeapHashSet<RawPtrWillBeWeakMember<FrameDestructionObserver> > m_d estructionObservers;
170 mutable FrameLoader m_loader; 177 mutable FrameLoader m_loader;
171 mutable NavigationScheduler m_navigationScheduler; 178 mutable NavigationScheduler m_navigationScheduler;
172 179
173 RefPtr<FrameView> m_view; 180 RefPtrWillBeMember<FrameView> m_view;
174 // Usually 0. Non-null if this is the top frame of PagePopup. 181 // Usually 0. Non-null if this is the top frame of PagePopup.
175 RefPtrWillBeMember<Element> m_pagePopupOwner; 182 RefPtrWillBeMember<Element> m_pagePopupOwner;
176 183
177 const OwnPtrWillBeMember<ScriptController> m_script; 184 const OwnPtrWillBeMember<ScriptController> m_script;
178 const OwnPtrWillBeMember<Editor> m_editor; 185 const OwnPtrWillBeMember<Editor> m_editor;
179 const OwnPtrWillBeMember<SpellChecker> m_spellChecker; 186 const OwnPtrWillBeMember<SpellChecker> m_spellChecker;
180 const OwnPtrWillBeMember<FrameSelection> m_selection; 187 const OwnPtrWillBeMember<FrameSelection> m_selection;
181 const OwnPtrWillBeMember<EventHandler> m_eventHandler; 188 const OwnPtrWillBeMember<EventHandler> m_eventHandler;
182 const OwnPtrWillBeMember<FrameConsole> m_console; 189 const OwnPtrWillBeMember<FrameConsole> m_console;
183 OwnPtrWillBeMember<InputMethodController> m_inputMethodController; 190 const OwnPtrWillBeMember<InputMethodController> m_inputMethodController;
191
192 #if ENABLE(OILPAN)
193 // Oilpan: in order to reliably finalize plugin elements with
194 // renderer-less plugins, the frame keeps track of them. When
195 // the frame is detached and disposed, these will be disposed
196 // of in the process. This is needed as the plugin element
197 // might not itself be attached to a DOM tree and be
198 // explicitly detached&disposed of.
199 //
200 // A weak reference is all wanted; the plugin element must
201 // otherwise be referenced and kept alive. So as to be able
202 // to process the set of weak references during the LocalFrame's
203 // weak callback, the set itself is not on the heap and the
204 // references are bare pointers (rather than WeakMembers.)
205 // See LocalFrame::clearWeakMembers().
206 HashSet<HTMLPlugInElement*> m_pluginElements;
207 #endif
184 208
185 float m_pageZoomFactor; 209 float m_pageZoomFactor;
186 float m_textZoomFactor; 210 float m_textZoomFactor;
187 211
188 bool m_inViewSourceMode; 212 bool m_inViewSourceMode;
189 }; 213 };
190 214
191 inline void LocalFrame::init() 215 inline void LocalFrame::init()
192 { 216 {
193 m_loader.init(); 217 m_loader.init();
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 DEFINE_TYPE_CASTS(LocalFrame, Frame, localFrame, localFrame->isLocalFrame(), localFrame.isLocalFrame()); 281 DEFINE_TYPE_CASTS(LocalFrame, Frame, localFrame, localFrame->isLocalFrame(), localFrame.isLocalFrame());
258 282
259 } // namespace blink 283 } // namespace blink
260 284
261 // During refactoring, there are some places where we need to do type conversion s that 285 // During refactoring, there are some places where we need to do type conversion s that
262 // will not be needed once all instances of LocalFrame and RemoteFrame are sorte d out. 286 // will not be needed once all instances of LocalFrame and RemoteFrame are sorte d out.
263 // At that time this #define will be removed and all the uses of it will need to be corrected. 287 // At that time this #define will be removed and all the uses of it will need to be corrected.
264 #define toLocalFrameTemporary toLocalFrame 288 #define toLocalFrameTemporary toLocalFrame
265 289
266 #endif // LocalFrame_h 290 #endif // LocalFrame_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698