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

Unified Diff: components/policy/core/common/cloud/cloud_policy_client.cc

Issue 756133002: Purge cache when the server removes the policy for an extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 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: components/policy/core/common/cloud/cloud_policy_client.cc
diff --git a/components/policy/core/common/cloud/cloud_policy_client.cc b/components/policy/core/common/cloud/cloud_policy_client.cc
index 3014fd7f1585755d8825c7c6ad01341d57aec0e5..fe2d2675a4458ebf17214d41904c2dea15bcbd84 100644
--- a/components/policy/core/common/cloud/cloud_policy_client.cc
+++ b/components/policy/core/common/cloud/cloud_policy_client.cc
@@ -220,7 +220,8 @@ void CloudPolicyClient::FetchPolicy() {
// Fire the job.
request_job_->Start(base::Bind(&CloudPolicyClient::OnPolicyFetchCompleted,
- base::Unretained(this)));
+ base::Unretained(this),
+ namespaces_to_fetch_));
}
void CloudPolicyClient::FetchRobotAuthCodes(const std::string& auth_token) {
@@ -376,6 +377,7 @@ void CloudPolicyClient::OnFetchRobotAuthCodesCompleted(
}
void CloudPolicyClient::OnPolicyFetchCompleted(
+ const NamespaceSet& namespaces_requested,
DeviceManagementStatus status,
int net_error,
const em::DeviceManagementResponse& response) {
@@ -389,9 +391,10 @@ void CloudPolicyClient::OnPolicyFetchCompleted(
status_ = status;
if (status == DM_STATUS_SUCCESS) {
+ namespaces_requested_ = namespaces_requested;
+ STLDeleteValues(&responses_);
const em::DevicePolicyResponse& policy_response =
response.policy_response();
- STLDeleteValues(&responses_);
for (int i = 0; i < policy_response.response_size(); ++i) {
const em::PolicyFetchResponse& response = policy_response.response(i);
em::PolicyData policy_data;

Powered by Google App Engine
This is Rietveld 408576698