Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef SVGTreeScopeResources_h | |
| 6 #define SVGTreeScopeResources_h | |
| 7 | |
| 8 #include "platform/heap/Handle.h" | |
| 9 #include "wtf/Forward.h" | |
| 10 #include "wtf/HashMap.h" | |
| 11 #include "wtf/HashSet.h" | |
| 12 #include "wtf/text/AtomicStringHash.h" | |
| 13 | |
| 14 namespace blink { | |
| 15 | |
| 16 class Element; | |
| 17 class TreeScope; | |
| 18 class LayoutSVGResourceContainer; | |
| 19 | |
| 20 class SVGTreeScopeResources | |
|
pdr.
2017/01/23 04:34:12
Can you add a very short comment here describing t
fs
2017/01/23 11:18:24
Done.
| |
| 21 : public GarbageCollectedFinalized<SVGTreeScopeResources> { | |
| 22 WTF_MAKE_NONCOPYABLE(SVGTreeScopeResources); | |
| 23 | |
| 24 public: | |
| 25 typedef HeapHashSet<Member<Element>> SVGPendingElements; | |
| 26 | |
| 27 explicit SVGTreeScopeResources(TreeScope*); | |
| 28 ~SVGTreeScopeResources(); | |
| 29 | |
| 30 void addResource(const AtomicString& id, LayoutSVGResourceContainer*); | |
| 31 void removeResource(const AtomicString& id); | |
| 32 LayoutSVGResourceContainer* resourceById(const AtomicString& id) const; | |
| 33 | |
| 34 // Pending resources are such which are referenced by any object in the SVG | |
| 35 // document, but do NOT exist yet. For instance, dynamically built gradients | |
| 36 // / patterns / clippers... | |
| 37 void addPendingResource(const AtomicString& id, Element*); | |
| 38 bool hasPendingResource(const AtomicString& id) const; | |
| 39 bool isElementPendingResources(Element*) const; | |
| 40 bool isElementPendingResource(Element*, const AtomicString& id) const; | |
| 41 void clearHasPendingResourcesIfPossible(Element*); | |
| 42 void removeElementFromPendingResources(Element*); | |
| 43 SVGPendingElements* removePendingResource(const AtomicString& id); | |
| 44 | |
| 45 DECLARE_TRACE(); | |
| 46 | |
| 47 private: | |
| 48 HashMap<AtomicString, LayoutSVGResourceContainer*> m_resources; | |
| 49 // Resources that are pending. | |
| 50 HeapHashMap<AtomicString, Member<SVGPendingElements>> m_pendingResources; | |
| 51 }; | |
| 52 | |
| 53 } // namespace blink | |
| 54 | |
| 55 #endif // SVGTreeScopeResources_h | |
| OLD | NEW |