| 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/string_util.h" |
| 10 #include "base/stringprintf.h" | 11 #include "base/stringprintf.h" |
| 11 #include "base/sys_info.h" | 12 #include "base/sys_info.h" |
| 12 #include "base/values.h" | 13 #include "base/values.h" |
| 13 #include "base/version.h" | 14 #include "base/version.h" |
| 14 #include "chrome/common/gpu_info.h" | 15 #include "chrome/common/gpu_info.h" |
| 15 | 16 |
| 16 GpuBlacklist::VersionInfo::VersionInfo(const std::string& version_op, | 17 GpuBlacklist::VersionInfo::VersionInfo(const std::string& version_op, |
| 17 const std::string& version_string, | 18 const std::string& version_string, |
| 18 const std::string& version_string2) { | 19 const std::string& version_string2) { |
| 19 op_ = StringToOp(version_op); | 20 op_ = StringToOp(version_op); |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 | 359 |
| 359 GpuFeatureFlags GpuBlacklist::DetermineGpuFeatureFlags( | 360 GpuFeatureFlags GpuBlacklist::DetermineGpuFeatureFlags( |
| 360 GpuBlacklist::OsType os, | 361 GpuBlacklist::OsType os, |
| 361 Version* os_version, | 362 Version* os_version, |
| 362 const GPUInfo& gpu_info) const { | 363 const GPUInfo& gpu_info) const { |
| 363 GpuFeatureFlags flags; | 364 GpuFeatureFlags flags; |
| 364 // No need to go through blacklist entries if GPUInfo isn't available. | 365 // No need to go through blacklist entries if GPUInfo isn't available. |
| 365 if (gpu_info.progress() == GPUInfo::kUninitialized) | 366 if (gpu_info.progress() == GPUInfo::kUninitialized) |
| 366 return flags; | 367 return flags; |
| 367 scoped_ptr<Version> driver_version( | 368 scoped_ptr<Version> driver_version( |
| 368 Version::GetVersionFromString(gpu_info.driver_version())); | 369 Version::GetVersionFromString(WideToASCII(gpu_info.driver_version()))); |
| 369 if (driver_version.get() == NULL) | 370 if (driver_version.get() == NULL) |
| 370 return flags; | 371 return flags; |
| 371 | 372 |
| 372 if (os == kOsAny) | 373 if (os == kOsAny) |
| 373 os = GetOsType(); | 374 os = GetOsType(); |
| 374 scoped_ptr<Version> my_os_version; | 375 scoped_ptr<Version> my_os_version; |
| 375 if (os_version == NULL) { | 376 if (os_version == NULL) { |
| 376 std::string version_string; | 377 std::string version_string; |
| 377 #if defined(OS_MACOSX) | 378 #if defined(OS_MACOSX) |
| 378 // Seems like base::SysInfo::OperatingSystemVersion() returns the wrong | 379 // Seems like base::SysInfo::OperatingSystemVersion() returns the wrong |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 return kOsUnknown; | 414 return kOsUnknown; |
| 414 #endif | 415 #endif |
| 415 } | 416 } |
| 416 | 417 |
| 417 void GpuBlacklist::Clear() { | 418 void GpuBlacklist::Clear() { |
| 418 for (size_t i = 0; i < blacklist_.size(); ++i) | 419 for (size_t i = 0; i < blacklist_.size(); ++i) |
| 419 delete blacklist_[i]; | 420 delete blacklist_[i]; |
| 420 blacklist_.clear(); | 421 blacklist_.clear(); |
| 421 } | 422 } |
| 422 | 423 |
| OLD | NEW |