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

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

Issue 2814603002: Move LayoutObject to satellite NodeLayoutData that hangs from a Node. (Closed)
Patch Set: esprehn comments 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/NodeRareData.h ('k') | no next file » | 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 else 70 else
71 TraceWrappersAfterDispatch(visitor); 71 TraceWrappersAfterDispatch(visitor);
72 } 72 }
73 73
74 DEFINE_TRACE_WRAPPERS_AFTER_DISPATCH(NodeRareData) { 74 DEFINE_TRACE_WRAPPERS_AFTER_DISPATCH(NodeRareData) {
75 visitor->TraceWrappersWithManualWriteBarrier(node_lists_); 75 visitor->TraceWrappersWithManualWriteBarrier(node_lists_);
76 visitor->TraceWrappersWithManualWriteBarrier(mutation_observer_data_); 76 visitor->TraceWrappersWithManualWriteBarrier(mutation_observer_data_);
77 } 77 }
78 78
79 void NodeRareData::FinalizeGarbageCollectedObject() { 79 void NodeRareData::FinalizeGarbageCollectedObject() {
80 CHECK(!GetLayoutObject());
81 if (is_element_rare_data_) 80 if (is_element_rare_data_)
82 static_cast<ElementRareData*>(this)->~ElementRareData(); 81 static_cast<ElementRareData*>(this)->~ElementRareData();
83 else 82 else
84 this->~NodeRareData(); 83 this->~NodeRareData();
85 } 84 }
86 85
87 void NodeRareData::IncrementConnectedSubframeCount() { 86 void NodeRareData::IncrementConnectedSubframeCount() {
88 SECURITY_CHECK((connected_frame_count_ + 1) <= Page::kMaxNumberOfFrames); 87 SECURITY_CHECK((connected_frame_count_ + 1) <= Page::kMaxNumberOfFrames);
89 ++connected_frame_count_; 88 ++connected_frame_count_;
90 } 89 }
91 90
92 // Ensure the 10 bits reserved for the m_connectedFrameCount cannot overflow 91 // Ensure the 10 bits reserved for the m_connectedFrameCount cannot overflow
93 static_assert(Page::kMaxNumberOfFrames < 92 static_assert(Page::kMaxNumberOfFrames <
94 (1 << NodeRareData::kConnectedFrameCountBits), 93 (1 << NodeRareData::kConnectedFrameCountBits),
95 "Frame limit should fit in rare data count"); 94 "Frame limit should fit in rare data count");
96 95
97 } // namespace blink 96 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/NodeRareData.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698