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

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

Issue 47513018: Make the internal storage of policy::Schemas ref counted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@chrome-policy-schema-4-new-generate
Patch Set: rebase Created 7 years, 1 month 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.cc
diff --git a/chrome/browser/policy/policy_domain_descriptor.cc b/chrome/browser/policy/policy_domain_descriptor.cc
index f054710a5d13a9b953c8b99c0a74ce6ddf95c407..3719860fc4eaf094a63823a1deddc07d1d00001f 100644
--- a/chrome/browser/policy/policy_domain_descriptor.cc
+++ b/chrome/browser/policy/policy_domain_descriptor.cc
@@ -47,13 +47,9 @@ bool Matches(Schema schema, const base::Value& value) {
PolicyDomainDescriptor::PolicyDomainDescriptor(PolicyDomain domain)
: domain_(domain) {}
-void PolicyDomainDescriptor::RegisterComponent(
- const std::string& component_id,
- scoped_ptr<SchemaOwner> schema) {
- SchemaOwner*& entry = schema_owner_map_[component_id];
- delete entry;
- entry = schema.release();
- schema_map_[component_id] = entry ? entry->schema() : Schema();
+void PolicyDomainDescriptor::RegisterComponent(const std::string& component_id,
+ Schema schema) {
+ schema_map_[component_id] = schema;
}
void PolicyDomainDescriptor::FilterBundle(PolicyBundle* bundle) const {
@@ -94,8 +90,6 @@ void PolicyDomainDescriptor::FilterBundle(PolicyBundle* bundle) const {
}
}
-PolicyDomainDescriptor::~PolicyDomainDescriptor() {
- STLDeleteValues(&schema_owner_map_);
-}
+PolicyDomainDescriptor::~PolicyDomainDescriptor() {}
} // namespace policy
« no previous file with comments | « chrome/browser/policy/policy_domain_descriptor.h ('k') | chrome/browser/policy/policy_domain_descriptor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698