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

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

Issue 7633038: Relax software rendering list parsing. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 4 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 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_;
}
« 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