Skip to content

chromium 119 update

Some notes about this:

I plan (currently) to try and keep up with at minimum major releases of chromium (so whole version number releases that occur on a 4 week cycle) from hence forward (maybe minor releases if I have time and can more fully automate it).

I am trying to keep the patch to actual chromium minimal to lighten the maintenance burden. That is why the number of chromium assets here has grown considerably. Since we are now using upstream chromium with their buildscripts directly, we lose out on all the "proper" packaging that Ubuntu did for chromium. There are things that building a chromium deb using the upstream scripts does that are not ideal, such as adding the chrome debian repo, adding a cron job that runs daily, etc. Upstream chromium debian packaging script also has no concept of the "customization" folder and "default" flags file that we previously used to ship api keys (now embedded in the binary) and chromium runtime flags (--no-sandbox still needed for now for ffmpeg). These features have been added back by including a customized chromium wrapper script (replacing the minimal upstream one).

For the sake of being open, the current patch used to produce the debs is:

( note: the rpath skip check hack/patch is due to ffmpeg being shipped as a library, I reported it to chromium and we will see if they decide that the scripts will stay as they are or change them to account for ffmpeg library support https://bugs.chromium.org/p/chromium/issues/detail?id=1499629 . Yes the current patch/hack for that is lazy but I did not want to waste time implementing a better system since chromium will likely do something about it themselves. )

Subject: [PATCH] multi-patch

---
 chrome/common/media/cdm_registration.cc       |  6 +++---
 chrome/installer/linux/BUILD.gn               |  9 +++++++-
 .../installer/linux/common/installer.include  | 10 ++++++++-
 media/base/supported_types.cc                 | 21 ++++---------------
 third_party/widevine/cdm/widevine.gni         |  2 +-
 .../widevine/cdm/widevine_cdm_version.h       |  1 +
 6 files changed, 26 insertions(+), 23 deletions(-)

diff --git a/chrome/common/media/cdm_registration.cc b/chrome/common/media/cdm_registration.cc
index a4526a9d24d10..8912fd455616e 100644
--- a/chrome/common/media/cdm_registration.cc
+++ b/chrome/common/media/cdm_registration.cc
@@ -100,7 +100,7 @@ std::unique_ptr<content::CdmInfo> CreateCdmInfoFromWidevineDirectory(
         // BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT)) && (BUILDFLAG(IS_LINUX) ||
         // BUILDFLAG(IS_CHROMEOS))
 
-#if BUILDFLAG(BUNDLE_WIDEVINE_CDM) && \
+#if BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT) && \
     (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
 // On Linux/ChromeOS we have to preload the CDM since it uses the zygote
 // sandbox. On Windows and Mac, the bundled CDM is handled by the component
@@ -121,7 +121,7 @@ content::CdmInfo* GetBundledWidevine() {
       }());
   return s_cdm_info->get();
 }
-#endif  // BUILDFLAG(BUNDLE_WIDEVINE_CDM) &&
+#endif  // BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT) &&
         // (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
 
 #if BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT) && \
@@ -181,7 +181,7 @@ void AddSoftwareSecureWidevine(std::vector<content::CdmInfo>* cdms) {
   // case both versions will be the same and point to the same directory, so
   // it doesn't matter which one is loaded.
   content::CdmInfo* bundled_widevine = nullptr;
-#if BUILDFLAG(BUNDLE_WIDEVINE_CDM)
+#if BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT)
   bundled_widevine = GetBundledWidevine();
 #endif
 
diff --git a/chrome/installer/linux/BUILD.gn b/chrome/installer/linux/BUILD.gn
index 3bacd3398d4a2..1dd3a5ba2a791 100644
--- a/chrome/installer/linux/BUILD.gn
+++ b/chrome/installer/linux/BUILD.gn
@@ -40,7 +40,7 @@ packaging_files_executables = [
   "$root_out_dir/chrome_management_service",
   "$root_out_dir/chrome_sandbox",
 ]
-packaging_files_shlibs = []
+packaging_files_shlibs = [ "$root_out_dir/libffmpeg.so" ]
 
 # Don't attempt to package NaCl when building the ARM32-NaCl-on-ARM64
 # configuration.  That could be made to work, but it would be somewhat
@@ -205,6 +205,11 @@ strip_binary("strip_chrome_sandbox") {
   deps = [ "//sandbox/linux:chrome_sandbox" ]
 }
 
+strip_binary("strip_libffmpeg_shlib") {
+  binary_input = "$root_out_dir/libffmpeg.so"
+  deps = [ "//third_party/ffmpeg:ffmpeg" ]
+}
+
 strip_binary("strip_libEGL_shlib") {
   binary_input = "$root_out_dir/libEGL.so"
   deps = [ "//third_party/angle:libEGL" ]
@@ -422,6 +427,8 @@ group("installer_deps") {
   }
   if (use_egl) {
     public_deps += [
+      ":strip_libffmpeg_shlib",
+      "//third_party/ffmpeg:ffmpeg",
       ":strip_libEGL_shlib",
       ":strip_libGLESv2_shlib",
       "//third_party/angle:libEGL",
diff --git a/chrome/installer/linux/common/installer.include b/chrome/installer/linux/common/installer.include
index 439ef5ccb0f52..619567078fd7d 100644
--- a/chrome/installer/linux/common/installer.include
+++ b/chrome/installer/linux/common/installer.include
@@ -248,6 +248,13 @@ stage_install_common() {
     install -m ${SHLIB_PERMS} "${strippedfile}" "${STAGEDIR}/${INSTALLDIR}/${file}"
   fi
 
+  # ffmpeg
+  if [ -f "${OUTPUTDIR}/libffmpeg.so" ]; then
+    file="libffmpeg.so"
+    strippedfile="${OUTPUTDIR}/${file}.stripped"
+    install -m ${SHLIB_PERMS} "${strippedfile}" "${STAGEDIR}/${INSTALLDIR}/${file}"
+  fi
+
   # QT shim
   if [ -f "${OUTPUTDIR}/libqt5_shim.so" ]; then
     file="libqt5_shim.so"
@@ -375,7 +382,8 @@ stage_install_common() {
   fi
 
   # Check to make sure no ELF binaries set RPATH.
-  if [ "${TARGET_OS}" != "chromeos" ]; then
+  # changed to linux from chromeos to skip checking
+  if [ "${TARGET_OS}" != "linux" ]; then
     RPATH_BINS=
     for elf in $(find "${STAGEDIR}/${INSTALLDIR}/" -type f | xargs file |
                    grep ELF | awk '{print $1;}' | sed 's/:$//'); do
diff --git a/media/base/supported_types.cc b/media/base/supported_types.cc
index ec5e5df9760ad..3902357234d4c 100644
--- a/media/base/supported_types.cc
+++ b/media/base/supported_types.cc
@@ -245,36 +245,21 @@ bool IsHevcProfileSupported(const VideoType& type) {
 }
 
 bool IsVp9ProfileSupported(const VideoType& type) {
-#if BUILDFLAG(ENABLE_LIBVPX)
-  // High bit depth capabilities may be toggled via LibVPX config flags.
-  static const bool vpx_supports_hbd = (vpx_codec_get_caps(vpx_codec_vp9_dx()) &
-                                        VPX_CODEC_CAP_HIGHBITDEPTH) != 0;
-
+  // hacks for libffmpeg based Vp9 decoding
   // Color management required for HDR to not look terrible.
   if (!IsColorSpaceSupported(type.color_space))
     return false;
 
   switch (type.profile) {
-    // LibVPX always supports Profiles 0 and 1.
     case VP9PROFILE_PROFILE0:
     case VP9PROFILE_PROFILE1:
       return true;
-#if BUILDFLAG(IS_ANDROID)
     case VP9PROFILE_PROFILE2:
-      return vpx_supports_hbd ||
-             MediaCodecUtil::IsVp9Profile2DecoderAvailable();
     case VP9PROFILE_PROFILE3:
-      return vpx_supports_hbd ||
-             MediaCodecUtil::IsVp9Profile3DecoderAvailable();
-#else
-    case VP9PROFILE_PROFILE2:
-    case VP9PROFILE_PROFILE3:
-      return vpx_supports_hbd;
-#endif  // BUILDFLAG(IS_ANDROID)
+      return false;
     default:
       NOTREACHED();
   }
-#endif  // BUILDFLAG(ENABLE_LIBVPX)
   return false;
 }
 
@@ -424,6 +409,8 @@ bool IsBuiltInVideoCodec(VideoCodec codec) {
     return true;
   if (codec == VideoCodec::kVP8)
     return true;
+  if (codec == VideoCodec::kVP9)
+    return true;
 #if BUILDFLAG(USE_PROPRIETARY_CODECS)
   if (codec == VideoCodec::kH264)
     return true;
diff --git a/third_party/widevine/cdm/widevine.gni b/third_party/widevine/cdm/widevine.gni
index 28baebbacfd4e..4f81f0e719c42 100644
--- a/third_party/widevine/cdm/widevine.gni
+++ b/third_party/widevine/cdm/widevine.gni
@@ -26,7 +26,7 @@ if (is_chromeos && !is_chromeos_device) {
 library_widevine_cdm_available =
     (is_chromeos &&
      (target_cpu == "x64" || target_cpu == "arm" || target_cpu == "arm64")) ||
-    (target_os == "linux" && target_cpu == "x64") ||
+    (target_os == "linux") ||
     (target_os == "mac" && (target_cpu == "x64" || target_cpu == "arm64")) ||
     (target_os == "win" &&
      (target_cpu == "x86" || target_cpu == "x64" || target_cpu == "arm64"))
diff --git a/third_party/widevine/cdm/widevine_cdm_version.h b/third_party/widevine/cdm/widevine_cdm_version.h
index db80700b6c1b2..ce495d308b6a6 100644
--- a/third_party/widevine/cdm/widevine_cdm_version.h
+++ b/third_party/widevine/cdm/widevine_cdm_version.h
@@ -11,5 +11,6 @@
 // If the Widevine CDM is available define the following:
 //  - WIDEVINE_CDM_VERSION_STRING (with the version of the CDM that's available
 //    as a string, e.g., "1.0.123.456").
+#define WIDEVINE_CDM_VERSION_STRING "undefined"
 
 #endif  // WIDEVINE_CDM_VERSION_H_
-- 
2.40.1

using the following args:

# chromium ubuntu default flags
enable_nacl = false
is_component_build = false 
is_component_ffmpeg = true
is_debug = false
is_official_build = true
blink_symbol_level = 0
symbol_level = 0
chrome_pgo_phase = 0
rtc_enable_protobuf = false
rtc_use_h264 = true
enable_widevine = true
# ffmpeg flags
proprietary_codecs = true
ffmpeg_branding = "Chrome"
# optimization flags
use_thin_lto = true
thin_lto_enable_optimizations = true
# target flags
target_cpu = "arm64"
arm_control_flow_integrity = "none"
enable_linux_installer = true
# ccache
cc_wrapper = "ccache"
# api keys
google_api_key = "AIzaSyCkfPOPZXDKNn8hhgu3JrA62wIgC93d44k"
google_default_client_id = "77185425430.apps.googleusercontent.com"
google_default_client_secret = "OTJgUOQcT7lO7GsGZq2G4IlT"
# disable vpx
media_use_libvpx = false

Merge request reports