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

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

Issue 2814603002: Move LayoutObject to satellite NodeLayoutData that hangs from a Node. (Closed)
Patch Set: Question 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) 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 296
297 Node::~Node() { 297 Node::~Node() {
298 // With Oilpan, the rare data finalizer also asserts for 298 // With Oilpan, the rare data finalizer also asserts for
299 // this condition (we cannot directly access it here.) 299 // this condition (we cannot directly access it here.)
300 CHECK(HasRareData() || !GetLayoutObject()); 300 CHECK(HasRareData() || !GetLayoutObject());
301 InstanceCounters::DecrementNodeCounter(); 301 InstanceCounters::DecrementNodeCounter();
302 } 302 }
303 303
304 NodeRareData* Node::RareData() const { 304 NodeRareData* Node::RareData() const {
305 SECURITY_DCHECK(HasRareData()); 305 SECURITY_DCHECK(HasRareData());
306 return static_cast<NodeRareData*>(data_.rare_data_); 306 return NodeRareData::Create();
307 } 307 }
308 308
309 NodeRareData& Node::EnsureRareData() { 309 NodeRareData& Node::EnsureRareData() {
310 if (HasRareData()) 310 if (HasRareData())
311 return *RareData(); 311 return *RareData();
312 312
313 if (IsElementNode()) 313 if (IsElementNode()) {
314 data_.rare_data_ = ElementRareData::Create(data_.layout_object_); 314 data_.rare_data_ = ElementRareData::Create();
315 else 315 } else {
316 data_.rare_data_ = NodeRareData::Create(data_.layout_object_); 316 data_.rare_data_ = NodeRareData::Create();
317 }
317 318
318 DCHECK(data_.rare_data_); 319 DCHECK(data_.rare_data_);
319 SetFlag(kHasRareDataFlag); 320 SetFlag(kHasRareDataFlag);
320 ScriptWrappableVisitor::WriteBarrier(this, RareData()); 321 ScriptWrappableVisitor::WriteBarrier(this, RareData());
321 return *RareData(); 322 return *RareData();
322 } 323 }
323 324
324 Node* Node::ToNode() { 325 Node* Node::ToNode() {
325 return this; 326 return this;
326 } 327 }
(...skipping 2204 matching lines...) Expand 10 before | Expand all | Expand 10 after
2531 if (node) { 2532 if (node) {
2532 std::stringstream stream; 2533 std::stringstream stream;
2533 node->PrintNodePathTo(stream); 2534 node->PrintNodePathTo(stream);
2534 LOG(INFO) << stream.str(); 2535 LOG(INFO) << stream.str();
2535 } else { 2536 } else {
2536 LOG(INFO) << "Cannot showNodePath for <null>"; 2537 LOG(INFO) << "Cannot showNodePath for <null>";
2537 } 2538 }
2538 } 2539 }
2539 2540
2540 #endif 2541 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698