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

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

Issue 8499021: UserPolicyCache only becomes ready after policy has been fetched. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 9 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_policy_controller.cc
diff --git a/chrome/browser/policy/cloud_policy_controller.cc b/chrome/browser/policy/cloud_policy_controller.cc
index 09371b34053e8b71cbdc0729c40a24921fd9544c..48d0ffa630ccdc4fb9fbca01420136587638e743 100644
--- a/chrome/browser/policy/cloud_policy_controller.cc
+++ b/chrome/browser/policy/cloud_policy_controller.cc
@@ -126,6 +126,7 @@ void CloudPolicyController::HandlePolicyResponse(
} else {
UMA_HISTOGRAM_ENUMERATION(kMetricPolicy, kMetricPolicyFetchBadResponse,
kMetricPolicySize);
+ SetState(STATE_POLICY_UNAVAILABLE);
}
}
@@ -369,6 +370,11 @@ void CloudPolicyController::SetState(
base::Bind(&CloudPolicyController::DoWork, base::Unretained(this)),
delay);
}
+
+ // Inform the cache if a fetch attempt has completed. This happens if policy
+ // has been succesfully fetched, or if token or policy fetching failed.
+ if (state_ != STATE_TOKEN_UNAVAILABLE && state_ != STATE_TOKEN_VALID)
+ cache_->SetFetchingDone();
}
int64 CloudPolicyController::GetRefreshDelay() {

Powered by Google App Engine
This is Rietveld 408576698