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

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

Issue 2891933004: Remove raw base::DictionaryValue::Set in //content (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
Index: content/shell/browser/shell_net_log.cc
diff --git a/content/shell/browser/shell_net_log.cc b/content/shell/browser/shell_net_log.cc
index a765603acaa56bf5694fc36f688ffb37dd3d83a6..aebbc092e072b884b68215f0ed936ebccbb54753 100644
--- a/content/shell/browser/shell_net_log.cc
+++ b/content/shell/browser/shell_net_log.cc
@@ -5,11 +5,13 @@
#include "content/shell/browser/shell_net_log.h"
#include <stdio.h>
+
#include <utility>
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/files/scoped_file.h"
+#include "base/memory/ptr_util.h"
#include "base/values.h"
#include "build/build_config.h"
#include "content/public/common/content_switches.h"
@@ -20,21 +22,22 @@ namespace content {
namespace {
-base::DictionaryValue* GetShellConstants(const std::string& app_name) {
+std::unique_ptr<base::DictionaryValue> GetShellConstants(
+ const std::string& app_name) {
std::unique_ptr<base::DictionaryValue> constants_dict =
net::GetNetConstants();
// Add a dictionary with client information
- base::DictionaryValue* dict = new base::DictionaryValue();
+ auto dict = base::MakeUnique<base::DictionaryValue>();
dict->SetString("name", app_name);
dict->SetString(
"command_line",
base::CommandLine::ForCurrentProcess()->GetCommandLineString());
- constants_dict->Set("clientInfo", dict);
+ constants_dict->Set("clientInfo", std::move(dict));
- return constants_dict.release();
+ return constants_dict;
}
} // namespace
« no previous file with comments | « content/shell/browser/shell_devtools_bindings.cc ('k') | content/shell/renderer/layout_test/leak_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698