| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/browser/gpu/gpu_data_manager_impl.h" | 5 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| 6 | 6 |
| 7 #include "content/browser/gpu/gpu_data_manager_impl_private.h" | 7 #include "content/browser/gpu/gpu_data_manager_impl_private.h" |
| 8 | 8 |
| 9 namespace content { | 9 namespace content { |
| 10 | 10 |
| 11 // static | 11 // static |
| 12 GpuDataManager* GpuDataManager::GetInstance() { | 12 GpuDataManager* GpuDataManager::GetInstance() { |
| 13 return GpuDataManagerImpl::GetInstance(); | 13 return GpuDataManagerImpl::GetInstance(); |
| 14 } | 14 } |
| 15 | 15 |
| 16 // static | 16 // static |
| 17 GpuDataManagerImpl* GpuDataManagerImpl::GetInstance() { | 17 GpuDataManagerImpl* GpuDataManagerImpl::GetInstance() { |
| 18 return Singleton<GpuDataManagerImpl>::get(); | 18 return Singleton<GpuDataManagerImpl>::get(); |
| 19 } | 19 } |
| 20 | 20 |
| 21 void GpuDataManagerImpl::InitializeForTesting( | 21 void GpuDataManagerImpl::InitializeForTesting( |
| 22 const std::string& gpu_blacklist_json, const GPUInfo& gpu_info) { | 22 const std::string& gpu_blacklist_json, const gpu::GPUInfo& gpu_info) { |
| 23 base::AutoLock auto_lock(lock_); | 23 base::AutoLock auto_lock(lock_); |
| 24 private_->InitializeForTesting(gpu_blacklist_json, gpu_info); | 24 private_->InitializeForTesting(gpu_blacklist_json, gpu_info); |
| 25 } | 25 } |
| 26 | 26 |
| 27 bool GpuDataManagerImpl::IsFeatureBlacklisted(int feature) const { | 27 bool GpuDataManagerImpl::IsFeatureBlacklisted(int feature) const { |
| 28 base::AutoLock auto_lock(lock_); | 28 base::AutoLock auto_lock(lock_); |
| 29 return private_->IsFeatureBlacklisted(feature); | 29 return private_->IsFeatureBlacklisted(feature); |
| 30 } | 30 } |
| 31 | 31 |
| 32 GPUInfo GpuDataManagerImpl::GetGPUInfo() const { | 32 gpu::GPUInfo GpuDataManagerImpl::GetGPUInfo() const { |
| 33 base::AutoLock auto_lock(lock_); | 33 base::AutoLock auto_lock(lock_); |
| 34 return private_->GetGPUInfo(); | 34 return private_->GetGPUInfo(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 void GpuDataManagerImpl::GetGpuProcessHandles( | 37 void GpuDataManagerImpl::GetGpuProcessHandles( |
| 38 const GetGpuProcessHandlesCallback& callback) const { | 38 const GetGpuProcessHandlesCallback& callback) const { |
| 39 base::AutoLock auto_lock(lock_); | 39 base::AutoLock auto_lock(lock_); |
| 40 private_->GetGpuProcessHandles(callback); | 40 private_->GetGpuProcessHandles(callback); |
| 41 } | 41 } |
| 42 | 42 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 void GpuDataManagerImpl::DisableHardwareAcceleration() { | 110 void GpuDataManagerImpl::DisableHardwareAcceleration() { |
| 111 base::AutoLock auto_lock(lock_); | 111 base::AutoLock auto_lock(lock_); |
| 112 private_->DisableHardwareAcceleration(); | 112 private_->DisableHardwareAcceleration(); |
| 113 } | 113 } |
| 114 | 114 |
| 115 void GpuDataManagerImpl::Initialize() { | 115 void GpuDataManagerImpl::Initialize() { |
| 116 base::AutoLock auto_lock(lock_); | 116 base::AutoLock auto_lock(lock_); |
| 117 private_->Initialize(); | 117 private_->Initialize(); |
| 118 } | 118 } |
| 119 | 119 |
| 120 void GpuDataManagerImpl::UpdateGpuInfo(const GPUInfo& gpu_info) { | 120 void GpuDataManagerImpl::UpdateGpuInfo(const gpu::GPUInfo& gpu_info) { |
| 121 base::AutoLock auto_lock(lock_); | 121 base::AutoLock auto_lock(lock_); |
| 122 private_->UpdateGpuInfo(gpu_info); | 122 private_->UpdateGpuInfo(gpu_info); |
| 123 } | 123 } |
| 124 | 124 |
| 125 void GpuDataManagerImpl::UpdateVideoMemoryUsageStats( | 125 void GpuDataManagerImpl::UpdateVideoMemoryUsageStats( |
| 126 const GPUVideoMemoryUsageStats& video_memory_usage_stats) { | 126 const GPUVideoMemoryUsageStats& video_memory_usage_stats) { |
| 127 base::AutoLock auto_lock(lock_); | 127 base::AutoLock auto_lock(lock_); |
| 128 private_->UpdateVideoMemoryUsageStats(video_memory_usage_stats); | 128 private_->UpdateVideoMemoryUsageStats(video_memory_usage_stats); |
| 129 } | 129 } |
| 130 | 130 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 145 base::AutoLock auto_lock(lock_); | 145 base::AutoLock auto_lock(lock_); |
| 146 private_->AppendPluginCommandLine(command_line); | 146 private_->AppendPluginCommandLine(command_line); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void GpuDataManagerImpl::UpdateRendererWebPrefs( | 149 void GpuDataManagerImpl::UpdateRendererWebPrefs( |
| 150 WebPreferences* prefs) const { | 150 WebPreferences* prefs) const { |
| 151 base::AutoLock auto_lock(lock_); | 151 base::AutoLock auto_lock(lock_); |
| 152 private_->UpdateRendererWebPrefs(prefs); | 152 private_->UpdateRendererWebPrefs(prefs); |
| 153 } | 153 } |
| 154 | 154 |
| 155 GpuSwitchingOption GpuDataManagerImpl::GetGpuSwitchingOption() const { | 155 gpu::GpuSwitchingOption GpuDataManagerImpl::GetGpuSwitchingOption() const { |
| 156 base::AutoLock auto_lock(lock_); | 156 base::AutoLock auto_lock(lock_); |
| 157 return private_->GetGpuSwitchingOption(); | 157 return private_->GetGpuSwitchingOption(); |
| 158 } | 158 } |
| 159 | 159 |
| 160 std::string GpuDataManagerImpl::GetBlacklistVersion() const { | 160 std::string GpuDataManagerImpl::GetBlacklistVersion() const { |
| 161 base::AutoLock auto_lock(lock_); | 161 base::AutoLock auto_lock(lock_); |
| 162 return private_->GetBlacklistVersion(); | 162 return private_->GetBlacklistVersion(); |
| 163 } | 163 } |
| 164 | 164 |
| 165 base::ListValue* GpuDataManagerImpl::GetBlacklistReasons() const { | 165 base::ListValue* GpuDataManagerImpl::GetBlacklistReasons() const { |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 } | 232 } |
| 233 | 233 |
| 234 GpuDataManagerImpl::GpuDataManagerImpl() | 234 GpuDataManagerImpl::GpuDataManagerImpl() |
| 235 : private_(GpuDataManagerImplPrivate::Create(this)) { | 235 : private_(GpuDataManagerImplPrivate::Create(this)) { |
| 236 } | 236 } |
| 237 | 237 |
| 238 GpuDataManagerImpl::~GpuDataManagerImpl() { | 238 GpuDataManagerImpl::~GpuDataManagerImpl() { |
| 239 } | 239 } |
| 240 | 240 |
| 241 } // namespace content | 241 } // namespace content |
| OLD | NEW |