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

Unified Diff: third_party/WebKit/Source/core/origin_trials/OriginTrialContext.h

Issue 1802773002: Support loading trial tokens from HTTP headers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clarify comment 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/origin_trials/OriginTrialContext.h
diff --git a/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.h b/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.h
index 1b4b6772a2957519e527e8b250413092b5d323fa..7f29843ee01b8eaed2237d98908e6813707d4147 100644
--- a/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.h
+++ b/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.h
@@ -39,6 +39,14 @@ public:
static const char* supplementName();
static OriginTrialContext* from(ExecutionContext*);
+ // Parses an Origin-Trial header as specified in
+ // https://jpchase.github.io/OriginTrials/#header into individual tokens.
+ // Returns null if the header value was malformed and could not be parsed.
+ // If the header does not contain any tokens, this returns an empty vector.
+ static std::unique_ptr<Vector<String>> parseHeaderValue(const String& headerValue);
Nate Chapin 2016/04/21 22:09:10 Is this public only for testing? If so, can we add
Marijn Kruisselbrink 2016/04/21 22:22:47 It's also public because in a follow-up patch (htt
Nate Chapin 2016/04/21 22:25:56 Makes sense.
+
+ static void addTokensFromHeader(ExecutionContext*, const String& headerValue);
+
void addToken(const String& token);
// Returns true if the feature should be considered enabled for the current

Powered by Google App Engine
This is Rietveld 408576698