Chromium Code Reviews| Index: third_party/WebKit/Source/build/scripts/make_css_property_names.py |
| diff --git a/third_party/WebKit/Source/build/scripts/make_css_property_names.py b/third_party/WebKit/Source/build/scripts/make_css_property_names.py |
| index e32dc5f682ec57857b5377e715ae9de30937f352..56a89951cf3fc7e6e01f51ca34ac5dbc156bda42 100755 |
| --- a/third_party/WebKit/Source/build/scripts/make_css_property_names.py |
| +++ b/third_party/WebKit/Source/build/scripts/make_css_property_names.py |
| @@ -44,9 +44,16 @@ const WTF::AtomicString& getPropertyNameAtomicString(CSSPropertyID); |
| WTF::String getPropertyNameString(CSSPropertyID); |
| WTF::String getJSPropertyName(CSSPropertyID); |
| +inline bool propertyHasName(int id) |
| +{ |
| + return id >= firstCSSProperty && id <= lastUnresolvedCSSProperty; |
| +} |
| + |
| + |
| inline CSSPropertyID convertToCSSPropertyID(int value) |
| { |
| - ASSERT(value >= CSSPropertyInvalid && value <= lastCSSProperty); |
| + DCHECK_GE(value, CSSPropertyInvalid); |
| + DCHECK_LE(value, lastCSSProperty); |
|
sashab
2016/08/15 07:23:13
Maybe DCHECK(propertyHasName() || property == CSSP
meade_UTC10
2016/09/29 07:39:56
Done.
meade_UTC10
2016/09/30 06:17:37
Actually that doesn't work - lastCSSProperty != la
|
| return static_cast<CSSPropertyID>(value); |
| } |
| @@ -118,14 +125,14 @@ const Property* findProperty(register const char* str, register unsigned int len |
| const char* getPropertyName(CSSPropertyID id) |
| { |
| - ASSERT(id >= firstCSSProperty && id <= lastUnresolvedCSSProperty); |
| + DCHECK(propertyHasName(id)); |
| int index = id - firstCSSProperty; |
| return propertyNameStringsPool + propertyNameStringsOffsets[index]; |
| } |
| const AtomicString& getPropertyNameAtomicString(CSSPropertyID id) |
| { |
| - ASSERT(id >= firstCSSProperty && id <= lastUnresolvedCSSProperty); |
| + DCHECK(propertyHasName(id)); |
| int index = id - firstCSSProperty; |
| static AtomicString* propertyStrings = new AtomicString[lastUnresolvedCSSProperty]; // Intentionally never destroyed. |
| AtomicString& propertyString = propertyStrings[index]; |