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

Unified Diff: chrome/browser/policy/policy_domain_descriptor.h

Issue 24367003: Refactored users of PolicySchema to use the new policy::Schema class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments Created 7 years, 3 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/browser/policy/policy_domain_descriptor.h
diff --git a/chrome/browser/policy/policy_domain_descriptor.h b/chrome/browser/policy/policy_domain_descriptor.h
index daa3d565e4ed148f82c6e3743d4c5230f45c01d3..2106633f026a1e9033a13ec76de3eb58bb8a6a36 100644
--- a/chrome/browser/policy/policy_domain_descriptor.h
+++ b/chrome/browser/policy/policy_domain_descriptor.h
@@ -12,18 +12,18 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/policy/policy_service.h"
+#include "components/policy/core/common/schema.h"
namespace policy {
class PolicyBundle;
-class PolicySchema;
// For each policy domain, this class keeps the complete list of valid
-// components for that domain, and the PolicySchema for each component.
+// components for that domain, and the Schema for each component.
class PolicyDomainDescriptor
: public base::RefCountedThreadSafe<PolicyDomainDescriptor> {
public:
- typedef std::map<std::string, const PolicySchema*> SchemaMap;
+ typedef std::map<std::string, Schema> SchemaMap;
explicit PolicyDomainDescriptor(PolicyDomain domain);
@@ -34,17 +34,21 @@ class PolicyDomainDescriptor
// |schema|. This registration overrides any previously set schema for this
// component.
void RegisterComponent(const std::string& component_id,
- scoped_ptr<PolicySchema> schema);
+ scoped_ptr<SchemaOwner> schema);
// Removes all the policies in |bundle| that don't match this descriptor.
// Policies of domains other than |domain_| are ignored.
void FilterBundle(PolicyBundle* bundle) const;
private:
+ typedef std::map<std::string, SchemaOwner*> SchemaOwnerMap;
+
friend class base::RefCountedThreadSafe<PolicyDomainDescriptor>;
+
~PolicyDomainDescriptor();
PolicyDomain domain_;
+ SchemaOwnerMap schema_owner_map_;
SchemaMap schema_map_;
DISALLOW_COPY_AND_ASSIGN(PolicyDomainDescriptor);

Powered by Google App Engine
This is Rietveld 408576698