Index: content/shell/browser/shell_devtools_bindings.cc |
diff --git a/content/shell/browser/shell_devtools_bindings.cc b/content/shell/browser/shell_devtools_bindings.cc |
index 77bfc75a95bed31056a00181e54bd7013ddced47..e13e73db8f88d449ed884e91de0712ae3848fc09 100644 |
--- a/content/shell/browser/shell_devtools_bindings.cc |
+++ b/content/shell/browser/shell_devtools_bindings.cc |
@@ -6,10 +6,13 @@ |
#include <stddef.h> |
+#include <utility> |
+ |
#include "base/json/json_reader.h" |
#include "base/json/json_writer.h" |
#include "base/json/string_escape.h" |
#include "base/macros.h" |
+#include "base/memory/ptr_util.h" |
#include "base/strings/string_number_conversions.h" |
#include "base/strings/stringprintf.h" |
#include "base/strings/utf_string_conversions.h" |
@@ -323,16 +326,16 @@ void ShellDevToolsBindings::OnURLFetchComplete(const net::URLFetcher* source) { |
DCHECK(it != pending_requests_.end()); |
base::DictionaryValue response; |
- base::DictionaryValue* headers = new base::DictionaryValue(); |
+ auto headers = base::MakeUnique<base::DictionaryValue>(); |
net::HttpResponseHeaders* rh = source->GetResponseHeaders(); |
response.SetInteger("statusCode", rh ? rh->response_code() : 200); |
- response.Set("headers", headers); |
size_t iterator = 0; |
std::string name; |
std::string value; |
while (rh && rh->EnumerateHeaderLines(&iterator, &name, &value)) |
headers->SetString(name, value); |
+ response.Set("headers", std::move(headers)); |
SendMessageAck(it->second, &response); |
pending_requests_.erase(it); |