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

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

Issue 1741783002: Add disabled origin trial feature list (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ef-finch
Patch Set: Rebase Created 4 years, 6 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 a5a268fbb0a580c98c9b4c95175823c4970ca3d3..aafc6c96107edb07d783df9368c10a2ece1c5610 100644
--- a/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.cpp
+++ b/third_party/WebKit/Source/core/origin_trials/OriginTrialContext.cpp
@@ -87,6 +87,7 @@ int getTokenValidationResultPriority(
switch (validationResult) {
case WebOriginTrialTokenStatus::Success:
case WebOriginTrialTokenStatus::Insecure:
+ case WebOriginTrialTokenStatus::FeatureDisabled:
// This function should only be used for token validation failures
NOTREACHED();
return 99;
@@ -373,8 +374,10 @@ WebOriginTrialTokenStatus OriginTrialContext::checkFeatureEnabled(const String&
// Check with the validator service to verify the signature and that
// the token is valid for the combination of origin and feature.
WebOriginTrialTokenStatus tokenResult = m_trialTokenValidator->validateToken(token, origin, featureName);
- if (tokenResult == WebOriginTrialTokenStatus::Success) {
- return WebOriginTrialTokenStatus::Success;
+ // If the feature is disabled by policy, or if the token is valid, we
+ // can return immediately now.
+ if (tokenResult == WebOriginTrialTokenStatus::FeatureDisabled || tokenResult == WebOriginTrialTokenStatus::Success) {
+ return tokenResult;
}
failedValidationResult = UpdateResultFromValidationFailure(tokenResult, failedValidationResult);
}
« no previous file with comments | « content/shell/common/shell_origin_trial_policy.cc ('k') | third_party/WebKit/public/platform/WebOriginTrialTokenStatus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698