Commit f7ef1c94 authored by Fredrik Söderquist's avatar Fredrik Söderquist Committed by Commit Bot

Use DEFINE_STATIC_LOCAL in CSSProperty::GetPropertyNameAtomicString

This avoids having a destructor being run when terminating the process.
These destructor could have ordering issues wrt to the destruction of
the AtomicStringTable. Using DEFINE_STATIC_LOCAL also shrinks the binary
a bit. (The android-binary-size bot says -16375 bytes.)

Remove some redundant '\0' characters for some additional (but minor)
savings.

Change-Id: I4f5c19fceb9b668e74d3ef9bad58b104182ddb86
Reviewed-on: https://chromium-review.googlesource.com/1233700Reviewed-by: default avatarAnders Ruud <andruud@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#592383}
parent 32827a57
......@@ -38,13 +38,13 @@ class {{property_classname}} final : public {{property.namespace_group}} {
return RuntimeEnabledFeatures::{{property.runtime_flag}}Enabled();
}
{% endif %}
const char* GetPropertyName() const override { return "{{property.name}}\0"; }
const char* GetPropertyName() const override { return "{{property.name}}"; }
const WTF::AtomicString& GetPropertyNameAtomicString() const override {
static const WTF::AtomicString& name = WTF::AtomicString("{{property.name}}\0");
DEFINE_STATIC_LOCAL(const AtomicString, name, ("{{property.name}}"));
return name;
}
const WTF::String GetJSPropertyName() const override {
return WTF::String("{{property_classname[0].lower() + property_classname[1:]}}\0");
return WTF::String("{{property_classname[0].lower() + property_classname[1:]}}");
}
{% if property.alias_for == None %}
CSSPropertyID PropertyID() const override { return {{property.property_id}}; }
......
......@@ -20,9 +20,9 @@ class Variable final : public Longhand {
bool IsInherited() const override { return true; }
bool IsAffectedByAll() const override { return false; }
CSSPropertyID PropertyID() const override { return CSSPropertyVariable; }
const char* GetPropertyName() const override { return "variable\0"; }
const char* GetPropertyName() const override { return "variable"; }
const WTF::AtomicString& GetPropertyNameAtomicString() const override {
static const WTF::AtomicString& name = WTF::AtomicString("variable\0");
DEFINE_STATIC_LOCAL(const AtomicString, name, ("variable"));
return name;
}
const CSSValue* CSSValueFromComputedStyleInternal(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment