| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/gpu_blacklist.h" | 5 #include "chrome/browser/gpu_blacklist.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 896 bool GpuBlacklist::LoadGpuBlacklist( | 896 bool GpuBlacklist::LoadGpuBlacklist( |
| 897 const DictionaryValue& parsed_json, GpuBlacklist::OsFilter os_filter) { | 897 const DictionaryValue& parsed_json, GpuBlacklist::OsFilter os_filter) { |
| 898 std::vector<ScopedGpuBlacklistEntry> entries; | 898 std::vector<ScopedGpuBlacklistEntry> entries; |
| 899 | 899 |
| 900 std::string version_string; | 900 std::string version_string; |
| 901 parsed_json.GetString("version", &version_string); | 901 parsed_json.GetString("version", &version_string); |
| 902 version_.reset(new Version(version_string)); | 902 version_.reset(new Version(version_string)); |
| 903 if (!version_->IsValid()) | 903 if (!version_->IsValid()) |
| 904 return false; | 904 return false; |
| 905 | 905 |
| 906 ListValue* list = NULL; | 906 const ListValue* list = NULL; |
| 907 if (!parsed_json.GetList("entries", &list)) | 907 if (!parsed_json.GetList("entries", &list)) |
| 908 return false; | 908 return false; |
| 909 | 909 |
| 910 uint32 max_entry_id = 0; | 910 uint32 max_entry_id = 0; |
| 911 bool contains_unknown_fields = false; | 911 bool contains_unknown_fields = false; |
| 912 for (size_t i = 0; i < list->GetSize(); ++i) { | 912 for (size_t i = 0; i < list->GetSize(); ++i) { |
| 913 DictionaryValue* list_item = NULL; | 913 DictionaryValue* list_item = NULL; |
| 914 bool valid = list->GetDictionary(i, &list_item); | 914 bool valid = list->GetDictionary(i, &list_item); |
| 915 if (!valid || list_item == NULL) | 915 if (!valid || list_item == NULL) |
| 916 return false; | 916 return false; |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1111 if (op == ">") | 1111 if (op == ">") |
| 1112 return kGT; | 1112 return kGT; |
| 1113 if (op == ">=") | 1113 if (op == ">=") |
| 1114 return kGE; | 1114 return kGE; |
| 1115 if (op == "any") | 1115 if (op == "any") |
| 1116 return kAny; | 1116 return kAny; |
| 1117 if (op == "between") | 1117 if (op == "between") |
| 1118 return kBetween; | 1118 return kBetween; |
| 1119 return kUnknown; | 1119 return kUnknown; |
| 1120 } | 1120 } |
| 1121 | |
| OLD | NEW |