| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 if (other.m_inlineStyle) { | 149 if (other.m_inlineStyle) { |
| 150 m_inlineStyle = other.m_inlineStyle->immutableCopyIfNeeded(); | 150 m_inlineStyle = other.m_inlineStyle->immutableCopyIfNeeded(); |
| 151 } | 151 } |
| 152 | 152 |
| 153 for (unsigned i = 0; i < m_arraySize; ++i) | 153 for (unsigned i = 0; i < m_arraySize; ++i) |
| 154 new (&m_attributeArray[i]) Attribute(other.m_attributeVector.at(i)); | 154 new (&m_attributeArray[i]) Attribute(other.m_attributeVector.at(i)); |
| 155 } | 155 } |
| 156 | 156 |
| 157 PassRefPtrWillBeRawPtr<ShareableElementData> ShareableElementData::createWithAtt
ributes(const Vector<Attribute>& attributes) | 157 PassRefPtrWillBeRawPtr<ShareableElementData> ShareableElementData::createWithAtt
ributes(const Vector<Attribute>& attributes) |
| 158 { | 158 { |
| 159 #if ENABLE(OILPAN) | |
| 160 void* slot = Heap::allocate<ElementData>(sizeForShareableElementDataWithAttr
ibuteCount(attributes.size())); | |
| 161 #else | |
| 162 void* slot = WTF::fastMalloc(sizeForShareableElementDataWithAttributeCount(a
ttributes.size())); | 159 void* slot = WTF::fastMalloc(sizeForShareableElementDataWithAttributeCount(a
ttributes.size())); |
| 163 #endif | |
| 164 return adoptRefWillBeNoop(new (slot) ShareableElementData(attributes)); | 160 return adoptRefWillBeNoop(new (slot) ShareableElementData(attributes)); |
| 165 } | 161 } |
| 166 | 162 |
| 167 UniqueElementData::UniqueElementData() | 163 UniqueElementData::UniqueElementData() |
| 168 { | 164 { |
| 169 } | 165 } |
| 170 | 166 |
| 171 UniqueElementData::UniqueElementData(const UniqueElementData& other) | 167 UniqueElementData::UniqueElementData(const UniqueElementData& other) |
| 172 : ElementData(other, true) | 168 : ElementData(other, true) |
| 173 , m_attributeVector(other.m_attributeVector) | 169 , m_attributeVector(other.m_attributeVector) |
| (...skipping 14 matching lines...) Expand all Loading... |
| 188 m_attributeVector.uncheckedAppend(other.m_attributeArray[i]); | 184 m_attributeVector.uncheckedAppend(other.m_attributeArray[i]); |
| 189 } | 185 } |
| 190 | 186 |
| 191 PassRefPtrWillBeRawPtr<UniqueElementData> UniqueElementData::create() | 187 PassRefPtrWillBeRawPtr<UniqueElementData> UniqueElementData::create() |
| 192 { | 188 { |
| 193 return adoptRefWillBeNoop(new UniqueElementData); | 189 return adoptRefWillBeNoop(new UniqueElementData); |
| 194 } | 190 } |
| 195 | 191 |
| 196 PassRefPtrWillBeRawPtr<ShareableElementData> UniqueElementData::makeShareableCop
y() const | 192 PassRefPtrWillBeRawPtr<ShareableElementData> UniqueElementData::makeShareableCop
y() const |
| 197 { | 193 { |
| 198 #if ENABLE(OILPAN) | |
| 199 void* slot = Heap::allocate<ElementData>(sizeForShareableElementDataWithAttr
ibuteCount(m_attributeVector.size())); | |
| 200 #else | |
| 201 void* slot = WTF::fastMalloc(sizeForShareableElementDataWithAttributeCount(m
_attributeVector.size())); | 194 void* slot = WTF::fastMalloc(sizeForShareableElementDataWithAttributeCount(m
_attributeVector.size())); |
| 202 #endif | |
| 203 return adoptRefWillBeNoop(new (slot) ShareableElementData(*this)); | 195 return adoptRefWillBeNoop(new (slot) ShareableElementData(*this)); |
| 204 } | 196 } |
| 205 | 197 |
| 206 void UniqueElementData::traceAfterDispatch(Visitor* visitor) | 198 void UniqueElementData::traceAfterDispatch(Visitor* visitor) |
| 207 { | 199 { |
| 208 ElementData::traceAfterDispatch(visitor); | 200 ElementData::traceAfterDispatch(visitor); |
| 209 } | 201 } |
| 210 | 202 |
| 211 } // namespace blink | 203 } // namespace blink |
| OLD | NEW |