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

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

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.h
diff --git a/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.h b/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.h
index f09122facd9c6526b441fe0ffeb5446fc85d582b..a776a9043befa76b8909766e4ec6e9e94071e239 100644
--- a/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.h
+++ b/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.h
@@ -23,13 +23,13 @@ class WebTrialTokenValidator;
// to check if the experimental feature should be enabled for the current
// context. This class is not for direct use by feature implementers.
// Instead, the OriginTrials generated namespace provides a method for each
-// feature to check if it is enabled. Experimental features must be defined in
+// trial to check if it is enabled. Experimental features must be defined in
// RuntimeEnabledFeatures.in, which is used to generate OriginTrials.h/cpp.
//
-// Experimental features are defined by string names, provided by the
-// implementers. The framework does not maintain an enum or constant list for
-// feature names. Instead, the name provided by the feature implementation
-// is validated against any provided tokens.
+// Origin trials are defined by string names, provided by the implementers. The
+// framework does not maintain an enum or constant list for trial names.
+// Instead, the name provided by the feature implementation is validated against
+// any provided tokens.
//
// For more information, see https://github.com/jpchase/OriginTrials.
class CORE_EXPORT OriginTrialContext final
@@ -66,9 +66,9 @@ class CORE_EXPORT OriginTrialContext final
void addToken(const String& token);
void addTokens(const Vector<String>& tokens);
- // Returns true if the feature should be considered enabled for the current
- // execution context.
- bool isFeatureEnabled(const String& featureName);
+ // Returns true if the trial (and therefore the feature or features it
+ // controls) should be considered enabled for the current execution context.
+ bool isTrialEnabled(const String& trialName);
// Installs JavaScript bindings for any features which should be enabled by
// the current set of trial tokens. This method is idempotent; only features
@@ -84,7 +84,7 @@ class CORE_EXPORT OriginTrialContext final
Member<ExecutionContext> m_host;
Vector<String> m_tokens;
- HashSet<String> m_enabledFeatures;
+ HashSet<String> m_enabledTrials;
WebTrialTokenValidator* m_trialTokenValidator;
};

Powered by Google App Engine
This is Rietveld 408576698