| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WebTrialTokenValidator_h | 5 #ifndef WebTrialTokenValidator_h |
| 6 #define WebTrialTokenValidator_h | 6 #define WebTrialTokenValidator_h |
| 7 | 7 |
| 8 #include "public/platform/WebCallbacks.h" | 8 #include "public/platform/WebCallbacks.h" |
| 9 #include "public/platform/WebSecurityOrigin.h" | 9 #include "public/platform/WebSecurityOrigin.h" |
| 10 #include "public/platform/WebString.h" | 10 #include "public/platform/WebString.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 enum class WebOriginTrialTokenStatus; | 14 enum class WebOriginTrialTokenStatus; |
| 15 | 15 |
| 16 // This interface abstracts the task of validating a token for an experimental | 16 // This interface abstracts the task of validating a token for an experimental |
| 17 // feature. Experimental features can be turned on and off at runtime for a | 17 // feature. Experimental features can be turned on and off at runtime for a |
| 18 // specific renderer, depending on the presence of a valid token provided by | 18 // specific renderer, depending on the presence of a valid token provided by |
| 19 // the origin. | 19 // the origin. |
| 20 // | 20 // |
| 21 // For more information, see https://github.com/jpchase/OriginTrials. | 21 // For more information, see https://github.com/jpchase/OriginTrials. |
| 22 | 22 |
| 23 class WebTrialTokenValidator { | 23 class WebTrialTokenValidator { |
| 24 public: | 24 public: |
| 25 virtual ~WebTrialTokenValidator() {} | 25 virtual ~WebTrialTokenValidator() {} |
| 26 | 26 |
| 27 // Returns true if the given token is valid for the specified origin and | 27 // Returns whether the given token is valid for the specified origin. If the |
| 28 // feature name. | 28 // token is valid, it also returns the feature the token is valid for in |
| 29 virtual WebOriginTrialTokenStatus validateToken(const WebString& token, cons
t WebSecurityOrigin&, const WebString& featureName) = 0; | 29 // |*featureName|. |
| 30 virtual WebOriginTrialTokenStatus validateToken(const WebString& token, cons
t WebSecurityOrigin&, WebString* featureName) = 0; |
| 30 }; | 31 }; |
| 31 | 32 |
| 32 } // namespace blink | 33 } // namespace blink |
| 33 | 34 |
| 34 #endif // WebTrialTokenValidator_h | 35 #endif // WebTrialTokenValidator_h |
| OLD | NEW |