| 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/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/file_path.h" | 11 #include "base/file_path.h" |
| 11 #include "base/file_util.h" | 12 #include "base/file_util.h" |
| 12 #include "base/logging.h" | 13 #include "base/logging.h" |
| 13 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 14 #include "base/string_util.h" | 15 #include "base/string_util.h" |
| 15 #include "base/values.h" | 16 #include "base/values.h" |
| 16 #include "chrome/browser/component_updater/component_updater_service.h" | 17 #include "chrome/browser/component_updater/component_updater_service.h" |
| 17 #include "chrome/common/chrome_paths.h" | 18 #include "chrome/common/chrome_paths.h" |
| 18 #include "content/public/browser/browser_thread.h" | 19 #include "content/public/browser/browser_thread.h" |
| 19 #include "content/public/browser/gpu_data_manager.h" | 20 #include "content/public/browser/gpu_data_manager.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 | 205 |
| 205 UpdateChecker *update_checker = new UpdateChecker(cus); | 206 UpdateChecker *update_checker = new UpdateChecker(cus); |
| 206 GpuDataManager::GetInstance()->AddObserver(update_checker); | 207 GpuDataManager::GetInstance()->AddObserver(update_checker); |
| 207 update_checker->OnGpuInfoUpdate(); | 208 update_checker->OnGpuInfoUpdate(); |
| 208 // We leak update_checker here, because it has to stick around for the life | 209 // We leak update_checker here, because it has to stick around for the life |
| 209 // of the GpuDataManager. | 210 // of the GpuDataManager. |
| 210 } | 211 } |
| 211 | 212 |
| 212 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { | 213 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { |
| 213 #if defined(ENABLE_SWIFTSHADER) | 214 #if defined(ENABLE_SWIFTSHADER) |
| 215 base::CPU cpu; |
| 216 |
| 217 if (!cpu.has_sse2()) |
| 218 return; |
| 214 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 219 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
| 215 base::Bind(&RegisterSwiftShaderPath, cus)); | 220 base::Bind(&RegisterSwiftShaderPath, cus)); |
| 216 #endif | 221 #endif |
| 217 } | 222 } |
| OLD | NEW |