| 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/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/cpu.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 if (cus->RegisterComponent(swiftshader) != ComponentUpdateService::kOk) { | 158 if (cus->RegisterComponent(swiftshader) != ComponentUpdateService::kOk) { |
| 159 NOTREACHED() << "SwiftShader component registration fail"; | 159 NOTREACHED() << "SwiftShader component registration fail"; |
| 160 } | 160 } |
| 161 } | 161 } |
| 162 | 162 |
| 163 class UpdateChecker : public content::GpuDataManagerObserver { | 163 class UpdateChecker : public content::GpuDataManagerObserver { |
| 164 public: | 164 public: |
| 165 explicit UpdateChecker(ComponentUpdateService* cus); | 165 explicit UpdateChecker(ComponentUpdateService* cus); |
| 166 | 166 |
| 167 virtual void OnGpuInfoUpdate() OVERRIDE; | 167 virtual void OnGpuInfoUpdate() OVERRIDE; |
| 168 virtual void OnVidmemUpdate(const content::GPUVidmem& vidmem) OVERRIDE {} |
| 168 | 169 |
| 169 private: | 170 private: |
| 170 ComponentUpdateService* cus_; | 171 ComponentUpdateService* cus_; |
| 171 }; | 172 }; |
| 172 | 173 |
| 173 UpdateChecker::UpdateChecker(ComponentUpdateService* cus) | 174 UpdateChecker::UpdateChecker(ComponentUpdateService* cus) |
| 174 : cus_(cus) { | 175 : cus_(cus) { |
| 175 } | 176 } |
| 176 | 177 |
| 177 void UpdateChecker::OnGpuInfoUpdate() { | 178 void UpdateChecker::OnGpuInfoUpdate() { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { | 228 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { |
| 228 #if defined(ENABLE_SWIFTSHADER) | 229 #if defined(ENABLE_SWIFTSHADER) |
| 229 base::CPU cpu; | 230 base::CPU cpu; |
| 230 | 231 |
| 231 if (!cpu.has_sse2()) | 232 if (!cpu.has_sse2()) |
| 232 return; | 233 return; |
| 233 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 234 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
| 234 base::Bind(&RegisterSwiftShaderPath, cus)); | 235 base::Bind(&RegisterSwiftShaderPath, cus)); |
| 235 #endif | 236 #endif |
| 236 } | 237 } |
| OLD | NEW |