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

Unified Diff: gpu/config/gpu_control_list.cc

Issue 2145543002: Use base::FooValue::From() to simplify gpu code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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 | « no previous file | gpu/tools/compositor_model_bench/compositor_model_bench.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/config/gpu_control_list.cc
diff --git a/gpu/config/gpu_control_list.cc b/gpu/config/gpu_control_list.cc
index 752003fe093d19d9e861f2b9a5427a2c3684e97f..a1e1ae53e115469d9a05d7088716b50f100c5197 100644
--- a/gpu/config/gpu_control_list.cc
+++ b/gpu/config/gpu_control_list.cc
@@ -1394,14 +1394,11 @@ GpuControlList::~GpuControlList() {
bool GpuControlList::LoadList(
const std::string& json_context,
GpuControlList::OsFilter os_filter) {
- std::unique_ptr<base::Value> root = base::JSONReader::Read(json_context);
- if (root.get() == NULL || !root->IsType(base::Value::TYPE_DICTIONARY))
+ std::unique_ptr<base::DictionaryValue> root =
+ base::DictionaryValue::From(base::JSONReader::Read(json_context));
+ if (!root)
return false;
-
- base::DictionaryValue* root_dictionary =
- static_cast<base::DictionaryValue*>(root.get());
- DCHECK(root_dictionary);
- return LoadList(*root_dictionary, os_filter);
+ return LoadList(*root, os_filter);
}
bool GpuControlList::LoadList(const base::DictionaryValue& parsed_json,
« no previous file with comments | « no previous file | gpu/tools/compositor_model_bench/compositor_model_bench.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698