Web Inspector: Native Memory Instrumentation: instrument RenderBox descendants.
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Dec 2012 17:31:35 +0000 (17:31 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Dec 2012 17:31:35 +0000 (17:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=104026

Reviewed by Eric Seidel.

Plain vanilla instrumentation for RenderBox descendants.

* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::reportMemoryUsage):
(WebCore):
(WebCore::RenderFrameSet::GridAxis::reportMemoryUsage):
* rendering/RenderFrameSet.h:
(RenderFrameSet):
(GridAxis):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::reportMemoryUsage):
(WebCore):
* rendering/RenderListMarker.h:
(RenderListMarker):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::reportMemoryUsage):
(WebCore):
* rendering/RenderReplaced.h:
(RenderReplaced):
* rendering/RenderTableCol.cpp:
(WebCore::RenderTableCol::reportMemoryUsage):
(WebCore):
* rendering/RenderTableCol.h:
(RenderTableCol):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::reportMemoryUsage):
(WebCore):
* rendering/RenderTableRow.h:
(RenderTableRow):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::reportMemoryUsage):
(WebCore):
(WebCore::RenderTableSection::RowStruct::reportMemoryUsage):
(WebCore::RenderTableSection::CellStruct::reportMemoryUsage):
* rendering/RenderTableSection.h:
(CellStruct):
(RowStruct):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@137169 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderFrameSet.cpp
Source/WebCore/rendering/RenderFrameSet.h
Source/WebCore/rendering/RenderListMarker.cpp
Source/WebCore/rendering/RenderListMarker.h
Source/WebCore/rendering/RenderReplaced.cpp
Source/WebCore/rendering/RenderReplaced.h
Source/WebCore/rendering/RenderTableCol.cpp
Source/WebCore/rendering/RenderTableCol.h
Source/WebCore/rendering/RenderTableRow.cpp
Source/WebCore/rendering/RenderTableRow.h
Source/WebCore/rendering/RenderTableSection.cpp
Source/WebCore/rendering/RenderTableSection.h

index 066ac93..8a36080 100644 (file)
@@ -1,3 +1,48 @@
+2012-12-10  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Web Inspector: Native Memory Instrumentation: instrument RenderBox descendants.
+        https://bugs.webkit.org/show_bug.cgi?id=104026
+
+        Reviewed by Eric Seidel.
+
+        Plain vanilla instrumentation for RenderBox descendants.
+
+        * rendering/RenderFrameSet.cpp:
+        (WebCore::RenderFrameSet::reportMemoryUsage):
+        (WebCore):
+        (WebCore::RenderFrameSet::GridAxis::reportMemoryUsage):
+        * rendering/RenderFrameSet.h:
+        (RenderFrameSet):
+        (GridAxis):
+        * rendering/RenderListMarker.cpp:
+        (WebCore::RenderListMarker::reportMemoryUsage):
+        (WebCore):
+        * rendering/RenderListMarker.h:
+        (RenderListMarker):
+        * rendering/RenderReplaced.cpp:
+        (WebCore::RenderReplaced::reportMemoryUsage):
+        (WebCore):
+        * rendering/RenderReplaced.h:
+        (RenderReplaced):
+        * rendering/RenderTableCol.cpp:
+        (WebCore::RenderTableCol::reportMemoryUsage):
+        (WebCore):
+        * rendering/RenderTableCol.h:
+        (RenderTableCol):
+        * rendering/RenderTableRow.cpp:
+        (WebCore::RenderTableRow::reportMemoryUsage):
+        (WebCore):
+        * rendering/RenderTableRow.h:
+        (RenderTableRow):
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::reportMemoryUsage):
+        (WebCore):
+        (WebCore::RenderTableSection::RowStruct::reportMemoryUsage):
+        (WebCore::RenderTableSection::CellStruct::reportMemoryUsage):
+        * rendering/RenderTableSection.h:
+        (CellStruct):
+        (RowStruct):
+
 2012-12-10  Alejandro PiƱeiro  <apinheiro@igalia.com>
 
         AX: wrong Enabled states on a ListBox
index 543c2d3..4ad4d98 100644 (file)
@@ -40,6 +40,8 @@
 #include "RenderLayer.h"
 #include "RenderView.h"
 #include "Settings.h"
+#include "WebCoreMemoryInstrumentation.h"
+#include <wtf/MemoryInstrumentationVector.h>
 
 namespace WebCore {
 
@@ -814,4 +816,22 @@ CursorDirective RenderFrameSet::getCursor(const LayoutPoint& point, Cursor& curs
     return RenderBox::getCursor(point, cursor);
 }
 
+void RenderFrameSet::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+{
+    MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering);
+    RenderBox::reportMemoryUsage(memoryObjectInfo);
+    info.addMember(m_children);
+    info.addMember(m_rows);
+    info.addMember(m_cols);
+}
+
+void RenderFrameSet::GridAxis::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+{
+    MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering);
+    info.addMember(m_sizes);
+    info.addMember(m_deltas);
+    info.addMember(m_preventResize);
+    info.addMember(m_allowBorder);
+}
+
 } // namespace WebCore
index edab2d9..af1782a 100644 (file)
@@ -76,6 +76,8 @@ public:
 
     void notifyFrameEdgeInfoChanged();
 
+    virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE;
+
 private:
     static const int noSplit = -1;
 
@@ -84,6 +86,9 @@ private:
     public:
         GridAxis();
         void resize(int);
+
+        void reportMemoryUsage(MemoryObjectInfo*) const;
+
         Vector<int> m_sizes;
         Vector<int> m_deltas;
         Vector<bool> m_preventResize;
index 7ccb686..4c61c1d 100644 (file)
@@ -32,6 +32,7 @@
 #include "RenderLayer.h"
 #include "RenderListItem.h"
 #include "RenderView.h"
+#include "WebCoreMemoryInstrumentation.h"
 #include <wtf/text/StringBuilder.h>
 #include <wtf/unicode/CharacterNames.h>
 
@@ -1732,4 +1733,13 @@ LayoutRect RenderListMarker::selectionRectForRepaint(const RenderLayerModelObjec
     return rect;
 }
 
+void RenderListMarker::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+{
+    MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering);
+    RenderBox::reportMemoryUsage(memoryObjectInfo);
+    info.addMember(m_text);
+    info.addMember(m_image);
+    info.addMember(m_listItem);
+}
+
 } // namespace WebCore
index 98480ea..88dab7d 100644 (file)
@@ -45,6 +45,8 @@ public:
 
     bool isInside() const;
 
+    virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE;
+
 private:
     virtual const char* renderName() const { return "RenderListMarker"; }
 
index 61e7490..623e2f0 100644 (file)
@@ -33,6 +33,7 @@
 #include "RenderTheme.h"
 #include "RenderView.h"
 #include "VisiblePosition.h"
+#include "WebCoreMemoryInstrumentation.h"
 
 using namespace std;
 
@@ -586,4 +587,10 @@ LayoutRect RenderReplaced::clippedOverflowRectForRepaint(const RenderLayerModelO
     return r;
 }
 
+void RenderReplaced::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+{
+    MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering);
+    RenderBox::reportMemoryUsage(memoryObjectInfo);
+}
+
 }
index a6dee44..c698616 100644 (file)
@@ -38,6 +38,8 @@ public:
     bool hasReplacedLogicalWidth() const;
     bool hasReplacedLogicalHeight() const;
 
+    virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE;
+
 protected:
     virtual void willBeDestroyed();
 
index cc630cb..811c980 100644 (file)
@@ -31,6 +31,7 @@
 #include "HTMLTableColElement.h"
 #include "RenderTable.h"
 #include "RenderTableCell.h"
+#include "WebCoreMemoryInstrumentation.h"
 
 namespace WebCore {
 
@@ -187,4 +188,11 @@ const BorderValue& RenderTableCol::borderAdjoiningCellAfter(const RenderTableCel
     return style()->borderEnd();
 }
 
+void RenderTableCol::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+{
+    MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering);
+    RenderBox::reportMemoryUsage(memoryObjectInfo);
+    info.addMember(m_children);
+}
+
 }
index a091a93..e11c8cb 100644 (file)
@@ -76,6 +76,8 @@ public:
     const BorderValue& borderAdjoiningCellBefore(const RenderTableCell*) const;
     const BorderValue& borderAdjoiningCellAfter(const RenderTableCell*) const;
 
+    virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE;
+
 private:
     virtual RenderObjectChildList* virtualChildren() { return children(); }
     virtual const RenderObjectChildList* virtualChildren() const { return children(); }
index e00c9a6..44360ff 100644 (file)
@@ -33,6 +33,7 @@
 #include "RenderTableCell.h"
 #include "RenderView.h"
 #include "StyleInheritedData.h"
+#include "WebCoreMemoryInstrumentation.h"
 
 namespace WebCore {
 
@@ -268,4 +269,11 @@ RenderTableRow* RenderTableRow::createAnonymousWithParentRenderer(const RenderOb
     return newRow;
 }
 
+void RenderTableRow::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+{
+    MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering);
+    RenderBox::reportMemoryUsage(memoryObjectInfo);
+    info.addMember(m_children);
+}
+
 } // namespace WebCore
index c05f44b..11de4f1 100644 (file)
@@ -88,6 +88,8 @@ public:
     const BorderValue& borderAdjoiningStartCell(const RenderTableCell*) const;
     const BorderValue& borderAdjoiningEndCell(const RenderTableCell*) const;
 
+    virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE;
+
 private:
     virtual RenderObjectChildList* virtualChildren() { return children(); }
     virtual const RenderObjectChildList* virtualChildren() const { return children(); }
index c8452a4..dd6f42f 100644 (file)
 #include "RenderTableRow.h"
 #include "RenderView.h"
 #include "StyleInheritedData.h"
+#include "WebCoreMemoryInstrumentation.h"
 #include <limits>
 #include <wtf/HashSet.h>
+#include <wtf/MemoryInstrumentationHashMap.h>
+#include <wtf/MemoryInstrumentationHashSet.h>
+#include <wtf/MemoryInstrumentationVector.h>
 #include <wtf/Vector.h>
 
 using namespace std;
@@ -1438,4 +1442,28 @@ void RenderTableSection::setLogicalPositionForCell(RenderTableCell* cell, unsign
     view()->addLayoutDelta(oldCellLocation - cell->location());
 }
 
+void RenderTableSection::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+{
+    MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering);
+    RenderBox::reportMemoryUsage(memoryObjectInfo);
+    info.addMember(m_children);
+    info.addMember(m_grid);
+    info.addMember(m_rowPos);
+    info.addMember(m_overflowingCells);
+    info.addMember(m_cellsCollapsedBorders);
+}
+
+void RenderTableSection::RowStruct::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+{
+    MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering);
+    info.addMember(row);
+    info.addMember(rowRenderer);
+}
+
+void RenderTableSection::CellStruct::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+{
+    MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering);
+    info.addMember(cells);
+}
+
 } // namespace WebCore
index 6399f7c..e25fa74 100644 (file)
@@ -102,6 +102,8 @@ public:
         }
 
         bool hasCells() const { return cells.size() > 0; }
+
+        void reportMemoryUsage(MemoryObjectInfo*) const;
     };
 
     typedef Vector<CellStruct> Row;
@@ -113,6 +115,8 @@ public:
         {
         }
 
+        void reportMemoryUsage(MemoryObjectInfo*) const;
+
         Row row;
         RenderTableRow* rowRenderer;
         LayoutUnit baseline;
@@ -195,6 +199,8 @@ public:
     
     virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE;
 
+    virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE;
+
 protected:
     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);