| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SVGTreeScopeResources_h | 5 #ifndef SVGTreeScopeResources_h |
| 6 #define SVGTreeScopeResources_h | 6 #define SVGTreeScopeResources_h |
| 7 | 7 |
| 8 #include "platform/heap/Handle.h" | 8 #include "platform/heap/Handle.h" |
| 9 #include "wtf/Forward.h" | 9 #include "wtf/Forward.h" |
| 10 #include "wtf/HashMap.h" | 10 #include "wtf/HashMap.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 class SVGTreeScopeResources | 23 class SVGTreeScopeResources |
| 24 : public GarbageCollectedFinalized<SVGTreeScopeResources> { | 24 : public GarbageCollectedFinalized<SVGTreeScopeResources> { |
| 25 WTF_MAKE_NONCOPYABLE(SVGTreeScopeResources); | 25 WTF_MAKE_NONCOPYABLE(SVGTreeScopeResources); |
| 26 | 26 |
| 27 public: | 27 public: |
| 28 typedef HeapHashSet<Member<Element>> SVGPendingElements; | 28 typedef HeapHashSet<Member<Element>> SVGPendingElements; |
| 29 | 29 |
| 30 explicit SVGTreeScopeResources(TreeScope*); | 30 explicit SVGTreeScopeResources(TreeScope*); |
| 31 ~SVGTreeScopeResources(); | 31 ~SVGTreeScopeResources(); |
| 32 | 32 |
| 33 void addResource(const AtomicString& id, LayoutSVGResourceContainer*); | 33 void updateResource(const AtomicString& id, LayoutSVGResourceContainer*); |
| 34 void removeResource(const AtomicString& id); | 34 void removeResource(const AtomicString& id); |
| 35 LayoutSVGResourceContainer* resourceById(const AtomicString& id) const; | 35 LayoutSVGResourceContainer* resourceById(const AtomicString& id) const; |
| 36 | 36 |
| 37 // Pending resources are such which are referenced by any object in the SVG | 37 // Pending resources are such which are referenced by any object in the SVG |
| 38 // document, but do NOT exist yet. For instance, dynamically built gradients | 38 // document, but do NOT exist yet. For instance, dynamically built gradients |
| 39 // / patterns / clippers... | 39 // / patterns / clippers... |
| 40 void addPendingResource(const AtomicString& id, Element*); | 40 void addPendingResource(const AtomicString& id, Element*); |
| 41 bool hasPendingResource(const AtomicString& id) const; | 41 bool hasPendingResource(const AtomicString& id) const; |
| 42 bool isElementPendingResources(Element*) const; | 42 bool isElementPendingResources(Element*) const; |
| 43 bool isElementPendingResource(Element*, const AtomicString& id) const; | 43 bool isElementPendingResource(Element*, const AtomicString& id) const; |
| 44 void clearHasPendingResourcesIfPossible(Element*); | 44 void clearHasPendingResourcesIfPossible(Element*); |
| 45 void removeElementFromPendingResources(Element*); | 45 void removeElementFromPendingResources(Element*); |
| 46 SVGPendingElements* removePendingResource(const AtomicString& id); | 46 SVGPendingElements* removePendingResource(const AtomicString& id); |
| 47 | 47 |
| 48 DECLARE_TRACE(); | 48 DECLARE_TRACE(); |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 HashMap<AtomicString, LayoutSVGResourceContainer*> m_resources; | 51 HashMap<AtomicString, LayoutSVGResourceContainer*> m_resources; |
| 52 // Resources that are pending. | 52 // Resources that are pending. |
| 53 HeapHashMap<AtomicString, Member<SVGPendingElements>> m_pendingResources; | 53 HeapHashMap<AtomicString, Member<SVGPendingElements>> m_pendingResources; |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 } // namespace blink | 56 } // namespace blink |
| 57 | 57 |
| 58 #endif // SVGTreeScopeResources_h | 58 #endif // SVGTreeScopeResources_h |
| OLD | NEW |