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

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

Issue 6532019: New policy protobuf protocol. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix one more leak Created 9 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
Index: chrome/browser/policy/mock_configuration_policy_provider.cc
diff --git a/chrome/browser/policy/mock_configuration_policy_provider.cc b/chrome/browser/policy/mock_configuration_policy_provider.cc
index a2566b050f53bce640515ff573f2faa7115f356c..46f997c5d1dcfaa0160d90b6cee2772a0b7b8b15 100644
--- a/chrome/browser/policy/mock_configuration_policy_provider.cc
+++ b/chrome/browser/policy/mock_configuration_policy_provider.cc
@@ -15,23 +15,16 @@ MockConfigurationPolicyProvider::MockConfigurationPolicyProvider()
initialization_complete_(false) {
}
-MockConfigurationPolicyProvider::~MockConfigurationPolicyProvider() {
- STLDeleteValues(&policy_map_);
-}
+MockConfigurationPolicyProvider::~MockConfigurationPolicyProvider() {}
void MockConfigurationPolicyProvider::AddPolicy(ConfigurationPolicyType policy,
Value* value) {
- std::swap(policy_map_[policy], value);
- delete value;
+ policy_map_.Set(policy, value);
}
void MockConfigurationPolicyProvider::RemovePolicy(
ConfigurationPolicyType policy) {
- const PolicyMap::iterator entry = policy_map_.find(policy);
- if (entry != policy_map_.end()) {
- delete entry->second;
- policy_map_.erase(entry);
- }
+ policy_map_.Erase(policy);
}
void MockConfigurationPolicyProvider::SetInitializationComplete(
@@ -52,4 +45,4 @@ bool MockConfigurationPolicyProvider::IsInitializationComplete() const {
return initialization_complete_;
}
-}
+} // namespace policy

Powered by Google App Engine
This is Rietveld 408576698