Chromium Code Reviews| Index: content/browser/gpu/gpu_blacklist.cc |
| =================================================================== |
| --- content/browser/gpu/gpu_blacklist.cc (revision 159378) |
| +++ content/browser/gpu/gpu_blacklist.cc (working copy) |
| @@ -6,6 +6,7 @@ |
| #include "base/command_line.h" |
| #include "base/json/json_reader.h" |
| +#include "base/cpu.h" |
|
Zhenyao Mo
2012/10/02 22:01:32
nit: still wrong order, move one line up
|
| #include "base/logging.h" |
| #if defined(OS_MACOSX) |
| @@ -578,6 +579,19 @@ |
| dictionary_entry_count++; |
| } |
| + const DictionaryValue* cpu_brand_value = NULL; |
| + if (value->GetDictionary("cpu_info", &cpu_brand_value)) { |
| + std::string cpu_op; |
| + std::string cpu_value; |
| + cpu_brand_value->GetString("op", &cpu_op); |
| + cpu_brand_value->GetString("value", &cpu_value); |
| + if (!entry->SetCpuBrand(cpu_op, cpu_value)) { |
| + LOG(WARNING) << "Malformed cpu_brand entry " << entry->id(); |
| + return NULL; |
| + } |
| + dictionary_entry_count++; |
| + } |
| + |
| const DictionaryValue* perf_graphics_value = NULL; |
| if (value->GetDictionary("perf_graphics", &perf_graphics_value)) { |
| std::string op; |
| @@ -846,6 +860,14 @@ |
| return gl_renderer_info_->IsValid(); |
| } |
| +bool GpuBlacklist::GpuBlacklistEntry::SetCpuBrand( |
| + const std::string& cpu_op, |
| + const std::string& cpu_value) { |
| + cpu_brand_.reset( |
| + new StringInfo(cpu_op, cpu_value)); |
| + return cpu_brand_->IsValid(); |
| +} |
| + |
| bool GpuBlacklist::GpuBlacklistEntry::SetPerfGraphicsInfo( |
| const std::string& op, |
| const std::string& float_string, |
| @@ -1048,6 +1070,12 @@ |
| if (gpu_count_info_.get() != NULL && |
| !gpu_count_info_->Contains(gpu_info.secondary_gpus.size() + 1)) |
| return false; |
| + if (cpu_brand_.get() != NULL) { |
| + base::CPU cpu_info; |
| + if (!cpu_brand_->Contains(cpu_info.cpu_brand())) |
| + return false; |
| + } |
| + |
| for (size_t i = 0; i < exceptions_.size(); ++i) { |
| if (exceptions_[i]->Contains(os_type, os_version, machine_model_name, |
| machine_model_version, gpu_info)) |