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

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

Issue 1802773002: Support loading trial tokens from HTTP headers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 "core/origin_trials/OriginTrialsBase.h"
9 #include "platform/Supplementable.h" 9 #include "platform/Supplementable.h"
10 #include "wtf/text/WTFString.h" 10 #include "wtf/text/WTFString.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class ExecutionContext; 14 class ExecutionContext;
15 class OriginTrialContext; 15 class OriginTrialContext;
16 16
17 // 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
18 // enabled through the experimental framework via API keys. 18 // enabled through the experimental framework via API keys.
19 19
20 class CORE_EXPORT OriginTrials final : public OriginTrialsBase, public WillBeHea pSupplement<ExecutionContext> { 20 class CORE_EXPORT OriginTrials final : public OriginTrialsBase, public WillBeHea pSupplement<ExecutionContext> {
21 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(OriginTrials) 21 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(OriginTrials)
22 public: 22 public:
23 static const char* supplementName(); 23 static const char* supplementName();
24 static OriginTrials* from(ExecutionContext*); 24 static OriginTrials* from(ExecutionContext*);
25 static void setTrialTokensFromHeader(ExecutionContext*, const String& header Value);
25 26
26 {% for feature in features %} 27 {% for feature in features %}
27 {% if feature.origin_trial_feature_name %} 28 {% if feature.origin_trial_feature_name %}
28 29
29 static bool {{feature.first_lowered_name}}Enabled(ExecutionContext*, String& errorMessage); 30 static bool {{feature.first_lowered_name}}Enabled(ExecutionContext*, String& errorMessage);
30 static bool {{feature.first_lowered_name}}Enabled(ExecutionContext*); 31 static bool {{feature.first_lowered_name}}Enabled(ExecutionContext*);
31 {% endif %} 32 {% endif %}
32 {% endfor %} 33 {% endfor %}
33 34
34 DECLARE_VIRTUAL_TRACE(); 35 DECLARE_VIRTUAL_TRACE();
35 36
36 private: 37 private:
37 explicit OriginTrials(ExecutionContext*); 38 explicit OriginTrials(ExecutionContext*);
38 39
39 {% for feature in features %} 40 {% for feature in features %}
40 {% if feature.origin_trial_feature_name %} 41 {% if feature.origin_trial_feature_name %}
41 bool {{feature.first_lowered_name}}EnabledImpl(String* errorMessage); 42 bool {{feature.first_lowered_name}}EnabledImpl(String* errorMessage);
42 {% endif %} 43 {% endif %}
43 {% endfor %} 44 {% endfor %}
44 }; 45 };
45 46
46 } // namespace blink 47 } // namespace blink
47 48
48 #endif // OriginTrials_h 49 #endif // OriginTrials_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698