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

Unified Diff: content/browser/gpu/gpu_blacklist.cc

Issue 11009011: Use the cpuid instruction to generate the CPU brand string. And (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/gpu/gpu_blacklist.cc
===================================================================
--- content/browser/gpu/gpu_blacklist.cc (revision 159378)
+++ content/browser/gpu/gpu_blacklist.cc (working copy)
@@ -16,6 +16,7 @@
#include "base/string_split.h"
#include "base/string_util.h"
#include "base/sys_info.h"
+#include "base/cpu.h"
Zhenyao Mo 2012/10/01 19:04:33 You need to insert the include in the right place
#include "base/version.h"
#include "content/browser/gpu/gpu_util.h"
#include "content/public/common/content_switches.h"
@@ -578,6 +579,19 @@
dictionary_entry_count++;
}
+ const DictionaryValue* cpu_info_value = NULL;
Zhenyao Mo 2012/10/01 19:04:33 cpu_brand_value, here and below.
+ if (value->GetDictionary("cpu_info", &cpu_info_value)) {
+ std::string cpu_op;
+ std::string cpu_value;
+ cpu_info_value->GetString("op", &cpu_op);
+ cpu_info_value->GetString("value", &cpu_value);
+ if (!entry->SetCpuInfo(cpu_op, cpu_value)) {
+ LOG(WARNING) << "Malformed cpu_info 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::SetCpuInfo(
+ const std::string& cpu_op,
+ const std::string& cpu_value) {
+ cpu_info_.reset(
+ new StringInfo(cpu_op, cpu_value));
+ return cpu_info_->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_info_.get() != NULL) {
+ base::CPU cpu_info;
Zhenyao Mo 2012/10/01 19:04:33 indent two spaces instead of four.
+ if (!cpu_info_->Contains(cpu_info.cpu_brand()))
+ return false;
Zhenyao Mo 2012/10/01 19:04:33 indent two spaces
+ }
+
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))

Powered by Google App Engine
This is Rietveld 408576698