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 "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
11 #include "chrome/browser/gpu_process_host_ui_shim.h" | 12 #include "chrome/browser/gpu_process_host_ui_shim.h" |
12 #include "chrome/browser/prefs/pref_service.h" | 13 #include "chrome/browser/prefs/pref_service.h" |
13 #include "chrome/common/child_process_logging.h" | 14 #include "chrome/common/child_process_logging.h" |
14 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
15 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
16 #include "content/browser/gpu_blacklist.h" | 17 #include "content/browser/gpu_blacklist.h" |
17 #include "content/gpu/gpu_info_collector.h" | 18 #include "content/gpu/gpu_info_collector.h" |
18 #include "grit/browser_resources.h" | 19 #include "grit/browser_resources.h" |
19 #include "ui/base/resource/resource_bundle.h" | 20 #include "ui/base/resource/resource_bundle.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 88 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
88 return gpu_info_; | 89 return gpu_info_; |
89 } | 90 } |
90 | 91 |
91 Value* GpuDataManager::GetBlacklistingReasons() const { | 92 Value* GpuDataManager::GetBlacklistingReasons() const { |
92 if (gpu_feature_flags_.flags() != 0 && gpu_blacklist_.get()) | 93 if (gpu_feature_flags_.flags() != 0 && gpu_blacklist_.get()) |
93 return gpu_blacklist_->GetBlacklistingReasons(); | 94 return gpu_blacklist_->GetBlacklistingReasons(); |
94 return NULL; | 95 return NULL; |
95 } | 96 } |
96 | 97 |
| 98 std::string GpuDataManager::GetBlacklistVersion() const { |
| 99 if (gpu_blacklist_.get() != NULL) { |
| 100 uint16 version_major, version_minor; |
| 101 if (gpu_blacklist_->GetVersion(&version_major, |
| 102 &version_minor)) { |
| 103 std::string version_string = |
| 104 base::UintToString(static_cast<unsigned>(version_major)) + |
| 105 "." + |
| 106 base::UintToString(static_cast<unsigned>(version_minor)); |
| 107 return version_string; |
| 108 } |
| 109 } |
| 110 return ""; |
| 111 } |
| 112 |
97 void GpuDataManager::AddLogMessage(Value* msg) { | 113 void GpuDataManager::AddLogMessage(Value* msg) { |
98 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 114 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
99 log_messages_.Append(msg); | 115 log_messages_.Append(msg); |
100 } | 116 } |
101 | 117 |
102 const ListValue& GpuDataManager::log_messages() const { | 118 const ListValue& GpuDataManager::log_messages() const { |
103 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 119 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
104 return log_messages_; | 120 return log_messages_; |
105 } | 121 } |
106 | 122 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 browser_command_line.GetSwitchValueASCII( | 291 browser_command_line.GetSwitchValueASCII( |
276 switches::kUseGL) == gfx::kGLImplementationOSMesaName) | 292 switches::kUseGL) == gfx::kGLImplementationOSMesaName) |
277 return NULL; | 293 return NULL; |
278 UpdateGpuBlacklist(); | 294 UpdateGpuBlacklist(); |
279 // No need to return an empty blacklist. | 295 // No need to return an empty blacklist. |
280 if (gpu_blacklist_.get() != NULL && gpu_blacklist_->max_entry_id() == 0) | 296 if (gpu_blacklist_.get() != NULL && gpu_blacklist_->max_entry_id() == 0) |
281 return NULL; | 297 return NULL; |
282 return gpu_blacklist_.get(); | 298 return gpu_blacklist_.get(); |
283 } | 299 } |
284 | 300 |
OLD | NEW |