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

Unified Diff: content/shell/browser/shell_devtools_bindings.cc

Issue 2891933004: Remove raw base::DictionaryValue::Set in //content (Closed)
Patch Set: 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 | « content/renderer/media/peer_connection_tracker.cc ('k') | content/shell/browser/shell_net_log.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « content/renderer/media/peer_connection_tracker.cc ('k') | content/shell/browser/shell_net_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698