| Index: content/browser/gpu/compositor_util.cc
|
| diff --git a/content/browser/gpu/compositor_util.cc b/content/browser/gpu/compositor_util.cc
|
| index bcd0f5bbc6e2c03f30ef7f8092c47c2e19a13f37..bea3861a4b48e12822bafa4b324f2498da69fe8a 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"
|
| @@ -293,13 +292,13 @@ bool IsMainFrameBeforeActivationEnabled() {
|
| return true;
|
| }
|
|
|
| -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) {
|
| @@ -347,23 +346,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));
|
| }
|
| @@ -372,14 +371,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));
|
| }
|
|
|