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

Side by Side Diff: gpu/config/gpu_control_list.cc

Issue 2424733002: Add unittest to avoid duplicate id in gpu driver bug list (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
OLDNEW
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> 10 #include <utility>
(...skipping 1562 matching lines...) Expand 10 before | Expand all | Expand 10 after
1573 problem->SetString("tag", tag); 1573 problem->SetString("tag", tag);
1574 1574
1575 problem_list->Append(std::move(problem)); 1575 problem_list->Append(std::move(problem));
1576 } 1576 }
1577 } 1577 }
1578 1578
1579 size_t GpuControlList::num_entries() const { 1579 size_t GpuControlList::num_entries() const {
1580 return entries_.size(); 1580 return entries_.size();
1581 } 1581 }
1582 1582
1583 bool GpuControlList::has_duplicate_entry_id() const {
1584 std::set<int> ids;
1585 for (size_t i = 0; i < entries_.size(); ++i) {
1586 if (ids.count(entries_[i]->id()) == 0)
1587 ids.insert(entries_[i]->id());
1588 else
1589 return true;
1590 }
1591 return false;
1592 }
1593
1583 uint32_t GpuControlList::max_entry_id() const { 1594 uint32_t GpuControlList::max_entry_id() const {
1584 return max_entry_id_; 1595 return max_entry_id_;
1585 } 1596 }
1586 1597
1587 std::string GpuControlList::version() const { 1598 std::string GpuControlList::version() const {
1588 return version_; 1599 return version_;
1589 } 1600 }
1590 1601
1591 GpuControlList::OsType GpuControlList::GetOsType() { 1602 GpuControlList::OsType GpuControlList::GetOsType() {
1592 #if defined(OS_CHROMEOS) 1603 #if defined(OS_CHROMEOS)
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1634 const std::string& feature_name, int feature_id) { 1645 const std::string& feature_name, int feature_id) {
1635 feature_map_[feature_name] = feature_id; 1646 feature_map_[feature_name] = feature_id;
1636 } 1647 }
1637 1648
1638 void GpuControlList::set_supports_feature_type_all(bool supported) { 1649 void GpuControlList::set_supports_feature_type_all(bool supported) {
1639 supports_feature_type_all_ = supported; 1650 supports_feature_type_all_ = supported;
1640 } 1651 }
1641 1652
1642 } // namespace gpu 1653 } // namespace gpu
1643 1654
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698