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

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

Issue 16896019: Replace RenderArena with PartitionAlloc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All r ights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All r ights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 , m_logicalWidth(logicalWidth) 56 , m_logicalWidth(logicalWidth)
57 , m_bitfields(firstLine, constructed, dirty, extracted, isHorizontal) 57 , m_bitfields(firstLine, constructed, dirty, extracted, isHorizontal)
58 #ifndef NDEBUG 58 #ifndef NDEBUG
59 , m_hasBadParent(false) 59 , m_hasBadParent(false)
60 #endif 60 #endif
61 { 61 {
62 } 62 }
63 63
64 virtual ~InlineBox(); 64 virtual ~InlineBox();
65 65
66 virtual void destroy(RenderArena*); 66 virtual void destroy();
67 #if ENABLE(PARTITION_ALLOC)
68 void* operator new(size_t);
69 #endif
67 70
68 virtual void deleteLine(RenderArena*); 71 virtual void deleteLine();
69 virtual void extractLine(); 72 virtual void extractLine();
70 virtual void attachLine(); 73 virtual void attachLine();
71 74
72 virtual bool isLineBreak() const { return false; } 75 virtual bool isLineBreak() const { return false; }
73 76
74 virtual void adjustPosition(float dx, float dy); 77 virtual void adjustPosition(float dx, float dy);
75 void adjustLogicalPosition(float deltaLogicalLeft, float deltaLogicalTop) 78 void adjustLogicalPosition(float deltaLogicalLeft, float deltaLogicalTop)
76 { 79 {
77 if (isHorizontal()) 80 if (isHorizontal())
78 adjustPosition(deltaLogicalLeft, deltaLogicalTop); 81 adjustPosition(deltaLogicalLeft, deltaLogicalTop);
(...skipping 11 matching lines...) Expand all
90 { 93 {
91 if (isHorizontal()) 94 if (isHorizontal())
92 adjustPosition(0, delta); 95 adjustPosition(0, delta);
93 else 96 else
94 adjustPosition(delta, 0); 97 adjustPosition(delta, 0);
95 } 98 }
96 99
97 virtual void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, Layou tUnit lineBottom); 100 virtual void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, Layou tUnit lineBottom);
98 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom); 101 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom);
99 102
100 // Overloaded new operator.
101 void* operator new(size_t, RenderArena*);
102
103 // Overridden to prevent the normal delete from being called.
104 void operator delete(void*, size_t);
105
106 private:
107 // The normal operator new is disallowed.
108 void* operator new(size_t) throw();
109
110 public:
111 #ifndef NDEBUG 103 #ifndef NDEBUG
112 void showTreeForThis() const; 104 void showTreeForThis() const;
113 void showLineTreeForThis() const; 105 void showLineTreeForThis() const;
114 106
115 virtual void showBox(int = 0) const; 107 virtual void showBox(int = 0) const;
116 virtual void showLineTreeAndMark(const InlineBox* = 0, const char* = 0, cons t InlineBox* = 0, const char* = 0, const RenderObject* = 0, int = 0) const; 108 virtual void showLineTreeAndMark(const InlineBox* = 0, const char* = 0, cons t InlineBox* = 0, const char* = 0, const RenderObject* = 0, int = 0) const;
117 virtual const char* boxName() const; 109 virtual const char* boxName() const;
118 #endif 110 #endif
119 111
120 bool isText() const { return m_bitfields.isText(); } 112 bool isText() const { return m_bitfields.isText(); }
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 public: 382 public:
391 signed expansion() const { return m_expansion; } 383 signed expansion() const { return m_expansion; }
392 void setExpansion(signed expansion) { m_expansion = expansion; } 384 void setExpansion(signed expansion) { m_expansion = expansion; }
393 }; 385 };
394 #undef ADD_BOOLEAN_BITFIELD 386 #undef ADD_BOOLEAN_BITFIELD
395 387
396 private: 388 private:
397 InlineBoxBitfields m_bitfields; 389 InlineBoxBitfields m_bitfields;
398 390
399 protected: 391 protected:
392 #if ENABLE(PARTITION_ALLOC)
393 void operator delete(void*);
394 #endif
400 // For RootInlineBox 395 // For RootInlineBox
401 bool endsWithBreak() const { return m_bitfields.endsWithBreak(); } 396 bool endsWithBreak() const { return m_bitfields.endsWithBreak(); }
402 void setEndsWithBreak(bool endsWithBreak) { m_bitfields.setEndsWithBreak(end sWithBreak); } 397 void setEndsWithBreak(bool endsWithBreak) { m_bitfields.setEndsWithBreak(end sWithBreak); }
403 bool hasEllipsisBox() const { return m_bitfields.hasEllipsisBoxOrHyphen(); } 398 bool hasEllipsisBox() const { return m_bitfields.hasEllipsisBoxOrHyphen(); }
404 bool hasSelectedChildren() const { return m_bitfields.hasSelectedChildrenOrC anHaveLeadingExpansion(); } 399 bool hasSelectedChildren() const { return m_bitfields.hasSelectedChildrenOrC anHaveLeadingExpansion(); }
405 void setHasSelectedChildren(bool hasSelectedChildren) { m_bitfields.setHasSe lectedChildrenOrCanHaveLeadingExpansion(hasSelectedChildren); } 400 void setHasSelectedChildren(bool hasSelectedChildren) { m_bitfields.setHasSe lectedChildrenOrCanHaveLeadingExpansion(hasSelectedChildren); }
406 void setHasEllipsisBox(bool hasEllipsisBox) { m_bitfields.setHasEllipsisBoxO rHyphen(hasEllipsisBox); } 401 void setHasEllipsisBox(bool hasEllipsisBox) { m_bitfields.setHasEllipsisBoxO rHyphen(hasEllipsisBox); }
407 402
408 // For InlineTextBox 403 // For InlineTextBox
409 bool hasHyphen() const { return m_bitfields.hasEllipsisBoxOrHyphen(); } 404 bool hasHyphen() const { return m_bitfields.hasEllipsisBoxOrHyphen(); }
(...skipping 27 matching lines...) Expand all
437 432
438 } // namespace WebCore 433 } // namespace WebCore
439 434
440 #ifndef NDEBUG 435 #ifndef NDEBUG
441 // Outside the WebCore namespace for ease of invocation from gdb. 436 // Outside the WebCore namespace for ease of invocation from gdb.
442 void showTree(const WebCore::InlineBox*); 437 void showTree(const WebCore::InlineBox*);
443 void showLineTree(const WebCore::InlineBox*); 438 void showLineTree(const WebCore::InlineBox*);
444 #endif 439 #endif
445 440
446 #endif // InlineBox_h 441 #endif // InlineBox_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698