summaryrefslogtreecommitdiffstats
path: root/content/browser/gpu_blacklist.cc
diff options
context:
space:
mode:
authornduca@chromium.org <nduca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-03 01:17:41 +0000
committernduca@chromium.org <nduca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-03 01:17:41 +0000
commit47847e9cbb0706e3a6b0788909a805adb4948fb0 (patch)
tree22bef441682ee7558cde89a0f850ba3eb5248fb4 /content/browser/gpu_blacklist.cc
parentbf4c0295dab0a17164a5ee9633fbe59c4266ba35 (diff)
downloadchromium_src-47847e9cbb0706e3a6b0788909a805adb4948fb0.zip
chromium_src-47847e9cbb0706e3a6b0788909a805adb4948fb0.tar.gz
chromium_src-47847e9cbb0706e3a6b0788909a805adb4948fb0.tar.bz2
Dont use the word blacklisting
Move logs into GpuDataManager. This fixes false reporting of the gpu blacklistedness. New custom message shown at top of about:gpu page when blacklisted. Blacklisting reason is provided per blacklist entry Tweak the GpuInfoUpdated call chain to have more-consistent naming. BUG=73796,74025 TEST= Review URL: http://codereview.chromium.org/6592004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76689 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/gpu_blacklist.cc')
-rw-r--r--content/browser/gpu_blacklist.cc52
1 files changed, 52 insertions, 0 deletions
diff --git a/content/browser/gpu_blacklist.cc b/content/browser/gpu_blacklist.cc
index fdeadda..42e7448 100644
--- a/content/browser/gpu_blacklist.cc
+++ b/content/browser/gpu_blacklist.cc
@@ -212,6 +212,35 @@ GpuBlacklist::GpuBlacklistEntry::GetGpuBlacklistEntryFromValue(
}
}
+ std::string description;
+ if (value->GetString("description", &description)) {
+ entry->description_ = description;
+ } else {
+ entry->description_ = "The GPU is unavailable for an unexplained reason.";
+ }
+
+ ListValue* cr_bugs;
+ if (value->GetList("cr_bugs", &cr_bugs)) {
+ for(size_t i = 0; i < cr_bugs->GetSize(); ++i) {
+ int bug_id;
+ if (cr_bugs->GetInteger(i, &bug_id))
+ entry->cr_bugs_.push_back(bug_id);
+ else
+ LOG(WARNING) << "Malformed cr_bugs entry " << entry->id();
+ }
+ }
+
+ ListValue* webkit_bugs;
+ if (value->GetList("webkit_bugs", &webkit_bugs)) {
+ for(size_t i = 0; i < webkit_bugs->GetSize(); ++i) {
+ int bug_id;
+ if (webkit_bugs->GetInteger(i, &bug_id))
+ entry->webkit_bugs_.push_back(bug_id);
+ else
+ LOG(WARNING) << "Malformed webkit_bugs entry " << entry->id();
+ }
+ }
+
DictionaryValue* os_value = NULL;
if (value->GetDictionary("os", &os_value)) {
std::string os_type;
@@ -628,6 +657,29 @@ void GpuBlacklist::GetGpuFeatureFlagEntries(
}
}
+Value* GpuBlacklist::GetBlacklistingReasons() const {
+ ListValue* reasons = new ListValue();
+ for (size_t i = 0; i < active_entries_.size(); ++i) {
+ DictionaryValue* reason = new DictionaryValue();
+ reason->SetString("description", active_entries_[i]->description());
+
+ ListValue* cr_bugs = new ListValue();
+ for (size_t j = 0; j < active_entries_[i]->cr_bugs().size(); ++j)
+ cr_bugs->Append(Value::CreateIntegerValue(
+ active_entries_[i]->cr_bugs()[j]));
+ reason->Set("cr_bugs", cr_bugs);
+
+ ListValue* webkit_bugs = new ListValue();
+ for (size_t j = 0; j < active_entries_[i]->webkit_bugs().size(); ++j)
+ webkit_bugs->Append(Value::CreateIntegerValue(
+ active_entries_[i]->webkit_bugs()[j]));
+ reason->Set("webkit_bugs", webkit_bugs);
+
+ reasons->Append(reason);
+ }
+ return reasons;
+}
+
uint32 GpuBlacklist::max_entry_id() const {
return max_entry_id_;
}