Commit e14e1a34 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

Remove "custom" field of runtime enabled features

The feature is not currently used anywhere. Also didn't find any usage
when we forked blink.

Change-Id: I2d84ab693b08075aaa39e57b2eddaffeb44c9b55
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2104431
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#750633}
parent 3647cfae
...@@ -56,7 +56,6 @@ class InternalRuntimeFlagsWriter( ...@@ -56,7 +56,6 @@ class InternalRuntimeFlagsWriter(
return { return {
'features': self._features, 'features': self._features,
'input_files': self._input_files, 'input_files': self._input_files,
'standard_features': self._standard_features,
} }
@template_expander.use_jinja('templates/internal_runtime_flags.h.tmpl') @template_expander.use_jinja('templates/internal_runtime_flags.h.tmpl')
...@@ -65,7 +64,6 @@ class InternalRuntimeFlagsWriter( ...@@ -65,7 +64,6 @@ class InternalRuntimeFlagsWriter(
'features': self._features, 'features': self._features,
'feature_sets': self._feature_sets(), 'feature_sets': self._feature_sets(),
'input_files': self._input_files, 'input_files': self._input_files,
'standard_features': self._standard_features,
'header_guard': self._header_guard, 'header_guard': self._header_guard,
} }
......
...@@ -82,9 +82,6 @@ class BaseRuntimeFeatureWriter(json5_generator.Writer): ...@@ -82,9 +82,6 @@ class BaseRuntimeFeatureWriter(json5_generator.Writer):
feature['status_type'] = "dict" if isinstance( feature['status_type'] = "dict" if isinstance(
feature['status'], dict) else "str" feature['status'], dict) else "str"
self._standard_features = [
feature for feature in self._features if not feature['custom']
]
self._origin_trial_features = [ self._origin_trial_features = [
feature for feature in self._features if feature['in_origin_trial'] feature for feature in self._features if feature['in_origin_trial']
] ]
...@@ -158,7 +155,6 @@ class RuntimeFeatureWriter(BaseRuntimeFeatureWriter): ...@@ -158,7 +155,6 @@ class RuntimeFeatureWriter(BaseRuntimeFeatureWriter):
'feature_sets': self._feature_sets(), 'feature_sets': self._feature_sets(),
'platforms': self._platforms(), 'platforms': self._platforms(),
'input_files': self._input_files, 'input_files': self._input_files,
'standard_features': self._standard_features,
'origin_trial_controlled_features': self._origin_trial_features, 'origin_trial_controlled_features': self._origin_trial_features,
'header_guard': self._header_guard, 'header_guard': self._header_guard,
} }
...@@ -185,8 +181,7 @@ class RuntimeFeatureTestHelpersWriter(BaseRuntimeFeatureWriter): ...@@ -185,8 +181,7 @@ class RuntimeFeatureTestHelpersWriter(BaseRuntimeFeatureWriter):
def _template_inputs(self): def _template_inputs(self):
return { return {
# The test helpers don't support custom features. 'features': self._features,
'features': self._standard_features,
'input_files': self._input_files, 'input_files': self._input_files,
'header_guard': self._header_guard, 'header_guard': self._header_guard,
} }
......
...@@ -25,13 +25,13 @@ class InternalRuntimeFlags : public ScriptWrappable { ...@@ -25,13 +25,13 @@ class InternalRuntimeFlags : public ScriptWrappable {
// These are reset between web tests from Internals::resetToConsistentState // These are reset between web tests from Internals::resetToConsistentState
// using RuntimeEnabledFeatures::Backup. // using RuntimeEnabledFeatures::Backup.
{% for feature in standard_features if feature.settable_from_internals %} {% for feature in features if feature.settable_from_internals %}
void set{{feature.name}}Enabled(bool isEnabled) { void set{{feature.name}}Enabled(bool isEnabled) {
RuntimeEnabledFeatures::Set{{feature.name}}Enabled(isEnabled); RuntimeEnabledFeatures::Set{{feature.name}}Enabled(isEnabled);
} }
{% endfor %} {% endfor %}
{% for feature in standard_features %} {% for feature in features %}
bool {{feature.name.to_lower_camel_case()}}Enabled() { bool {{feature.name.to_lower_camel_case()}}Enabled() {
{% if feature.in_origin_trial %} {% if feature.in_origin_trial %}
return RuntimeEnabledFeatures::{{feature.name}}EnabledByRuntimeFlag(); return RuntimeEnabledFeatures::{{feature.name}}EnabledByRuntimeFlag();
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
{{source_files_for_generated_file(template_file, input_files)}} {{source_files_for_generated_file(template_file, input_files)}}
interface InternalRuntimeFlags { interface InternalRuntimeFlags {
{% for feature in standard_features %} {% for feature in features %}
{%+ if feature.condition %}[Conditional={{feature.condition}}] {% endif -%} {%+ if feature.condition %}[Conditional={{feature.condition}}] {% endif -%}
{% if feature.settable_from_internals %} {% if feature.settable_from_internals %}
attribute boolean {{feature.name.to_lower_camel_case()}}Enabled; attribute boolean {{feature.name.to_lower_camel_case()}}Enabled;
......
...@@ -13,14 +13,14 @@ ...@@ -13,14 +13,14 @@
namespace blink { namespace blink {
RuntimeEnabledFeatures::Backup::Backup() RuntimeEnabledFeatures::Backup::Backup()
: {% for feature in standard_features -%} : {% for feature in features -%}
{{feature.data_member_name}}(RuntimeEnabledFeatures::{{feature.data_member_name}}) {{feature.data_member_name}}(RuntimeEnabledFeatures::{{feature.data_member_name}})
{%- if not loop.last %}, {%- if not loop.last %},
{%+ endif -%} {%+ endif -%}
{% endfor %} {} {% endfor %} {}
void RuntimeEnabledFeatures::Backup::Restore() { void RuntimeEnabledFeatures::Backup::Restore() {
{% for feature in standard_features %} {% for feature in features %}
RuntimeEnabledFeatures::{{feature.data_member_name}} = {{feature.data_member_name}}; RuntimeEnabledFeatures::{{feature.data_member_name}} = {{feature.data_member_name}};
{% endfor %} {% endfor %}
} }
...@@ -67,7 +67,7 @@ void RuntimeEnabledFeatures::SetFeatureEnabledFromString( ...@@ -67,7 +67,7 @@ void RuntimeEnabledFeatures::SetFeatureEnabledFromString(
const char* name; const char* name;
bool* setting; bool* setting;
} kFeatures[] = { } kFeatures[] = {
{% for feature in standard_features %} {% for feature in features %}
{"{{feature.name}}", &{{feature.data_member_name}}}, {"{{feature.name}}", &{{feature.data_member_name}}},
{% endfor %} {% endfor %}
}; };
...@@ -100,7 +100,7 @@ bool RuntimeEnabledFeatures::{{feature.name}}Enabled(const FeatureContext* conte ...@@ -100,7 +100,7 @@ bool RuntimeEnabledFeatures::{{feature.name}}Enabled(const FeatureContext* conte
{% endfor %} {% endfor %}
{% for feature in standard_features %} {% for feature in features %}
{% if feature.status_type == 'str' %} {% if feature.status_type == 'str' %}
bool RuntimeEnabledFeatures::{{feature.data_member_name}} = {{'true' if feature.status == 'stable' else 'false'}}; bool RuntimeEnabledFeatures::{{feature.data_member_name}} = {{'true' if feature.status == 'stable' else 'false'}};
{% endif %} {% endif %}
...@@ -109,7 +109,7 @@ bool RuntimeEnabledFeatures::{{feature.data_member_name}} = {{'true' if feature. ...@@ -109,7 +109,7 @@ bool RuntimeEnabledFeatures::{{feature.data_member_name}} = {{'true' if feature.
// Platform-dependent features // Platform-dependent features
{% for platform in platforms %} {% for platform in platforms %}
#if defined(OS_{{platform | upper}}) #if defined(OS_{{platform | upper}})
{% for feature in standard_features %} {% for feature in features %}
{% if feature.status_type == 'dict' %} {% if feature.status_type == 'dict' %}
bool RuntimeEnabledFeatures::{{feature.data_member_name}} = {{'true' if feature.status[platform] == 'stable' else 'false'}}; bool RuntimeEnabledFeatures::{{feature.data_member_name}} = {{'true' if feature.status[platform] == 'stable' else 'false'}};
{% endif %} {% endif %}
...@@ -124,7 +124,7 @@ bool RuntimeEnabledFeatures::{{feature.data_member_name}} = {{'true' if feature. ...@@ -124,7 +124,7 @@ bool RuntimeEnabledFeatures::{{feature.data_member_name}} = {{'true' if feature.
!defined(OS_{{platform | upper}}) !defined(OS_{{platform | upper}})
{%- endfor %} {%- endfor %}
{% for feature in standard_features %} {% for feature in features %}
{% if feature.status_type == 'dict' %} {% if feature.status_type == 'dict' %}
bool RuntimeEnabledFeatures::{{feature.data_member_name}} = {{'true' if feature.status['default'] == 'stable' else 'false'}}; bool RuntimeEnabledFeatures::{{feature.data_member_name}} = {{'true' if feature.status['default'] == 'stable' else 'false'}};
{% endif %} {% endif %}
......
...@@ -48,7 +48,7 @@ class PLATFORM_EXPORT RuntimeEnabledFeatures { ...@@ -48,7 +48,7 @@ class PLATFORM_EXPORT RuntimeEnabledFeatures {
void Restore(); void Restore();
private: private:
{% for feature in standard_features %} {% for feature in features %}
bool {{feature.data_member_name}}; bool {{feature.data_member_name}};
{% endfor %} {% endfor %}
}; };
...@@ -62,13 +62,9 @@ class PLATFORM_EXPORT RuntimeEnabledFeatures { ...@@ -62,13 +62,9 @@ class PLATFORM_EXPORT RuntimeEnabledFeatures {
{% for feature in features %} {% for feature in features %}
{% if not feature.in_origin_trial %} {% if not feature.in_origin_trial %}
{% if feature.custom %}
static bool {{feature.name}}Enabled();
{% else %}
static void Set{{feature.name}}Enabled(bool enabled) { {{feature.data_member_name}} = enabled; } static void Set{{feature.name}}Enabled(bool enabled) { {{feature.data_member_name}} = enabled; }
static bool {{feature.name}}Enabled() { return {{feature.enabled_condition}}; } static bool {{feature.name}}Enabled() { return {{feature.enabled_condition}}; }
static bool {{feature.name}}Enabled(const FeatureContext*) { return {{feature.enabled_condition}}; } static bool {{feature.name}}Enabled(const FeatureContext*) { return {{feature.enabled_condition}}; }
{% endif %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
...@@ -84,12 +80,8 @@ class PLATFORM_EXPORT RuntimeEnabledFeatures { ...@@ -84,12 +80,8 @@ class PLATFORM_EXPORT RuntimeEnabledFeatures {
// feature is enabled in a given context. // feature is enabled in a given context.
{% for feature in origin_trial_controlled_features %} {% for feature in origin_trial_controlled_features %}
{% if feature.custom %}
static bool {{feature.name}}EnabledByRuntimeFlag();
{% else %}
static void Set{{feature.name}}Enabled(bool enabled) { {{feature.data_member_name}} = enabled; } static void Set{{feature.name}}Enabled(bool enabled) { {{feature.data_member_name}} = enabled; }
static bool {{feature.name}}EnabledByRuntimeFlag() { return {{feature.enabled_condition}}; } static bool {{feature.name}}EnabledByRuntimeFlag() { return {{feature.enabled_condition}}; }
{% endif %}
static bool {{feature.name}}Enabled(const FeatureContext*); static bool {{feature.name}}Enabled(const FeatureContext*);
{% endfor %} {% endfor %}
...@@ -97,7 +89,7 @@ class PLATFORM_EXPORT RuntimeEnabledFeatures { ...@@ -97,7 +89,7 @@ class PLATFORM_EXPORT RuntimeEnabledFeatures {
private: private:
friend class RuntimeEnabledFeaturesTestHelpers; friend class RuntimeEnabledFeaturesTestHelpers;
{% for feature in standard_features %} {% for feature in features %}
static bool {{feature.data_member_name}}; static bool {{feature.data_member_name}};
{% endfor %} {% endfor %}
}; };
......
...@@ -94,11 +94,6 @@ ...@@ -94,11 +94,6 @@
valid_type: "bool", valid_type: "bool",
}, },
// Set to true to have customised {feature}Enabled() method implementation.
custom: {
valid_type: "bool",
},
// Feature policy IDL extended attribute (see crrev.com/2247923004). // Feature policy IDL extended attribute (see crrev.com/2247923004).
feature_policy: { feature_policy: {
}, },
......
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