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

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

Issue 9599009: Fix infinite refresh of device policy when the TPM gets out of sync with the stateful partition. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added unit test Created 8 years, 10 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
« no previous file with comments | « chrome/browser/policy/device_policy_cache.h ('k') | chrome/browser/policy/device_policy_cache_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/device_policy_cache.cc
diff --git a/chrome/browser/policy/device_policy_cache.cc b/chrome/browser/policy/device_policy_cache.cc
index 8c4f296282a536497f21084d15882643b2d74c94..922de4b90e657ed42d3103cd794d2c3d9e712831 100644
--- a/chrome/browser/policy/device_policy_cache.cc
+++ b/chrome/browser/policy/device_policy_cache.cc
@@ -142,7 +142,7 @@ void DevicePolicyCache::Load() {
weak_ptr_factory_.GetWeakPtr()));
}
-void DevicePolicyCache::SetPolicy(const em::PolicyFetchResponse& policy) {
+bool DevicePolicyCache::SetPolicy(const em::PolicyFetchResponse& policy) {
DCHECK(IsReady());
// Make sure we have an enterprise device.
@@ -154,7 +154,7 @@ void DevicePolicyCache::SetPolicy(const em::PolicyFetchResponse& policy) {
kMetricPolicySize);
InformNotifier(CloudPolicySubsystem::LOCAL_ERROR,
CloudPolicySubsystem::POLICY_LOCAL_ERROR);
- return;
+ return false;
}
// Check the user this policy is for against the device-locked name.
@@ -165,7 +165,7 @@ void DevicePolicyCache::SetPolicy(const em::PolicyFetchResponse& policy) {
kMetricPolicySize);
InformNotifier(CloudPolicySubsystem::LOCAL_ERROR,
CloudPolicySubsystem::POLICY_LOCAL_ERROR);
- return;
+ return false;
}
if (registration_user != policy_data.username()) {
@@ -175,7 +175,7 @@ void DevicePolicyCache::SetPolicy(const em::PolicyFetchResponse& policy) {
kMetricPolicySize);
InformNotifier(CloudPolicySubsystem::LOCAL_ERROR,
CloudPolicySubsystem::POLICY_LOCAL_ERROR);
- return;
+ return false;
}
set_last_policy_refresh_time(base::Time::NowFromSystemTime());
@@ -185,6 +185,7 @@ void DevicePolicyCache::SetPolicy(const em::PolicyFetchResponse& policy) {
base::Bind(&DevicePolicyCache::PolicyStoreOpCompleted,
weak_ptr_factory_.GetWeakPtr());
new StorePolicyOperation(signed_settings_helper_, policy, callback);
+ return true;
}
void DevicePolicyCache::SetUnmanaged() {
« no previous file with comments | « chrome/browser/policy/device_policy_cache.h ('k') | chrome/browser/policy/device_policy_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698