| 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 SVGElementSet* dependencies = | 256 SVGElementSet* dependencies = |
| 257 toSVGElement(object->node())->setOfIncomingReferences(); | 257 toSVGElement(object->node())->setOfIncomingReferences(); |
| 258 if (!dependencies) | 258 if (!dependencies) |
| 259 return; | 259 return; |
| 260 | 260 |
| 261 // We allow cycles in SVGDocumentExtensions reference sets in order to avoid | 261 // We allow cycles in SVGDocumentExtensions reference sets in order to avoid |
| 262 // expensive reference graph adjustments on changes, so we need to break | 262 // expensive reference graph adjustments on changes, so we need to break |
| 263 // possible cycles here. | 263 // possible cycles here. |
| 264 // This strong reference is safe, as it is guaranteed that this set will be | 264 // This strong reference is safe, as it is guaranteed that this set will be |
| 265 // emptied at the end of recursion. | 265 // emptied at the end of recursion. |
| 266 ALLOW_UNSAFE_SINGLETON() |
| 266 DEFINE_STATIC_LOCAL(SVGElementSet, invalidatingDependencies, | 267 DEFINE_STATIC_LOCAL(SVGElementSet, invalidatingDependencies, |
| 267 (new SVGElementSet)); | 268 (new SVGElementSet)); |
| 268 | 269 |
| 269 for (SVGElement* element : *dependencies) { | 270 for (SVGElement* element : *dependencies) { |
| 270 if (LayoutObject* layoutObject = element->layoutObject()) { | 271 if (LayoutObject* layoutObject = element->layoutObject()) { |
| 271 if (UNLIKELY(!invalidatingDependencies.insert(element).isNewEntry)) { | 272 if (UNLIKELY(!invalidatingDependencies.insert(element).isNewEntry)) { |
| 272 // Reference cycle: we are in process of invalidating this dependant. | 273 // Reference cycle: we are in process of invalidating this dependant. |
| 273 continue; | 274 continue; |
| 274 } | 275 } |
| 275 | 276 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 301 // This will process the rest of the ancestors. | 302 // This will process the rest of the ancestors. |
| 302 toLayoutSVGResourceContainer(current)->removeAllClientsFromCache(); | 303 toLayoutSVGResourceContainer(current)->removeAllClientsFromCache(); |
| 303 break; | 304 break; |
| 304 } | 305 } |
| 305 | 306 |
| 306 current = current->parent(); | 307 current = current->parent(); |
| 307 } | 308 } |
| 308 } | 309 } |
| 309 | 310 |
| 310 } // namespace blink | 311 } // namespace blink |
| OLD | NEW |