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

Unified Diff: third_party/WebKit/Source/core/svg/SVGTreeScopeResources.h

Issue 2722543002: Improve handling of duplicate id's for SVG resources (Closed)
Patch Set: Rebase Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/svg/SVGTreeScopeResources.h
diff --git a/third_party/WebKit/Source/core/svg/SVGTreeScopeResources.h b/third_party/WebKit/Source/core/svg/SVGTreeScopeResources.h
index 8b9c003a6db7dcd6b9f7dd57487c347fe728d987..ccbfb7d517f6a7cf2bc67be403253092f4a54dec 100644
--- a/third_party/WebKit/Source/core/svg/SVGTreeScopeResources.h
+++ b/third_party/WebKit/Source/core/svg/SVGTreeScopeResources.h
@@ -29,7 +29,10 @@ class SVGTreeScopeResources
~SVGTreeScopeResources();
void updateResource(const AtomicString& id, LayoutSVGResourceContainer*);
- void removeResource(const AtomicString& id);
+ void updateResource(const AtomicString& oldId,
+ const AtomicString& newId,
+ LayoutSVGResourceContainer*);
+ void removeResource(const AtomicString& id, LayoutSVGResourceContainer*);
LayoutSVGResourceContainer* resourceById(const AtomicString& id) const;
// Pending resources are such which are referenced by any object in the SVG
@@ -46,10 +49,16 @@ class SVGTreeScopeResources
void clearHasPendingResourcesIfPossible(Element&);
using SVGPendingElements = HeapHashSet<Member<Element>>;
+ using ResourceMap = HashMap<AtomicString, LayoutSVGResourceContainer*>;
- HashMap<AtomicString, LayoutSVGResourceContainer*> m_resources;
+ void registerResource(const AtomicString& id, LayoutSVGResourceContainer*);
+ void unregisterResource(ResourceMap::iterator);
+ void notifyPendingClients(const AtomicString& id);
+
+ ResourceMap m_resources;
// Resources that are pending.
HeapHashMap<AtomicString, Member<SVGPendingElements>> m_pendingResources;
+ Member<TreeScope> m_treeScope;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698