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

Side by Side Diff: content/common/origin_trials/trial_token_validator.h

Issue 2123323004: Simplify OriginTrialContext and the way it validates tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mark enum as obsolete Created 4 years, 5 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 unified diff | Download patch
OLDNEW
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 CONTENT_COMMON_ORIGIN_TRIALS_TRIAL_TOKEN_VALIDATOR_H_ 5 #ifndef CONTENT_COMMON_ORIGIN_TRIALS_TRIAL_TOKEN_VALIDATOR_H_
6 #define CONTENT_COMMON_ORIGIN_TRIALS_TRIAL_TOKEN_VALIDATOR_H_ 6 #define CONTENT_COMMON_ORIGIN_TRIALS_TRIAL_TOKEN_VALIDATOR_H_
7 7
8 #include <string> 8 #include <string>
9 #include "base/strings/string_piece.h" 9 #include "base/strings/string_piece.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
11 #include "url/origin.h" 11 #include "url/origin.h"
12 12
13 namespace blink { 13 namespace blink {
14 enum class WebOriginTrialTokenStatus; 14 enum class WebOriginTrialTokenStatus;
15 } 15 }
16 16
17 namespace content { 17 namespace content {
18 18
19 namespace TrialTokenValidator { 19 namespace TrialTokenValidator {
20 20
21 // If token validates, |*feature_name| is set to the name of the feature the
22 // token enables.
21 // This method is thread-safe. 23 // This method is thread-safe.
22 CONTENT_EXPORT blink::WebOriginTrialTokenStatus ValidateToken( 24 CONTENT_EXPORT blink::WebOriginTrialTokenStatus ValidateToken(
23 const std::string& token, 25 const std::string& token,
24 const url::Origin& origin, 26 const url::Origin& origin,
25 base::StringPiece feature_name); 27 std::string* feature_name);
26 28
27 } // namespace TrialTokenValidator 29 } // namespace TrialTokenValidator
28 30
29 } // namespace content 31 } // namespace content
30 32
31 #endif // CONTENT_COMMON_ORIGIN_TRIALS_TRIAL_TOKEN_VALIDATOR_H_ 33 #endif // CONTENT_COMMON_ORIGIN_TRIALS_TRIAL_TOKEN_VALIDATOR_H_
OLDNEW
« no previous file with comments | « content/common/origin_trials/trial_token_unittest.cc ('k') | content/common/origin_trials/trial_token_validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698