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

Unified Diff: third_party/WebKit/Source/build/scripts/make_css_property_names.py

Issue 2228313002: Make a function to query whether a CSSPropertyID is valid and whether it has a name. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@asan
Patch Set: Revert spurious change Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6db3fc48ed5576692e5f49359c0cbad2987d9a2a 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 isCSSPropertyIDWithName(int id)
+{
+ 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(isCSSPropertyIDWithName(id));
int index = id - firstCSSProperty;
return propertyNameStringsPool + propertyNameStringsOffsets[index];
}
const AtomicString& getPropertyNameAtomicString(CSSPropertyID id)
{
- ASSERT(id >= firstCSSProperty && id <= lastUnresolvedCSSProperty);
+ DCHECK(isCSSPropertyIDWithName(id));
int index = id - firstCSSProperty;
static AtomicString* propertyStrings = new AtomicString[lastUnresolvedCSSProperty]; // Intentionally never destroyed.
AtomicString& propertyString = propertyStrings[index];
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698