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..56de4cba828929334f7493d375353b839d0ced9e 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,19 @@ const WTF::AtomicString& getPropertyNameAtomicString(CSSPropertyID); |
| WTF::String getPropertyNameString(CSSPropertyID); |
| WTF::String getJSPropertyName(CSSPropertyID); |
| +inline bool isPropertyIDWithName(int id) |
|
rune
2016/09/30 09:48:33
Should the name here also include "CSS"? isCSSProp
meade_UTC10
2016/10/06 04:42:05
Done.
|
| +{ |
| + return id >= firstCSSProperty && id <= lastUnresolvedCSSProperty; |
| +} |
| + |
| +inline bool isValidCSSPropertyID(CSSPropertyID id) |
| +{ |
| + return id != CSSPropertyInvalid; |
| +} |
| + |
| inline CSSPropertyID convertToCSSPropertyID(int value) |
| { |
| - ASSERT(value >= CSSPropertyInvalid && value <= lastCSSProperty); |
| + DCHECK(value >= CSSPropertyInvalid && value <= lastCSSProperty); |
| return static_cast<CSSPropertyID>(value); |
| } |
| @@ -118,14 +128,14 @@ const Property* findProperty(register const char* str, register unsigned int len |
| const char* getPropertyName(CSSPropertyID id) |
| { |
| - ASSERT(id >= firstCSSProperty && id <= lastUnresolvedCSSProperty); |
| + DCHECK(isPropertyIDWithName(id)); |
| int index = id - firstCSSProperty; |
| return propertyNameStringsPool + propertyNameStringsOffsets[index]; |
| } |
| const AtomicString& getPropertyNameAtomicString(CSSPropertyID id) |
| { |
| - ASSERT(id >= firstCSSProperty && id <= lastUnresolvedCSSProperty); |
| + DCHECK(isPropertyIDWithName(id)); |
| int index = id - firstCSSProperty; |
| static AtomicString* propertyStrings = new AtomicString[lastUnresolvedCSSProperty]; // Intentionally never destroyed. |
| AtomicString& propertyString = propertyStrings[index]; |