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 "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/cpu.h" | 10 #include "base/cpu.h" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 223 |
224 UpdateChecker *update_checker = new UpdateChecker(cus); | 224 UpdateChecker *update_checker = new UpdateChecker(cus); |
225 GpuDataManager::GetInstance()->AddObserver(update_checker); | 225 GpuDataManager::GetInstance()->AddObserver(update_checker); |
226 update_checker->OnGpuInfoUpdate(); | 226 update_checker->OnGpuInfoUpdate(); |
227 // We leak update_checker here, because it has to stick around for the life | 227 // We leak update_checker here, because it has to stick around for the life |
228 // of the GpuDataManager. | 228 // of the GpuDataManager. |
229 | 229 |
230 // Remove older versions of SwiftShader. | 230 // Remove older versions of SwiftShader. |
231 for (std::vector<base::FilePath>::iterator iter = older_dirs.begin(); | 231 for (std::vector<base::FilePath>::iterator iter = older_dirs.begin(); |
232 iter != older_dirs.end(); ++iter) { | 232 iter != older_dirs.end(); ++iter) { |
233 base::Delete(*iter, true); | 233 base::DeleteFile(*iter, true); |
234 } | 234 } |
235 } | 235 } |
236 | 236 |
237 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { | 237 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { |
238 #if defined(ENABLE_SWIFTSHADER) | 238 #if defined(ENABLE_SWIFTSHADER) |
239 base::CPU cpu; | 239 base::CPU cpu; |
240 | 240 |
241 if (!cpu.has_sse2()) | 241 if (!cpu.has_sse2()) |
242 return; | 242 return; |
243 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 243 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
244 base::Bind(&RegisterSwiftShaderPath, cus)); | 244 base::Bind(&RegisterSwiftShaderPath, cus)); |
245 #endif | 245 #endif |
246 } | 246 } |
OLD | NEW |