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

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

Issue 1962953002: Storage of ComputedStyle separate from LayoutObject. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Elliott's comments Created 4 years, 4 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) 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 r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 #endif 260 #endif
261 InstanceCounters::incrementCounter(InstanceCounters::NodeCounter); 261 InstanceCounters::incrementCounter(InstanceCounters::NodeCounter);
262 } 262 }
263 263
264 Node::~Node() 264 Node::~Node()
265 { 265 {
266 // With Oilpan, the rare data finalizer also asserts for 266 // With Oilpan, the rare data finalizer also asserts for
267 // this condition (we cannot directly access it here.) 267 // this condition (we cannot directly access it here.)
268 RELEASE_ASSERT(hasRareData() || !layoutObject()); 268 RELEASE_ASSERT(hasRareData() || !layoutObject());
269 InstanceCounters::decrementCounter(InstanceCounters::NodeCounter); 269 InstanceCounters::decrementCounter(InstanceCounters::NodeCounter);
270 if (!hasRareData() && m_data.m_computedStyle)
271 m_data.m_computedStyle->deref();
270 } 272 }
271 273
272 NodeRareData* Node::rareData() const 274 NodeRareData* Node::rareData() const
273 { 275 {
274 ASSERT_WITH_SECURITY_IMPLICATION(hasRareData()); 276 ASSERT_WITH_SECURITY_IMPLICATION(hasRareData());
275 return static_cast<NodeRareData*>(m_data.m_rareData); 277 return static_cast<NodeRareData*>(m_data.m_rareData);
276 } 278 }
277 279
278 NodeRareData& Node::ensureRareData() 280 NodeRareData& Node::ensureRareData()
279 { 281 {
280 if (hasRareData()) 282 if (hasRareData())
281 return *rareData(); 283 return *rareData();
282 284
283 if (isElementNode()) 285 if (isElementNode())
284 m_data.m_rareData = ElementRareData::create(m_data.m_layoutObject); 286 m_data.m_rareData = ElementRareData::create(layoutObject());
285 else 287 else
286 m_data.m_rareData = NodeRareData::create(m_data.m_layoutObject); 288 m_data.m_rareData = NodeRareData::create(layoutObject());
287 289
288 DCHECK(m_data.m_rareData); 290 DCHECK(m_data.m_rareData);
289 291
290 setFlag(HasRareDataFlag); 292 setFlag(HasRareDataFlag);
291 return *rareData(); 293 return *rareData();
292 } 294 }
293 295
294 Node* Node::toNode() 296 Node* Node::toNode()
295 { 297 {
296 return this; 298 return this;
(...skipping 2113 matching lines...) Expand 10 before | Expand all | Expand 10 after
2410 2412
2411 void showNodePath(const blink::Node* node) 2413 void showNodePath(const blink::Node* node)
2412 { 2414 {
2413 if (node) 2415 if (node)
2414 node->showNodePathForThis(); 2416 node->showNodePathForThis();
2415 else 2417 else
2416 fprintf(stderr, "Cannot showNodePath for (nil)\n"); 2418 fprintf(stderr, "Cannot showNodePath for (nil)\n");
2417 } 2419 }
2418 2420
2419 #endif 2421 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.h ('k') | third_party/WebKit/Source/core/dom/NodeComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698