| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 25 matching lines...) Expand all Loading... |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 class ExceptionState; | 38 class ExceptionState; |
| 39 | 39 |
| 40 class SVGString : public SVGPropertyBase { | 40 class SVGString : public SVGPropertyBase { |
| 41 public: | 41 public: |
| 42 // SVGString does not have a tear-off type. | 42 // SVGString does not have a tear-off type. |
| 43 typedef void TearOffType; | 43 typedef void TearOffType; |
| 44 typedef String PrimitiveType; | 44 typedef String PrimitiveType; |
| 45 | 45 |
| 46 static PassRefPtr<SVGString> create() | 46 static PassRefPtrWillBeRawPtr<SVGString> create() |
| 47 { | 47 { |
| 48 return adoptRef(new SVGString()); | 48 return adoptRefWillBeNoop(new SVGString()); |
| 49 } | 49 } |
| 50 | 50 |
| 51 static PassRefPtr<SVGString> create(const String& value) | 51 static PassRefPtrWillBeRawPtr<SVGString> create(const String& value) |
| 52 { | 52 { |
| 53 return adoptRef(new SVGString(value)); | 53 return adoptRefWillBeNoop(new SVGString(value)); |
| 54 } | 54 } |
| 55 | 55 |
| 56 PassRefPtr<SVGString> clone() const { return create(m_value); } | 56 PassRefPtrWillBeRawPtr<SVGString> clone() const { return create(m_value); } |
| 57 virtual PassRefPtr<SVGPropertyBase> cloneForAnimation(const String& value) c
onst override | 57 virtual PassRefPtrWillBeRawPtr<SVGPropertyBase> cloneForAnimation(const Stri
ng& value) const override |
| 58 { | 58 { |
| 59 return create(value); | 59 return create(value); |
| 60 } | 60 } |
| 61 | 61 |
| 62 virtual String valueAsString() const override { return m_value; } | 62 virtual String valueAsString() const override { return m_value; } |
| 63 void setValueAsString(const String& value, ExceptionState&) { m_value = valu
e; } | 63 void setValueAsString(const String& value, ExceptionState&) { m_value = valu
e; } |
| 64 | 64 |
| 65 virtual void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) overr
ide; | 65 virtual void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) overr
ide; |
| 66 virtual void calculateAnimatedValue(SVGAnimationElement*, float percentage,
unsigned repeatCount, PassRefPtr<SVGPropertyBase> from, PassRefPtr<SVGPropertyBa
se> to, PassRefPtr<SVGPropertyBase> toAtEndOfDurationValue, SVGElement*) overrid
e; | 66 virtual void calculateAnimatedValue(SVGAnimationElement*, float percentage,
unsigned repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> from, PassRefPtrWi
llBeRawPtr<SVGPropertyBase> to, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEndO
fDurationValue, SVGElement*) override; |
| 67 virtual float calculateDistance(PassRefPtr<SVGPropertyBase> to, SVGElement*)
override; | 67 virtual float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to,
SVGElement*) override; |
| 68 | 68 |
| 69 const String& value() const { return m_value; } | 69 const String& value() const { return m_value; } |
| 70 void setValue(const String& value) { m_value = value; } | 70 void setValue(const String& value) { m_value = value; } |
| 71 | 71 |
| 72 static AnimatedPropertyType classType() { return AnimatedString; } | 72 static AnimatedPropertyType classType() { return AnimatedString; } |
| 73 | 73 |
| 74 private: | 74 private: |
| 75 SVGString() | 75 SVGString() |
| 76 : SVGPropertyBase(classType()) | 76 : SVGPropertyBase(classType()) |
| 77 { | 77 { |
| 78 } | 78 } |
| 79 | 79 |
| 80 explicit SVGString(const String& value) | 80 explicit SVGString(const String& value) |
| 81 : SVGPropertyBase(classType()) | 81 : SVGPropertyBase(classType()) |
| 82 , m_value(value) | 82 , m_value(value) |
| 83 { | 83 { |
| 84 } | 84 } |
| 85 | 85 |
| 86 String m_value; | 86 String m_value; |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 inline PassRefPtr<SVGString> toSVGString(PassRefPtr<SVGPropertyBase> passBase) | 89 inline PassRefPtrWillBeRawPtr<SVGString> toSVGString(PassRefPtrWillBeRawPtr<SVGP
ropertyBase> passBase) |
| 90 { | 90 { |
| 91 RefPtr<SVGPropertyBase> base = passBase; | 91 RefPtrWillBeRawPtr<SVGPropertyBase> base = passBase; |
| 92 ASSERT(base->type() == SVGString::classType()); | 92 ASSERT(base->type() == SVGString::classType()); |
| 93 return static_pointer_cast<SVGString>(base.release()); | 93 return static_pointer_cast<SVGString>(base.release()); |
| 94 } | 94 } |
| 95 | 95 |
| 96 } // namespace blink | 96 } // namespace blink |
| 97 | 97 |
| 98 #endif // SVGString_h | 98 #endif // SVGString_h |
| OLD | NEW |