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

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: fix chromeos build 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
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 86d01aa8693754b1b7f8d29fe9acf038fdf21e8a..e77aec76bbc8655eef386288ad3250ba38c4ea19 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);
}
@@ -84,6 +85,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.

Powered by Google App Engine
This is Rietveld 408576698