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

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

Issue 7982034: Add a "disabled" field for GPU Blacklist entries. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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
« no previous file with comments | « content/browser/gpu/gpu_blacklist.h ('k') | content/browser/gpu/gpu_blacklist_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/gpu_blacklist.cc
===================================================================
--- content/browser/gpu/gpu_blacklist.cc (revision 102158)
+++ content/browser/gpu/gpu_blacklist.cc (working copy)
@@ -223,6 +223,12 @@
return NULL;
}
dictionary_entry_count++;
+
+ bool disabled;
+ if (value->GetBoolean("disabled", &disabled)) {
+ entry->SetDisabled(disabled);
+ dictionary_entry_count++;
+ }
}
std::string description;
@@ -456,6 +462,7 @@
GpuBlacklist::GpuBlacklistEntry::GpuBlacklistEntry()
: id_(0),
+ disabled_(false),
vendor_id_(0),
contains_unknown_fields_(false),
contains_unknown_features_(false) {
@@ -469,6 +476,10 @@
return false;
}
+void GpuBlacklist::GpuBlacklistEntry::SetDisabled(bool disabled) {
+ disabled_ = disabled;
+}
+
bool GpuBlacklist::GpuBlacklistEntry::SetOsInfo(
const std::string& os,
const std::string& version_op,
@@ -644,6 +655,10 @@
return id_;
}
+bool GpuBlacklist::GpuBlacklistEntry::disabled() const {
+ return disabled_;
+}
+
GpuFeatureFlags GpuBlacklist::GpuBlacklistEntry::GetGpuFeatureFlags() const {
return *feature_flags_;
}
@@ -752,7 +767,8 @@
for (size_t i = 0; i < blacklist_.size(); ++i) {
if (blacklist_[i]->Contains(os, *os_version, browser_channel_, gpu_info)) {
- flags.Combine(blacklist_[i]->GetGpuFeatureFlags());
+ if (!blacklist_[i]->disabled())
+ flags.Combine(blacklist_[i]->GetGpuFeatureFlags());
active_entries_.push_back(blacklist_[i]);
}
}
@@ -761,10 +777,12 @@
void GpuBlacklist::GetGpuFeatureFlagEntries(
GpuFeatureFlags::GpuFeatureType feature,
- std::vector<uint32>& entry_ids) const {
+ std::vector<uint32>& entry_ids,
+ bool disabled) const {
entry_ids.clear();
for (size_t i = 0; i < active_entries_.size(); ++i) {
- if ((feature & active_entries_[i]->GetGpuFeatureFlags().flags()) != 0)
+ if (((feature & active_entries_[i]->GetGpuFeatureFlags().flags()) != 0) &&
+ disabled == active_entries_[i]->disabled())
entry_ids.push_back(active_entries_[i]->id());
}
}
« no previous file with comments | « content/browser/gpu/gpu_blacklist.h ('k') | content/browser/gpu/gpu_blacklist_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698