Chromium Code Reviews| Index: third_party/WebKit/Source/build/scripts/templates/OriginTrials.h.tmpl |
| diff --git a/third_party/WebKit/Source/build/scripts/templates/OriginTrials.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/OriginTrials.h.tmpl |
| index f49790ed580e176c09d93000e3e703397add34a9..8b35c9a150a6fd111af7fb8cd9c441bb66337e89 100644 |
| --- a/third_party/WebKit/Source/build/scripts/templates/OriginTrials.h.tmpl |
| +++ b/third_party/WebKit/Source/build/scripts/templates/OriginTrials.h.tmpl |
| @@ -5,32 +5,47 @@ |
| #define OriginTrials_h |
| #include "core/CoreExport.h" |
| +#include "platform/Supplementable.h" |
| #include "wtf/text/WTFString.h" |
| namespace blink { |
| class ExecutionContext; |
| +class OriginTrialContext; |
| // A class that stores dynamic tests for experimental features which can be |
| // enabled through the experimental framework via API keys. |
| -class CORE_EXPORT OriginTrials { |
| +class CORE_EXPORT OriginTrials final : public NoBaseWillBeGarbageCollected<OriginTrials>, public WillBeHeapSupplement<ExecutionContext> { |
| +WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(OriginTrials) |
| public: |
| + OriginTrials(PassOwnPtrWillBeRawPtr<OriginTrialContext>); |
| + |
| + static const char* supplementName(); |
| + static OriginTrials* from(ExecutionContext*); |
| + |
| {% for feature in features %} |
| {% if feature.origin_trial_feature_name %} |
| + |
| + // 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
|
| + // instance on the ExecutionContext directly, once the bindings generation |
| + // code is updated to match. |
| static bool {{feature.first_lowered_name}}Enabled(ExecutionContext* executionContext, String& errorMessage); |
| - static bool {{feature.first_lowered_name}}Enabled(ExecutionContext* executionContext); |
| + bool {{feature.first_lowered_name}}Enabled(String& errorMessage); |
| + bool {{feature.first_lowered_name}}Enabled(); |
| {% endif %} |
| {% endfor %} |
| -private: |
| - OriginTrials() { } |
| + DECLARE_TRACE(); |
| +private: |
| {% for feature in features %} |
| {% if feature.origin_trial_feature_name %} |
| - static bool {{feature.first_lowered_name}}EnabledImpl(ExecutionContext* executionContext, String* errorMessage); |
| + bool {{feature.first_lowered_name}}EnabledImpl(String* errorMessage); |
| {% endif %} |
| {% endfor %} |
| + |
| + OwnPtrWillBeMember<OriginTrialContext> m_originTrialContext; |
| }; |
| } // namespace blink |