Index: content/browser/gpu/gpu_blacklist.h |
=================================================================== |
--- content/browser/gpu/gpu_blacklist.h (revision 97470) |
+++ content/browser/gpu/gpu_blacklist.h (working copy) |
@@ -32,18 +32,35 @@ |
kOsUnknown |
}; |
+ enum OsFilter { |
+ // In loading, Ignore all entries that belong to other OS. |
+ kCurrentOsOnly, |
+ // In loading, keep all entries. This is for testing only. |
+ kAllOs |
+ }; |
+ |
+ enum UnknownFieldOption { |
+ // Ignore any entries with unknown field. |
+ kIgnoreEntryWithUnknownField, |
+ // The same as kIgnoreEntryWithUnknownField; however, if an exception entry |
+ // contains an unknown field, ignore that exception entry but still keep |
+ // the main entry. |
+ kIgnoreExceptionWithUnknownField, |
+ // Ignore all entries if an unknown field exists. This is for testing only. |
+ kFailOnUnknownField |
+ }; |
+ |
explicit GpuBlacklist(const std::string& browser_version_string); |
~GpuBlacklist(); |
// Loads blacklist information from a json file. |
- // current_os_only==true indicates all blacklist entries that don't belong to |
- // the current OS are discarded; current_os_only==false should only be used |
- // for testing purpose. |
// If failed, the current GpuBlacklist is un-touched. |
bool LoadGpuBlacklist(const std::string& json_context, |
- bool current_os_only); |
+ OsFilter os_filter, |
+ UnknownFieldOption unknown_field_option); |
bool LoadGpuBlacklist(const base::DictionaryValue& parsed_json, |
- bool current_os_only); |
+ OsFilter os_filter, |
+ UnknownFieldOption unknown_field_option); |
// Collects system information and combines them with gpu_info and blacklist |
// information to determine gpu feature flags. |
@@ -63,7 +80,6 @@ |
void GetGpuFeatureFlagEntries(GpuFeatureFlags::GpuFeatureType feature, |
std::vector<uint32>& entry_ids) const; |
- |
// Returns status information on the blacklist. This is two parted: |
// { |
// featureStatus: [] |
@@ -96,6 +112,9 @@ |
bool disable_experimental_webgl, |
bool disable_multisampling) const; |
+ // Returns the number of entries. |
+ size_t num_entries() const; |
+ |
// Return the largest entry id. This is used for histogramming. |
uint32 max_entry_id() const; |
@@ -213,13 +232,21 @@ |
// Returns the description of the entry |
const std::string& description() const { return description_; } |
- // Returs a list of Chromium and Webkit bugs applicable to this entry |
+ // Returns a list of Chromium and Webkit bugs applicable to this entry |
const std::vector<int>& cr_bugs() const { return cr_bugs_; } |
const std::vector<int>& webkit_bugs() const { return webkit_bugs_; } |
// Returns the GpuFeatureFlags. |
GpuFeatureFlags GetGpuFeatureFlags() const; |
+ bool contains_unknown_field() const { |
+ return contains_unknown_field_; |
+ } |
+ |
+ bool contains_exception_with_unknown_field() const { |
+ return contains_exception_with_unknown_field_; |
+ } |
+ |
~GpuBlacklistEntry(); |
private: |
@@ -268,6 +295,8 @@ |
scoped_ptr<StringInfo> gl_renderer_info_; |
scoped_ptr<GpuFeatureFlags> feature_flags_; |
std::vector<GpuBlacklistEntry*> exceptions_; |
+ bool contains_unknown_field_; |
+ bool contains_exception_with_unknown_field_; |
}; |
enum BrowserVersionSupport { |