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

Side by Side Diff: Source/core/svg/properties/SVGPropertyTearOff.h

Issue 25314003: SVGPropertyTearOffs should detachChildren before deleting its value (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: no revert revert revert Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 static PassRefPtr<Self> create(const PropertyType& initialValue) 49 static PassRefPtr<Self> create(const PropertyType& initialValue)
50 { 50 {
51 return adoptRef(new Self(initialValue)); 51 return adoptRef(new Self(initialValue));
52 } 52 }
53 53
54 PropertyType& propertyReference() { return *m_value; } 54 PropertyType& propertyReference() { return *m_value; }
55 SVGAnimatedProperty* animatedProperty() const { return m_animatedProperty; } 55 SVGAnimatedProperty* animatedProperty() const { return m_animatedProperty; }
56 56
57 void setValue(PropertyType& value) 57 void setValue(PropertyType& value)
58 { 58 {
59 if (m_valueIsCopy) 59 if (m_valueIsCopy) {
60 detachChildren();
60 delete m_value; 61 delete m_value;
62 }
61 m_valueIsCopy = false; 63 m_valueIsCopy = false;
62 m_value = &value; 64 m_value = &value;
63 } 65 }
64 66
65 void setAnimatedProperty(SVGAnimatedProperty* animatedProperty) 67 void setAnimatedProperty(SVGAnimatedProperty* animatedProperty)
66 { 68 {
67 m_animatedProperty = animatedProperty; 69 m_animatedProperty = animatedProperty;
68 70
69 if (m_animatedProperty) 71 if (m_animatedProperty)
70 m_contextElement = m_animatedProperty->contextElement(); 72 m_contextElement = m_animatedProperty->contextElement();
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 SVGAnimatedProperty* m_animatedProperty; 160 SVGAnimatedProperty* m_animatedProperty;
159 SVGPropertyRole m_role; 161 SVGPropertyRole m_role;
160 PropertyType* m_value; 162 PropertyType* m_value;
161 Vector<WeakPtr<SVGPropertyTearOffBase> > m_childTearOffs; 163 Vector<WeakPtr<SVGPropertyTearOffBase> > m_childTearOffs;
162 bool m_valueIsCopy : 1; 164 bool m_valueIsCopy : 1;
163 }; 165 };
164 166
165 } 167 }
166 168
167 #endif // SVGPropertyTearOff_h 169 #endif // SVGPropertyTearOff_h
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698