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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBoxModelObject.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
Index: third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
index 33672ccc2d653469824876d32a0794e44c97fdf4..db1ace938936f242fbc3771ea2a01afa597f6815 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
@@ -260,6 +260,17 @@ void LayoutBoxModelObject::willBeDestroyed() {
destroyLayer();
}
+char LayoutBoxModelObject::approximateHeapMemoryUsage() const {
+ int memory = LayoutObject::approximateHeapMemoryUsage();
+ if (m_layer) {
+ memory += sizeof(PaintLayer);
+ memory += m_layer->approximateHeapMemoryUsage();
+ }
+ if (m_rareData)
+ memory += sizeof(LayoutBoxModelObjectRareData);
+ return memory;
+}
+
void LayoutBoxModelObject::styleWillChange(StyleDifference diff,
const ComputedStyle& newStyle) {
// This object's layer may begin or cease to be a stacking context, in which
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h ('k') | third_party/WebKit/Source/core/layout/LayoutButton.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698