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

Unified Diff: content/browser/gpu/compositor_util.cc

Issue 2891933004: Remove raw base::DictionaryValue::Set in //content (Closed)
Patch Set: 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 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));
}
« 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