Index: content/browser/gpu/gpu_blacklist.cc |
=================================================================== |
--- content/browser/gpu/gpu_blacklist.cc (revision 96607) |
+++ content/browser/gpu/gpu_blacklist.cc (working copy) |
@@ -596,7 +596,8 @@ |
} |
bool GpuBlacklist::LoadGpuBlacklist(const std::string& json_context, |
- bool current_os_only) { |
+ bool current_os_only, |
vangelis
2011/08/18 21:15:11
One more thing. Having two bool's next to each oth
|
+ bool tolerate_errors) { |
scoped_ptr<Value> root; |
root.reset(base::JSONReader::Read(json_context, false)); |
if (root.get() == NULL || !root->IsType(Value::TYPE_DICTIONARY)) |
@@ -604,11 +605,12 @@ |
DictionaryValue* root_dictionary = static_cast<DictionaryValue*>(root.get()); |
DCHECK(root_dictionary); |
- return LoadGpuBlacklist(*root_dictionary, current_os_only); |
+ return LoadGpuBlacklist(*root_dictionary, current_os_only, tolerate_errors); |
} |
bool GpuBlacklist::LoadGpuBlacklist(const DictionaryValue& parsed_json, |
- bool current_os_only) { |
+ bool current_os_only, |
+ bool tolerate_errors) { |
std::vector<GpuBlacklistEntry*> entries; |
std::string version_string; |
@@ -644,13 +646,13 @@ |
GpuBlacklistEntry* entry = |
GpuBlacklistEntry::GetGpuBlacklistEntryFromValue(list_item, true); |
if (entry == NULL) |
- break; |
+ continue; |
vangelis
2011/08/18 20:51:11
It seems to me that entries with unknown fields wi
|
if (entry->id() > max_entry_id) |
max_entry_id = entry->id(); |
entries.push_back(entry); |
} |
- if (entries.size() != entry_count_expectation) { |
+ if (!tolerate_errors && entries.size() != entry_count_expectation) { |
for (size_t i = 0; i < entries.size(); ++i) |
delete entries[i]; |
return false; |
@@ -889,6 +891,10 @@ |
return status; |
} |
+size_t GpuBlacklist::num_entries() const { |
+ return blacklist_.size(); |
+} |
+ |
uint32 GpuBlacklist::max_entry_id() const { |
return max_entry_id_; |
} |