Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 CHROME_COMMON_ORIGIN_TRIALS_ORIGIN_TRIAL_KEY_MANAGER_H_ | 5 #ifndef CHROME_COMMON_ORIGIN_TRIALS_ORIGIN_TRIAL_KEY_MANAGER_H_ |
| 6 #define CHROME_COMMON_ORIGIN_TRIALS_ORIGIN_TRIAL_KEY_MANAGER_H_ | 6 #define CHROME_COMMON_ORIGIN_TRIALS_ORIGIN_TRIAL_KEY_MANAGER_H_ |
| 7 | 7 |
| 8 #include <set> | |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 11 #include "base/strings/string_piece.h" | 12 #include "base/strings/string_piece.h" |
| 12 | 13 |
| 13 class PrefRegistrySimple; | 14 class PrefRegistrySimple; |
| 14 | 15 |
| 15 // This class is instantiated on the main/ui thread, but its methods can be | 16 // This class is instantiated on the main/ui thread, but its methods can be |
| 16 // accessed from any thread. | 17 // accessed from any thread. |
| 17 class OriginTrialKeyManager { | 18 class OriginTrialKeyManager { |
|
chasej
2016/06/07 15:51:31
This class now does more than manage keys. I think
iclelland
2016/06/08 15:38:52
Renamed in refactor-CL https://codereview.chromium
| |
| 18 public: | 19 public: |
| 19 OriginTrialKeyManager(); | 20 OriginTrialKeyManager(); |
| 20 ~OriginTrialKeyManager(); | 21 ~OriginTrialKeyManager(); |
| 21 | 22 |
| 22 bool SetPublicKeyFromASCIIString(const std::string& ascii_public_key); | 23 bool SetPublicKeyFromASCIIString(const std::string& ascii_public_key); |
| 23 base::StringPiece GetPublicKey() const; | 24 base::StringPiece GetPublicKey() const; |
| 25 bool SetDisabledFeatures(const std::string& disabled_feature_list); | |
| 26 bool IsFeatureDisabled(base::StringPiece feature); | |
|
Sorin Jianu
2016/06/07 17:20:24
Most likely, StringPiece can be forward declared.
iclelland
2016/06/08 13:37:56
I don't think so -- it's a typedef to a template;
| |
| 24 | 27 |
| 25 static void RegisterPrefs(PrefRegistrySimple* registry); | 28 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 26 | 29 |
| 27 private: | 30 private: |
| 28 std::string public_key_; | 31 std::string public_key_; |
| 32 std::set<std::string> disabled_features_; | |
| 29 | 33 |
| 30 DISALLOW_COPY_AND_ASSIGN(OriginTrialKeyManager); | 34 DISALLOW_COPY_AND_ASSIGN(OriginTrialKeyManager); |
| 31 }; | 35 }; |
| 32 | 36 |
| 33 #endif // CHROME_COMMON_ORIGIN_TRIALS_ORIGIN_TRIAL_KEY_MANAGER_H_ | 37 #endif // CHROME_COMMON_ORIGIN_TRIALS_ORIGIN_TRIAL_KEY_MANAGER_H_ |
| OLD | NEW |