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

Unified Diff: net/dns/dns_config_service.cc

Issue 2899723003: Remove raw base::DictionaryValue::Set in //net (Closed)
Patch Set: Rebase Created 3 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 | « no previous file | net/http/http_request_headers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/dns_config_service.cc
diff --git a/net/dns/dns_config_service.cc b/net/dns/dns_config_service.cc
index 1a7a59d5df438ad506ef864722e96944144c416c..64f70fe2cae81e60e16c06df51c75a96e589698d 100644
--- a/net/dns/dns_config_service.cc
+++ b/net/dns/dns_config_service.cc
@@ -4,7 +4,10 @@
#include "net/dns/dns_config_service.h"
+#include <utility>
+
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/values.h"
#include "net/base/ip_endpoint.h"
@@ -60,17 +63,17 @@ void DnsConfig::CopyIgnoreHosts(const DnsConfig& d) {
}
std::unique_ptr<base::Value> DnsConfig::ToValue() const {
- std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
+ auto dict = base::MakeUnique<base::DictionaryValue>();
- base::ListValue* list = new base::ListValue();
+ auto list = base::MakeUnique<base::ListValue>();
for (size_t i = 0; i < nameservers.size(); ++i)
list->AppendString(nameservers[i].ToString());
- dict->Set("nameservers", list);
+ dict->Set("nameservers", std::move(list));
- list = new base::ListValue();
+ list = base::MakeUnique<base::ListValue>();
for (size_t i = 0; i < search.size(); ++i)
list->AppendString(search[i]);
- dict->Set("search", list);
+ dict->Set("search", std::move(list));
dict->SetBoolean("unhandled_options", unhandled_options);
dict->SetBoolean("append_to_multi_label_name", append_to_multi_label_name);
« no previous file with comments | « no previous file | net/http/http_request_headers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698