Chromium Code Reviews| OLD | NEW |
|---|---|
| 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. All rights reserv ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. |
| 7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 233 #if ENABLE(ASSERT) | 233 #if ENABLE(ASSERT) |
| 234 , m_hasAXObject(false) | 234 , m_hasAXObject(false) |
| 235 , m_setNeedsLayoutForbidden(false) | 235 , m_setNeedsLayoutForbidden(false) |
| 236 #endif | 236 #endif |
| 237 , m_bitfields(node) | 237 , m_bitfields(node) |
| 238 { | 238 { |
| 239 // TODO(wangxianzhu): Move this into initialization list when we enable the feature by default. | 239 // TODO(wangxianzhu): Move this into initialization list when we enable the feature by default. |
| 240 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) | 240 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) |
| 241 m_previousPositionFromPaintInvalidationBacking = uninitializedPaintOffse t(); | 241 m_previousPositionFromPaintInvalidationBacking = uninitializedPaintOffse t(); |
| 242 InstanceCounters::incrementCounter(InstanceCounters::LayoutObjectCounter); | 242 InstanceCounters::incrementCounter(InstanceCounters::LayoutObjectCounter); |
| 243 if (m_node) | |
|
chrishtr
2016/08/11 00:43:35
On every LayoutObject creation? That's expensive.
Charlie Harrison
2016/08/11 00:48:57
It's just upping a counter, right? Or are you more
chrishtr
2016/08/11 00:55:46
I guess it's ok...
Isn't it already counted by li
Charlie Harrison
2016/08/11 01:01:37
Good catch. It would be nice to not duplicate this
Kunihiko Sakamoto
2016/08/11 03:50:18
Yeah the instance counters are process global. We
| |
| 244 frameView()->incrementLayoutObjectCount(); | |
| 243 } | 245 } |
| 244 | 246 |
| 245 LayoutObject::~LayoutObject() | 247 LayoutObject::~LayoutObject() |
| 246 { | 248 { |
| 247 ASSERT(!m_hasAXObject); | 249 ASSERT(!m_hasAXObject); |
| 248 InstanceCounters::decrementCounter(InstanceCounters::LayoutObjectCounter); | 250 InstanceCounters::decrementCounter(InstanceCounters::LayoutObjectCounter); |
| 249 } | 251 } |
| 250 | 252 |
| 251 bool LayoutObject::isDescendantOf(const LayoutObject* obj) const | 253 bool LayoutObject::isDescendantOf(const LayoutObject* obj) const |
| 252 { | 254 { |
| (...skipping 3402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3655 const blink::LayoutObject* root = object1; | 3657 const blink::LayoutObject* root = object1; |
| 3656 while (root->parent()) | 3658 while (root->parent()) |
| 3657 root = root->parent(); | 3659 root = root->parent(); |
| 3658 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3660 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3659 } else { | 3661 } else { |
| 3660 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); | 3662 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); |
| 3661 } | 3663 } |
| 3662 } | 3664 } |
| 3663 | 3665 |
| 3664 #endif | 3666 #endif |
| OLD | NEW |