OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_data_manager.h" | 5 #include "chrome/browser/gpu_data_manager.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 // updated GPU info. | 81 // updated GPU info. |
82 gpu_feature_flags_set_ = false; | 82 gpu_feature_flags_set_ = false; |
83 RunGpuInfoUpdateCallbacks(); | 83 RunGpuInfoUpdateCallbacks(); |
84 } | 84 } |
85 | 85 |
86 const GPUInfo& GpuDataManager::gpu_info() const { | 86 const GPUInfo& GpuDataManager::gpu_info() const { |
87 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 87 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
88 return gpu_info_; | 88 return gpu_info_; |
89 } | 89 } |
90 | 90 |
91 Value* GpuDataManager::GetBlacklistingReasons() const { | 91 Value* GpuDataManager::GetBlacklistStatus() const { |
92 if (gpu_feature_flags_.flags() != 0 && gpu_blacklist_.get()) | 92 if (gpu_blacklist_.get()) |
93 return gpu_blacklist_->GetBlacklistingReasons(); | 93 return gpu_blacklist_->GetStatus(); |
94 return NULL; | 94 return NULL; |
95 } | 95 } |
96 | 96 |
97 std::string GpuDataManager::GetBlacklistVersion() const { | 97 std::string GpuDataManager::GetBlacklistVersion() const { |
98 if (gpu_blacklist_.get() != NULL) { | 98 if (gpu_blacklist_.get() != NULL) { |
99 uint16 version_major, version_minor; | 99 uint16 version_major, version_minor; |
100 if (gpu_blacklist_->GetVersion(&version_major, | 100 if (gpu_blacklist_->GetVersion(&version_major, |
101 &version_minor)) { | 101 &version_minor)) { |
102 std::string version_string = | 102 std::string version_string = |
103 base::UintToString(static_cast<unsigned>(version_major)) + | 103 base::UintToString(static_cast<unsigned>(version_major)) + |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 if (browser_command_line.HasSwitch(switches::kIgnoreGpuBlacklist) || | 289 if (browser_command_line.HasSwitch(switches::kIgnoreGpuBlacklist) || |
290 browser_command_line.GetSwitchValueASCII( | 290 browser_command_line.GetSwitchValueASCII( |
291 switches::kUseGL) == gfx::kGLImplementationOSMesaName) | 291 switches::kUseGL) == gfx::kGLImplementationOSMesaName) |
292 return NULL; | 292 return NULL; |
293 UpdateGpuBlacklist(); | 293 UpdateGpuBlacklist(); |
294 // No need to return an empty blacklist. | 294 // No need to return an empty blacklist. |
295 if (gpu_blacklist_.get() != NULL && gpu_blacklist_->max_entry_id() == 0) | 295 if (gpu_blacklist_.get() != NULL && gpu_blacklist_->max_entry_id() == 0) |
296 return NULL; | 296 return NULL; |
297 return gpu_blacklist_.get(); | 297 return gpu_blacklist_.get(); |
298 } | 298 } |
OLD | NEW |