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

Unified Diff: chrome/browser/policy/mock_configuration_policy_store.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_store.cc
diff --git a/chrome/browser/policy/mock_configuration_policy_store.cc b/chrome/browser/policy/mock_configuration_policy_store.cc
index bda4688899e32f7a8309f50acb556f267cb8cf2e..1cbf4386d5c6eb4427be8333520eabdd6db6d84b 100644
--- a/chrome/browser/policy/mock_configuration_policy_store.cc
+++ b/chrome/browser/policy/mock_configuration_policy_store.cc
@@ -14,20 +14,16 @@ MockConfigurationPolicyStore::MockConfigurationPolicyStore() {
Invoke(this, &MockConfigurationPolicyStore::ApplyToMap));
}
-MockConfigurationPolicyStore::~MockConfigurationPolicyStore() {
- STLDeleteValues(&policy_map_);
-}
+MockConfigurationPolicyStore::~MockConfigurationPolicyStore() {}
const Value* MockConfigurationPolicyStore::Get(
ConfigurationPolicyType type) const {
- PolicyMap::const_iterator entry(policy_map_.find(type));
- return entry == policy_map_.end() ? NULL : entry->second;
+ return policy_map_.Get(type);
}
void MockConfigurationPolicyStore::ApplyToMap(
ConfigurationPolicyType policy, Value* value) {
- std::swap(policy_map_[policy], value);
- delete value;
+ policy_map_.Set(policy, value);
}
} // namespace policy

Powered by Google App Engine
This is Rietveld 408576698