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

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

Issue 15061007: Added a PolicyDomainDescriptor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments, rebase on new PolicySchema Created 7 years, 7 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/async_policy_loader.cc
diff --git a/chrome/browser/policy/async_policy_loader.cc b/chrome/browser/policy/async_policy_loader.cc
index 13e23e2d19b96b30e83fb08f2828cf5ef133c891..f7357b076f0c10466ac2fa9acd6bc4557620e746 100644
--- a/chrome/browser/policy/async_policy_loader.cc
+++ b/chrome/browser/policy/async_policy_loader.cc
@@ -55,10 +55,24 @@ void AsyncPolicyLoader::Reload(bool force) {
return;
}
+ // Filter out mismatching policies.
+ for (DescriptorMap::iterator it = descriptor_map_.begin();
+ it != descriptor_map_.end(); ++it) {
+ it->second->FilterBundle(bundle.get());
+ }
+
update_callback_.Run(bundle.Pass());
ScheduleNextReload(TimeDelta::FromSeconds(kReloadIntervalSeconds));
}
+void AsyncPolicyLoader::RegisterPolicyDomain(
+ scoped_refptr<const PolicyDomainDescriptor> descriptor) {
+ if (descriptor->domain() != POLICY_DOMAIN_CHROME) {
+ descriptor_map_[descriptor->domain()] = descriptor;
+ Reload(true);
+ }
+}
+
scoped_ptr<PolicyBundle> AsyncPolicyLoader::InitialLoad() {
// This is the first load, early during startup. Use this to record the
// initial |last_modification_time_|, so that potential changes made before

Powered by Google App Engine
This is Rietveld 408576698