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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayer.cpp

Issue 2766943002: Do-not-commit: Count layout tree memory usage
Patch Set: Rebase, add object paint property counter Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintLayer.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
index aabe1c5f5f715dabeeb6687319411f2a189aab07..bd6d311d459f8042bf7f8f0c37613f2609c402bd 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -211,6 +211,28 @@ LayoutRect PaintLayer::visualRect() const {
return m_layoutObject.visualRect();
}
+char PaintLayer::approximateHeapMemoryUsage() const {
+ int memory = 0;
+ if (m_ancestorDependentCompositingInputs)
+ memory += sizeof(AncestorDependentCompositingInputs);
+ if (m_scrollableArea) {
+ // TODO(pdr): Include the additional heap allocations in
+ // PaintLayerScrollableArea.
+ memory += sizeof(PaintLayerScrollableArea);
+ }
+ if (m_ancestorDependentCompositingInputs)
+ memory += sizeof(AncestorDependentCompositingInputs);
+ if (m_clipRectsCache)
+ memory += sizeof(ClipRectsCache);
+ if (m_stackingNode)
+ memory += sizeof(PaintLayerStackingNode);
+ if (m_previousPaintingClipRects)
+ memory += sizeof(ClipRects);
+ if (m_rareData)
+ memory += sizeof(PaintLayerRareData);
+ return memory;
+}
+
PaintLayerCompositor* PaintLayer::compositor() const {
if (!layoutObject().view())
return 0;
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698