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

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

Issue 15908002: Differential updates for components. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Sync to LKGR revision 207804. Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/widevine_cdm_component_installer.h" 5 #include "chrome/browser/component_updater/widevine_cdm_component_installer.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 188
189 class WidevineCdmComponentInstaller : public ComponentInstaller { 189 class WidevineCdmComponentInstaller : public ComponentInstaller {
190 public: 190 public:
191 explicit WidevineCdmComponentInstaller(const base::Version& version); 191 explicit WidevineCdmComponentInstaller(const base::Version& version);
192 virtual ~WidevineCdmComponentInstaller() {} 192 virtual ~WidevineCdmComponentInstaller() {}
193 193
194 virtual void OnUpdateError(int error) OVERRIDE; 194 virtual void OnUpdateError(int error) OVERRIDE;
195 virtual bool Install(const base::DictionaryValue& manifest, 195 virtual bool Install(const base::DictionaryValue& manifest,
196 const base::FilePath& unpack_path) OVERRIDE; 196 const base::FilePath& unpack_path) OVERRIDE;
197 197
198 virtual bool GetInstalledFile(const std::string& file,
199 base::FilePath* installed_file) OVERRIDE;
200
198 private: 201 private:
199 base::Version current_version_; 202 base::Version current_version_;
200 }; 203 };
201 204
202 WidevineCdmComponentInstaller::WidevineCdmComponentInstaller( 205 WidevineCdmComponentInstaller::WidevineCdmComponentInstaller(
203 const base::Version& version) 206 const base::Version& version)
204 : current_version_(version) { 207 : current_version_(version) {
205 DCHECK(version.IsValid()); 208 DCHECK(version.IsValid());
206 } 209 }
207 210
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 if (!file_util::CopyFile(adapter_source_path, adapter_install_path)) 242 if (!file_util::CopyFile(adapter_source_path, adapter_install_path))
240 return false; 243 return false;
241 244
242 // Installation is done. Now register the Widevine CDM with chrome. 245 // Installation is done. Now register the Widevine CDM with chrome.
243 current_version_ = version; 246 current_version_ = version;
244 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( 247 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(
245 &RegisterWidevineCdmWithChrome, adapter_install_path, version)); 248 &RegisterWidevineCdmWithChrome, adapter_install_path, version));
246 return true; 249 return true;
247 } 250 }
248 251
252 bool WidevineCdmComponentInstaller::GetInstalledFile(
253 const std::string& file, base::FilePath* installed_file) {
254 return false;
255 }
256
249 void FinishWidevineCdmUpdateRegistration(ComponentUpdateService* cus, 257 void FinishWidevineCdmUpdateRegistration(ComponentUpdateService* cus,
250 const base::Version& version) { 258 const base::Version& version) {
251 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 259 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
252 CrxComponent widevine_cdm; 260 CrxComponent widevine_cdm;
253 widevine_cdm.name = "WidevineCdm"; 261 widevine_cdm.name = "WidevineCdm";
254 widevine_cdm.installer = new WidevineCdmComponentInstaller(version); 262 widevine_cdm.installer = new WidevineCdmComponentInstaller(version);
255 widevine_cdm.version = version; 263 widevine_cdm.version = version;
256 widevine_cdm.pk_hash.assign(kSha2Hash, &kSha2Hash[sizeof(kSha2Hash)]); 264 widevine_cdm.pk_hash.assign(kSha2Hash, &kSha2Hash[sizeof(kSha2Hash)]);
257 if (cus->RegisterComponent(widevine_cdm) != ComponentUpdateService::kOk) { 265 if (cus->RegisterComponent(widevine_cdm) != ComponentUpdateService::kOk) {
258 NOTREACHED() << "Widevine CDM component registration failed."; 266 NOTREACHED() << "Widevine CDM component registration failed.";
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT) 311 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT)
304 312
305 } // namespace 313 } // namespace
306 314
307 void RegisterWidevineCdmComponent(ComponentUpdateService* cus) { 315 void RegisterWidevineCdmComponent(ComponentUpdateService* cus) {
308 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT) 316 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT)
309 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, 317 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
310 base::Bind(&StartWidevineCdmUpdateRegistration, cus)); 318 base::Bind(&StartWidevineCdmUpdateRegistration, cus));
311 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT) 319 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT)
312 } 320 }
OLDNEW
« no previous file with comments | « chrome/browser/component_updater/test/test_installer.cc ('k') | chrome/browser/net/crl_set_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698