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

Unified Diff: content/browser/gpu/compositor_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
Index: content/browser/gpu/compositor_util.cc
diff --git a/content/browser/gpu/compositor_util.cc b/content/browser/gpu/compositor_util.cc
index 09018f7e4eb59a239ab9c775d858cabf77e88667..0d45e84b8bf816a56df01544d85d8e1d7262d523 100644
--- a/content/browser/gpu/compositor_util.cc
+++ b/content/browser/gpu/compositor_util.cc
@@ -6,6 +6,9 @@
#include <stddef.h>
+#include <memory>
+#include <utility>
+
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/logging.h"
@@ -380,7 +383,8 @@ base::Value* GetProblems() {
for (size_t i = 0; !eof; ++i) {
const GpuFeatureInfo gpu_feature_info = GetGpuFeatureInfo(i, &eof);
if (gpu_feature_info.disabled) {
- base::DictionaryValue* problem = new base::DictionaryValue();
+ std::unique_ptr<base::DictionaryValue> problem(
+ new base::DictionaryValue());
problem->SetString(
"description", gpu_feature_info.disabled_description);
problem->Set("crBugs", new base::ListValue());
@@ -389,7 +393,7 @@ base::Value* GetProblems() {
disabled_features->AppendString(gpu_feature_info.name);
problem->Set("affectedGpuSettings", disabled_features);
problem->SetString("tag", "disabledFeatures");
- problem_list->Append(problem);
+ problem_list->Append(std::move(problem));
}
}
return problem_list;

Powered by Google App Engine
This is Rietveld 408576698