OLD | NEW |
1 // Copyright (c) 2011 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/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/browser/gpu/gpu_data_manager.h" | 20 #include "content/browser/gpu/gpu_data_manager.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 203 |
203 UpdateChecker *update_checker = new UpdateChecker(cus); | 204 UpdateChecker *update_checker = new UpdateChecker(cus); |
204 GpuDataManager::GetInstance()->AddObserver(update_checker); | 205 GpuDataManager::GetInstance()->AddObserver(update_checker); |
205 update_checker->OnGpuInfoUpdate(); | 206 update_checker->OnGpuInfoUpdate(); |
206 // We leak update_checker here, because it has to stick around for the life | 207 // We leak update_checker here, because it has to stick around for the life |
207 // of the GpuDataManager. | 208 // of the GpuDataManager. |
208 } | 209 } |
209 | 210 |
210 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { | 211 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { |
211 #if defined(ENABLE_SWIFTSHADER) | 212 #if defined(ENABLE_SWIFTSHADER) |
| 213 base::CPU cpu; |
| 214 |
| 215 if (!cpu.has_sse2()) |
| 216 return; |
212 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 217 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
213 base::Bind(&RegisterSwiftShaderPath, cus)); | 218 base::Bind(&RegisterSwiftShaderPath, cus)); |
214 #endif | 219 #endif |
215 } | 220 } |
OLD | NEW |