Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: third_party/WebKit/Source/build/scripts/templates/OriginTrials.h.tmpl

Issue 1833063002: Store the list of trial tokens in OriginTrialContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "core/origin_trials/OriginTrialsBase.h"
8 #include "platform/Supplementable.h" 9 #include "platform/Supplementable.h"
9 #include "wtf/text/WTFString.h" 10 #include "wtf/text/WTFString.h"
10 11
11 namespace blink { 12 namespace blink {
12 13
13 class ExecutionContext; 14 class ExecutionContext;
14 class OriginTrialContext; 15 class OriginTrialContext;
15 16
16 // A class that stores dynamic tests for experimental features which can be 17 // A class that stores dynamic tests for experimental features which can be
17 // enabled through the experimental framework via API keys. 18 // enabled through the experimental framework via API keys.
18 19
19 class CORE_EXPORT OriginTrials final : public NoBaseWillBeGarbageCollected<Origi nTrials>, public WillBeHeapSupplement<ExecutionContext> { 20 class CORE_EXPORT OriginTrials final : public OriginTrialsBase, public WillBeHea pSupplement<ExecutionContext> {
20 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(OriginTrials) 21 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(OriginTrials)
21 public: 22 public:
22 OriginTrials(PassOwnPtrWillBeRawPtr<OriginTrialContext>);
23
24 static const char* supplementName(); 23 static const char* supplementName();
25 static OriginTrials* from(ExecutionContext*); 24 static OriginTrials* from(ExecutionContext*);
26 25
27 {% for feature in features %} 26 {% for feature in features %}
28 {% if feature.origin_trial_feature_name %} 27 {% if feature.origin_trial_feature_name %}
29 28
30 static bool {{feature.first_lowered_name}}Enabled(ExecutionContext* executio nContext, String& errorMessage); 29 static bool {{feature.first_lowered_name}}Enabled(ExecutionContext*, String& errorMessage);
31 static bool {{feature.first_lowered_name}}Enabled(ExecutionContext* executio nContext); 30 static bool {{feature.first_lowered_name}}Enabled(ExecutionContext*);
32 {% endif %} 31 {% endif %}
33 {% endfor %} 32 {% endfor %}
34 33
35 DECLARE_TRACE(); 34 DECLARE_VIRTUAL_TRACE();
36 35
37 private: 36 private:
37 explicit OriginTrials(ExecutionContext*);
38
38 {% for feature in features %} 39 {% for feature in features %}
39 {% if feature.origin_trial_feature_name %} 40 {% if feature.origin_trial_feature_name %}
40 bool {{feature.first_lowered_name}}EnabledImpl(String* errorMessage); 41 bool {{feature.first_lowered_name}}EnabledImpl(String* errorMessage);
41 {% endif %} 42 {% endif %}
42 {% endfor %} 43 {% endfor %}
43
44 OwnPtrWillBeMember<OriginTrialContext> m_originTrialContext;
45 }; 44 };
46 45
47 } // namespace blink 46 } // namespace blink
48 47
49 #endif // OriginTrials_h 48 #endif // OriginTrials_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698