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

Side by Side Diff: third_party/WebKit/Source/core/dom/Node.cpp

Issue 2393353003: Fix performance issue in InstanceCounters for DOM nodes (Closed)
Patch Set: Address on reviews Created 4 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/inspector/InstanceCounters.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 * rights reserved. 6 * rights reserved.
7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * 10 *
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 Node::Node(TreeScope* treeScope, ConstructionType type) 262 Node::Node(TreeScope* treeScope, ConstructionType type)
263 : m_nodeFlags(type), 263 : m_nodeFlags(type),
264 m_parentOrShadowHostNode(nullptr), 264 m_parentOrShadowHostNode(nullptr),
265 m_treeScope(treeScope), 265 m_treeScope(treeScope),
266 m_previous(nullptr), 266 m_previous(nullptr),
267 m_next(nullptr) { 267 m_next(nullptr) {
268 DCHECK(m_treeScope || type == CreateDocument || type == CreateShadowRoot); 268 DCHECK(m_treeScope || type == CreateDocument || type == CreateShadowRoot);
269 #if !defined(NDEBUG) || (defined(DUMP_NODE_STATISTICS) && DUMP_NODE_STATISTICS) 269 #if !defined(NDEBUG) || (defined(DUMP_NODE_STATISTICS) && DUMP_NODE_STATISTICS)
270 trackForDebugging(); 270 trackForDebugging();
271 #endif 271 #endif
272 InstanceCounters::incrementCounter(InstanceCounters::NodeCounter); 272 InstanceCounters::incrementNodeCounter();
273 } 273 }
274 274
275 Node::~Node() { 275 Node::~Node() {
276 // With Oilpan, the rare data finalizer also asserts for 276 // With Oilpan, the rare data finalizer also asserts for
277 // this condition (we cannot directly access it here.) 277 // this condition (we cannot directly access it here.)
278 RELEASE_ASSERT(hasRareData() || !layoutObject()); 278 RELEASE_ASSERT(hasRareData() || !layoutObject());
279 InstanceCounters::decrementCounter(InstanceCounters::NodeCounter); 279 InstanceCounters::decrementNodeCounter();
280 } 280 }
281 281
282 NodeRareData* Node::rareData() const { 282 NodeRareData* Node::rareData() const {
283 SECURITY_DCHECK(hasRareData()); 283 SECURITY_DCHECK(hasRareData());
284 return static_cast<NodeRareData*>(m_data.m_rareData); 284 return static_cast<NodeRareData*>(m_data.m_rareData);
285 } 285 }
286 286
287 NodeRareData& Node::ensureRareData() { 287 NodeRareData& Node::ensureRareData() {
288 if (hasRareData()) 288 if (hasRareData())
289 return *rareData(); 289 return *rareData();
(...skipping 2175 matching lines...) Expand 10 before | Expand all | Expand 10 after
2465 if (node) { 2465 if (node) {
2466 std::stringstream stream; 2466 std::stringstream stream;
2467 node->printNodePathTo(stream); 2467 node->printNodePathTo(stream);
2468 LOG(INFO) << stream.str(); 2468 LOG(INFO) << stream.str();
2469 } else { 2469 } else {
2470 LOG(INFO) << "Cannot showNodePath for <null>"; 2470 LOG(INFO) << "Cannot showNodePath for <null>";
2471 } 2471 }
2472 } 2472 }
2473 2473
2474 #endif 2474 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/inspector/InstanceCounters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698