Changeset 224196 in webkit


Ignore:
Timestamp:
Oct 30, 2017 12:45:49 PM (6 years ago)
Author:
commit-queue@webkit.org
Message:

[Setting] Only expose experimental features that are compiled in
https://bugs.webkit.org/show_bug.cgi?id=179023

Patch by Sam Weinig <sam@webkit.org> on 2017-10-30
Reviewed by Tim Horton.

  • Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:

Update template to conditionally expose experimental features based on their
'condition' option in WebPreferences.yaml

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r224192 r224196  
     12017-10-30  Sam Weinig  <sam@webkit.org>
     2
     3        [Setting] Only expose experimental features that are compiled in
     4        https://bugs.webkit.org/show_bug.cgi?id=179023
     5
     6        Reviewed by Tim Horton.
     7
     8        * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
     9       
     10            Update template to conditionally expose experimental features based on their
     11            'condition' option in WebPreferences.yaml
     12
    1132017-10-30  Michael Catanzaro  <mcatanzaro@igalia.com>
    214
  • trunk/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb

    r224191 r224196  
    5151    static NeverDestroyed<Vector<RefPtr<API::Object>>> features(std::initializer_list<RefPtr<API::Object>> {
    5252<%- for @pref in @experimentalFeatures do -%>
     53<%- if @pref.condition -%>
     54#if <%= @pref.condition %>
     55<%- end -%>
    5356        API::ExperimentalFeature::create(<%= @pref.humanReadableName %>, "<%= @pref.name %>", <%= @pref.humanReadableDescription %>, <%= @pref.defaultValue %>),
     57<%- if @pref.condition -%>
     58#endif
     59<%- end -%>
    5460<%- end -%>
    5561    });
     
    6773    static FeatureGetterMapping getters[] = {
    6874<%- for @pref in @experimentalFeatures do -%>
     75<%- if @pref.condition -%>
     76#if <%= @pref.condition %>
     77<%- end -%>
    6978        { "<%= @pref.name %>", &WebPreferences::<%= @pref.nameLower %> },
     79<%- if @pref.condition -%>
     80#endif
     81<%- end -%>
    7082<%- end -%>
    7183    };
     
    90102    static FeatureSetterMapping setters[] = {
    91103<%- for @pref in @experimentalFeatures do -%>
     104<%- if @pref.condition -%>
     105#if <%= @pref.condition %>
     106<%- end -%>
    92107        { "<%= @pref.name %>", &WebPreferences::set<%= @pref.name %> },
     108<%- if @pref.condition -%>
     109#endif
     110<%- end -%>
    93111<%- end -%>
    94112    };
     
    107125{
    108126<%- for @pref in @experimentalFeatures do -%>
     127<%- if @pref.condition -%>
     128#if <%= @pref.condition %>
     129<%- end -%>
    109130    set<%= @pref.name %>(true);
     131<%- if @pref.condition -%>
     132#endif
     133<%- end -%>
    110134<%- end -%>
    111135}
Note: See TracChangeset for help on using the changeset viewer.