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

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

Issue 2398793003: [Origin Trials] Clarify the distinction between trials and features (Closed)
Patch Set: Rebase; -DurableStorage, +WebVR 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: third_party/WebKit/Source/core/origin_trials/OriginTrialContext.cpp
diff --git a/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.cpp b/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.cpp
index 5400bfa4b8c99dffb5ef9a07a0428a5ab1e4c035..fb45fcff2d457c0d57c2564ec07cdb1d42272382 100644
--- a/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.cpp
+++ b/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.cpp
@@ -169,17 +169,17 @@ void OriginTrialContext::addTokens(const Vector<String>& tokens) {
}
}
-bool OriginTrialContext::isFeatureEnabled(const String& featureName) {
+bool OriginTrialContext::isTrialEnabled(const String& trialName) {
if (!RuntimeEnabledFeatures::originTrialsEnabled())
return false;
- return m_enabledFeatures.contains(featureName);
+ return m_enabledTrials.contains(trialName);
}
void OriginTrialContext::validateToken(const String& token) {
DCHECK(!token.isEmpty());
- // Feature trials are only enabled for secure origins
+ // Origin trials are only enabled for secure origins
if (!m_host->isSecureContext()) {
tokenValidationResultHistogram().count(
static_cast<int>(WebOriginTrialTokenStatus::Insecure));
@@ -193,11 +193,11 @@ void OriginTrialContext::validateToken(const String& token) {
}
WebSecurityOrigin origin(m_host->getSecurityOrigin());
- WebString featureName;
+ WebString trialName;
WebOriginTrialTokenStatus tokenResult =
- m_trialTokenValidator->validateToken(token, origin, &featureName);
+ m_trialTokenValidator->validateToken(token, origin, &trialName);
if (tokenResult == WebOriginTrialTokenStatus::Success)
- m_enabledFeatures.add(featureName);
+ m_enabledTrials.add(trialName);
tokenValidationResultHistogram().count(static_cast<int>(tokenResult));
}

Powered by Google App Engine
This is Rietveld 408576698