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

Side by Side Diff: third_party/WebKit/Source/build/scripts/templates/OriginTrials.cpp.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, 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 #include "core/origin_trials/OriginTrials.h" 4 #include "core/origin_trials/OriginTrials.h"
5 5
6 #include "core/dom/ExecutionContext.h" 6 #include "core/dom/ExecutionContext.h"
7 #include "platform/RuntimeEnabledFeatures.h" 7 #include "platform/RuntimeEnabledFeatures.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
(...skipping 10 matching lines...) Expand all
21 if (!originTrials) { 21 if (!originTrials) {
22 originTrials = new OriginTrials(host); 22 originTrials = new OriginTrials(host);
23 WillBeHeapSupplement<ExecutionContext>::provideTo(*host, supplementName( ), adoptPtrWillBeNoop(originTrials)); 23 WillBeHeapSupplement<ExecutionContext>::provideTo(*host, supplementName( ), adoptPtrWillBeNoop(originTrials));
24 } 24 }
25 return originTrials; 25 return originTrials;
26 } 26 }
27 27
28 OriginTrials::OriginTrials(ExecutionContext* host) 28 OriginTrials::OriginTrials(ExecutionContext* host)
29 : OriginTrialsBase(host) {} 29 : OriginTrialsBase(host) {}
30 30
31 // static
32 void OriginTrials::setTrialTokensFromHeader(ExecutionContext* executionContext, const String& headerValue)
33 {
34 if (headerValue.isEmpty()) return;
iclelland 2016/04/05 17:01:30 I don't know how much we care about formatting in
Marijn Kruisselbrink 2016/04/05 23:57:00 Yeah, was already fixed in the patch I uploaded ye
35 from(executionContext)->loadTokensFromHeader(headerValue);
36 }
37
31 {% for feature in features %} 38 {% for feature in features %}
32 {% if feature.origin_trial_feature_name %} 39 {% if feature.origin_trial_feature_name %}
33 40
34 // static 41 // static
35 bool OriginTrials::{{feature.first_lowered_name}}Enabled(ExecutionContext* execu tionContext, String& errorMessage) { 42 bool OriginTrials::{{feature.first_lowered_name}}Enabled(ExecutionContext* execu tionContext, String& errorMessage) {
36 return OriginTrials::from(executionContext)->{{feature.first_lowered_name}}E nabledImpl(&errorMessage); 43 return OriginTrials::from(executionContext)->{{feature.first_lowered_name}}E nabledImpl(&errorMessage);
37 } 44 }
38 45
39 // static 46 // static
40 bool OriginTrials::{{feature.first_lowered_name}}Enabled(ExecutionContext* execu tionContext) { 47 bool OriginTrials::{{feature.first_lowered_name}}Enabled(ExecutionContext* execu tionContext) {
(...skipping 13 matching lines...) Expand all
54 } 61 }
55 {% endif %} 62 {% endif %}
56 {% endfor %} 63 {% endfor %}
57 64
58 DEFINE_TRACE(OriginTrials) 65 DEFINE_TRACE(OriginTrials)
59 { 66 {
60 OriginTrialsBase::trace(visitor); 67 OriginTrialsBase::trace(visitor);
61 } 68 }
62 69
63 } // namespace blink 70 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698