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

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

Issue 68933002: Added SchemaMap::GetChanges(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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
« no previous file with comments | « chrome/browser/policy/schema_map.h ('k') | chrome/browser/policy/schema_map_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/schema_map.cc
diff --git a/chrome/browser/policy/schema_map.cc b/chrome/browser/policy/schema_map.cc
index 08900eefc82e85fe241512fa5697dd4ac4727299..987458e85d15820128d9bcdc9620518974c67b6d 100644
--- a/chrome/browser/policy/schema_map.cc
+++ b/chrome/browser/policy/schema_map.cc
@@ -80,4 +80,26 @@ bool SchemaMap::HasComponents() const {
return false;
}
+void SchemaMap::GetChanges(const scoped_refptr<SchemaMap>& older,
+ PolicyNamespaceList* removed,
+ PolicyNamespaceList* added) const {
+ GetNamespacesNotInOther(older, added);
+ older->GetNamespacesNotInOther(this, removed);
+}
+
+void SchemaMap::GetNamespacesNotInOther(const SchemaMap* other,
+ PolicyNamespaceList* list) const {
+ list->clear();
+ for (DomainMap::const_iterator domain = map_.begin();
+ domain != map_.end(); ++domain) {
+ const ComponentMap& components = domain->second;
+ for (ComponentMap::const_iterator comp = components.begin();
+ comp != components.end(); ++comp) {
+ PolicyNamespace ns(domain->first, comp->first);
+ if (!other->GetSchema(ns))
+ list->push_back(ns);
+ }
+ }
+}
+
} // namespace policy
« no previous file with comments | « chrome/browser/policy/schema_map.h ('k') | chrome/browser/policy/schema_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698