Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGTreeScopeResources.h

Issue 2714473002: Move LayoutSVGResourceContainer registration to SVGTreeScopeResources (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698