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

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

Issue 2912663002: Clean up creation of "detached" SVG* data type objects (Closed)
Patch Set: Created 3 years, 6 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
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGTransformTearOff.cpp ('k') | 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 attribute_name_ = attribute_name; 69 attribute_name_ = attribute_name;
70 } 70 }
71 71
72 virtual AnimatedPropertyType GetType() const = 0; 72 virtual AnimatedPropertyType GetType() const = 0;
73 73
74 DEFINE_INLINE_VIRTUAL_TRACE() {} 74 DEFINE_INLINE_VIRTUAL_TRACE() {}
75 75
76 static void ThrowReadOnly(ExceptionState&); 76 static void ThrowReadOnly(ExceptionState&);
77 77
78 protected: 78 protected:
79 SVGPropertyTearOffBase( 79 SVGPropertyTearOffBase(SVGElement* context_element,
80 SVGElement* context_element, 80 PropertyIsAnimValType property_is_anim_val,
81 PropertyIsAnimValType property_is_anim_val, 81 const QualifiedName& attribute_name)
82 const QualifiedName& attribute_name = QualifiedName::Null())
83 : context_element_(context_element), 82 : context_element_(context_element),
84 property_is_anim_val_(property_is_anim_val), 83 property_is_anim_val_(property_is_anim_val),
85 attribute_name_(attribute_name) {} 84 attribute_name_(attribute_name) {}
86 85
87 private: 86 private:
88 // This raw pointer is safe since the SVG element is guaranteed to be kept 87 // This raw pointer is safe since the SVG element is guaranteed to be kept
89 // alive by a V8 wrapper. 88 // alive by a V8 wrapper.
90 // See http://crbug.com/528275 for the detail. 89 // See http://crbug.com/528275 for the detail.
91 UntracedMember<SVGElement> context_element_; 90 UntracedMember<SVGElement> context_element_;
92 91
(...skipping 16 matching lines...) Expand all
109 AnimatedPropertyType GetType() const override { 108 AnimatedPropertyType GetType() const override {
110 return Property::ClassType(); 109 return Property::ClassType();
111 } 110 }
112 111
113 DEFINE_INLINE_VIRTUAL_TRACE() { 112 DEFINE_INLINE_VIRTUAL_TRACE() {
114 visitor->Trace(target_); 113 visitor->Trace(target_);
115 SVGPropertyTearOffBase::Trace(visitor); 114 SVGPropertyTearOffBase::Trace(visitor);
116 } 115 }
117 116
118 protected: 117 protected:
119 SVGPropertyTearOff( 118 SVGPropertyTearOff(Property* target,
120 Property* target, 119 SVGElement* context_element,
121 SVGElement* context_element, 120 PropertyIsAnimValType property_is_anim_val,
122 PropertyIsAnimValType property_is_anim_val, 121 const QualifiedName& attribute_name)
123 const QualifiedName& attribute_name = QualifiedName::Null())
124 : SVGPropertyTearOffBase(context_element, 122 : SVGPropertyTearOffBase(context_element,
125 property_is_anim_val, 123 property_is_anim_val,
126 attribute_name), 124 attribute_name),
127 target_(target) { 125 target_(target) {
128 DCHECK(target_); 126 DCHECK(target_);
129 } 127 }
130 128
131 private: 129 private:
132 Member<Property> target_; 130 Member<Property> target_;
133 }; 131 };
134 132
135 } // namespace blink 133 } // namespace blink
136 134
137 #endif // SVGPropertyTearOff_h 135 #endif // SVGPropertyTearOff_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGTransformTearOff.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698