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

Unified Diff: net/http/http_request_headers.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 | « net/dns/dns_config_service.cc ('k') | net/http/http_response_headers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_request_headers.cc
diff --git a/net/http/http_request_headers.cc b/net/http/http_request_headers.cc
index 3d97a3e9ace26a188a64f6e701d2e47671ad5694..11ed2bda0a01748a6a8461712934995e588f43fe 100644
--- a/net/http/http_request_headers.cc
+++ b/net/http/http_request_headers.cc
@@ -7,6 +7,7 @@
#include <utility>
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -190,9 +191,9 @@ std::string HttpRequestHeaders::ToString() const {
std::unique_ptr<base::Value> HttpRequestHeaders::NetLogCallback(
const std::string* request_line,
NetLogCaptureMode capture_mode) const {
- std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
+ auto dict = base::MakeUnique<base::DictionaryValue>();
dict->SetString("line", EscapeNonASCII(*request_line));
- base::ListValue* headers = new base::ListValue();
+ auto headers = base::MakeUnique<base::ListValue>();
for (HeaderVector::const_iterator it = headers_.begin(); it != headers_.end();
++it) {
std::string log_value =
@@ -202,7 +203,7 @@ std::unique_ptr<base::Value> HttpRequestHeaders::NetLogCallback(
headers->AppendString(base::StringPrintf("%s: %s", escaped_name.c_str(),
escaped_value.c_str()));
}
- dict->Set("headers", headers);
+ dict->Set("headers", std::move(headers));
return std::move(dict);
}
« no previous file with comments | « net/dns/dns_config_service.cc ('k') | net/http/http_response_headers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698