Chromium Code Reviews| 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 * Copyright (C) 2013 Samsung Electronics. All rights reserved. | 3 * Copyright (C) 2013 Samsung Electronics. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 Vector<SVGAnimatedPropertyDescription> keysToRemove; | 49 Vector<SVGAnimatedPropertyDescription> keysToRemove; |
| 50 | 50 |
| 51 const Cache::const_iterator end = cache->end(); | 51 const Cache::const_iterator end = cache->end(); |
| 52 for (Cache::const_iterator it = cache->begin(); it != end; ++it) { | 52 for (Cache::const_iterator it = cache->begin(); it != end; ++it) { |
| 53 if (it->key.m_element == element) { | 53 if (it->key.m_element == element) { |
| 54 it->value->resetContextElement(); | 54 it->value->resetContextElement(); |
| 55 keysToRemove.append(it->key); | 55 keysToRemove.append(it->key); |
| 56 } | 56 } |
| 57 } | 57 } |
| 58 | 58 |
| 59 for (Vector<SVGAnimatedPropertyDescription>::const_iterator it = keysToRemov e.begin(); it != keysToRemove.end(); ++it) | 59 // Workaround for http://crbug.com/333156 : |
|
pdr.
2014/01/14 04:33:25
Please remove the workaround comment, as I think w
kouhei (in TOK)
2014/01/14 04:51:27
Done.
| |
| 60 // There are unknown cases where detachAnimatedPropertiesForElement is calle d recursively from ~SVGAnimatedProperty. | |
| 61 // This vector makes this function safe by deferring the recursive call unti l we finish touching the HashMap. | |
| 62 Vector<RefPtr<SVGAnimatedProperty> > deferredPropertyDestruct; | |
|
pdr.
2014/01/14 04:33:25
I would also change this comment slightly to just
kouhei (in TOK)
2014/01/14 04:51:27
Done.
| |
| 63 for (Vector<SVGAnimatedPropertyDescription>::const_iterator it = keysToRemov e.begin(); it != keysToRemove.end(); ++it) { | |
| 64 deferredPropertyDestruct.append(cache->get(*it)); | |
|
pdr.
2014/01/14 04:33:25
I'm okay with a temporary workaround but I think w
kouhei (in TOK)
2014/01/14 04:45:07
No. The problem is that SVGAnimatedProperty is som
kouhei (in TOK)
2014/01/14 04:51:27
Done.
| |
| 60 cache->remove(*it); | 65 cache->remove(*it); |
| 66 } | |
| 61 } | 67 } |
| 62 | 68 |
| 63 void SVGAnimatedProperty::commitChange() | 69 void SVGAnimatedProperty::commitChange() |
| 64 { | 70 { |
| 65 ASSERT(m_contextElement); | 71 ASSERT(m_contextElement); |
| 66 ASSERT_WITH_SECURITY_IMPLICATION(!m_contextElement->m_deletionHasBegun); | 72 ASSERT_WITH_SECURITY_IMPLICATION(!m_contextElement->m_deletionHasBegun); |
| 67 m_contextElement->invalidateSVGAttributes(); | 73 m_contextElement->invalidateSVGAttributes(); |
| 68 m_contextElement->svgAttributeChanged(m_attributeName); | 74 m_contextElement->svgAttributeChanged(m_attributeName); |
| 69 } | 75 } |
| 70 | 76 |
| 71 SVGAnimatedProperty::Cache* SVGAnimatedProperty::animatedPropertyCache() | 77 SVGAnimatedProperty::Cache* SVGAnimatedProperty::animatedPropertyCache() |
| 72 { | 78 { |
| 73 static Cache* s_cache = new Cache; | 79 static Cache* s_cache = new Cache; |
| 74 return s_cache; | 80 return s_cache; |
| 75 } | 81 } |
| 76 | 82 |
| 77 } // namespace WebCore | 83 } // namespace WebCore |
| OLD | NEW |