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

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: Switch to lazy initialization in ChromeContentClient 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
« no previous file with comments | « chrome/common/chrome_content_client.cc ('k') | chrome/common/origin_trials/chrome_origin_trial_policy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/origin_trials/chrome_origin_trial_policy.h
diff --git a/chrome/common/origin_trials/chrome_origin_trial_policy.h b/chrome/common/origin_trials/chrome_origin_trial_policy.h
new file mode 100644
index 0000000000000000000000000000000000000000..b6ea373cb99e994557534de5e1855983fabc2ed9
--- /dev/null
+++ b/chrome/common/origin_trials/chrome_origin_trial_policy.h
@@ -0,0 +1,32 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// 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_CHROME_ORIGIN_TRIAL_POLICY_H_
+#define CHROME_COMMON_ORIGIN_TRIALS_CHROME_ORIGIN_TRIAL_POLICY_H_
+
+#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 ChromeOriginTrialPolicy : public content::OriginTrialPolicy {
+ public:
+ ChromeOriginTrialPolicy();
+ ~ChromeOriginTrialPolicy() override;
+
+ // OriginTrialPolicy interface
+ base::StringPiece GetPublicKey() const override;
+
+ bool SetPublicKeyFromASCIIString(const std::string& ascii_public_key);
+
+ private:
+ std::string public_key_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChromeOriginTrialPolicy);
+};
+
+#endif // CHROME_COMMON_ORIGIN_TRIALS_CHROME_ORIGIN_TRIAL_POLICY_H_
« no previous file with comments | « chrome/common/chrome_content_client.cc ('k') | chrome/common/origin_trials/chrome_origin_trial_policy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698