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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.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) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2009 Google Inc. All rights reserved. 8 * Copyright (C) 2009 Google Inc. All rights reserved.
9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 } 250 }
251 251
252 bool LayoutObject::isHR() const { 252 bool LayoutObject::isHR() const {
253 return isHTMLHRElement(node()); 253 return isHTMLHRElement(node());
254 } 254 }
255 255
256 bool LayoutObject::isLegend() const { 256 bool LayoutObject::isLegend() const {
257 return isHTMLLegendElement(node()); 257 return isHTMLLegendElement(node());
258 } 258 }
259 259
260 char LayoutObject::approximateHeapMemoryUsage() const {
261 int memory = 0;
262 if (m_style)
263 memory += sizeof(ComputedStyle);
264 if (m_paintProperties) {
265 memory += sizeof(ObjectPaintProperties);
266 memory += m_paintProperties->heapMemoryUsage();
267 }
268 return memory;
269 }
270
260 void LayoutObject::setIsInsideFlowThreadIncludingDescendants( 271 void LayoutObject::setIsInsideFlowThreadIncludingDescendants(
261 bool insideFlowThread) { 272 bool insideFlowThread) {
262 LayoutObject* next; 273 LayoutObject* next;
263 for (LayoutObject* object = this; object; object = next) { 274 for (LayoutObject* object = this; object; object = next) {
264 // If object is a fragmentation context it already updated the descendants 275 // If object is a fragmentation context it already updated the descendants
265 // flag accordingly. 276 // flag accordingly.
266 if (object->isLayoutFlowThread()) { 277 if (object->isLayoutFlowThread()) {
267 next = object->nextInPreOrderAfterChildren(this); 278 next = object->nextInPreOrderAfterChildren(this);
268 continue; 279 continue;
269 } 280 }
(...skipping 3356 matching lines...) Expand 10 before | Expand all | Expand 10 after
3626 const blink::LayoutObject* root = object1; 3637 const blink::LayoutObject* root = object1;
3627 while (root->parent()) 3638 while (root->parent())
3628 root = root->parent(); 3639 root = root->parent();
3629 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3640 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3630 } else { 3641 } else {
3631 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); 3642 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)");
3632 } 3643 }
3633 } 3644 }
3634 3645
3635 #endif 3646 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/layout/LayoutPagedFlowThread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698