| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 public: | 113 public: |
| 114 static SVGEnumeration<Enum>* create(Enum newValue) { | 114 static SVGEnumeration<Enum>* create(Enum newValue) { |
| 115 return new SVGEnumeration<Enum>(newValue); | 115 return new SVGEnumeration<Enum>(newValue); |
| 116 } | 116 } |
| 117 | 117 |
| 118 ~SVGEnumeration() override {} | 118 ~SVGEnumeration() override {} |
| 119 | 119 |
| 120 SVGEnumerationBase* clone() const override { return create(enumValue()); } | 120 SVGEnumerationBase* clone() const override { return create(enumValue()); } |
| 121 | 121 |
| 122 Enum enumValue() const { | 122 Enum enumValue() const { |
| 123 ASSERT(m_value <= maxInternalEnumValue()); | 123 DCHECK_LE(m_value, maxInternalEnumValue()); |
| 124 return static_cast<Enum>(m_value); | 124 return static_cast<Enum>(m_value); |
| 125 } | 125 } |
| 126 | 126 |
| 127 void setEnumValue(Enum value) { | 127 void setEnumValue(Enum value) { |
| 128 m_value = value; | 128 m_value = value; |
| 129 notifyChange(); | 129 notifyChange(); |
| 130 } | 130 } |
| 131 | 131 |
| 132 protected: | 132 protected: |
| 133 explicit SVGEnumeration(Enum newValue) | 133 explicit SVGEnumeration(Enum newValue) |
| 134 : SVGEnumerationBase(newValue, | 134 : SVGEnumerationBase(newValue, |
| 135 getStaticStringEntries<Enum>(), | 135 getStaticStringEntries<Enum>(), |
| 136 getMaxExposedEnumValue<Enum>()) {} | 136 getMaxExposedEnumValue<Enum>()) {} |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 } // namespace blink | 139 } // namespace blink |
| 140 | 140 |
| 141 #endif // SVGEnumeration_h | 141 #endif // SVGEnumeration_h |
| OLD | NEW |