| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012, 2013 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2012, 2013 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 * | 24 * |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #ifndef ElementDataCache_h | 27 #ifndef ElementDataCache_h |
| 28 #define ElementDataCache_h | 28 #define ElementDataCache_h |
| 29 | 29 |
| 30 #include "platform/heap/Handle.h" | 30 #include "platform/heap/Handle.h" |
| 31 #include "wtf/HashMap.h" | 31 #include "wtf/HashMap.h" |
| 32 #include "wtf/PassOwnPtr.h" | |
| 33 #include "wtf/PassRefPtr.h" | |
| 34 #include "wtf/RefPtr.h" | |
| 35 #include "wtf/Vector.h" | 32 #include "wtf/Vector.h" |
| 36 #include "wtf/text/StringHash.h" | 33 #include "wtf/text/StringHash.h" |
| 37 | 34 |
| 38 namespace blink { | 35 namespace blink { |
| 39 | 36 |
| 40 class Attribute; | 37 class Attribute; |
| 41 class ShareableElementData; | 38 class ShareableElementData; |
| 42 | 39 |
| 43 class ElementDataCache final : public GarbageCollected<ElementDataCache> { | 40 class ElementDataCache final : public GarbageCollected<ElementDataCache> { |
| 44 public: | 41 public: |
| 45 static RawPtr<ElementDataCache> create() { return new ElementDataCache; } | 42 static RawPtr<ElementDataCache> create() { return new ElementDataCache; } |
| 46 | 43 |
| 47 RawPtr<ShareableElementData> cachedShareableElementDataWithAttributes(const
Vector<Attribute>&); | 44 RawPtr<ShareableElementData> cachedShareableElementDataWithAttributes(const
Vector<Attribute>&); |
| 48 | 45 |
| 49 DECLARE_TRACE(); | 46 DECLARE_TRACE(); |
| 50 | 47 |
| 51 private: | 48 private: |
| 52 ElementDataCache(); | 49 ElementDataCache(); |
| 53 | 50 |
| 54 typedef HeapHashMap<unsigned, Member<ShareableElementData>, AlreadyHashed> S
hareableElementDataCache; | 51 typedef HeapHashMap<unsigned, Member<ShareableElementData>, AlreadyHashed> S
hareableElementDataCache; |
| 55 ShareableElementDataCache m_shareableElementDataCache; | 52 ShareableElementDataCache m_shareableElementDataCache; |
| 56 }; | 53 }; |
| 57 | 54 |
| 58 } // namespace blink | 55 } // namespace blink |
| 59 | 56 |
| 60 #endif | 57 #endif |
| OLD | NEW |