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

Unified Diff: chrome/browser/component_updater/widevine_cdm_component_installer.cc

Issue 2617023004: media: Copy Widevine CDM adapter signature file (Closed)
Patch Set: media: Copy Widevine CDM adapter signature file Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..57ce33d55e105fb2a01a0b75c2ecf253e1e27754 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,22 +384,31 @@ 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)) {
+ if (!base::CopyFile(adapter_source_path, adapter_install_path)) {
+ PLOG(WARNING) << "Failed to copy Widevine CDM adapter.";
+ return;
+ }
+
+ // Generate the version file.
int bytes_written = base::WriteFile(
adapter_version_path, chrome_version.data(), chrome_version.size());
if (bytes_written < 0 ||
static_cast<size_t>(bytes_written) != chrome_version.size()) {
PLOG(WARNING) << "Failed to write Widevine CDM adapter version file.";
- // Ignore version file writing failure and try to copy the CDM adapter.
+ // Ignore version file writing failure.
}
- if (!base::CopyFile(adapter_source_path, adapter_install_path)) {
- PLOG(WARNING) << "Failed to copy Widevine CDM adapter.";
- return;
+ // Copy Widevine CDM adapter signature file.
+ if (!base::CopyFile(
+ adapter_source_path.AddExtension(kSignatureFileExtension),
+ adapter_install_path.AddExtension(kSignatureFileExtension))) {
+ PLOG(WARNING) << "Failed to copy Widevine CDM adapter signature file.";
+ // The sig file may be missing or the copy failed. Ignore the failure.
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698