OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 const std::string& version_op, | 95 const std::string& version_op, |
96 const std::string& version_string, | 96 const std::string& version_string, |
97 const std::string& version_string2) { | 97 const std::string& version_string2) { |
98 type_ = StringToOsType(os); | 98 type_ = StringToOsType(os); |
99 if (type_ != kOsUnknown) { | 99 if (type_ != kOsUnknown) { |
100 version_info_.reset( | 100 version_info_.reset( |
101 new VersionInfo(version_op, version_string, version_string2)); | 101 new VersionInfo(version_op, version_string, version_string2)); |
102 } | 102 } |
103 } | 103 } |
104 | 104 |
| 105 GpuBlacklist::OsInfo::~OsInfo() {} |
| 106 |
105 bool GpuBlacklist::OsInfo::Contains(OsType type, | 107 bool GpuBlacklist::OsInfo::Contains(OsType type, |
106 const Version& version) const { | 108 const Version& version) const { |
107 if (!IsValid()) | 109 if (!IsValid()) |
108 return false; | 110 return false; |
109 if (type_ != type && type_ != kOsAny) | 111 if (type_ != type && type_ != kOsAny) |
110 return false; | 112 return false; |
111 return version_info_->Contains(version); | 113 return version_info_->Contains(version); |
112 } | 114 } |
113 | 115 |
114 bool GpuBlacklist::OsInfo::IsValid() const { | 116 bool GpuBlacklist::OsInfo::IsValid() const { |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 } | 209 } |
208 } | 210 } |
209 if (!entry->SetBlacklistedFeatures(blacklist)) { | 211 if (!entry->SetBlacklistedFeatures(blacklist)) { |
210 delete entry; | 212 delete entry; |
211 return NULL; | 213 return NULL; |
212 } | 214 } |
213 | 215 |
214 return entry; | 216 return entry; |
215 } | 217 } |
216 | 218 |
| 219 GpuBlacklist::GpuBlacklistEntry::~GpuBlacklistEntry() {} |
| 220 |
217 GpuBlacklist::GpuBlacklistEntry::GpuBlacklistEntry() | 221 GpuBlacklist::GpuBlacklistEntry::GpuBlacklistEntry() |
218 : vendor_id_(0), | 222 : vendor_id_(0), |
219 device_id_(0) { | 223 device_id_(0) { |
220 } | 224 } |
221 | 225 |
222 bool GpuBlacklist::GpuBlacklistEntry::SetOsInfo( | 226 bool GpuBlacklist::GpuBlacklistEntry::SetOsInfo( |
223 const std::string& os, | 227 const std::string& os, |
224 const std::string& version_op, | 228 const std::string& version_op, |
225 const std::string& version_string, | 229 const std::string& version_string, |
226 const std::string& version_string2) { | 230 const std::string& version_string2) { |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 return kOsUnknown; | 417 return kOsUnknown; |
414 #endif | 418 #endif |
415 } | 419 } |
416 | 420 |
417 void GpuBlacklist::Clear() { | 421 void GpuBlacklist::Clear() { |
418 for (size_t i = 0; i < blacklist_.size(); ++i) | 422 for (size_t i = 0; i < blacklist_.size(); ++i) |
419 delete blacklist_[i]; | 423 delete blacklist_[i]; |
420 blacklist_.clear(); | 424 blacklist_.clear(); |
421 } | 425 } |
422 | 426 |
OLD | NEW |