| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/component_updater/swiftshader_component_installer.h" | 5 #include "chrome/browser/component_updater/swiftshader_component_installer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/cpu.h" | 10 #include "base/cpu.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 }; | 174 }; |
| 175 | 175 |
| 176 UpdateChecker::UpdateChecker(ComponentUpdateService* cus) | 176 UpdateChecker::UpdateChecker(ComponentUpdateService* cus) |
| 177 : cus_(cus) { | 177 : cus_(cus) { |
| 178 } | 178 } |
| 179 | 179 |
| 180 void UpdateChecker::OnGpuInfoUpdate() { | 180 void UpdateChecker::OnGpuInfoUpdate() { |
| 181 GpuDataManager *gpu_data_manager = GpuDataManager::GetInstance(); | 181 GpuDataManager *gpu_data_manager = GpuDataManager::GetInstance(); |
| 182 | 182 |
| 183 if (!gpu_data_manager->GpuAccessAllowed() || | 183 if (!gpu_data_manager->GpuAccessAllowed() || |
| 184 (gpu_data_manager->GetGpuFeatureType() & | 184 (gpu_data_manager->GetBlacklistedFeatures() & |
| 185 content::GPU_FEATURE_TYPE_WEBGL) || | 185 content::GPU_FEATURE_TYPE_WEBGL) || |
| 186 gpu_data_manager->ShouldUseSoftwareRendering()) { | 186 gpu_data_manager->ShouldUseSoftwareRendering()) { |
| 187 gpu_data_manager->RemoveObserver(this); | 187 gpu_data_manager->RemoveObserver(this); |
| 188 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 188 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 189 FilePath path = GetSwiftShaderBaseDirectory(); | 189 FilePath path = GetSwiftShaderBaseDirectory(); |
| 190 | 190 |
| 191 Version version(kNullVersion); | 191 Version version(kNullVersion); |
| 192 GetLatestSwiftShaderDirectory(&path, &version, NULL); | 192 GetLatestSwiftShaderDirectory(&path, &version, NULL); |
| 193 | 193 |
| 194 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 194 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { | 230 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { |
| 231 #if defined(ENABLE_SWIFTSHADER) | 231 #if defined(ENABLE_SWIFTSHADER) |
| 232 base::CPU cpu; | 232 base::CPU cpu; |
| 233 | 233 |
| 234 if (!cpu.has_sse2()) | 234 if (!cpu.has_sse2()) |
| 235 return; | 235 return; |
| 236 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 236 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
| 237 base::Bind(&RegisterSwiftShaderPath, cus)); | 237 base::Bind(&RegisterSwiftShaderPath, cus)); |
| 238 #endif | 238 #endif |
| 239 } | 239 } |
| OLD | NEW |