| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2014 Apple Inc. All rights reserved. | 3 * Copyright (C) 2014 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 static ShareableElementData* createWithAttributes(const Vector<Attribute>&); | 128 static ShareableElementData* createWithAttributes(const Vector<Attribute>&); |
| 129 | 129 |
| 130 explicit ShareableElementData(const Vector<Attribute>&); | 130 explicit ShareableElementData(const Vector<Attribute>&); |
| 131 explicit ShareableElementData(const UniqueElementData&); | 131 explicit ShareableElementData(const UniqueElementData&); |
| 132 ~ShareableElementData(); | 132 ~ShareableElementData(); |
| 133 | 133 |
| 134 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { ElementData::traceAfterDispatch(visit
or); } | 134 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { ElementData::traceAfterDispatch(visit
or); } |
| 135 | 135 |
| 136 // Add support for placement new as ShareableElementData is not allocated | 136 // Add support for placement new as ShareableElementData is not allocated |
| 137 // with a fixed size. Instead the allocated memory size is computed based on | 137 // with a fixed size. Instead the allocated memory size is computed based on |
| 138 // the number of attributes. This requires us to use ThreadHeap::allocate di
rectly | 138 // the number of attributes. This requires us to use Heap::allocate directly |
| 139 // with the computed size and subsequently call placement new with the | 139 // with the computed size and subsequently call placement new with the |
| 140 // allocated memory address. | 140 // allocated memory address. |
| 141 void* operator new(std::size_t, void* location) | 141 void* operator new(std::size_t, void* location) |
| 142 { | 142 { |
| 143 return location; | 143 return location; |
| 144 } | 144 } |
| 145 | 145 |
| 146 AttributeCollection attributes() const; | 146 AttributeCollection attributes() const; |
| 147 | 147 |
| 148 Attribute m_attributeArray[0]; | 148 Attribute m_attributeArray[0]; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 } | 218 } |
| 219 | 219 |
| 220 inline MutableAttributeCollection UniqueElementData::attributes() | 220 inline MutableAttributeCollection UniqueElementData::attributes() |
| 221 { | 221 { |
| 222 return MutableAttributeCollection(m_attributeVector); | 222 return MutableAttributeCollection(m_attributeVector); |
| 223 } | 223 } |
| 224 | 224 |
| 225 } // namespace blink | 225 } // namespace blink |
| 226 | 226 |
| 227 #endif // ElementData_h | 227 #endif // ElementData_h |
| OLD | NEW |