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

Side by Side Diff: Source/core/rendering/RenderObject.h

Issue 869323003: Oilpan: move RenderObjects off heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review-induced improvements Created 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderMenuList.cpp ('k') | Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 bool draggable; 119 bool draggable;
120 }; 120 };
121 121
122 typedef WTF::HashMap<const RenderLayer*, Vector<LayoutRect> > LayerHitTestRects; 122 typedef WTF::HashMap<const RenderLayer*, Vector<LayoutRect> > LayerHitTestRects;
123 123
124 #ifndef NDEBUG 124 #ifndef NDEBUG
125 const int showTreeCharacterOffset = 39; 125 const int showTreeCharacterOffset = 39;
126 #endif 126 #endif
127 127
128 // Base class for all rendering tree objects. 128 // Base class for all rendering tree objects.
129 class RenderObject : public NoBaseWillBeGarbageCollectedFinalized<RenderObject>, public ImageResourceClient { 129 class RenderObject : public ImageResourceClient {
130 friend class RenderBlock; 130 friend class RenderBlock;
131 friend class RenderBlockFlow; 131 friend class RenderBlockFlow;
132 friend class RenderLayerReflectionInfo; // For setParent 132 friend class RenderLayerReflectionInfo; // For setParent
133 friend class RenderLayerScrollableArea; // For setParent. 133 friend class RenderLayerScrollableArea; // For setParent.
134 friend class RenderObjectChildList; 134 friend class RenderObjectChildList;
135 WTF_MAKE_NONCOPYABLE(RenderObject); 135 WTF_MAKE_NONCOPYABLE(RenderObject);
136 public: 136 public:
137 // Anonymous objects should pass the document as their node, and they will t hen automatically be 137 // Anonymous objects should pass the document as their node, and they will t hen automatically be
138 // marked as anonymous in the constructor. 138 // marked as anonymous in the constructor.
139 explicit RenderObject(Node*); 139 explicit RenderObject(Node*);
140 virtual ~RenderObject(); 140 virtual ~RenderObject();
141 virtual void trace(Visitor*);
142 141
143 virtual const char* renderName() const = 0; 142 virtual const char* renderName() const = 0;
144 143
145 String debugName() const; 144 String debugName() const;
146 145
147 RenderObject* parent() const { return m_parent; } 146 RenderObject* parent() const { return m_parent; }
148 bool isDescendantOf(const RenderObject*) const; 147 bool isDescendantOf(const RenderObject*) const;
149 148
150 RenderObject* previousSibling() const { return m_previous; } 149 RenderObject* previousSibling() const { return m_previous; }
151 RenderObject* nextSibling() const { return m_next; } 150 RenderObject* nextSibling() const { return m_next; }
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 void showRenderObject() const; 317 void showRenderObject() const;
319 // We don't make printedCharacters an optional parameter so that 318 // We don't make printedCharacters an optional parameter so that
320 // showRenderObject can be called from gdb easily. 319 // showRenderObject can be called from gdb easily.
321 void showRenderObject(int printedCharacters) const; 320 void showRenderObject(int printedCharacters) const;
322 void showRenderTreeAndMark(const RenderObject* markedObject1 = 0, const char * markedLabel1 = 0, const RenderObject* markedObject2 = 0, const char* markedLab el2 = 0, int depth = 0) const; 321 void showRenderTreeAndMark(const RenderObject* markedObject1 = 0, const char * markedLabel1 = 0, const RenderObject* markedObject2 = 0, const char* markedLab el2 = 0, int depth = 0) const;
323 #endif 322 #endif
324 323
325 static RenderObject* createObject(Element*, RenderStyle*); 324 static RenderObject* createObject(Element*, RenderStyle*);
326 static unsigned instanceCount() { return s_instanceCount; } 325 static unsigned instanceCount() { return s_instanceCount; }
327 326
328 #if !ENABLE(OILPAN)
329 // RenderObjects are allocated out of the rendering partition. 327 // RenderObjects are allocated out of the rendering partition.
330 void* operator new(size_t); 328 void* operator new(size_t);
331 void operator delete(void*); 329 void operator delete(void*);
332 #endif
333 330
334 public: 331 public:
335 bool isPseudoElement() const { return node() && node()->isPseudoElement(); } 332 bool isPseudoElement() const { return node() && node()->isPseudoElement(); }
336 333
337 virtual bool isBoxModelObject() const { return false; } 334 virtual bool isBoxModelObject() const { return false; }
338 bool isBR() const { return isOfType(RenderObjectBr); } 335 bool isBR() const { return isOfType(RenderObjectBr); }
339 bool isCanvas() const { return isOfType(RenderObjectCanvas); } 336 bool isCanvas() const { return isOfType(RenderObjectCanvas); }
340 bool isCounter() const { return isOfType(RenderObjectCounter); } 337 bool isCounter() const { return isOfType(RenderObjectCounter); }
341 bool isDetailsMarker() const { return isOfType(RenderObjectDetailsMarker); } 338 bool isDetailsMarker() const { return isOfType(RenderObjectDetailsMarker); }
342 bool isEmbeddedObject() const { return isOfType(RenderObjectEmbeddedObject); } 339 bool isEmbeddedObject() const { return isOfType(RenderObjectEmbeddedObject); }
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 606
610 virtual void updateDragState(bool dragOn); 607 virtual void updateDragState(bool dragOn);
611 608
612 RenderView* view() const { return document().renderView(); }; 609 RenderView* view() const { return document().renderView(); };
613 FrameView* frameView() const { return document().view(); }; 610 FrameView* frameView() const { return document().view(); };
614 611
615 bool isRooted() const; 612 bool isRooted() const;
616 613
617 Node* node() const 614 Node* node() const
618 { 615 {
619 return isAnonymous() ? 0 : m_node.get(); 616 return isAnonymous() ? 0 : m_node;
620 } 617 }
621 618
622 Node* nonPseudoNode() const 619 Node* nonPseudoNode() const
623 { 620 {
624 return isPseudoElement() ? 0 : node(); 621 return isPseudoElement() ? 0 : node();
625 } 622 }
626 623
627 // FIXME: Why does RenderPart need this? crbug.com/422457 624 // FIXME: Why does RenderPart need this? crbug.com/422457
628 void clearNode() { m_node = nullptr; } 625 void clearNode() { m_node = nullptr; }
629 626
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
1216 #if ENABLE(ASSERT) 1213 #if ENABLE(ASSERT)
1217 void checkBlockPositionedObjectsNeedLayout(); 1214 void checkBlockPositionedObjectsNeedLayout();
1218 #endif 1215 #endif
1219 1216
1220 void markContainingBlockChainForPaintInvalidation(); 1217 void markContainingBlockChainForPaintInvalidation();
1221 1218
1222 static bool isAllowedToModifyRenderTreeStructure(Document&); 1219 static bool isAllowedToModifyRenderTreeStructure(Document&);
1223 1220
1224 RefPtr<RenderStyle> m_style; 1221 RefPtr<RenderStyle> m_style;
1225 1222
1226 RawPtrWillBeMember<Node> m_node; 1223 // Oilpan: raw pointer back to the owning Node is considered safe.
1224 Node* m_node;
1227 1225
1228 RawPtrWillBeMember<RenderObject> m_parent; 1226 RenderObject* m_parent;
1229 RawPtrWillBeMember<RenderObject> m_previous; 1227 RenderObject* m_previous;
1230 RawPtrWillBeMember<RenderObject> m_next; 1228 RenderObject* m_next;
1231 1229
1232 #if ENABLE(ASSERT) 1230 #if ENABLE(ASSERT)
1233 unsigned m_hasAXObject : 1; 1231 unsigned m_hasAXObject : 1;
1234 unsigned m_setNeedsLayoutForbidden : 1; 1232 unsigned m_setNeedsLayoutForbidden : 1;
1235 #if ENABLE(OILPAN)
1236 protected:
1237 unsigned m_didCallDestroy : 1;
1238 private:
1239 #endif
1240 #endif 1233 #endif
1241 1234
1242 #define ADD_BOOLEAN_BITFIELD(name, Name) \ 1235 #define ADD_BOOLEAN_BITFIELD(name, Name) \
1243 private:\ 1236 private:\
1244 unsigned m_##name : 1;\ 1237 unsigned m_##name : 1;\
1245 public:\ 1238 public:\
1246 bool name() const { return m_##name; }\ 1239 bool name() const { return m_##name; }\
1247 void set##Name(bool name) { m_##name = name; }\ 1240 void set##Name(bool name) { m_##name = name; }\
1248 1241
1249 class RenderObjectBitfields { 1242 class RenderObjectBitfields {
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1394 // This stores the paint invalidation rect from the previous frame. 1387 // This stores the paint invalidation rect from the previous frame.
1395 LayoutRect m_previousPaintInvalidationRect; 1388 LayoutRect m_previousPaintInvalidationRect;
1396 1389
1397 // This stores the position in the paint invalidation backing's coordinate. 1390 // This stores the position in the paint invalidation backing's coordinate.
1398 // It is used to detect renderer shifts that forces a full invalidation. 1391 // It is used to detect renderer shifts that forces a full invalidation.
1399 LayoutPoint m_previousPositionFromPaintInvalidationBacking; 1392 LayoutPoint m_previousPositionFromPaintInvalidationBacking;
1400 1393
1401 static unsigned s_instanceCount; 1394 static unsigned s_instanceCount;
1402 }; 1395 };
1403 1396
1404 WILL_NOT_BE_EAGERLY_TRACED_CLASS(RenderObject);
1405
1406 // FIXME: remove this once the render object lifecycle ASSERTS are no longer hit . 1397 // FIXME: remove this once the render object lifecycle ASSERTS are no longer hit .
1407 class DeprecatedDisableModifyRenderTreeStructureAsserts { 1398 class DeprecatedDisableModifyRenderTreeStructureAsserts {
1408 WTF_MAKE_NONCOPYABLE(DeprecatedDisableModifyRenderTreeStructureAsserts); 1399 WTF_MAKE_NONCOPYABLE(DeprecatedDisableModifyRenderTreeStructureAsserts);
1409 public: 1400 public:
1410 DeprecatedDisableModifyRenderTreeStructureAsserts(); 1401 DeprecatedDisableModifyRenderTreeStructureAsserts();
1411 1402
1412 static bool canModifyRenderTreeStateInAnyState(); 1403 static bool canModifyRenderTreeStateInAnyState();
1413 1404
1414 private: 1405 private:
1415 TemporaryChange<bool> m_disabler; 1406 TemporaryChange<bool> m_disabler;
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
1615 void showTree(const blink::RenderObject*); 1606 void showTree(const blink::RenderObject*);
1616 void showLineTree(const blink::RenderObject*); 1607 void showLineTree(const blink::RenderObject*);
1617 void showRenderTree(const blink::RenderObject* object1); 1608 void showRenderTree(const blink::RenderObject* object1);
1618 // We don't make object2 an optional parameter so that showRenderTree 1609 // We don't make object2 an optional parameter so that showRenderTree
1619 // can be called from gdb easily. 1610 // can be called from gdb easily.
1620 void showRenderTree(const blink::RenderObject* object1, const blink::RenderObjec t* object2); 1611 void showRenderTree(const blink::RenderObject* object1, const blink::RenderObjec t* object2);
1621 1612
1622 #endif 1613 #endif
1623 1614
1624 #endif // RenderObject_h 1615 #endif // RenderObject_h
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderMenuList.cpp ('k') | Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698