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

Unified Diff: chrome/common/origin_trials/chrome_origin_trial_policy.h

Issue 2049783002: Refactor OriginTrialPolicy to be an abstract interface in content/public/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ef-add-revoked-feature-list
Patch Set: 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: chrome/common/origin_trials/chrome_origin_trial_policy.h
diff --git a/chrome/common/origin_trials/origin_trial_key_manager.h b/chrome/common/origin_trials/chrome_origin_trial_policy.h
similarity index 50%
rename from chrome/common/origin_trials/origin_trial_key_manager.h
rename to chrome/common/origin_trials/chrome_origin_trial_policy.h
index a2806f1891ab08d8ccd9dbe9eea29f124d1e4e5e..1fa0692f6a7e5bfcdf8cd66dfc0d3da925ab5649 100644
--- a/chrome/common/origin_trials/origin_trial_key_manager.h
+++ b/chrome/common/origin_trials/chrome_origin_trial_policy.h
@@ -2,32 +2,35 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_COMMON_ORIGIN_TRIALS_ORIGIN_TRIAL_KEY_MANAGER_H_
-#define CHROME_COMMON_ORIGIN_TRIALS_ORIGIN_TRIAL_KEY_MANAGER_H_
+#ifndef CHROME_COMMON_ORIGIN_TRIALS_CHROME_ORIGIN_TRIAL_POLICY_H_
+#define CHROME_COMMON_ORIGIN_TRIALS_CHROME_ORIGIN_TRIAL_POLICY_H_
#include <set>
#include <string>
#include "base/macros.h"
#include "base/strings/string_piece.h"
+#include "content/public/common/origin_trial_policy.h"
// This class is instantiated on the main/ui thread, but its methods can be
// accessed from any thread.
-class OriginTrialKeyManager {
+class ChromeOriginTrialPolicy : public content::OriginTrialPolicy {
public:
- OriginTrialKeyManager();
- ~OriginTrialKeyManager();
+ ChromeOriginTrialPolicy();
+ ~ChromeOriginTrialPolicy() override;
+
+ // OriginTrialPolicy interface
+ base::StringPiece GetPublicKey() const override;
+ bool IsFeatureDisabled(base::StringPiece feature) const override;
bool SetPublicKeyFromASCIIString(const std::string& ascii_public_key);
- base::StringPiece GetPublicKey() const;
bool SetDisabledFeatures(const std::string& disabled_feature_list);
- bool IsFeatureDisabled(base::StringPiece feature) const;
private:
std::string public_key_;
std::set<std::string> disabled_features_;
- DISALLOW_COPY_AND_ASSIGN(OriginTrialKeyManager);
+ DISALLOW_COPY_AND_ASSIGN(ChromeOriginTrialPolicy);
};
-#endif // CHROME_COMMON_ORIGIN_TRIALS_ORIGIN_TRIAL_KEY_MANAGER_H_
+#endif // CHROME_COMMON_ORIGIN_TRIALS_CHROME_ORIGIN_TRIAL_POLICY_H_

Powered by Google App Engine
This is Rietveld 408576698