Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(954)

Side by Side Diff: chrome/browser/component_updater/swiftshader_component_installer.cc

Issue 879993005: Add support for uninstalling components and use it in SupervisedUserWhitelistInstaller. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: fix Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 // ComponentInstaller implementation: 103 // ComponentInstaller implementation:
104 void OnUpdateError(int error) override; 104 void OnUpdateError(int error) override;
105 105
106 bool Install(const base::DictionaryValue& manifest, 106 bool Install(const base::DictionaryValue& manifest,
107 const base::FilePath& unpack_path) override; 107 const base::FilePath& unpack_path) override;
108 108
109 bool GetInstalledFile(const std::string& file, 109 bool GetInstalledFile(const std::string& file,
110 base::FilePath* installed_file) override; 110 base::FilePath* installed_file) override;
111 111
112 bool Uninstall() override;
113
112 private: 114 private:
113 ~SwiftShaderComponentInstaller() override {} 115 ~SwiftShaderComponentInstaller() override {}
114 116
115 Version current_version_; 117 Version current_version_;
116 }; 118 };
117 119
118 SwiftShaderComponentInstaller::SwiftShaderComponentInstaller( 120 SwiftShaderComponentInstaller::SwiftShaderComponentInstaller(
119 const Version& version) 121 const Version& version)
120 : current_version_(version) { 122 : current_version_(version) {
121 DCHECK(version.IsValid()); 123 DCHECK(version.IsValid());
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 base::Bind(&RegisterSwiftShaderWithChrome, path)); 158 base::Bind(&RegisterSwiftShaderWithChrome, path));
157 return true; 159 return true;
158 } 160 }
159 161
160 bool SwiftShaderComponentInstaller::GetInstalledFile( 162 bool SwiftShaderComponentInstaller::GetInstalledFile(
161 const std::string& file, 163 const std::string& file,
162 base::FilePath* installed_file) { 164 base::FilePath* installed_file) {
163 return false; 165 return false;
164 } 166 }
165 167
168 bool SwiftShaderComponentInstaller::Uninstall() {
169 return false;
170 }
171
166 void FinishSwiftShaderUpdateRegistration(ComponentUpdateService* cus, 172 void FinishSwiftShaderUpdateRegistration(ComponentUpdateService* cus,
167 const Version& version) { 173 const Version& version) {
168 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 174 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
169 175
170 update_client::CrxComponent swiftshader; 176 update_client::CrxComponent swiftshader;
171 swiftshader.name = "Swift Shader"; 177 swiftshader.name = "Swift Shader";
172 swiftshader.installer = new SwiftShaderComponentInstaller(version); 178 swiftshader.installer = new SwiftShaderComponentInstaller(version);
173 swiftshader.version = version; 179 swiftshader.version = version;
174 swiftshader.pk_hash.assign(kSha2Hash, &kSha2Hash[sizeof(kSha2Hash)]); 180 swiftshader.pk_hash.assign(kSha2Hash, &kSha2Hash[sizeof(kSha2Hash)]);
175 if (cus->RegisterComponent(swiftshader) != ComponentUpdateService::kOk) { 181 if (cus->RegisterComponent(swiftshader) != ComponentUpdateService::kOk) {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 257
252 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) { 258 void RegisterSwiftShaderComponent(ComponentUpdateService* cus) {
253 #if defined(ENABLE_SWIFTSHADER) 259 #if defined(ENABLE_SWIFTSHADER)
254 BrowserThread::PostTask(BrowserThread::FILE, 260 BrowserThread::PostTask(BrowserThread::FILE,
255 FROM_HERE, 261 FROM_HERE,
256 base::Bind(&RegisterSwiftShaderPath, cus)); 262 base::Bind(&RegisterSwiftShaderPath, cus));
257 #endif 263 #endif
258 } 264 }
259 265
260 } // namespace component_updater 266 } // namespace component_updater
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698