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

Unified Diff: content/common/origin_trials/trial_token.h

Issue 2411803002: Support subdomain matching in trial tokens (Closed)
Patch Set: Add fuzzer data for subdomain tokens Created 4 years, 2 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: content/common/origin_trials/trial_token.h
diff --git a/content/common/origin_trials/trial_token.h b/content/common/origin_trials/trial_token.h
index 73eb3616f677faa51779ae62c6281e54ecb6342a..9432756394ab3f74ed57b452e5d444cfbfced54a 100644
--- a/content/common/origin_trials/trial_token.h
+++ b/content/common/origin_trials/trial_token.h
@@ -21,14 +21,13 @@ enum class WebOriginTrialTokenStatus;
namespace content {
-// The Experimental Framework (EF) provides limited access to experimental
-// features, on a per-origin basis (origin trials). This class defines the trial
-// token data structure, used to securely provide access to an experimental
-// feature.
+// The Origin Trials Framework (OT) provides limited access to experimental
+// features, on a per-origin basis. This class defines the trial token data
+// structure, used to securely provide access to an experimental feature.
//
-// Features are defined by string names, provided by the implementers. The EF
+// Features are defined by string names, provided by the implementers. The OT
// code does not maintain an enum or constant list for feature names. Instead,
-// the EF validates the name provided by the feature implementation against any
+// it validates the name provided by the feature implementation against any
// provided tokens.
//
// More documentation on the token format can be found at
@@ -58,6 +57,7 @@ class CONTENT_EXPORT TrialToken {
const base::Time& now) const;
url::Origin origin() { return origin_; }
+ bool match_subdomains() const { return match_subdomains_; }
std::string feature_name() { return feature_name_; }
base::Time expiry_time() { return expiry_time_; }
@@ -92,12 +92,16 @@ class CONTENT_EXPORT TrialToken {
private:
TrialToken(const url::Origin& origin,
+ bool match_subdomains,
const std::string& feature_name,
uint64_t expiry_timestamp);
// The origin for which this token is valid. Must be a secure origin.
url::Origin origin_;
+ // Indicates if the token should match all subdomains of the origin.
+ bool match_subdomains_;
+
// The name of the experimental feature which this token enables.
std::string feature_name_;
« no previous file with comments | « no previous file | content/common/origin_trials/trial_token.cc » ('j') | content/common/origin_trials/trial_token.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698