| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 base::Version version(kNullVersion); | 226 base::Version version(kNullVersion); |
| 227 GetLatestSwiftShaderDirectory(&path, &version, NULL); | 227 GetLatestSwiftShaderDirectory(&path, &version, NULL); |
| 228 | 228 |
| 229 BrowserThread::PostTask( | 229 BrowserThread::PostTask( |
| 230 BrowserThread::UI, | 230 BrowserThread::UI, |
| 231 FROM_HERE, | 231 FROM_HERE, |
| 232 base::Bind(&FinishSwiftShaderUpdateRegistration, cus_, version)); | 232 base::Bind(&FinishSwiftShaderUpdateRegistration, cus_, version)); |
| 233 } | 233 } |
| 234 } | 234 } |
| 235 | 235 |
| 236 #if BUILDFLAG(ENABLE_SWIFTSHADER) | 236 #if BUILDFLAG(ENABLE_SWIFTSHADER) && defined(ARCH_CPU_X86) |
| 237 | 237 |
| 238 // Check if there already is a version of swiftshader installed, | 238 // Check if there already is a version of swiftshader installed, |
| 239 // and if so register it. | 239 // and if so register it. |
| 240 void RegisterSwiftShaderPath(ComponentUpdateService* cus) { | 240 void RegisterSwiftShaderPath(ComponentUpdateService* cus) { |
| 241 DCHECK_CURRENTLY_ON(BrowserThread::FILE); | 241 DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
| 242 base::FilePath path = GetSwiftShaderBaseDirectory(); | 242 base::FilePath path = GetSwiftShaderBaseDirectory(); |
| 243 if (!base::PathExists(path)) { | 243 if (!base::PathExists(path)) { |
| 244 if (!base::CreateDirectory(path)) { | 244 if (!base::CreateDirectory(path)) { |
| 245 NOTREACHED() << "Could not create SwiftShader directory."; | 245 NOTREACHED() << "Could not create SwiftShader directory."; |
| 246 return; | 246 return; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 274 | 274 |
| 275 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { | 275 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { |
| 276 #if BUILDFLAG(ENABLE_SWIFTSHADER) && defined(ARCH_CPU_X86) | 276 #if BUILDFLAG(ENABLE_SWIFTSHADER) && defined(ARCH_CPU_X86) |
| 277 BrowserThread::PostTask(BrowserThread::FILE, | 277 BrowserThread::PostTask(BrowserThread::FILE, |
| 278 FROM_HERE, | 278 FROM_HERE, |
| 279 base::Bind(&RegisterSwiftShaderPath, cus)); | 279 base::Bind(&RegisterSwiftShaderPath, cus)); |
| 280 #endif | 280 #endif |
| 281 } | 281 } |
| 282 | 282 |
| 283 } // namespace component_updater | 283 } // namespace component_updater |
| OLD | NEW |