Index: net/http/http_response_headers.cc |
diff --git a/net/http/http_response_headers.cc b/net/http/http_response_headers.cc |
index 79ae58416388dd3e2333070c6cb39ef757d9815a..98f2f7d2f1b3cc8c44b1f2066e7ad67ba223ec60 100644 |
--- a/net/http/http_response_headers.cc |
+++ b/net/http/http_response_headers.cc |
@@ -15,6 +15,7 @@ |
#include "base/format_macros.h" |
#include "base/logging.h" |
+#include "base/memory/ptr_util.h" |
#include "base/metrics/histogram_macros.h" |
#include "base/pickle.h" |
#include "base/strings/string_number_conversions.h" |
@@ -1264,8 +1265,8 @@ bool HttpResponseHeaders::GetContentRangeFor206( |
std::unique_ptr<base::Value> HttpResponseHeaders::NetLogCallback( |
NetLogCaptureMode capture_mode) const { |
- std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
- base::ListValue* headers = new base::ListValue(); |
+ auto dict = base::MakeUnique<base::DictionaryValue>(); |
+ auto headers = base::MakeUnique<base::ListValue>(); |
headers->AppendString(EscapeNonASCII(GetStatusLine())); |
size_t iterator = 0; |
std::string name; |
@@ -1278,7 +1279,7 @@ std::unique_ptr<base::Value> HttpResponseHeaders::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); |
} |