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