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

Unified Diff: third_party/WebKit/public/platform/WebTrialTokenValidator.h

Issue 1909633003: Collect UMA data for Origin Trials (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/public/platform/WebTrialTokenValidator.h
diff --git a/third_party/WebKit/public/platform/WebTrialTokenValidator.h b/third_party/WebKit/public/platform/WebTrialTokenValidator.h
index b11cb215a68614b540b686f6f1d4ad2c12b58402..8f37d6b453a755f02e40e9e11ff02287df3ebe83 100644
--- a/third_party/WebKit/public/platform/WebTrialTokenValidator.h
+++ b/third_party/WebKit/public/platform/WebTrialTokenValidator.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef WebTrialTokenValidator_h
-#define WebTrialTokenValidator_h
+#ifndef THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_WEBTRIALTOKENVALIDATOR_H_
Marijn Kruisselbrink 2016/04/21 18:18:43 Why this change?
chasej 2016/04/22 18:50:06 A side effect of the battle between git cl format,
Marijn Kruisselbrink 2016/04/22 21:51:06 Since I don't see any code anywhere in blink with
chasej 2016/04/25 20:32:52 Done.
+#define THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_WEBTRIALTOKENVALIDATOR_H_
#include "public/platform/WebCallbacks.h"
#include "public/platform/WebSecurityOrigin.h"
@@ -16,18 +16,31 @@ namespace blink {
// specific renderer, depending on the presence of a valid token provided by
// the origin.
//
-// More documentation on the design of the experimental framework is at
-// https://docs.google.com/document/d/1qVP2CK1lbfmtIJRIm6nwuEFFhGhYbtThLQPo3CSTtmg
+// For more information, see https://github.com/jpchase/OriginTrials.
class WebTrialTokenValidator {
public:
+ enum TokenValidationResult {
+ TokenValidationResultSuccess = 0,
+ TokenValidationResultExpired,
+ TokenValidationResultInvalidSignature,
+ TokenValidationResultMalformed,
+ TokenValidationResultNotSupported,
+ TokenValidationResultWrongFeature,
+ TokenValidationResultWrongOrigin,
+ };
+
virtual ~WebTrialTokenValidator() {}
// Returns true if the given token is valid for the specified origin and
// feature name.
- virtual bool validateToken(const WebString& token, const WebSecurityOrigin&, const WebString& featureName) = 0;
+ virtual TokenValidationResult validateToken(
+ const WebString& token,
+ const WebSecurityOrigin&,
+ const WebString& featureName)
+ = 0;
};
} // namespace blink
-#endif // WebTrialTokenValidator_h
+#endif // THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_WEBTRIALTOKENVALIDATOR_H_

Powered by Google App Engine
This is Rietveld 408576698