OLD | NEW |
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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include <string> | 10 #include <string> |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 bool VerifyInstallation( | 242 bool VerifyInstallation( |
243 const base::DictionaryValue& manifest, | 243 const base::DictionaryValue& manifest, |
244 const base::FilePath& install_dir) const override; | 244 const base::FilePath& install_dir) const override; |
245 void ComponentReady( | 245 void ComponentReady( |
246 const base::Version& version, | 246 const base::Version& version, |
247 const base::FilePath& path, | 247 const base::FilePath& path, |
248 scoped_ptr<base::DictionaryValue> manifest) override; | 248 scoped_ptr<base::DictionaryValue> manifest) override; |
249 base::FilePath GetBaseDirectory() const override; | 249 base::FilePath GetBaseDirectory() const override; |
250 void GetHash(std::vector<uint8_t>* hash) const override; | 250 void GetHash(std::vector<uint8_t>* hash) const override; |
251 std::string GetName() const override; | 251 std::string GetName() const override; |
| 252 std::string GetAp() const override; |
252 | 253 |
253 // Checks and updates CDM adapter if necessary to make sure the latest CDM | 254 // Checks and updates CDM adapter if necessary to make sure the latest CDM |
254 // adapter is always used. | 255 // adapter is always used. |
255 // Note: The component is ready when CDM is present, but the CDM won't be | 256 // Note: The component is ready when CDM is present, but the CDM won't be |
256 // registered until the adapter is copied by this function (see | 257 // registered until the adapter is copied by this function (see |
257 // VerifyInstallation). | 258 // VerifyInstallation). |
258 void UpdateCdmAdapter(const base::Version& cdm_version, | 259 void UpdateCdmAdapter(const base::Version& cdm_version, |
259 const base::FilePath& cdm_install_dir, | 260 const base::FilePath& cdm_install_dir, |
260 scoped_ptr<base::DictionaryValue> manifest); | 261 scoped_ptr<base::DictionaryValue> manifest); |
261 | 262 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 | 317 |
317 void WidevineCdmComponentInstallerTraits::GetHash( | 318 void WidevineCdmComponentInstallerTraits::GetHash( |
318 std::vector<uint8_t>* hash) const { | 319 std::vector<uint8_t>* hash) const { |
319 hash->assign(kSha2Hash, kSha2Hash + arraysize(kSha2Hash)); | 320 hash->assign(kSha2Hash, kSha2Hash + arraysize(kSha2Hash)); |
320 } | 321 } |
321 | 322 |
322 std::string WidevineCdmComponentInstallerTraits::GetName() const { | 323 std::string WidevineCdmComponentInstallerTraits::GetName() const { |
323 return kWidevineCdmDisplayName; | 324 return kWidevineCdmDisplayName; |
324 } | 325 } |
325 | 326 |
| 327 std::string WidevineCdmComponentInstallerTraits::GetAp() const { |
| 328 return std::string(); |
| 329 } |
| 330 |
326 void WidevineCdmComponentInstallerTraits::UpdateCdmAdapter( | 331 void WidevineCdmComponentInstallerTraits::UpdateCdmAdapter( |
327 const base::Version& cdm_version, | 332 const base::Version& cdm_version, |
328 const base::FilePath& cdm_install_dir, | 333 const base::FilePath& cdm_install_dir, |
329 scoped_ptr<base::DictionaryValue> manifest) { | 334 scoped_ptr<base::DictionaryValue> manifest) { |
330 const base::FilePath adapter_version_path = | 335 const base::FilePath adapter_version_path = |
331 GetPlatformDirectory(cdm_install_dir).AppendASCII(kCdmAdapterVersionName); | 336 GetPlatformDirectory(cdm_install_dir).AppendASCII(kCdmAdapterVersionName); |
332 const base::FilePath adapter_install_path = | 337 const base::FilePath adapter_install_path = |
333 GetPlatformDirectory(cdm_install_dir) | 338 GetPlatformDirectory(cdm_install_dir) |
334 .AppendASCII(kWidevineCdmAdapterFileName); | 339 .AppendASCII(kWidevineCdmAdapterFileName); |
335 | 340 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 scoped_ptr<ComponentInstallerTraits> traits( | 383 scoped_ptr<ComponentInstallerTraits> traits( |
379 new WidevineCdmComponentInstallerTraits); | 384 new WidevineCdmComponentInstallerTraits); |
380 // |cus| will take ownership of |installer| during installer->Register(cus). | 385 // |cus| will take ownership of |installer| during installer->Register(cus). |
381 DefaultComponentInstaller* installer = | 386 DefaultComponentInstaller* installer = |
382 new DefaultComponentInstaller(std::move(traits)); | 387 new DefaultComponentInstaller(std::move(traits)); |
383 installer->Register(cus, base::Closure()); | 388 installer->Register(cus, base::Closure()); |
384 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT) | 389 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT) |
385 } | 390 } |
386 | 391 |
387 } // namespace component_updater | 392 } // namespace component_updater |
OLD | NEW |