OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 if (other.m_inlineStyle) { | 156 if (other.m_inlineStyle) { |
157 m_inlineStyle = other.m_inlineStyle->immutableCopyIfNeeded(); | 157 m_inlineStyle = other.m_inlineStyle->immutableCopyIfNeeded(); |
158 } | 158 } |
159 | 159 |
160 for (unsigned i = 0; i < m_arraySize; ++i) | 160 for (unsigned i = 0; i < m_arraySize; ++i) |
161 new (&m_attributeArray[i]) Attribute(other.m_attributeVector.at(i)); | 161 new (&m_attributeArray[i]) Attribute(other.m_attributeVector.at(i)); |
162 } | 162 } |
163 | 163 |
164 ShareableElementData* ShareableElementData::createWithAttributes(const Vector<At
tribute>& attributes) | 164 ShareableElementData* ShareableElementData::createWithAttributes(const Vector<At
tribute>& attributes) |
165 { | 165 { |
166 void* slot = Heap::allocate<ElementData>(sizeForShareableElementDataWithAttr
ibuteCount(attributes.size())); | 166 void* slot = ThreadHeap::allocate<ElementData>(sizeForShareableElementDataWi
thAttributeCount(attributes.size())); |
167 return new (slot) ShareableElementData(attributes); | 167 return new (slot) ShareableElementData(attributes); |
168 } | 168 } |
169 | 169 |
170 UniqueElementData::UniqueElementData() | 170 UniqueElementData::UniqueElementData() |
171 { | 171 { |
172 } | 172 } |
173 | 173 |
174 UniqueElementData::UniqueElementData(const UniqueElementData& other) | 174 UniqueElementData::UniqueElementData(const UniqueElementData& other) |
175 : ElementData(other, true) | 175 : ElementData(other, true) |
176 , m_presentationAttributeStyle(other.m_presentationAttributeStyle) | 176 , m_presentationAttributeStyle(other.m_presentationAttributeStyle) |
(...skipping 15 matching lines...) Expand all Loading... |
192 m_attributeVector.uncheckedAppend(other.m_attributeArray[i]); | 192 m_attributeVector.uncheckedAppend(other.m_attributeArray[i]); |
193 } | 193 } |
194 | 194 |
195 UniqueElementData* UniqueElementData::create() | 195 UniqueElementData* UniqueElementData::create() |
196 { | 196 { |
197 return new UniqueElementData; | 197 return new UniqueElementData; |
198 } | 198 } |
199 | 199 |
200 ShareableElementData* UniqueElementData::makeShareableCopy() const | 200 ShareableElementData* UniqueElementData::makeShareableCopy() const |
201 { | 201 { |
202 void* slot = Heap::allocate<ElementData>(sizeForShareableElementDataWithAttr
ibuteCount(m_attributeVector.size())); | 202 void* slot = ThreadHeap::allocate<ElementData>(sizeForShareableElementDataWi
thAttributeCount(m_attributeVector.size())); |
203 return new (slot) ShareableElementData(*this); | 203 return new (slot) ShareableElementData(*this); |
204 } | 204 } |
205 | 205 |
206 DEFINE_TRACE_AFTER_DISPATCH(UniqueElementData) | 206 DEFINE_TRACE_AFTER_DISPATCH(UniqueElementData) |
207 { | 207 { |
208 visitor->trace(m_presentationAttributeStyle); | 208 visitor->trace(m_presentationAttributeStyle); |
209 ElementData::traceAfterDispatch(visitor); | 209 ElementData::traceAfterDispatch(visitor); |
210 } | 210 } |
211 | 211 |
212 } // namespace blink | 212 } // namespace blink |
OLD | NEW |