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

Unified Diff: chromeos/network/policy_applicator.cc

Issue 2387783002: Remove stl_util's deletion functions from chromeos/. (Closed)
Patch Set: armansito Created 4 years, 2 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
« no previous file with comments | « chromeos/network/policy_applicator.h ('k') | chromeos/network/policy_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/policy_applicator.cc
diff --git a/chromeos/network/policy_applicator.cc b/chromeos/network/policy_applicator.cc
index eb4e29641245445b384d1354dab246008554c4ed..b2fec74d551c22b62f71f860370418d95f9fbd4e 100644
--- a/chromeos/network/policy_applicator.cc
+++ b/chromeos/network/policy_applicator.cc
@@ -10,7 +10,7 @@
#include "base/bind.h"
#include "base/location.h"
#include "base/logging.h"
-#include "base/stl_util.h"
+#include "base/memory/ptr_util.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/shill_profile_client.h"
#include "chromeos/network/network_type_pattern.h"
@@ -36,10 +36,10 @@ void LogErrorMessage(const tracked_objects::Location& from_where,
const base::DictionaryValue* GetByGUID(
const PolicyApplicator::GuidToPolicyMap& policies,
const std::string& guid) {
- PolicyApplicator::GuidToPolicyMap::const_iterator it = policies.find(guid);
+ auto it = policies.find(guid);
if (it == policies.end())
return NULL;
- return it->second;
+ return it->second.get();
}
} // namespace
@@ -53,14 +53,13 @@ PolicyApplicator::PolicyApplicator(
: handler_(handler), profile_(profile), weak_ptr_factory_(this) {
global_network_config_.MergeDictionary(&global_network_config);
remaining_policies_.swap(*modified_policies);
- for (GuidToPolicyMap::const_iterator it = all_policies.begin();
- it != all_policies.end(); ++it) {
- all_policies_.insert(std::make_pair(it->first, it->second->DeepCopy()));
+ for (const auto& policy_pair : all_policies) {
+ all_policies_.insert(std::make_pair(policy_pair.first,
+ policy_pair.second->CreateDeepCopy()));
}
}
PolicyApplicator::~PolicyApplicator() {
- base::STLDeleteValues(&all_policies_);
VLOG(1) << "Destroying PolicyApplicator for " << profile_.userhash;
}
« no previous file with comments | « chromeos/network/policy_applicator.h ('k') | chromeos/network/policy_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698