| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 private: | 94 private: |
| 95 friend class Element; | 95 friend class Element; |
| 96 friend class ShareableElementData; | 96 friend class ShareableElementData; |
| 97 friend class UniqueElementData; | 97 friend class UniqueElementData; |
| 98 friend class SVGElement; | 98 friend class SVGElement; |
| 99 | 99 |
| 100 UniqueElementData* makeUniqueCopy() const; | 100 UniqueElementData* makeUniqueCopy() const; |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 #define DEFINE_ELEMENT_DATA_TYPE_CASTS(thisType, pointerPredicate, referencePre
dicate) \ | 103 #define DEFINE_ELEMENT_DATA_TYPE_CASTS(thisType, pointerPredicate, referencePre
dicate) \ |
| 104 template<typename T> inline thisType* to##thisType(const RefPtr<T>& data) {
return to##thisType(data.get()); } \ | |
| 105 DEFINE_TYPE_CASTS(thisType, ElementData, data, pointerPredicate, referencePr
edicate) | 104 DEFINE_TYPE_CASTS(thisType, ElementData, data, pointerPredicate, referencePr
edicate) |
| 106 | 105 |
| 107 #if COMPILER(MSVC) | 106 #if COMPILER(MSVC) |
| 108 #pragma warning(push) | 107 #pragma warning(push) |
| 109 #pragma warning(disable: 4200) // Disable "zero-sized array in struct/union" war
ning | 108 #pragma warning(disable: 4200) // Disable "zero-sized array in struct/union" war
ning |
| 110 #endif | 109 #endif |
| 111 | 110 |
| 112 // SharableElementData is managed by ElementDataCache and is produced by | 111 // SharableElementData is managed by ElementDataCache and is produced by |
| 113 // the parser during page load for elements that have identical attributes. This | 112 // the parser during page load for elements that have identical attributes. This |
| 114 // is a memory optimization since it's very common for many elements to have | 113 // is a memory optimization since it's very common for many elements to have |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 } | 198 } |
| 200 | 199 |
| 201 inline MutableAttributeCollection UniqueElementData::attributes() | 200 inline MutableAttributeCollection UniqueElementData::attributes() |
| 202 { | 201 { |
| 203 return MutableAttributeCollection(m_attributeVector); | 202 return MutableAttributeCollection(m_attributeVector); |
| 204 } | 203 } |
| 205 | 204 |
| 206 } // namespace blink | 205 } // namespace blink |
| 207 | 206 |
| 208 #endif // ElementData_h | 207 #endif // ElementData_h |
| OLD | NEW |