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

Unified Diff: content/browser/gpu/compositor_util.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
« no previous file with comments | « content/browser/gpu/compositor_util.h ('k') | content/browser/gpu/gpu_data_manager_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
}
« no previous file with comments | « content/browser/gpu/compositor_util.h ('k') | content/browser/gpu/gpu_data_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698