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

Unified Diff: base/test/gtest_util.cc

Issue 2058233002: Rewrite simple uses of base::ListValue::Append() taking a raw pointer var. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: less comments more ownership Created 4 years, 6 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 | « no previous file | chrome/browser/devtools/devtools_targets_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/gtest_util.cc
diff --git a/base/test/gtest_util.cc b/base/test/gtest_util.cc
index b0623432badd05ad3f50f4b5384589ed393a1aa5..50ac9e6ff6cd0fc59be22a50a750ee9004ff0811 100644
--- a/base/test/gtest_util.cc
+++ b/base/test/gtest_util.cc
@@ -6,6 +6,8 @@
#include <stddef.h>
+#include <memory>
+
#include "base/files/file_path.h"
#include "base/json/json_file_value_serializer.h"
#include "base/values.h"
@@ -47,12 +49,12 @@ bool WriteCompiledInTestsToFile(const FilePath& path) {
ListValue root;
for (size_t i = 0; i < tests.size(); ++i) {
- DictionaryValue* test_info = new DictionaryValue;
+ std::unique_ptr<class base::DictionaryValue> test_info(new DictionaryValue);
test_info->SetString("test_case_name", tests[i].test_case_name);
test_info->SetString("test_name", tests[i].test_name);
test_info->SetString("file", tests[i].file);
test_info->SetInteger("line", tests[i].line);
- root.Append(test_info);
+ root.Append(std::move(test_info));
}
JSONFileValueSerializer serializer(path);
« no previous file with comments | « no previous file | chrome/browser/devtools/devtools_targets_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698