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

Unified Diff: net/http/http_response_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/http/http_request_headers.cc ('k') | net/http/transport_security_persister.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « net/http/http_request_headers.cc ('k') | net/http/transport_security_persister.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698