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

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

Issue 2738863002: Replace ASSERT with DCHECK in core/svg/ (Closed)
Patch Set: Split DCHECKS wherever possible Created 3 years, 9 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
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGEllipseElement.cpp ('k') | third_party/WebKit/Source/core/svg/SVGEnumeration.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698