Chromium Code Reviews| Index: chrome/browser/component_updater/widevine_cdm_component_installer.cc |
| diff --git a/chrome/browser/component_updater/widevine_cdm_component_installer.cc b/chrome/browser/component_updater/widevine_cdm_component_installer.cc |
| index 83723d2080cdfa916fdcceaac9e89b111d33f497..15e1821f3c36bf7d839f3fca8de431be38215db5 100644 |
| --- a/chrome/browser/component_updater/widevine_cdm_component_installer.cc |
| +++ b/chrome/browser/component_updater/widevine_cdm_component_installer.cc |
| @@ -104,6 +104,10 @@ const char kCdmHostVersionsName[] = "x-cdm-host-versions"; |
| // The list is passed to other parts of Chrome. |
| const char kCdmCodecsListName[] = "x-cdm-codecs"; |
| +// TODO(xhwang): Move this to a common place if needed. |
| +const base::FilePath::CharType kSignatureFileExtension[] = |
| + FILE_PATH_LITERAL(".sig"); |
| + |
| // Widevine CDM is packaged as a multi-CRX. Widevine CDM binaries are located in |
| // _platform_specific/<platform_arch> folder in the package. This function |
| // returns the platform-specific subdirectory that is part of that multi-CRX. |
| @@ -380,8 +384,8 @@ void WidevineCdmComponentInstallerTraits::UpdateCdmAdapter( |
| DCHECK(!chrome_version.empty()); |
| // If we are not using bundled CDM and we don't have a valid adapter, create |
| - // the version file and copy the CDM adapter from |adapter_source_path| to |
| - // |adapter_install_path|. |
| + // the version file, copy the CDM adapter signature file, and copy the CDM |
| + // adapter. |
| if (adapter_install_path != adapter_source_path && |
| !HasValidAdapter(adapter_version_path, adapter_install_path, |
| chrome_version)) { |
| @@ -393,6 +397,18 @@ void WidevineCdmComponentInstallerTraits::UpdateCdmAdapter( |
| // Ignore version file writing failure and try to copy the CDM adapter. |
| } |
| + // Copy Widevine CDM signature file if it exists. |
|
jrummell
2017/01/06 02:04:00
Since failing to find and/or copy this is not fata
xhwang
2017/01/06 04:37:06
Good point. Done.
|
| + base::FilePath adapter_sig_source_path = |
| + adapter_source_path.AddExtension(kSignatureFileExtension); |
| + if (base::PathExists(adapter_sig_source_path)) { |
| + base::FilePath adapter_sig_install_path = |
| + adapter_install_path.AddExtension(kSignatureFileExtension); |
| + if (!base::CopyFile(adapter_sig_source_path, adapter_sig_install_path)) |
| + PLOG(WARNING) << "Failed to copy Widevine CDM adapter signature file."; |
| + } else { |
| + PLOG(WARNING) << "Widevine CDM adapter signature file does not exist."; |
|
jrummell
2017/01/06 02:04:00
Since there is a log if the file doesn't exist or
xhwang
2017/01/06 04:37:07
We did have cases where the CDM is missing and the
|
| + } |
| + |
| if (!base::CopyFile(adapter_source_path, adapter_install_path)) { |
| PLOG(WARNING) << "Failed to copy Widevine CDM adapter."; |
| return; |