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

Side by Side 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, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 * Copyright (C) 2010 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 frameView->removeViewportConstrainedObject(*this); 253 frameView->removeViewportConstrainedObject(*this);
254 } 254 }
255 } 255 }
256 } 256 }
257 257
258 LayoutObject::willBeDestroyed(); 258 LayoutObject::willBeDestroyed();
259 259
260 destroyLayer(); 260 destroyLayer();
261 } 261 }
262 262
263 char LayoutBoxModelObject::approximateHeapMemoryUsage() const {
264 int memory = LayoutObject::approximateHeapMemoryUsage();
265 if (m_layer) {
266 memory += sizeof(PaintLayer);
267 memory += m_layer->approximateHeapMemoryUsage();
268 }
269 if (m_rareData)
270 memory += sizeof(LayoutBoxModelObjectRareData);
271 return memory;
272 }
273
263 void LayoutBoxModelObject::styleWillChange(StyleDifference diff, 274 void LayoutBoxModelObject::styleWillChange(StyleDifference diff,
264 const ComputedStyle& newStyle) { 275 const ComputedStyle& newStyle) {
265 // This object's layer may begin or cease to be a stacking context, in which 276 // This object's layer may begin or cease to be a stacking context, in which
266 // case the paint invalidation container of this object and descendants may 277 // case the paint invalidation container of this object and descendants may
267 // change. Thus we need to invalidate paint eagerly for all such children. 278 // change. Thus we need to invalidate paint eagerly for all such children.
268 // PaintLayerCompositor::paintInvalidationOnCompositingChange() doesn't work 279 // PaintLayerCompositor::paintInvalidationOnCompositingChange() doesn't work
269 // for the case because we can only see the new paintInvalidationContainer 280 // for the case because we can only see the new paintInvalidationContainer
270 // during compositing update. 281 // during compositing update.
271 if (style() && 282 if (style() &&
272 (style()->isStackingContext() != newStyle.isStackingContext())) { 283 (style()->isStackingContext() != newStyle.isStackingContext())) {
(...skipping 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after
1468 if (rootElementStyle->hasBackground()) 1479 if (rootElementStyle->hasBackground())
1469 return false; 1480 return false;
1470 1481
1471 if (node() != document().firstBodyElement()) 1482 if (node() != document().firstBodyElement())
1472 return false; 1483 return false;
1473 1484
1474 return true; 1485 return true;
1475 } 1486 }
1476 1487
1477 } // namespace blink 1488 } // namespace blink
OLDNEW
« 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