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

Unified Diff: chrome/browser/policy/cloud/component_cloud_policy_service.cc

Issue 78953002: Fixes and improvements to cloud policy for extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments 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/cloud/component_cloud_policy_service.cc
diff --git a/chrome/browser/policy/cloud/component_cloud_policy_service.cc b/chrome/browser/policy/cloud/component_cloud_policy_service.cc
index 8bed9394440eca10e8669f29fa9c3a46befec7ba..7908f43b2509200d56c33c467a5d53b2d3751eca 100644
--- a/chrome/browser/policy/cloud/component_cloud_policy_service.cc
+++ b/chrome/browser/policy/cloud/component_cloud_policy_service.cc
@@ -145,10 +145,15 @@ void ComponentCloudPolicyService::Backend::Init(
OnSchemasUpdated(schema_map, scoped_ptr<PolicyNamespaceList>());
// Read the initial policy. Note that this does not trigger notifications
- // through OnComponentCloudPolicyStoreUpdated.
+ // through OnComponentCloudPolicyStoreUpdated. Note also that the cached
+ // data may contain names or values that don't match the schema for that
+ // component; the data must be cached without modifications so that its
+ // integrity can be verified using the hash, but it must also be filtered
+ // right after a Load().
store_.Load();
scoped_ptr<PolicyBundle> bundle(new PolicyBundle);
bundle->CopyFrom(store_.policy());
+ schema_map_->FilterBundle(bundle.get());
// Start downloading any pending data.
updater_.reset(new ComponentCloudPolicyUpdater(

Powered by Google App Engine
This is Rietveld 408576698