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

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

Issue 1743623002: [Experimental Framework] Make the OriginTrialContext a member of ExecutionContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use WeakPersistent for Oilpan Created 4 years, 9 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 "wtf/text/WTFString.h" 8 #include "wtf/text/WTFString.h"
9 9
10 namespace blink { 10 namespace blink {
11 11
12 class ExecutionContext; 12 class ExecutionContext;
13 class OriginTrialContext;
13 14
14 // A class that stores dynamic tests for experimental features which can be 15 // A class that stores dynamic tests for experimental features which can be
15 // enabled through the experimental framework via API keys. 16 // enabled through the experimental framework via API keys.
16 17
17 class CORE_EXPORT OriginTrials { 18 class CORE_EXPORT OriginTrials {
18 public: 19 public:
20 OriginTrials(OriginTrialContext*);
19 {% for feature in features %} 21 {% for feature in features %}
20 {% if feature.origin_trial_feature_name %} 22 {% if feature.origin_trial_feature_name %}
23
24 // TODO(iclelland): Remove this static method in favour of calling the
25 // instance on the ExecutionContext directly, once the bindings generation
26 // code is updated to match.
21 static bool {{feature.first_lowered_name}}Enabled(ExecutionContext* executio nContext, String& errorMessage); 27 static bool {{feature.first_lowered_name}}Enabled(ExecutionContext* executio nContext, String& errorMessage);
22 static bool {{feature.first_lowered_name}}Enabled(ExecutionContext* executio nContext); 28 bool {{feature.first_lowered_name}}Enabled(String& errorMessage);
29 bool {{feature.first_lowered_name}}Enabled();
23 {% endif %} 30 {% endif %}
24 {% endfor %} 31 {% endfor %}
25 32
26 private: 33 private:
27 OriginTrials() { }
28
29 {% for feature in features %} 34 {% for feature in features %}
30 {% if feature.origin_trial_feature_name %} 35 {% if feature.origin_trial_feature_name %}
31 static bool {{feature.first_lowered_name}}EnabledImpl(ExecutionContext* exec utionContext, String* errorMessage); 36 bool {{feature.first_lowered_name}}EnabledImpl(String* errorMessage);
32 {% endif %} 37 {% endif %}
33 {% endfor %} 38 {% endfor %}
39
40 OriginTrialContext* m_originTrialContext;
34 }; 41 };
35 42
36 } // namespace blink 43 } // namespace blink
37 44
38 #endif // OriginTrials_h 45 #endif // OriginTrials_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698