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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTextFragment.h

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 * (C) 1999 Lars Knoll (knoll@kde.org) 2 * (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Dirk Mueller (mueller@kde.org) 3 * (C) 2000 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 LayoutTextFragment(Node*, StringImpl*); 43 LayoutTextFragment(Node*, StringImpl*);
44 ~LayoutTextFragment() override; 44 ~LayoutTextFragment() override;
45 45
46 static LayoutTextFragment* createAnonymous(PseudoElement&, StringImpl*); 46 static LayoutTextFragment* createAnonymous(PseudoElement&, StringImpl*);
47 static LayoutTextFragment* createAnonymous(PseudoElement&, 47 static LayoutTextFragment* createAnonymous(PseudoElement&,
48 StringImpl*, 48 StringImpl*,
49 unsigned start, 49 unsigned start,
50 unsigned length); 50 unsigned length);
51 51
52 bool isTextFragment() const override { return true; } 52 bool isTextFragment() const override { return true; }
53 char objectSize() const override { return sizeof(this); }
54 char approximateHeapMemoryUsage() const override {
55 int memory = LayoutText::approximateHeapMemoryUsage();
56 // TODO(pdr): Include memory from m_contentString?
57 return memory;
58 }
53 59
54 bool canBeSelectionLeaf() const override { 60 bool canBeSelectionLeaf() const override {
55 return node() && hasEditableStyle(*node()); 61 return node() && hasEditableStyle(*node());
56 } 62 }
57 63
58 unsigned start() const { return m_start; } 64 unsigned start() const { return m_start; }
59 unsigned fragmentLength() const { return m_fragmentLength; } 65 unsigned fragmentLength() const { return m_fragmentLength; }
60 66
61 unsigned textStartOffset() const override { return start(); } 67 unsigned textStartOffset() const override { return start(); }
62 68
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 119
114 DEFINE_TYPE_CASTS(LayoutTextFragment, 120 DEFINE_TYPE_CASTS(LayoutTextFragment,
115 LayoutObject, 121 LayoutObject,
116 object, 122 object,
117 toLayoutText(object)->isTextFragment(), 123 toLayoutText(object)->isTextFragment(),
118 toLayoutText(object).isTextFragment()); 124 toLayoutText(object).isTextFragment());
119 125
120 } // namespace blink 126 } // namespace blink
121 127
122 #endif // LayoutTextFragment_h 128 #endif // LayoutTextFragment_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698