| Index: content/browser/gpu/compositor_util.cc
|
| diff --git a/content/browser/gpu/compositor_util.cc b/content/browser/gpu/compositor_util.cc
|
| index 0921c99ccde118f58f0d695246d4d56101226444..1298d758be69ca71da7af70e1afe58c859c8ec19 100644
|
| --- a/content/browser/gpu/compositor_util.cc
|
| +++ b/content/browser/gpu/compositor_util.cc
|
| @@ -6,7 +6,6 @@
|
|
|
| #include <stddef.h>
|
|
|
| -#include <memory>
|
| #include <utility>
|
|
|
| #include "base/command_line.h"
|
| @@ -295,13 +294,13 @@ bool IsCheckerImagingEnabled() {
|
| return false;
|
| }
|
|
|
| -base::DictionaryValue* GetFeatureStatus() {
|
| +std::unique_ptr<base::DictionaryValue> GetFeatureStatus() {
|
| GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance();
|
| std::string gpu_access_blocked_reason;
|
| bool gpu_access_blocked =
|
| !manager->GpuAccessAllowed(&gpu_access_blocked_reason);
|
|
|
| - base::DictionaryValue* feature_status_dict = new base::DictionaryValue();
|
| + auto feature_status_dict = base::MakeUnique<base::DictionaryValue>();
|
|
|
| bool eof = false;
|
| for (size_t i = 0; !eof; ++i) {
|
| @@ -356,23 +355,23 @@ base::DictionaryValue* GetFeatureStatus() {
|
| return feature_status_dict;
|
| }
|
|
|
| -base::Value* GetProblems() {
|
| +std::unique_ptr<base::ListValue> GetProblems() {
|
| GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance();
|
| std::string gpu_access_blocked_reason;
|
| bool gpu_access_blocked =
|
| !manager->GpuAccessAllowed(&gpu_access_blocked_reason);
|
|
|
| - base::ListValue* problem_list = new base::ListValue();
|
| - manager->GetBlacklistReasons(problem_list);
|
| + auto problem_list = base::MakeUnique<base::ListValue>();
|
| + manager->GetBlacklistReasons(problem_list.get());
|
|
|
| if (gpu_access_blocked) {
|
| auto problem = base::MakeUnique<base::DictionaryValue>();
|
| problem->SetString("description",
|
| "GPU process was unable to boot: " + gpu_access_blocked_reason);
|
| - problem->Set("crBugs", new base::ListValue());
|
| - base::ListValue* disabled_features = new base::ListValue();
|
| + problem->Set("crBugs", base::MakeUnique<base::ListValue>());
|
| + auto disabled_features = base::MakeUnique<base::ListValue>();
|
| disabled_features->AppendString("all");
|
| - problem->Set("affectedGpuSettings", disabled_features);
|
| + problem->Set("affectedGpuSettings", std::move(disabled_features));
|
| problem->SetString("tag", "disabledFeatures");
|
| problem_list->Insert(0, std::move(problem));
|
| }
|
| @@ -381,14 +380,13 @@ base::Value* GetProblems() {
|
| for (size_t i = 0; !eof; ++i) {
|
| const GpuFeatureInfo gpu_feature_info = GetGpuFeatureInfo(i, &eof);
|
| if (gpu_feature_info.disabled) {
|
| - std::unique_ptr<base::DictionaryValue> problem(
|
| - new base::DictionaryValue());
|
| + auto problem = base::MakeUnique<base::DictionaryValue>();
|
| problem->SetString(
|
| "description", gpu_feature_info.disabled_description);
|
| - problem->Set("crBugs", new base::ListValue());
|
| - base::ListValue* disabled_features = new base::ListValue();
|
| + problem->Set("crBugs", base::MakeUnique<base::ListValue>());
|
| + auto disabled_features = base::MakeUnique<base::ListValue>();
|
| disabled_features->AppendString(gpu_feature_info.name);
|
| - problem->Set("affectedGpuSettings", disabled_features);
|
| + problem->Set("affectedGpuSettings", std::move(disabled_features));
|
| problem->SetString("tag", "disabledFeatures");
|
| problem_list->Append(std::move(problem));
|
| }
|
|
|