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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
| 10 #include <utility> |
| 11 |
10 #include "base/cpu.h" | 12 #include "base/cpu.h" |
11 #include "base/json/json_reader.h" | 13 #include "base/json/json_reader.h" |
12 #include "base/logging.h" | 14 #include "base/logging.h" |
13 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
14 #include "base/strings/string_split.h" | 16 #include "base/strings/string_split.h" |
15 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
16 #include "base/strings/stringprintf.h" | 18 #include "base/strings/stringprintf.h" |
17 #include "base/sys_info.h" | 19 #include "base/sys_info.h" |
18 #include "gpu/config/gpu_info.h" | 20 #include "gpu/config/gpu_info.h" |
19 #include "gpu/config/gpu_util.h" | 21 #include "gpu/config/gpu_util.h" |
(...skipping 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1523 disabled_extensions.end()); | 1525 disabled_extensions.end()); |
1524 } | 1526 } |
1525 | 1527 |
1526 void GpuControlList::GetReasons(base::ListValue* problem_list, | 1528 void GpuControlList::GetReasons(base::ListValue* problem_list, |
1527 const std::string& tag) const { | 1529 const std::string& tag) const { |
1528 DCHECK(problem_list); | 1530 DCHECK(problem_list); |
1529 for (size_t i = 0; i < active_entries_.size(); ++i) { | 1531 for (size_t i = 0; i < active_entries_.size(); ++i) { |
1530 GpuControlListEntry* entry = active_entries_[i].get(); | 1532 GpuControlListEntry* entry = active_entries_[i].get(); |
1531 if (entry->disabled()) | 1533 if (entry->disabled()) |
1532 continue; | 1534 continue; |
1533 base::DictionaryValue* problem = new base::DictionaryValue(); | 1535 std::unique_ptr<base::DictionaryValue> problem(new base::DictionaryValue()); |
1534 | 1536 |
1535 problem->SetString("description", entry->description()); | 1537 problem->SetString("description", entry->description()); |
1536 | 1538 |
1537 base::ListValue* cr_bugs = new base::ListValue(); | 1539 base::ListValue* cr_bugs = new base::ListValue(); |
1538 for (size_t j = 0; j < entry->cr_bugs().size(); ++j) | 1540 for (size_t j = 0; j < entry->cr_bugs().size(); ++j) |
1539 cr_bugs->AppendInteger(entry->cr_bugs()[j]); | 1541 cr_bugs->AppendInteger(entry->cr_bugs()[j]); |
1540 problem->Set("crBugs", cr_bugs); | 1542 problem->Set("crBugs", cr_bugs); |
1541 | 1543 |
1542 base::ListValue* webkit_bugs = new base::ListValue(); | 1544 base::ListValue* webkit_bugs = new base::ListValue(); |
1543 for (size_t j = 0; j < entry->webkit_bugs().size(); ++j) { | 1545 for (size_t j = 0; j < entry->webkit_bugs().size(); ++j) { |
1544 webkit_bugs->AppendInteger(entry->webkit_bugs()[j]); | 1546 webkit_bugs->AppendInteger(entry->webkit_bugs()[j]); |
1545 } | 1547 } |
1546 problem->Set("webkitBugs", webkit_bugs); | 1548 problem->Set("webkitBugs", webkit_bugs); |
1547 | 1549 |
1548 base::ListValue* features = new base::ListValue(); | 1550 base::ListValue* features = new base::ListValue(); |
1549 entry->GetFeatureNames(features, feature_map_, supports_feature_type_all_); | 1551 entry->GetFeatureNames(features, feature_map_, supports_feature_type_all_); |
1550 problem->Set("affectedGpuSettings", features); | 1552 problem->Set("affectedGpuSettings", features); |
1551 | 1553 |
1552 DCHECK(tag == "workarounds" || tag == "disabledFeatures"); | 1554 DCHECK(tag == "workarounds" || tag == "disabledFeatures"); |
1553 problem->SetString("tag", tag); | 1555 problem->SetString("tag", tag); |
1554 | 1556 |
1555 problem_list->Append(problem); | 1557 problem_list->Append(std::move(problem)); |
1556 } | 1558 } |
1557 } | 1559 } |
1558 | 1560 |
1559 size_t GpuControlList::num_entries() const { | 1561 size_t GpuControlList::num_entries() const { |
1560 return entries_.size(); | 1562 return entries_.size(); |
1561 } | 1563 } |
1562 | 1564 |
1563 uint32_t GpuControlList::max_entry_id() const { | 1565 uint32_t GpuControlList::max_entry_id() const { |
1564 return max_entry_id_; | 1566 return max_entry_id_; |
1565 } | 1567 } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1614 const std::string& feature_name, int feature_id) { | 1616 const std::string& feature_name, int feature_id) { |
1615 feature_map_[feature_name] = feature_id; | 1617 feature_map_[feature_name] = feature_id; |
1616 } | 1618 } |
1617 | 1619 |
1618 void GpuControlList::set_supports_feature_type_all(bool supported) { | 1620 void GpuControlList::set_supports_feature_type_all(bool supported) { |
1619 supports_feature_type_all_ = supported; | 1621 supports_feature_type_all_ = supported; |
1620 } | 1622 } |
1621 | 1623 |
1622 } // namespace gpu | 1624 } // namespace gpu |
1623 | 1625 |
OLD | NEW |