| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 94 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 95 GpuDataManager::GetInstance()->RegisterSwiftShaderPath(path); | 95 GpuDataManager::GetInstance()->RegisterSwiftShaderPath(path); |
| 96 } | 96 } |
| 97 | 97 |
| 98 class SwiftShaderComponentInstaller : public ComponentInstaller { | 98 class SwiftShaderComponentInstaller : public ComponentInstaller { |
| 99 public: | 99 public: |
| 100 explicit SwiftShaderComponentInstaller(const Version& version); | 100 explicit SwiftShaderComponentInstaller(const Version& version); |
| 101 | 101 |
| 102 virtual ~SwiftShaderComponentInstaller() {} | 102 virtual ~SwiftShaderComponentInstaller() {} |
| 103 | 103 |
| 104 virtual void OnUpdateError(int error) OVERRIDE; | 104 virtual void OnUpdateError(int error) override; |
| 105 | 105 |
| 106 virtual bool Install(const base::DictionaryValue& manifest, | 106 virtual bool Install(const base::DictionaryValue& manifest, |
| 107 const base::FilePath& unpack_path) OVERRIDE; | 107 const base::FilePath& unpack_path) override; |
| 108 | 108 |
| 109 virtual bool GetInstalledFile(const std::string& file, | 109 virtual bool GetInstalledFile(const std::string& file, |
| 110 base::FilePath* installed_file) OVERRIDE; | 110 base::FilePath* installed_file) override; |
| 111 | 111 |
| 112 private: | 112 private: |
| 113 Version current_version_; | 113 Version current_version_; |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 SwiftShaderComponentInstaller::SwiftShaderComponentInstaller( | 116 SwiftShaderComponentInstaller::SwiftShaderComponentInstaller( |
| 117 const Version& version) | 117 const Version& version) |
| 118 : current_version_(version) { | 118 : current_version_(version) { |
| 119 DCHECK(version.IsValid()); | 119 DCHECK(version.IsValid()); |
| 120 } | 120 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 swiftshader.pk_hash.assign(kSha2Hash, &kSha2Hash[sizeof(kSha2Hash)]); | 172 swiftshader.pk_hash.assign(kSha2Hash, &kSha2Hash[sizeof(kSha2Hash)]); |
| 173 if (cus->RegisterComponent(swiftshader) != ComponentUpdateService::kOk) { | 173 if (cus->RegisterComponent(swiftshader) != ComponentUpdateService::kOk) { |
| 174 NOTREACHED() << "SwiftShader component registration fail"; | 174 NOTREACHED() << "SwiftShader component registration fail"; |
| 175 } | 175 } |
| 176 } | 176 } |
| 177 | 177 |
| 178 class UpdateChecker : public content::GpuDataManagerObserver { | 178 class UpdateChecker : public content::GpuDataManagerObserver { |
| 179 public: | 179 public: |
| 180 explicit UpdateChecker(ComponentUpdateService* cus); | 180 explicit UpdateChecker(ComponentUpdateService* cus); |
| 181 | 181 |
| 182 virtual void OnGpuInfoUpdate() OVERRIDE; | 182 virtual void OnGpuInfoUpdate() override; |
| 183 | 183 |
| 184 private: | 184 private: |
| 185 ComponentUpdateService* cus_; | 185 ComponentUpdateService* cus_; |
| 186 }; | 186 }; |
| 187 | 187 |
| 188 UpdateChecker::UpdateChecker(ComponentUpdateService* cus) : cus_(cus) { | 188 UpdateChecker::UpdateChecker(ComponentUpdateService* cus) : cus_(cus) { |
| 189 } | 189 } |
| 190 | 190 |
| 191 void UpdateChecker::OnGpuInfoUpdate() { | 191 void UpdateChecker::OnGpuInfoUpdate() { |
| 192 GpuDataManager* gpu_data_manager = GpuDataManager::GetInstance(); | 192 GpuDataManager* gpu_data_manager = GpuDataManager::GetInstance(); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 | 249 |
| 250 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { | 250 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { |
| 251 #if defined(ENABLE_SWIFTSHADER) | 251 #if defined(ENABLE_SWIFTSHADER) |
| 252 BrowserThread::PostTask(BrowserThread::FILE, | 252 BrowserThread::PostTask(BrowserThread::FILE, |
| 253 FROM_HERE, | 253 FROM_HERE, |
| 254 base::Bind(&RegisterSwiftShaderPath, cus)); | 254 base::Bind(&RegisterSwiftShaderPath, cus)); |
| 255 #endif | 255 #endif |
| 256 } | 256 } |
| 257 | 257 |
| 258 } // namespace component_updater | 258 } // namespace component_updater |
| OLD | NEW |