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

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

Issue 98433003: Fixed crash in CloudPolicyManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments Created 7 years 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/cloud/component_cloud_policy_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/cloud/user_cloud_policy_manager.cc
diff --git a/chrome/browser/policy/cloud/user_cloud_policy_manager.cc b/chrome/browser/policy/cloud/user_cloud_policy_manager.cc
index e74a931097a42b86ba52e952bce7da7e3805c2e9..77e3adae0d3b4a638fe250b32c92748a487d25b9 100644
--- a/chrome/browser/policy/cloud/user_cloud_policy_manager.cc
+++ b/chrome/browser/policy/cloud/user_cloud_policy_manager.cc
@@ -66,6 +66,7 @@ void UserCloudPolicyManager::Connect(
policy_prefs::kUserPolicyRefreshRate);
if (external_data_manager_)
external_data_manager_->Connect(request_context);
+
CreateComponentCloudPolicyService(component_policy_cache_path_,
request_context);
}
@@ -89,6 +90,12 @@ void UserCloudPolicyManager::DisconnectAndRemovePolicy() {
if (external_data_manager_)
external_data_manager_->Disconnect();
core()->Disconnect();
+
+ // store_->Clear() will publish the updated, empty policy. The component
+ // policy service must be cleared before OnStoreLoaded() is issued, so that
+ // component policies are also empty at CheckAndPublishPolicy().
+ ClearAndDestroyComponentCloudPolicyService();
+
// When the |store_| is cleared, it informs the |external_data_manager_| that
// all external data references have been removed, causing the
// |external_data_manager_| to clear its cache as well.
« no previous file with comments | « chrome/browser/policy/cloud/component_cloud_policy_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698