| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gpu/config/gpu_control_list.h" | 5 #include "gpu/config/gpu_control_list.h" |
| 6 | 6 |
| 7 #include "base/cpu.h" | 7 #include "base/cpu.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1316 control_list_logging_enabled_(false) { | 1316 control_list_logging_enabled_(false) { |
| 1317 } | 1317 } |
| 1318 | 1318 |
| 1319 GpuControlList::~GpuControlList() { | 1319 GpuControlList::~GpuControlList() { |
| 1320 Clear(); | 1320 Clear(); |
| 1321 } | 1321 } |
| 1322 | 1322 |
| 1323 bool GpuControlList::LoadList( | 1323 bool GpuControlList::LoadList( |
| 1324 const std::string& json_context, | 1324 const std::string& json_context, |
| 1325 GpuControlList::OsFilter os_filter) { | 1325 GpuControlList::OsFilter os_filter) { |
| 1326 scoped_ptr<base::Value> root; | 1326 scoped_ptr<base::Value> root(base::JSONReader::Read(json_context)); |
| 1327 root.reset(base::JSONReader::Read(json_context)); | |
| 1328 if (root.get() == NULL || !root->IsType(base::Value::TYPE_DICTIONARY)) | 1327 if (root.get() == NULL || !root->IsType(base::Value::TYPE_DICTIONARY)) |
| 1329 return false; | 1328 return false; |
| 1330 | 1329 |
| 1331 base::DictionaryValue* root_dictionary = | 1330 base::DictionaryValue* root_dictionary = |
| 1332 static_cast<base::DictionaryValue*>(root.get()); | 1331 static_cast<base::DictionaryValue*>(root.get()); |
| 1333 DCHECK(root_dictionary); | 1332 DCHECK(root_dictionary); |
| 1334 return LoadList(*root_dictionary, os_filter); | 1333 return LoadList(*root_dictionary, os_filter); |
| 1335 } | 1334 } |
| 1336 | 1335 |
| 1337 bool GpuControlList::LoadList(const base::DictionaryValue& parsed_json, | 1336 bool GpuControlList::LoadList(const base::DictionaryValue& parsed_json, |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1511 const std::string& feature_name, int feature_id) { | 1510 const std::string& feature_name, int feature_id) { |
| 1512 feature_map_[feature_name] = feature_id; | 1511 feature_map_[feature_name] = feature_id; |
| 1513 } | 1512 } |
| 1514 | 1513 |
| 1515 void GpuControlList::set_supports_feature_type_all(bool supported) { | 1514 void GpuControlList::set_supports_feature_type_all(bool supported) { |
| 1516 supports_feature_type_all_ = supported; | 1515 supports_feature_type_all_ = supported; |
| 1517 } | 1516 } |
| 1518 | 1517 |
| 1519 } // namespace gpu | 1518 } // namespace gpu |
| 1520 | 1519 |
| OLD | NEW |