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

Unified Diff: third_party/WebKit/Source/core/svg/SVGEnumeration.h

Issue 1412713004: Hoist some pre-condition checks out of SVGAngle/SVGEnumeration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/svg/SVGEnumeration.h
diff --git a/third_party/WebKit/Source/core/svg/SVGEnumeration.h b/third_party/WebKit/Source/core/svg/SVGEnumeration.h
index 854d14bc1e4c591d7066527a1d27bb4d7737c1ee..62758d74f267c4dd135ba28c0f5bbba67f96a230 100644
--- a/third_party/WebKit/Source/core/svg/SVGEnumeration.h
+++ b/third_party/WebKit/Source/core/svg/SVGEnumeration.h
@@ -49,7 +49,7 @@ public:
~SVGEnumerationBase() override;
unsigned short value() const { return m_value <= maxExposedEnumValue() ? m_value : 0; }
- void setValue(unsigned short, ExceptionState&);
+ void setValue(unsigned short);
// SVGPropertyBase:
virtual PassRefPtrWillBeRawPtr<SVGEnumerationBase> clone() const = 0;
@@ -64,11 +64,11 @@ public:
static AnimatedPropertyType classType() { return AnimatedEnumeration; }
- // Ensure that |SVGAnimatedEnumerationBase::setBaseVal| is used instead of |SVGAnimatedProperty<SVGEnumerationBase>::setBaseVal|.
- void setValue(unsigned short) { ASSERT_NOT_REACHED(); }
-
static unsigned short valueOfLastEnum(const StringEntries& entries) { return entries.last().first; }
+ // This is the maximum value that is exposed as an IDL constant on the relevant interface.
+ unsigned short maxExposedEnumValue() const { return m_maxExposed; }
+
protected:
SVGEnumerationBase(unsigned short value, const StringEntries& entries, unsigned short maxExposed)
: SVGPropertyBase(classType())
@@ -82,9 +82,6 @@ protected:
// This assumes that |m_entries| are sorted.
unsigned short maxInternalEnumValue() const { return valueOfLastEnum(m_entries); }
- // This is the maximum value that is exposed as an IDL constant on the relevant interface.
- unsigned short maxExposedEnumValue() const { return m_maxExposed; }
-
// Used by SVGMarkerOrientEnumeration.
virtual void notifyChange() { }

Powered by Google App Engine
This is Rietveld 408576698