| OLD | NEW |
| 1 {% from 'macros.tmpl' import license %} | 1 {% from 'macros.tmpl' import license %} |
| 2 {{license()}} | 2 {{license()}} |
| 3 | 3 |
| 4 #ifndef OriginTrials_h | 4 #ifndef OriginTrials_h |
| 5 #define OriginTrials_h | 5 #define OriginTrials_h |
| 6 | 6 |
| 7 #include "core/CoreExport.h" | 7 #include "core/CoreExport.h" |
| 8 #include "platform/Supplementable.h" |
| 8 #include "wtf/text/WTFString.h" | 9 #include "wtf/text/WTFString.h" |
| 9 | 10 |
| 10 namespace blink { | 11 namespace blink { |
| 11 | 12 |
| 12 class ExecutionContext; | 13 class ExecutionContext; |
| 14 class OriginTrialContext; |
| 13 | 15 |
| 14 // A namespace with dynamic tests for experimental features which can be enabled
through the | 16 // A class that stores dynamic tests for experimental features which can be |
| 15 // experimental framework via origin trial tokens. | 17 // enabled through the experimental framework via API keys. |
| 16 namespace OriginTrials { | 18 |
| 19 class CORE_EXPORT OriginTrials final : public GarbageCollected<OriginTrials>, pu
blic Supplement<ExecutionContext> { |
| 20 USING_GARBAGE_COLLECTED_MIXIN(OriginTrials); |
| 21 public: |
| 22 OriginTrials(RawPtr<OriginTrialContext>); |
| 23 |
| 24 static const char* supplementName(); |
| 25 static OriginTrials* from(ExecutionContext*); |
| 26 |
| 17 {% for feature in features %} | 27 {% for feature in features %} |
| 18 {% if feature.origin_trial_feature_name %} | 28 {% if feature.origin_trial_feature_name %} |
| 19 CORE_EXPORT bool {{feature.first_lowered_name}}Enabled(ExecutionContext*, St
ring& errorMessage); | 29 |
| 20 CORE_EXPORT bool {{feature.first_lowered_name}}Enabled(ExecutionContext*); | 30 static bool {{feature.first_lowered_name}}Enabled(ExecutionContext* executio
nContext, String& errorMessage); |
| 31 static bool {{feature.first_lowered_name}}Enabled(ExecutionContext* executio
nContext); |
| 21 {% endif %} | 32 {% endif %} |
| 22 {% endfor %} | 33 {% endfor %} |
| 23 } // namespace OriginTrials | 34 |
| 35 DECLARE_TRACE(); |
| 36 |
| 37 private: |
| 38 {% for feature in features %} |
| 39 {% if feature.origin_trial_feature_name %} |
| 40 bool {{feature.first_lowered_name}}EnabledImpl(String* errorMessage); |
| 41 {% endif %} |
| 42 {% endfor %} |
| 43 |
| 44 Member<OriginTrialContext> m_originTrialContext; |
| 45 }; |
| 24 | 46 |
| 25 } // namespace blink | 47 } // namespace blink |
| 26 | 48 |
| 27 #endif // OriginTrials_h | 49 #endif // OriginTrials_h |
| OLD | NEW |