OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 78 |
79 HashSet<RenderSVGResourceContainer*>::iterator end = resourceSet.end(); | 79 HashSet<RenderSVGResourceContainer*>::iterator end = resourceSet.end(); |
80 for (HashSet<RenderSVGResourceContainer*>::iterator it = resourceSet.begin()
; it != end; ++it) | 80 for (HashSet<RenderSVGResourceContainer*>::iterator it = resourceSet.begin()
; it != end; ++it) |
81 (*it)->removeClient(object); | 81 (*it)->removeClient(object); |
82 } | 82 } |
83 | 83 |
84 static inline SVGResourcesCache* resourcesCacheFromRenderObject(const RenderObje
ct* renderer) | 84 static inline SVGResourcesCache* resourcesCacheFromRenderObject(const RenderObje
ct* renderer) |
85 { | 85 { |
86 Document& document = renderer->document(); | 86 Document& document = renderer->document(); |
87 | 87 |
88 SVGDocumentExtensions* extensions = document.accessSVGExtensions(); | 88 SVGDocumentExtensions& extensions = document.accessSVGExtensions(); |
89 ASSERT(extensions); | 89 SVGResourcesCache* cache = extensions.resourcesCache(); |
90 | |
91 SVGResourcesCache* cache = extensions->resourcesCache(); | |
92 ASSERT(cache); | 90 ASSERT(cache); |
93 | 91 |
94 return cache; | 92 return cache; |
95 } | 93 } |
96 | 94 |
97 SVGResources* SVGResourcesCache::cachedResourcesForRenderObject(const RenderObje
ct* renderer) | 95 SVGResources* SVGResourcesCache::cachedResourcesForRenderObject(const RenderObje
ct* renderer) |
98 { | 96 { |
99 ASSERT(renderer); | 97 ASSERT(renderer); |
100 return resourcesCacheFromRenderObject(renderer)->m_cache.get(renderer); | 98 return resourcesCacheFromRenderObject(renderer)->m_cache.get(renderer); |
101 } | 99 } |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 // The resource itself may have clients, that need to be notified. | 185 // The resource itself may have clients, that need to be notified. |
188 cache->removeResourcesFromRenderObject(resource); | 186 cache->removeResourcesFromRenderObject(resource); |
189 | 187 |
190 CacheMap::iterator end = cache->m_cache.end(); | 188 CacheMap::iterator end = cache->m_cache.end(); |
191 for (CacheMap::iterator it = cache->m_cache.begin(); it != end; ++it) { | 189 for (CacheMap::iterator it = cache->m_cache.begin(); it != end; ++it) { |
192 it->value->resourceDestroyed(resource); | 190 it->value->resourceDestroyed(resource); |
193 | 191 |
194 // Mark users of destroyed resources as pending resolution based on the
id of the old resource. | 192 // Mark users of destroyed resources as pending resolution based on the
id of the old resource. |
195 Element* resourceElement = resource->element(); | 193 Element* resourceElement = resource->element(); |
196 Element* clientElement = toElement(it->key->node()); | 194 Element* clientElement = toElement(it->key->node()); |
197 SVGDocumentExtensions* extensions = clientElement->document().accessSVGE
xtensions(); | 195 SVGDocumentExtensions& extensions = clientElement->document().accessSVGE
xtensions(); |
198 | 196 |
199 extensions->addPendingResource(resourceElement->fastGetAttribute(HTMLNam
es::idAttr), clientElement); | 197 extensions.addPendingResource(resourceElement->fastGetAttribute(HTMLName
s::idAttr), clientElement); |
200 } | 198 } |
201 } | 199 } |
202 | 200 |
203 } | 201 } |
OLD | NEW |