OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2007 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> | 4 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> |
5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
176 | 176 |
177 if (RenderSVGResourceMasker* masker = resources->masker()) | 177 if (RenderSVGResourceMasker* masker = resources->masker()) |
178 masker->removeClientFromCache(object); | 178 masker->removeClientFromCache(object); |
179 | 179 |
180 if (RenderSVGResourceClipper* clipper = resources->clipper()) | 180 if (RenderSVGResourceClipper* clipper = resources->clipper()) |
181 clipper->removeClientFromCache(object); | 181 clipper->removeClientFromCache(object); |
182 } | 182 } |
183 | 183 |
184 if (!object->node() || !object->node()->isSVGElement()) | 184 if (!object->node() || !object->node()->isSVGElement()) |
185 return; | 185 return; |
186 HashSet<SVGElement*>* dependencies = object->document().accessSVGExtensions( ).setOfElementsReferencingTarget(toSVGElement(object->node())); | 186 WeakSVGElementSet* dependencies = object->document().accessSVGExtensions().s etOfElementsReferencingTarget(toSVGElement(object->node())); |
187 if (!dependencies) | 187 if (!dependencies) |
188 return; | 188 return; |
189 | 189 |
190 // We allow cycles in SVGDocumentExtensions reference sets in order to avoid expensive | 190 // We allow cycles in SVGDocumentExtensions reference sets in order to avoid expensive |
191 // reference graph adjustments on changes, so we need to break possible cycl es here. | 191 // reference graph adjustments on changes, so we need to break possible cycl es here. |
192 DEFINE_STATIC_LOCAL(HashSet<SVGElement*>, invalidatingDependencies, ()); | 192 // This strong reference is safe, as it is guaranteed that this set will be emptied |
193 // at the end of recursion. | |
194 typedef WillBeHeapHashSet<Member<SVGElement> > SVGElementSet; | |
haraken
2014/06/09 09:33:58
This should be WillBeHeapHashSet<RawPtrWillBeMembe
| |
195 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<SVGElementSet>, invalidatingDepen dencies, (adoptPtrWillBeNoop(new SVGElementSet))); | |
193 | 196 |
194 HashSet<SVGElement*>::iterator end = dependencies->end(); | 197 WeakSVGElementSet::iterator end = dependencies->end(); |
195 for (HashSet<SVGElement*>::iterator it = dependencies->begin(); it != end; + +it) { | 198 for (WeakSVGElementSet::iterator it = dependencies->begin(); it != end; ++it ) { |
196 if (RenderObject* renderer = (*it)->renderer()) { | 199 if (RenderObject* renderer = (*it)->renderer()) { |
197 if (UNLIKELY(!invalidatingDependencies.add(*it).isNewEntry)) { | 200 if (UNLIKELY(!invalidatingDependencies->add(*it).isNewEntry)) { |
198 // Reference cycle: we are in process of invalidating this depen dant. | 201 // Reference cycle: we are in process of invalidating this depen dant. |
199 continue; | 202 continue; |
200 } | 203 } |
201 | 204 |
202 RenderSVGResource::markForLayoutAndParentResourceInvalidation(render er, needsLayout); | 205 RenderSVGResource::markForLayoutAndParentResourceInvalidation(render er, needsLayout); |
203 invalidatingDependencies.remove(*it); | 206 invalidatingDependencies->remove(*it); |
204 } | 207 } |
205 } | 208 } |
206 } | 209 } |
207 | 210 |
208 void RenderSVGResource::markForLayoutAndParentResourceInvalidation(RenderObject* object, bool needsLayout) | 211 void RenderSVGResource::markForLayoutAndParentResourceInvalidation(RenderObject* object, bool needsLayout) |
209 { | 212 { |
210 ASSERT(object); | 213 ASSERT(object); |
211 ASSERT(object->node()); | 214 ASSERT(object->node()); |
212 | 215 |
213 if (needsLayout && !object->documentBeingDestroyed()) | 216 if (needsLayout && !object->documentBeingDestroyed()) |
(...skipping 10 matching lines...) Expand all Loading... | |
224 // This will process the rest of the ancestors. | 227 // This will process the rest of the ancestors. |
225 toRenderSVGResourceContainer(current)->removeAllClientsFromCache(); | 228 toRenderSVGResourceContainer(current)->removeAllClientsFromCache(); |
226 break; | 229 break; |
227 } | 230 } |
228 | 231 |
229 current = current->parent(); | 232 current = current->parent(); |
230 } | 233 } |
231 } | 234 } |
232 | 235 |
233 } | 236 } |
OLD | NEW |