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

Unified Diff: remoting/host/policy_watcher.cc

Issue 1940153002: Use std::unique_ptr to express ownership of base::Value in PolicyMap::Entry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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: remoting/host/policy_watcher.cc
diff --git a/remoting/host/policy_watcher.cc b/remoting/host/policy_watcher.cc
index 96727292f7fd98b3b7efd41526da4448bd92a17b..a6425e1574525e5408afb595f0fdd40886d18edb 100644
--- a/remoting/host/policy_watcher.cc
+++ b/remoting/host/policy_watcher.cc
@@ -90,16 +90,16 @@ std::unique_ptr<base::DictionaryValue> CopyChromotingPoliciesIntoDictionary(
const char kPolicyNameSubstring[] = "RemoteAccessHost";
std::unique_ptr<base::DictionaryValue> policy_dict(
new base::DictionaryValue());
- for (auto it = current.begin(); it != current.end(); ++it) {
- const std::string& key = it->first;
- const base::Value* value = it->second.value;
+ for (const auto& entry : current) {
+ const std::string& key = entry.first;
+ const base::Value* value = entry.second.value.get();
// Copying only Chromoting-specific policies helps avoid false alarms
// raised by NormalizePolicies below (such alarms shutdown the host).
// TODO(lukasza): Removing this somewhat brittle filtering will be possible
// after having separate, Chromoting-specific schema.
if (key.find(kPolicyNameSubstring) != std::string::npos) {
- policy_dict->Set(key, value->DeepCopy());
+ policy_dict->Set(key, value->CreateDeepCopy());
}
}

Powered by Google App Engine
This is Rietveld 408576698