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

Side by Side Diff: Source/core/svg/SVGEnumeration.cpp

Issue 678163002: Oilpan: move SVG property hierarchy to the heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased upto r185213 Created 6 years, 1 month 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 | « Source/core/svg/SVGEnumeration.h ('k') | Source/core/svg/SVGFEBlendElement.h » ('j') | 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) 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 21 matching lines...) Expand all
32 32
33 #include "core/svg/SVGEnumeration.h" 33 #include "core/svg/SVGEnumeration.h"
34 34
35 #include "bindings/core/v8/ExceptionState.h" 35 #include "bindings/core/v8/ExceptionState.h"
36 #include "bindings/core/v8/ExceptionStatePlaceholder.h" 36 #include "bindings/core/v8/ExceptionStatePlaceholder.h"
37 #include "core/dom/ExceptionCode.h" 37 #include "core/dom/ExceptionCode.h"
38 #include "core/svg/SVGAnimationElement.h" 38 #include "core/svg/SVGAnimationElement.h"
39 39
40 namespace blink { 40 namespace blink {
41 41
42 inline PassRefPtr<SVGEnumerationBase> toSVGEnumerationBase(PassRefPtr<SVGPropert yBase> passBase) 42 inline PassRefPtrWillBeRawPtr<SVGEnumerationBase> toSVGEnumerationBase(PassRefPt rWillBeRawPtr<SVGPropertyBase> passBase)
43 { 43 {
44 RefPtr<SVGPropertyBase> base = passBase; 44 RefPtrWillBeRawPtr<SVGPropertyBase> base = passBase;
45 ASSERT(base->type() == SVGEnumerationBase::classType()); 45 ASSERT(base->type() == SVGEnumerationBase::classType());
46 return static_pointer_cast<SVGEnumerationBase>(base.release()); 46 return static_pointer_cast<SVGEnumerationBase>(base.release());
47 } 47 }
48 48
49 SVGEnumerationBase::~SVGEnumerationBase() 49 SVGEnumerationBase::~SVGEnumerationBase()
50 { 50 {
51 } 51 }
52 52
53 PassRefPtr<SVGPropertyBase> SVGEnumerationBase::cloneForAnimation(const String& value) const 53 PassRefPtrWillBeRawPtr<SVGPropertyBase> SVGEnumerationBase::cloneForAnimation(co nst String& value) const
54 { 54 {
55 RefPtr<SVGEnumerationBase> svgEnumeration = clone(); 55 RefPtrWillBeRawPtr<SVGEnumerationBase> svgEnumeration = clone();
56 svgEnumeration->setValueAsString(value, IGNORE_EXCEPTION); 56 svgEnumeration->setValueAsString(value, IGNORE_EXCEPTION);
57 return svgEnumeration.release(); 57 return svgEnumeration.release();
58 } 58 }
59 59
60 String SVGEnumerationBase::valueAsString() const 60 String SVGEnumerationBase::valueAsString() const
61 { 61 {
62 StringEntries::const_iterator it = m_entries.begin(); 62 StringEntries::const_iterator it = m_entries.begin();
63 StringEntries::const_iterator itEnd = m_entries.end(); 63 StringEntries::const_iterator itEnd = m_entries.end();
64 for (; it != itEnd; ++it) { 64 for (; it != itEnd; ++it) {
65 if (m_value == it->first) 65 if (m_value == it->first)
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 exceptionState.throwDOMException(SyntaxError, "The value provided ('" + stri ng + "') is invalid."); 103 exceptionState.throwDOMException(SyntaxError, "The value provided ('" + stri ng + "') is invalid.");
104 notifyChange(); 104 notifyChange();
105 } 105 }
106 106
107 void SVGEnumerationBase::add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement *) 107 void SVGEnumerationBase::add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement *)
108 { 108 {
109 ASSERT_NOT_REACHED(); 109 ASSERT_NOT_REACHED();
110 } 110 }
111 111
112 void SVGEnumerationBase::calculateAnimatedValue(SVGAnimationElement* animationEl ement, float percentage, unsigned repeatCount, PassRefPtr<SVGPropertyBase> from, PassRefPtr<SVGPropertyBase> to, PassRefPtr<SVGPropertyBase>, SVGElement*) 112 void SVGEnumerationBase::calculateAnimatedValue(SVGAnimationElement* animationEl ement, float percentage, unsigned repeatCount, PassRefPtrWillBeRawPtr<SVGPropert yBase> from, PassRefPtrWillBeRawPtr<SVGPropertyBase> to, PassRefPtrWillBeRawPtr< SVGPropertyBase>, SVGElement*)
113 { 113 {
114 ASSERT(animationElement); 114 ASSERT(animationElement);
115 unsigned short fromEnumeration = animationElement->animationMode() == ToAnim ation ? m_value : toSVGEnumerationBase(from)->value(); 115 unsigned short fromEnumeration = animationElement->animationMode() == ToAnim ation ? m_value : toSVGEnumerationBase(from)->value();
116 unsigned short toEnumeration = toSVGEnumerationBase(to)->value(); 116 unsigned short toEnumeration = toSVGEnumerationBase(to)->value();
117 117
118 animationElement->animateDiscreteType<unsigned short>(percentage, fromEnumer ation, toEnumeration, m_value); 118 animationElement->animateDiscreteType<unsigned short>(percentage, fromEnumer ation, toEnumeration, m_value);
119 } 119 }
120 120
121 float SVGEnumerationBase::calculateDistance(PassRefPtr<SVGPropertyBase>, SVGElem ent*) 121 float SVGEnumerationBase::calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBa se>, SVGElement*)
122 { 122 {
123 // No paced animations for boolean. 123 // No paced animations for boolean.
124 return -1; 124 return -1;
125 } 125 }
126 126
127 } 127 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGEnumeration.h ('k') | Source/core/svg/SVGFEBlendElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698