Skip to content

Commit

Permalink
media: Remove widevinecdmadapter target
Browse files Browse the repository at this point in the history
Pepper CDM is being deprecated so widevinecdmadapter should not be
needed anywhere now. Targets that need Widevine CDM should depend
on "widevinecdm" target directly.

Details of change:
- Remove widevinecdmadapter from third_party/widevine/cdm/BUILD.gn
- Remove files required to build widevinecdmadapter
- Remove stub CDM since it's only needed to build the CDM adapter
- Update installer code to remove widevinecdmadapter

Bug: 772160
Change-Id: I5c17d3d34a98839ecb48438cd09aaa8a565dd5dd
Reviewed-on: https://chromium-review.googlesource.com/957868
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Reviewed-by: John Rummell <jrummell@chromium.org>
Reviewed-by: Prasad Vuppalapu <prasadv@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544557}
  • Loading branch information
xhwang-chromium authored and Commit Bot committed Mar 20, 2018
1 parent 9be1f48 commit d5b69c8
Show file tree
Hide file tree
Showing 17 changed files with 50 additions and 468 deletions.
70 changes: 15 additions & 55 deletions chrome/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ if (!is_android && !is_mac) {

data_deps += [
"//chrome/browser/resources/media/mei_preload:component",
"//third_party/widevine/cdm:widevinecdmadapter",
"//third_party/widevine/cdm",
]

if (is_multi_dll_chrome) {
Expand Down Expand Up @@ -766,9 +766,7 @@ if (is_win) {
":verify_chrome_framework_order",
]

# Only official builds that include Widevine need the widevine
# signature file.
if (is_chrome_branded && enable_library_cdms) {
if (enable_widevine_cdm_host_verification) {
sources += [ "$root_out_dir/Widevine Resources.bundle" ]
public_deps += [ ":widevine_resources_bundle" ]
}
Expand Down Expand Up @@ -1046,52 +1044,20 @@ if (is_win) {
}
}

_should_bundle_widevine =
(is_chrome_branded || enable_widevine) && enable_library_cdms
if (_should_bundle_widevine) {
# The Widevine CDM and manifest are either the actual Widevine CDM and
# manifest or stubs used for testing only. The choice is made within the
# corresponding Widevine targets based on branding.
if (should_bundle_widevine_cdm) {
bundle_data("widevine_cdm_library_binaries") {
sources = [
"$root_out_dir/$widevine_cdm_path/widevinecdmadapter.plugin",
"$root_out_dir/libwidevinecdm.dylib",
]
outputs = [
"{{bundle_contents_dir}}/Libraries/$widevine_cdm_path/{{source_file_part}}",
]
public_deps = [
# Need this intermediate dependency because "widevinecdm" is a
# shared_library if !is_chrome_branded, and then depending on
# "widevinecdm" directly would cause it to be linked into the Chromium
# Framework, which we don't want.
":widevine_cdm_library_copy",
"//third_party/widevine/cdm:widevinecdmadapter",
]

# Signatures are only generated for official chrome.
if (is_chrome_branded) {
sources += [
"$root_out_dir/$widevine_cdm_path/widevinecdmadapter.plugin.sig",
"$root_out_dir/libwidevinecdm.dylib.sig",
]
public_deps += [ ":sign_cdm_adapter_for_widevine" ]
}
}

copy("widevine_cdm_library_copy") {
sources = [
"$root_out_dir/$widevine_cdm_path/libwidevinecdm.dylib",
]
if (is_chrome_branded) {
if (enable_widevine_cdm_host_verification) {
sources +=
[ "$root_out_dir/$widevine_cdm_path/libwidevinecdm.dylib.sig" ]
}
outputs = [
"$root_out_dir/{{source_file_part}}",
"{{bundle_contents_dir}}/Libraries/$widevine_cdm_path/{{source_file_part}}",
]
deps = [
"//third_party/widevine/cdm:widevinecdm",
public_deps = [
"//third_party/widevine/cdm",
]
}

Expand All @@ -1103,18 +1069,21 @@ if (is_win) {
"{{bundle_contents_dir}}/Libraries/WidevineCdm/{{source_file_part}}",
]
public_deps = [
"//third_party/widevine/cdm:widevine_cdm_manifest",
"//third_party/widevine/cdm",
]
}
}

widevine_sign_file("sign_cdm_adapter_for_widevine") {
file = "$root_out_dir/$widevine_cdm_path/widevinecdmadapter.plugin"
flags = 0
group("widevine_cdm_library") {
if (should_bundle_widevine_cdm) {
deps = [
"//third_party/widevine/cdm:widevinecdmadapter",
":widevine_cdm_library_binaries",
":widevine_cdm_library_manifest",
]
}
}

if (enable_widevine_cdm_host_verification) {
widevine_sign_file("sign_chrome_framework_for_widevine") {
file = "$root_out_dir/$chrome_framework_name.framework/"
if (defined(chrome_framework_version)) {
Expand Down Expand Up @@ -1174,15 +1143,6 @@ if (is_win) {
}
}

group("widevine_cdm_library") {
if (_should_bundle_widevine) {
deps = [
":widevine_cdm_library_binaries",
":widevine_cdm_library_manifest",
]
}
}

if (is_chrome_branded) {
action("keystone_registration_framework") {
script = "//chrome/tools/build/mac/copy_keystone_framework.py"
Expand Down
11 changes: 3 additions & 8 deletions chrome/installer/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ if (enable_nacl) {

# The widevine BUILD.gn only produces shared libraries for x86 and x64
if (is_chrome_branded && (current_cpu == "x86" || current_cpu == "x64")) {
packaging_files_shlibs += [
"$root_out_dir/$widevine_cdm_path/libwidevinecdmadapter.so",
"$root_out_dir/$widevine_cdm_path/libwidevinecdm.so",
]
packaging_files_shlibs +=
[ "$root_out_dir/$widevine_cdm_path/libwidevinecdm.so" ]
}

if (!libcpp_is_static && use_custom_libcxx) {
Expand Down Expand Up @@ -370,10 +368,7 @@ group("installer_deps") {
]
}
if (current_cpu == "x86" || current_cpu == "x64") {
public_deps += [
"//third_party/widevine/cdm:widevinecdm",
"//third_party/widevine/cdm:widevinecdmadapter",
]
public_deps += [ "//third_party/widevine/cdm" ]
}
if (!is_chromeos) {
public_deps += [ ":rpm_packaging_files" ]
Expand Down
3 changes: 1 addition & 2 deletions chrome/installer/linux/common/installer.include
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,7 @@ stage_install_common() {
fi

# Widevine CDM.
if [ -f "${BUILDDIR}/libwidevinecdmadapter.so" ]; then
install -m ${SHLIB_PERMS} -s "${BUILDDIR}/libwidevinecdmadapter.so" "${STAGEDIR}/${INSTALLDIR}/"
if [ -f "${BUILDDIR}/libwidevinecdm.so" ]; then
# No need to strip; libwidevinecdm.so starts out stripped.
install -m ${SHLIB_PERMS} "${BUILDDIR}/libwidevinecdm.so" "${STAGEDIR}/${INSTALLDIR}/"
fi
Expand Down
11 changes: 0 additions & 11 deletions chrome/installer/mac/sign_versioned_dir.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ crashpad_handler="${framework}/Helpers/crashpad_handler"
helper_app="${versioned_dir}/@MAC_PRODUCT_NAME@ Helper.app"
app_mode_loader_app="${framework}/Resources/app_mode_loader.app"
app_mode_loader="${app_mode_loader_app}/Contents/MacOS/app_mode_loader"
widevine_plugin="${framework}/Libraries/WidevineCdm/_platform_specific/mac_x64/widevinecdmadapter.plugin"

codesign_with_options "${crashpad_handler}" \
"${enforcement_flags_helpers}" \
Expand Down Expand Up @@ -120,23 +119,13 @@ codesign_with_options "${notification_service}" \
"${enforcement_flags_helpers}" \
"${xpc_bundle_id}"

# Only sign widevine plugin if it is present in the bundle.
# ${enforcement_flags*} are meaningless for dynamic libraries.
if [[ -f "${widevine_plugin}" ]]; then
codesign_with_options "${widevine_plugin}" "" "widevinecdmadapter"
fi

# The framework is a dylib, so ${enforcement_flags_helpers} are meaningless.
codesign_with_options "${framework}" "" "com.google.Chrome.framework"

codesign_with_options "${helper_app}" \
"${enforcement_flags_app}" \
"com.google.Chrome.helper"

if [[ -f "${widevine_plugin}" ]]; then
codesign_display_and_verify "${widevine_plugin}"
fi

codesign_display_and_verify "${crashpad_handler}" --deep
codesign_display_and_verify "${app_mode_loader}" --ignore-resources
codesign_display_and_verify "${notification_service}" --deep
Expand Down
2 changes: 0 additions & 2 deletions chrome/installer/mini_installer/chrome.release
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,8 @@ chrome_200_percent.pak: %(VersionDir)s\
WidevineCdm\manifest.json: %(VersionDir)s\WidevineCdm\
WidevineCdm\_platform_specific\win_x86\widevinecdm.dll: %(VersionDir)s\WidevineCdm\_platform_specific\win_x86\
WidevineCdm\_platform_specific\win_x86\widevinecdm.dll.sig: %(VersionDir)s\WidevineCdm\_platform_specific\win_x86\
WidevineCdm\_platform_specific\win_x86\widevinecdmadapter.dll: %(VersionDir)s\WidevineCdm\_platform_specific\win_x86\
WidevineCdm\_platform_specific\win_x64\widevinecdm.dll: %(VersionDir)s\WidevineCdm\_platform_specific\win_x64\
WidevineCdm\_platform_specific\win_x64\widevinecdm.dll.sig: %(VersionDir)s\WidevineCdm\_platform_specific\win_x64\
WidevineCdm\_platform_specific\win_x64\widevinecdmadapter.dll: %(VersionDir)s\WidevineCdm\_platform_specific\win_x64\

#
# MEI Preload sub dir
Expand Down
4 changes: 2 additions & 2 deletions chrome/test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1966,7 +1966,7 @@ test("browser_tests") {
# Runtime dependencies.
data_deps += [
"//media/cdm/library_cdm/clear_key_cdm",
"//third_party/widevine/cdm:widevinecdmadapter",
"//third_party/widevine/cdm",
]
}
if (enable_print_preview) {
Expand Down Expand Up @@ -5440,7 +5440,7 @@ if (!is_android && !is_fuchsia) {
deps += [ "//media/cdm:cdm_paths" ]
data_deps = [
"//media/cdm/library_cdm/clear_key_cdm",
"//third_party/widevine/cdm:widevinecdmadapter",
"//third_party/widevine/cdm",
]
}

Expand Down
7 changes: 1 addition & 6 deletions chrome/tools/build/chromeos/FILES.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,11 @@ FILES = [
'filename': 'xdg-settings',
'buildtype': ['dev', 'official'],
},
# CDM files (each has an adapter and the actual CDM):
# CDM files
{
'filename': 'libclearkeycdm.so',
'buildtype': ['dev', 'official'],
},
{
'filename': 'libwidevinecdmadapter.so',
'arch': ['32bit', '64bit', 'arm'],
'buildtype': ['official'],
},
{
'filename': 'libwidevinecdm.so',
'arch': ['32bit', '64bit', 'arm'],
Expand Down
5 changes: 0 additions & 5 deletions chrome/tools/build/linux/FILES.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,6 @@ FILES = [
'filename': 'libclearkeycdm.so',
'buildtype': ['dev', 'official'],
},
{
'filename': 'libwidevinecdmadapter.so',
'arch': ['32bit', '64bit'],
'buildtype': ['official'],
},
{
'filename': 'libwidevinecdm.so',
'arch': ['32bit', '64bit'],
Expand Down
10 changes: 0 additions & 10 deletions chrome/tools/build/win/FILES.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,6 @@ FILES = [
'arch': ['32bit'],
'buildtype': ['official'],
},
{
'filename': 'WidevineCdm/_platform_specific/win_x86/widevinecdmadapter.dll',
'arch': ['32bit'],
'buildtype': ['official'],
},
{
'filename': 'WidevineCdm/_platform_specific/win_x64/widevinecdm.dll',
'arch': ['64bit'],
Expand All @@ -362,11 +357,6 @@ FILES = [
'arch': ['64bit'],
'buildtype': ['official'],
},
{
'filename': 'WidevineCdm/_platform_specific/win_x64/widevinecdmadapter.dll',
'arch': ['64bit'],
'buildtype': ['official'],
},
# ANGLE files:
{
'filename': 'D3DCompiler_47.dll',
Expand Down
Loading

0 comments on commit d5b69c8

Please sign in to comment.