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

Return const char* from CSS*Property::GetJSPropertyName

This makes callsites slightly slower (requiring calls to strlen()), but
the result is cached for the primary user of this, so the difference
from that is likely negligible. Each indiviual method however no longer
need to instantiate a WTF::String, yielding a perhaps modest, but not
insignificant, reduction in binary size (-1568 bytes according to
the android-binary-size bot.)

Change-Id: Ib9ecc17cbe3e745bc2c33e1b4d9dcbd40190e026
Reviewed-on: https://chromium-review.googlesource.com/1233710Reviewed-by: default avatarAnders Ruud <andruud@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#592728}
parent 8e6b81db
......@@ -43,8 +43,8 @@ class {{property_classname}} final : public {{property.namespace_group}} {
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:]}}");
const char* GetJSPropertyName() const override {
return "{{property_classname[0].lower() + property_classname[1:]}}";
}
{% if property.alias_for == None %}
CSSPropertyID PropertyID() const override { return {{property.property_id}}; }
......
......@@ -31,9 +31,9 @@ class CSSUnresolvedProperty {
NOTREACHED();
return g_empty_atom;
}
virtual const WTF::String GetJSPropertyName() const {
virtual const char* GetJSPropertyName() const {
NOTREACHED();
return g_empty_string;
return "";
}
WTF::String GetPropertyNameString() const {
// We share the StringImpl with the AtomicStrings.
......
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