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

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: another-fix Created 4 years, 7 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 | « components/sync_driver/sync_policy_handler_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/policy_watcher.cc
diff --git a/remoting/host/policy_watcher.cc b/remoting/host/policy_watcher.cc
index ce590480ac797728a9ec4ebfb1f29fa105c8b42c..ea90d6373928aa7e905e2ecd63142588fa9e3a4c 100644
--- a/remoting/host/policy_watcher.cc
+++ b/remoting/host/policy_watcher.cc
@@ -90,9 +90,9 @@ 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).
« no previous file with comments | « components/sync_driver/sync_policy_handler_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698