| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/gpu_blacklist.h" | 5 #include "chrome/browser/gpu_blacklist.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.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/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 ScopedGpuBlacklistEntry exception) { | 658 ScopedGpuBlacklistEntry exception) { |
| 659 exceptions_.push_back(exception); | 659 exceptions_.push_back(exception); |
| 660 } | 660 } |
| 661 | 661 |
| 662 bool GpuBlacklist::GpuBlacklistEntry::Contains( | 662 bool GpuBlacklist::GpuBlacklistEntry::Contains( |
| 663 OsType os_type, const Version& os_version, | 663 OsType os_type, const Version& os_version, |
| 664 const content::GPUInfo& gpu_info) const { | 664 const content::GPUInfo& gpu_info) const { |
| 665 DCHECK(os_type != kOsAny); | 665 DCHECK(os_type != kOsAny); |
| 666 if (os_info_.get() != NULL && !os_info_->Contains(os_type, os_version)) | 666 if (os_info_.get() != NULL && !os_info_->Contains(os_type, os_version)) |
| 667 return false; | 667 return false; |
| 668 if (vendor_id_ != 0 && vendor_id_ != gpu_info.vendor_id) | 668 if (vendor_id_ != 0 && vendor_id_ != gpu_info.gpu.vendor_id) |
| 669 return false; | 669 return false; |
| 670 if (device_id_list_.size() > 0) { | 670 if (device_id_list_.size() > 0) { |
| 671 bool found = false; | 671 bool found = false; |
| 672 for (size_t i = 0; i < device_id_list_.size(); ++i) { | 672 for (size_t i = 0; i < device_id_list_.size(); ++i) { |
| 673 if (device_id_list_[i] == gpu_info.device_id) { | 673 if (device_id_list_[i] == gpu_info.gpu.device_id) { |
| 674 found = true; | 674 found = true; |
| 675 break; | 675 break; |
| 676 } | 676 } |
| 677 } | 677 } |
| 678 if (!found) | 678 if (!found) |
| 679 return false; | 679 return false; |
| 680 } | 680 } |
| 681 if (driver_vendor_info_.get() != NULL && | 681 if (driver_vendor_info_.get() != NULL && |
| 682 !driver_vendor_info_->Contains(gpu_info.driver_vendor)) | 682 !driver_vendor_info_->Contains(gpu_info.driver_vendor)) |
| 683 return false; | 683 return false; |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 997 return kGT; | 997 return kGT; |
| 998 if (op == ">=") | 998 if (op == ">=") |
| 999 return kGE; | 999 return kGE; |
| 1000 if (op == "any") | 1000 if (op == "any") |
| 1001 return kAny; | 1001 return kAny; |
| 1002 if (op == "between") | 1002 if (op == "between") |
| 1003 return kBetween; | 1003 return kBetween; |
| 1004 return kUnknown; | 1004 return kUnknown; |
| 1005 } | 1005 } |
| 1006 | 1006 |
| OLD | NEW |