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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 void RegisterSwiftShaderWithChrome(const base::FilePath& path) { | 94 void RegisterSwiftShaderWithChrome(const base::FilePath& path) { |
95 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 95 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
96 GpuDataManager::GetInstance()->RegisterSwiftShaderPath(path); | 96 GpuDataManager::GetInstance()->RegisterSwiftShaderPath(path); |
97 } | 97 } |
98 | 98 |
99 class SwiftShaderComponentInstaller : public update_client::ComponentInstaller { | 99 class SwiftShaderComponentInstaller : public update_client::ComponentInstaller { |
100 public: | 100 public: |
101 explicit SwiftShaderComponentInstaller(const Version& version); | 101 explicit SwiftShaderComponentInstaller(const Version& version); |
102 | 102 |
103 ~SwiftShaderComponentInstaller() override {} | 103 // ComponentInstaller implementation: |
104 | |
105 void OnUpdateError(int error) override; | 104 void OnUpdateError(int error) override; |
106 | 105 |
107 bool Install(const base::DictionaryValue& manifest, | 106 bool Install(const base::DictionaryValue& manifest, |
108 const base::FilePath& unpack_path) override; | 107 const base::FilePath& unpack_path) override; |
109 | 108 |
110 bool GetInstalledFile(const std::string& file, | 109 bool GetInstalledFile(const std::string& file, |
111 base::FilePath* installed_file) override; | 110 base::FilePath* installed_file) override; |
112 | 111 |
113 private: | 112 private: |
| 113 ~SwiftShaderComponentInstaller() override {} |
| 114 |
114 Version current_version_; | 115 Version current_version_; |
115 }; | 116 }; |
116 | 117 |
117 SwiftShaderComponentInstaller::SwiftShaderComponentInstaller( | 118 SwiftShaderComponentInstaller::SwiftShaderComponentInstaller( |
118 const Version& version) | 119 const Version& version) |
119 : current_version_(version) { | 120 : current_version_(version) { |
120 DCHECK(version.IsValid()); | 121 DCHECK(version.IsValid()); |
121 } | 122 } |
122 | 123 |
123 void SwiftShaderComponentInstaller::OnUpdateError(int error) { | 124 void SwiftShaderComponentInstaller::OnUpdateError(int error) { |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 | 251 |
251 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { | 252 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { |
252 #if defined(ENABLE_SWIFTSHADER) | 253 #if defined(ENABLE_SWIFTSHADER) |
253 BrowserThread::PostTask(BrowserThread::FILE, | 254 BrowserThread::PostTask(BrowserThread::FILE, |
254 FROM_HERE, | 255 FROM_HERE, |
255 base::Bind(&RegisterSwiftShaderPath, cus)); | 256 base::Bind(&RegisterSwiftShaderPath, cus)); |
256 #endif | 257 #endif |
257 } | 258 } |
258 | 259 |
259 } // namespace component_updater | 260 } // namespace component_updater |
OLD | NEW |