Chromium Code Reviews| 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 class that stores dynamic tests for experimental features which can be | 16 // A class that stores dynamic tests for experimental features which can be |
| 15 // enabled through the experimental framework via API keys. | 17 // enabled through the experimental framework via API keys. |
| 16 | 18 |
| 17 class CORE_EXPORT OriginTrials { | 19 class CORE_EXPORT OriginTrials final : public NoBaseWillBeGarbageCollected<Origi nTrials>, public WillBeHeapSupplement<ExecutionContext> { |
| 20 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(OriginTrials) | |
| 18 public: | 21 public: |
| 22 OriginTrials(PassOwnPtrWillBeRawPtr<OriginTrialContext>); | |
| 23 | |
| 24 static const char* supplementName(); | |
| 25 static OriginTrials* from(ExecutionContext*); | |
| 26 | |
| 19 {% for feature in features %} | 27 {% for feature in features %} |
| 20 {% if feature.origin_trial_feature_name %} | 28 {% if feature.origin_trial_feature_name %} |
| 29 | |
| 30 // TODO(iclelland): Remove this static method in favour of calling the | |
|
jbroman
2016/03/04 15:23:48
Does this TODO still apply? Given the use of a sup
iclelland
2016/03/07 15:38:37
I think you're right; the static method is easier
| |
| 31 // instance on the ExecutionContext directly, once the bindings generation | |
| 32 // code is updated to match. | |
| 21 static bool {{feature.first_lowered_name}}Enabled(ExecutionContext* executio nContext, String& errorMessage); | 33 static bool {{feature.first_lowered_name}}Enabled(ExecutionContext* executio nContext, String& errorMessage); |
| 22 static bool {{feature.first_lowered_name}}Enabled(ExecutionContext* executio nContext); | 34 bool {{feature.first_lowered_name}}Enabled(String& errorMessage); |
| 35 bool {{feature.first_lowered_name}}Enabled(); | |
| 23 {% endif %} | 36 {% endif %} |
| 24 {% endfor %} | 37 {% endfor %} |
| 25 | 38 |
| 39 DECLARE_TRACE(); | |
| 40 | |
| 26 private: | 41 private: |
| 27 OriginTrials() { } | |
| 28 | |
| 29 {% for feature in features %} | 42 {% for feature in features %} |
| 30 {% if feature.origin_trial_feature_name %} | 43 {% if feature.origin_trial_feature_name %} |
| 31 static bool {{feature.first_lowered_name}}EnabledImpl(ExecutionContext* exec utionContext, String* errorMessage); | 44 bool {{feature.first_lowered_name}}EnabledImpl(String* errorMessage); |
| 32 {% endif %} | 45 {% endif %} |
| 33 {% endfor %} | 46 {% endfor %} |
| 47 | |
| 48 OwnPtrWillBeMember<OriginTrialContext> m_originTrialContext; | |
| 34 }; | 49 }; |
| 35 | 50 |
| 36 } // namespace blink | 51 } // namespace blink |
| 37 | 52 |
| 38 #endif // OriginTrials_h | 53 #endif // OriginTrials_h |
| OLD | NEW |