| 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 <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/cpu.h" | |
| 14 #include "base/files/file_enumerator.h" | 13 #include "base/files/file_enumerator.h" |
| 15 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 16 #include "base/files/file_util.h" | 15 #include "base/files/file_util.h" |
| 17 #include "base/logging.h" | 16 #include "base/logging.h" |
| 18 #include "base/path_service.h" | 17 #include "base/path_service.h" |
| 19 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
| 20 #include "base/values.h" | 19 #include "base/values.h" |
| 21 #include "components/component_updater/component_updater_paths.h" | 20 #include "components/component_updater/component_updater_paths.h" |
| 22 #include "components/component_updater/component_updater_service.h" | 21 #include "components/component_updater/component_updater_service.h" |
| 23 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 base::DeleteFile(*iter, true); | 241 base::DeleteFile(*iter, true); |
| 243 } | 242 } |
| 244 } | 243 } |
| 245 | 244 |
| 246 #endif // ENABLE_SWIFTSHADER | 245 #endif // ENABLE_SWIFTSHADER |
| 247 | 246 |
| 248 } // namespace | 247 } // namespace |
| 249 | 248 |
| 250 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { | 249 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { |
| 251 #if defined(ENABLE_SWIFTSHADER) | 250 #if defined(ENABLE_SWIFTSHADER) |
| 252 base::CPU cpu; | |
| 253 | |
| 254 if (!cpu.has_sse2()) | |
| 255 return; | |
| 256 BrowserThread::PostTask(BrowserThread::FILE, | 251 BrowserThread::PostTask(BrowserThread::FILE, |
| 257 FROM_HERE, | 252 FROM_HERE, |
| 258 base::Bind(&RegisterSwiftShaderPath, cus)); | 253 base::Bind(&RegisterSwiftShaderPath, cus)); |
| 259 #endif | 254 #endif |
| 260 } | 255 } |
| 261 | 256 |
| 262 } // namespace component_updater | 257 } // namespace component_updater |
| OLD | NEW |