diff --git a/Cr122-ffmpeg-new-channel-layout.patch b/Cr122-ffmpeg-new-channel-layout.patch new file mode 100644 index 0000000000000000000000000000000000000000..3658264e71d742ddeae84cfd8003ed49115e0a21 --- /dev/null +++ b/Cr122-ffmpeg-new-channel-layout.patch @@ -0,0 +1,350 @@ +From 84d1d7adcd1697348e3f821811179c525d3b5717 Mon Sep 17 00:00:00 2001 +From: Dale Curtis +Date: Tue, 28 Nov 2023 00:41:42 +0000 +Subject: [PATCH] Roll src/third_party/ffmpeg/ c1d0dc413..866768f35 (492 + commits) + +https://chromium.googlesource.com/chromium/third_party/ffmpeg.git/+log/c1d0dc4135ec..866768f35c22 + +$ git log c1d0dc413..866768f35 --date=short --no-merges --format='%ad %ae %s' +2023-11-22 dalecurtis README.chromium file +2023-11-22 dalecurtis Chromium patches file +2023-11-22 dalecurtis GN Configuration +2023-11-21 dalecurtis Switch to remoteexec for robosushi +2023-11-12 mypopydev vulkan_decode: fix the print format of VkDeviceSize +2023-08-28 mypopydev avdevice/decklink_dec: add explicit specifier +2023-11-20 jamrial avcodec: bump version after EVC additions +2023-09-19 d.kozinski avcodec/evc_decoder: Provided support for EVC decoder +2023-09-19 d.kozinski avcodec/evc_encoder: Provided support for EVC encoder +2023-10-17 michael avcodec/h264dec: Support skipping frames that used gray gap frames +2023-10-17 michael avcodec/h264: Avoid using gray gap frames as references +2023-10-17 michael avcodec/h264: keep track of which frames used gray references +2023-10-02 michael avcodec/h264dec: More elaborate documentation for frame_recovered +2023-10-02 michael avcodec/h264: Use FRAME_RECOVERED_HEURISTIC instead of IDR/SEI +2023-10-02 michael avcodec/h264: Seperate SEI and IDR recovery handling +2023-11-19 onemda avfilter/af_afir: remove flag that is not needed +2023-11-19 onemda avfilter/af_afir: no need to dynamically add outpad +2023-11-19 onemda avfilter/af_afir: refactor crossfade code +2023-11-19 onemda avfilter/af_afir: add timeline support +2023-11-16 remi riscv: set fast half-precision conversion +2023-11-19 onemda avfilter/af_afir: remove IR response video rendering support +2023-11-19 onemda doc/filters: add one more example for afir filter usage +2023-11-14 anton tools/general_assembly: update to conform to new rules +2023-11-14 anton tools/general_assembly: make the script executable +2023-11-18 onemda avfilter/avf_showvolume: improve step for vertical orientation +2023-11-18 onemda avfilter/avf_showvolume: draw channel names directly into output frame +2023-11-15 remi lavc/llviddsp: R-V V add_bytes +2023-11-15 remi lavc/flacdsp: R-V V LPC16 function +2023-11-15 remi lavc/flacdsp: R-V V LPC32 +2023-11-15 remi checkasm/flacdsp: add LPC test +2023-11-15 remi riscv: fix builds without Zbb support +2023-11-18 mypopydev lavfi/Makefile: fix vf_cropdetect missed edge_common +2023-11-10 ffmpeg-devel apply spelling fixes +2023-11-18 onemda avfilter/af_afir: add irnorm and irlink options +2023-11-14 remi lavc/flacdsp: R-V V decorrelate_indep 16-bit packed +2023-11-14 remi lavc/flacdsp: R-V V decorrelate_indep 32-bit packed +2023-11-13 remi lavc/flacdsp: R-V V decorrelate_ms packed +2023-08-16 remi lavc/flacdsp: R-V V packed decorrelate_{l,r}s +2023-11-13 remi checkasm/flacdsp: fix ls/rs/ms tests +2023-11-08 onemda avfilter/af_adynamicequalizer: add adaptive detection mode +2023-11-06 onemda avfilter/af_adynamicequalizer: do gain calculations in log domain +2023-11-03 sunyuechi af_afir: RISC-V V fcmul_add +2023-11-12 remi lavc/llauddsp: R-V V scalarproduct_and_madd_int32 +2023-11-12 remi lavc/llauddsp: R-V V scalarproduct_and_madd_int16 +2023-11-12 remi checkasm: add lossless audio DSP +2023-11-15 jamrial x86/flacds: clear the high bits from pred_order in lpc_32 functions +2023-11-13 jianhui.j.dai-at-intel.com avcodec/cbs_vp8: Add support for VP8 codec bitstream +2023-11-13 jianhui.j.dai-at-intel.com avcodec/vp8: Export `vp8_token_update_probs` variable +2023-11-12 remi lavc/huffyuvdsp: basic R-V V add_hfyu_left_pred_bgr32 +2023-11-12 remi checkasm/huffyuvdsp: test for add_hfyu_left_pred_bgr32 +(...) +2022-08-04 andreas.rheinhardt avcodec/cbs: Use RefStruct-API for unit content +2022-08-04 andreas.rheinhardt avcodec/refstruct: Allow checking for exclusive ownership +2022-08-04 andreas.rheinhardt avcodec/dovi_rpu: Use RefStruct API for Vdr data +2022-08-04 andreas.rheinhardt avcodec/wavpack: Use RefStruct API for DSD context +2023-07-17 andreas.rheinhardt avcodec/vp8: Use RefStruct API for seg_map +2022-08-04 andreas.rheinhardt avcodec/hevc_ps: Use RefStruct API for parameter sets +2022-08-04 andreas.rheinhardt avcodec/h264_ps: Use RefStruct API for SPS/PPS +2022-08-04 andreas.rheinhardt avcodec/get_buffer: Use RefStruct API for FramePool +2022-08-04 andreas.rheinhardt avcodec/refstruct: Add simple API for refcounted objects +2023-10-03 remi lavu/fixed_dsp: R-V V scalarproduct +2023-10-07 onemda avformat/wavdec: w64: do not error out for broken files if data start is found +2023-10-06 onemda avcodec/mlpenc: rename some variables related to thd +2023-10-03 andreas.rheinhardt avcodec/mpegvideo: Move allocating new_picture to the encoder +2023-07-17 jamrial fftools/ffplay: stop injecting stream side data in packets +2023-07-17 jamrial fftools/ffmpeg: stop injecting stream side data in packets +2023-07-17 jamrial avcodec/decode: propagate global side data to frames +2023-07-17 jamrial avcodec/hevcdec: check for DOVI configuration record in AVCodecContext side data +2023-07-16 jamrial fftools/ffprobe: stop using AVStream.side_data +2023-07-16 jamrial fftools/ffplay: stop using AVStream.side_data +2023-07-16 jamrial fftools/ffmpeg: stop using AVStream.side_data +2023-09-26 jamrial avcodec/packet: add some documentation for AVPacketSideData +2023-07-16 jamrial avformat/avformat: use the side data from AVStream.codecpar +2023-07-16 jamrial avcodec/codec_par: add side data to AVCodecParameters +2023-07-16 jamrial avcodec/packet: add generic side data helpers +2023-10-06 andreas.rheinhardt avfilter/vulkan_filter: Remove unused label +2023-10-06 onemda avcodec/mlpdec: set extended_substream_info from header +2023-08-26 stefasab doc/encoders/libopus: clarify lowdelay and cutoff options +2023-08-26 stefasab doc/encoders/libxvid: fix references for me_quality option +2023-08-26 stefasab doc/encoders/libx264: clarify meaning of level option +2023-08-26 stefasab lavc: clarify meaning of avctx.level option +2023-10-03 leo.izen avcodec/jpegxl_parser: fix various memory issues +2023-10-03 leo.izen avcodec/jpegxl_parser: add some icc profile checks +2023-09-01 stefasab ffprobe: introduce section type, use for the compact output +2023-09-01 stefasab ffprobe: correct section name for side data piece +2023-08-31 stefasab ffprobe: factorize side data printing to dedicated function +2023-10-03 onemda avcodec/mlpenc: restructure code and resolve several bugs +2023-10-05 dev hwcontext_vulkan: properly support STORAGE usage for mutliplane images +2023-09-30 ben vulkan_hevc: handle non-contiguous SPS/PPS/VPS ids +2023-10-03 ffmpeg-devel avcodec/svt-av1: Set force_key_frames only when gop_size == 1 +2023-10-03 andreas.rheinhardt avcodec/h261dec, mpeg12dec, vc1dec: Remove setting write-only flags +2023-10-03 andreas.rheinhardt avcodec/rv10: Replace switch by LUT +2023-10-03 andreas.rheinhardt avcodec/rv10: Remove dead code +2023-10-02 andreas.rheinhardt avcodec/h263dec, mpeg4videodec: Parse extradata during init +2023-10-01 andreas.rheinhardt avcodec/mpegvideo_dec: Always initialize IDCTDSPContext during init +2023-10-01 andreas.rheinhardt avcodec/mpegvideo_dec: Don't zero context on init failure +2023-10-01 andreas.rheinhardt avcodec/mpeg12dec: Don't initialize IDCT more than once +2023-10-02 remi lavc/ac3: add R-V Zbb extract_exponents +2023-10-04 jamrial avcodec/hcadec: add a flush callback +2023-10-01 remi swscale/rgb2rgb: R-V V deinterleaveBytes +2023-10-01 remi swscale/rgb2rgb: fix extra iteration in R-V V interleave + +Created with: + roll-dep src/third_party/ffmpeg + +R=jrummell + +Bug: 1504603 +Change-Id: Ia40313bc2abcb0594543019bc8d1c22fbf7bde82 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5055586 +Reviewed-by: John Rummell +Auto-Submit: Dale Curtis +Commit-Queue: Dale Curtis +Cr-Commit-Position: refs/heads/main@{#1229653} +--- + DEPS | 2 +- + media/ffmpeg/ffmpeg_common.cc | 169 +++++++++--------- + .../filters/audio_video_metadata_extractor.cc | 17 +- + media/filters/ffmpeg_demuxer_unittest.cc | 4 +- + third_party/ffmpeg | 2 +- + 5 files changed, 97 insertions(+), 97 deletions(-) + +diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc +index 3c97e4a6cf4c7..a55e4ab51d5b3 100644 +--- a/media/ffmpeg/ffmpeg_common.cc ++++ b/media/ffmpeg/ffmpeg_common.cc +@@ -653,15 +653,6 @@ bool AVStreamToVideoDecoderConfig(const AVStream* stream, + profile = ProfileIDToVideoCodecProfile(codec_context->profile); + } + +- void* display_matrix = +- av_stream_get_side_data(stream, AV_PKT_DATA_DISPLAYMATRIX, nullptr); +- +- VideoTransformation video_transformation = VideoTransformation(); +- if (display_matrix) { +- video_transformation = VideoTransformation::FromFFmpegDisplayMatrix( +- static_cast(display_matrix)); +- } +- + if (!color_space.IsSpecified()) { + // VP9 frames may have color information, but that information cannot + // express new color spaces, like HDR. For that reason, color space +@@ -718,91 +709,92 @@ + codec_context->extradata + codec_context->extradata_size); + } + +- if (stream->nb_side_data) { +- for (int i = 0; i < stream->nb_side_data; ++i) { +- AVPacketSideData side_data = stream->side_data[i]; +- switch (side_data.type) { +- case AV_PKT_DATA_MASTERING_DISPLAY_METADATA: { +- AVMasteringDisplayMetadata* mdcv = +- reinterpret_cast(side_data.data); +- gfx::HdrMetadataSmpteSt2086 smpte_st_2086; +- if (mdcv->has_primaries) { +- smpte_st_2086.primaries = { +- static_cast(av_q2d(mdcv->display_primaries[0][0])), +- static_cast(av_q2d(mdcv->display_primaries[0][1])), +- static_cast(av_q2d(mdcv->display_primaries[1][0])), +- static_cast(av_q2d(mdcv->display_primaries[1][1])), +- static_cast(av_q2d(mdcv->display_primaries[2][0])), +- static_cast(av_q2d(mdcv->display_primaries[2][1])), +- static_cast(av_q2d(mdcv->white_point[0])), +- static_cast(av_q2d(mdcv->white_point[1])), +- }; +- } +- if (mdcv->has_luminance) { +- smpte_st_2086.luminance_max = av_q2d(mdcv->max_luminance); +- smpte_st_2086.luminance_min = av_q2d(mdcv->min_luminance); +- } +- +- // TODO(https://crbug.com/1446302): Consider rejecting metadata that +- // does not specify all values. +- if (mdcv->has_primaries || mdcv->has_luminance) { +- hdr_metadata.smpte_st_2086 = smpte_st_2086; +- } +- break; ++ VideoTransformation video_transformation = VideoTransformation(); ++ for (int i = 0; i < stream->codecpar->nb_coded_side_data; ++i) { ++ const auto& side_data = stream->codecpar->coded_side_data[i]; ++ switch (side_data.type) { ++ case AV_PKT_DATA_DISPLAYMATRIX: { ++ CHECK_EQ(side_data.size, sizeof(int32_t) * 3 * 3); ++ video_transformation = VideoTransformation::FromFFmpegDisplayMatrix( ++ reinterpret_cast(side_data.data)); ++ break; ++ } ++ case AV_PKT_DATA_MASTERING_DISPLAY_METADATA: { ++ AVMasteringDisplayMetadata* mdcv = ++ reinterpret_cast(side_data.data); ++ gfx::HdrMetadataSmpteSt2086 smpte_st_2086; ++ if (mdcv->has_primaries) { ++ smpte_st_2086.primaries = { ++ static_cast(av_q2d(mdcv->display_primaries[0][0])), ++ static_cast(av_q2d(mdcv->display_primaries[0][1])), ++ static_cast(av_q2d(mdcv->display_primaries[1][0])), ++ static_cast(av_q2d(mdcv->display_primaries[1][1])), ++ static_cast(av_q2d(mdcv->display_primaries[2][0])), ++ static_cast(av_q2d(mdcv->display_primaries[2][1])), ++ static_cast(av_q2d(mdcv->white_point[0])), ++ static_cast(av_q2d(mdcv->white_point[1])), ++ }; + } +- case AV_PKT_DATA_CONTENT_LIGHT_LEVEL: { +- AVContentLightMetadata* clli = +- reinterpret_cast(side_data.data); +- hdr_metadata.cta_861_3 = +- gfx::HdrMetadataCta861_3(clli->MaxCLL, clli->MaxFALL); +- break; ++ if (mdcv->has_luminance) { ++ smpte_st_2086.luminance_max = av_q2d(mdcv->max_luminance); ++ smpte_st_2086.luminance_min = av_q2d(mdcv->min_luminance); ++ } ++ ++ // TODO(https://crbug.com/1446302): Consider rejecting metadata that ++ // does not specify all values. ++ if (mdcv->has_primaries || mdcv->has_luminance) { ++ hdr_metadata.smpte_st_2086 = smpte_st_2086; + } ++ break; ++ } ++ case AV_PKT_DATA_CONTENT_LIGHT_LEVEL: { ++ AVContentLightMetadata* clli = ++ reinterpret_cast(side_data.data); ++ hdr_metadata.cta_861_3 = ++ gfx::HdrMetadataCta861_3(clli->MaxCLL, clli->MaxFALL); ++ break; ++ } + #if BUILDFLAG(ENABLE_PLATFORM_DOLBY_VISION) +- case AV_PKT_DATA_DOVI_CONF: { +- AVDOVIDecoderConfigurationRecord* dovi = +- reinterpret_cast( +- side_data.data); +- VideoType type; +- type.codec = VideoCodec::kDolbyVision; +- type.level = dovi->dv_level; +- type.color_space = color_space; +- type.hdr_metadata_type = gfx::HdrMetadataType::kNone; +- switch (dovi->dv_profile) { +- case 0: +- type.profile = VideoCodecProfile::DOLBYVISION_PROFILE0; +- break; +- case 4: +- type.profile = VideoCodecProfile::DOLBYVISION_PROFILE4; +- break; +- case 5: +- type.profile = VideoCodecProfile::DOLBYVISION_PROFILE5; +- break; +- case 7: +- type.profile = VideoCodecProfile::DOLBYVISION_PROFILE7; +- break; +- case 8: +- type.profile = VideoCodecProfile::DOLBYVISION_PROFILE8; +- break; +- case 9: +- type.profile = VideoCodecProfile::DOLBYVISION_PROFILE9; +- break; +- default: +- type.profile = VideoCodecProfile::VIDEO_CODEC_PROFILE_UNKNOWN; +- break; +- } +- // Treat dolby vision contents as dolby vision codec only if the +- // device support clear DV decoding, otherwise use the original +- // HEVC or AVC codec and profile. +- if (media::IsSupportedVideoType(type)) { +- codec = type.codec; +- profile = type.profile; +- } +- break; ++ case AV_PKT_DATA_DOVI_CONF: { ++ AVDOVIDecoderConfigurationRecord* dovi = ++ reinterpret_cast(side_data.data); ++ VideoType type; ++ type.codec = VideoCodec::kDolbyVision; ++ type.level = dovi->dv_level; ++ type.color_space = color_space; ++ type.hdr_metadata_type = gfx::HdrMetadataType::kNone; ++ switch (dovi->dv_profile) { ++ case 0: ++ type.profile = VideoCodecProfile::DOLBYVISION_PROFILE0; ++ break; ++ case 5: ++ type.profile = VideoCodecProfile::DOLBYVISION_PROFILE5; ++ break; ++ case 7: ++ type.profile = VideoCodecProfile::DOLBYVISION_PROFILE7; ++ break; ++ case 8: ++ type.profile = VideoCodecProfile::DOLBYVISION_PROFILE8; ++ break; ++ case 9: ++ type.profile = VideoCodecProfile::DOLBYVISION_PROFILE9; ++ break; ++ default: ++ type.profile = VideoCodecProfile::VIDEO_CODEC_PROFILE_UNKNOWN; ++ break; + } ++ // Treat dolby vision contents as dolby vision codec only if the ++ // device support clear DV decoding, otherwise use the original ++ // HEVC or AVC codec and profile. ++ if (media::IsSupportedVideoType(type)) { ++ codec = type.codec; ++ profile = type.profile; ++ } ++ break; ++ } + #endif // BUILDFLAG(ENABLE_PLATFORM_DOLBY_VISION) + default: + break; +- } + } + } + +diff --git a/media/filters/audio_video_metadata_extractor.cc b/media/filters/audio_video_metadata_extractor.cc +index cb002490a6322..e841b4ad13383 100644 +--- a/media/filters/audio_video_metadata_extractor.cc ++++ b/media/filters/audio_video_metadata_extractor.cc +@@ -113,13 +113,16 @@ bool AudioVideoMetadataExtractor::Extract(DataSource* source, + if (!stream) + continue; + +- void* display_matrix = +- av_stream_get_side_data(stream, AV_PKT_DATA_DISPLAYMATRIX, nullptr); +- if (display_matrix) { +- rotation_ = VideoTransformation::FromFFmpegDisplayMatrix( +- static_cast(display_matrix)) +- .rotation; +- info.tags["rotate"] = base::NumberToString(rotation_); ++ for (int j = 0; j < stream->codecpar->nb_coded_side_data; j++) { ++ const AVPacketSideData& sd = stream->codecpar->coded_side_data[j]; ++ if (sd.type == AV_PKT_DATA_DISPLAYMATRIX) { ++ CHECK_EQ(sd.size, sizeof(int32_t) * 3 * 3); ++ rotation_ = VideoTransformation::FromFFmpegDisplayMatrix( ++ reinterpret_cast(sd.data)) ++ .rotation; ++ info.tags["rotate"] = base::NumberToString(rotation_); ++ break; ++ } + } + + // Extract dictionary from streams also. Needed for containers that attach diff --git a/INSTALL.sh b/INSTALL.sh new file mode 100644 index 0000000000000000000000000000000000000000..849175325b27b332d6c5fb698782a4cba38801b1 --- /dev/null +++ b/INSTALL.sh @@ -0,0 +1,148 @@ +#!/bin/bash +set -x +while getopts s:o:l:i: option +do +case "${option}" in +s) STAGEDIR=${OPTARG};; +o) OUTPUTDIR=${OPTARG};; +l) LIBDIR=${OPTARG};; +i) ICUDATAFILE=${OPTARG};; +esac +done +SHLIB_PERMS="755" +PROGNAME="chrome" +PACKAGE="chromium-browser" +MENUNAME="Chromium Web Browser" +CHANNEL="stable" +INSTALLDIR="${LIBDIR}/chromium" + +install -m 755 -d \ + "${STAGEDIR}/${INSTALLDIR}" \ + "${STAGEDIR}/usr/bin" \ + "${STAGEDIR}/usr/share/applications" \ + "${STAGEDIR}/usr/share/metainfo" \ + "${STAGEDIR}/usr/share/man/man1" + +# app +buildfile="${OUTPUTDIR}/${PROGNAME}" +install -m 755 "${buildfile}" "${STAGEDIR}/${INSTALLDIR}/${PROGNAME}" + +# crashpad +buildfile="${OUTPUTDIR}/chrome_crashpad_handler" +install -m 755 "${buildfile}" "${STAGEDIR}/${INSTALLDIR}/chrome_crashpad_handler" + +# resources +install -m 644 "${OUTPUTDIR}/resources.pak" "${STAGEDIR}/${INSTALLDIR}/" +install -m 644 "${OUTPUTDIR}/chrome_100_percent.pak" "${STAGEDIR}/${INSTALLDIR}/" +install -m 644 "${OUTPUTDIR}/chrome_200_percent.pak" "${STAGEDIR}/${INSTALLDIR}/" + +# ICU data file; Necessary when the GN icu_use_data_file flag is true. +if [ "x$ICUDATAFILE" == "xtrue" ]; then + install -m 644 "${OUTPUTDIR}/icudtl.dat" "${STAGEDIR}/${INSTALLDIR}/" +fi + +# V8 snapshot files; Necessary when the GN v8_use_external_startup_data flag + # is true. + # Use v8_context_snapshot.bin instead of snapshot_blob.bin if it is available. + # TODO(crbug.com/764576): Unship snapshot_blob.bin on ChromeOS and drop this branch +install -m 644 "${OUTPUTDIR}/v8_context_snapshot.bin" "${STAGEDIR}/${INSTALLDIR}/" + +# l10n paks +install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/locales/" +find "${OUTPUTDIR}/locales" -type f -name '*.pak' -print -exec \ + cp -a {} "${STAGEDIR}/${INSTALLDIR}/locales/" \; +find "${STAGEDIR}/${INSTALLDIR}/locales" -type f -print -exec chmod 644 {} \; + +# ANGLE +if [ -f "${OUTPUTDIR}/libEGL.so" ]; then + for file in libEGL.so libGLESv2.so; + do + buildfile="${OUTPUTDIR}/${file}" + install -m ${SHLIB_PERMS} "${buildfile}" "${STAGEDIR}/${INSTALLDIR}/${file}" + done +fi + +# ANGLE's libvulkan library +if [ -f "${OUTPUTDIR}/libvulkan.so.1" ]; then + file="libvulkan.so.1" + buildfile="${OUTPUTDIR}/${file}" + install -m 755 "${buildfile}" "${STAGEDIR}/${INSTALLDIR}/${file}" +fi + +# SwiftShader ES +if [ -f "${OUTPUTDIR}/swiftshader/libEGL.so" ]; then + install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/swiftshader/" + for file in libEGL.so libGLESv2.so; + do + buildfile="${OUTPUTDIR}/swiftshader/${file}" + install -m ${SHLIB_PERMS} "${buildfile}" "${STAGEDIR}/${INSTALLDIR}/swiftshader/${file}" + done +fi + +# SwiftShader VK +if [ -f "${OUTPUTDIR}/libvk_swiftshader.so" ]; then + install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/" + file="libvk_swiftshader.so" + buildfile="${OUTPUTDIR}/${file}" + install -m ${SHLIB_PERMS} "${buildfile}" "${STAGEDIR}/${INSTALLDIR}/${file}" +fi +sed -e 's|${ICD_LIBRARY_PATH}|./libvk_swiftshader.so|g' third_party/swiftshader/src/Vulkan/vk_swiftshader_icd.json.tmpl > ${OUTPUTDIR}/vk_swiftshader_icd.json +# Install the ICD json file to point ANGLE to libvk_swiftshader.so +install -m 644 "${OUTPUTDIR}/vk_swiftshader_icd.json" "${STAGEDIR}/${INSTALLDIR}/" + +# QT shim +if [ -f "${OUTPUTDIR}/libqt5_shim.so" ]; then + file="libqt5_shim.so" + buildfile="${OUTPUTDIR}/${file}" + install -m ${SHLIB_PERMS} "${buildfile}" "${STAGEDIR}/${INSTALLDIR}/${file}" +fi + +# default apps +if [ -d "${OUTPUTDIR}/default_apps" ]; then + cp -a "${OUTPUTDIR}/default_apps" "${STAGEDIR}/${INSTALLDIR}/" + find "${STAGEDIR}/${INSTALLDIR}/default_apps" -type d -exec chmod 755 '{}' \; + find "${STAGEDIR}/${INSTALLDIR}/default_apps" -type f -exec chmod 644 '{}' \; +fi + +# launcher script and symlink +sed \ + -e "s#@@PROGNAME@@#${PROGNAME}#g" \ + -e "s#@@CHANNEL@@#${CHANNEL}#g" \ + "chrome/installer/linux/common/wrapper" > "${STAGEDIR}/${INSTALLDIR}/chrome-wrapper" +chmod 755 "${STAGEDIR}/${INSTALLDIR}/chrome-wrapper" +ln -s "${INSTALLDIR}/chrome-wrapper" "${STAGEDIR}/usr/bin/${PACKAGE}" + +# app icons +for size in 16 32; +do + icon="chrome/app/theme/default_100_percent/chromium/product_logo_${size}.png" + installpath="${STAGEDIR}/usr/share/icons/hicolor/${size}x${size}/apps/chromium-browser.png" + install -D -m 644 ${icon} ${installpath} +done +for size in 24 48 64 128 256; +do + icon="chrome/app/theme/chromium/product_logo_${size}.png" + installpath="${STAGEDIR}/usr/share/icons/hicolor/${size}x${size}/apps/chromium-browser.png" + install -D -m 644 ${icon} ${installpath} +done + +# desktop integration +## AppData +install -m 644 "chrome/installer/linux/common/chromium-browser/chromium-browser.appdata.xml" \ +"${STAGEDIR}/usr/share/metainfo/${PACKAGE}.appdata.xml" + +## Desktop file +sed \ + -e "s#@@MENUNAME@@#${MENUNAME}#g" \ + -e "s#@@USR_BIN_SYMLINK_NAME@@#${PACKAGE}#g" \ + -e "s#@@PACKAGE@@#${PACKAGE}#g" \ + "chrome/installer/linux/common/desktop.template" > "${STAGEDIR}/usr/share/applications/${PACKAGE}.desktop" +chmod 644 "${STAGEDIR}/usr/share/applications/${PACKAGE}.desktop" + +# documentation +sed \ + -e "s#@@MENUNAME@@#${MENUNAME}#g" \ + -e "s#@@PACKAGE@@#${PACKAGE}#g" \ + "chrome/app/resources/manpage.1.in" > "${STAGEDIR}/usr/share/man/man1/${PACKAGE}.1" +gzip -9n "${STAGEDIR}/usr/share/man/man1/${PACKAGE}.1" +chmod 644 "${STAGEDIR}/usr/share/man/man1/${PACKAGE}.1.gz" diff --git a/chrome-remote-desktop@.service b/chrome-remote-desktop@.service deleted file mode 100644 index 4b5b1fcbfd58d3d23350165ffefb4bff9f7f1918..0000000000000000000000000000000000000000 --- a/chrome-remote-desktop@.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description="Chrome Remote Desktop host daemon" - -[Service] -User=%i -Environment=HOME=%h -ExecStart=@@CRD_PATH@@/chrome-remote-desktop --start --foreground -ExecStop=@@CRD_PATH@@/chrome-remote-desktop --stop -ExecReload=@@CRD_PATH@@/chrome-remote-desktop --reload -Restart=always -TimeoutStopSec=10 - -[Install] -WantedBy=multi-user.target diff --git a/chrome-wrapper b/chrome-wrapper new file mode 100644 index 0000000000000000000000000000000000000000..10e983d760f10d5dd801ead5e6e05ee69501e51d --- /dev/null +++ b/chrome-wrapper @@ -0,0 +1,38 @@ +#!/bin/bash +# +# Copyright (c) 2011 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Let the wrapped binary know that it has been run through the wrapper. +export CHROME_WRAPPER="`readlink -f "$0"`" + +HERE="`dirname "$CHROME_WRAPPER"`" + +# Always use our versions of ffmpeg libs. +# This also makes RPMs find the compatibly-named library symlinks. +export LD_LIBRARY_PATH="$HERE${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" + +export CHROME_VERSION_EXTRA="stable" + +# We don't want bug-buddy intercepting our crashes. http://crbug.com/24120 +export GNOME_DISABLE_CRASH_DIALOG=SET_BY_GOOGLE_CHROME + +# Allow root usage +no_sandbox= +if [ "`id -u`" == "0" ]; then + no_sandbox=--no-sandbox +fi +# If uname is riscv64, then allow usage too +if [ "`uname -m`" == "riscv64" ]; then + no_sandbox=--no-sandbox +fi + +# Sanitize std{in,out,err} because they'll be shared with untrusted child +# processes (http://crbug.com/376567). +exec < /dev/null +exec > >(exec cat) +exec 2> >(exec cat >&2) + +# Note: exec -a below is a bashism. +exec -a "$0" "$HERE/chrome" $no_sandbox "$@" diff --git a/chromium-102-regex_pattern-array.patch b/chromium-102-regex_pattern-array.patch new file mode 100644 index 0000000000000000000000000000000000000000..293193751577f2e896c59c095958f8e587ad2383 --- /dev/null +++ b/chromium-102-regex_pattern-array.patch @@ -0,0 +1,16 @@ +Index: chromium-123.0.6312.46/components/autofill/core/browser/BUILD.gn +=================================================================== +--- chromium-123.0.6312.46.orig/components/autofill/core/browser/BUILD.gn ++++ chromium-123.0.6312.46/components/autofill/core/browser/BUILD.gn +@@ -58,6 +58,11 @@ action("regex_patterns_inl_h") { + } + + static_library("browser") { ++ if (is_clang) { ++ cflags = [ ++ "-fbracket-depth=1000", ++ ] ++ } + sources = [ + "address_data_cleaner.cc", + "address_data_cleaner.h", diff --git a/chromium-103.0.5060.53-update-rjsmin-to-1.2.0.patch b/chromium-103.0.5060.53-update-rjsmin-to-1.2.0.patch deleted file mode 100644 index 29a5d9cc0eb36dfb96182cf6965f8d756d665d0a..0000000000000000000000000000000000000000 --- a/chromium-103.0.5060.53-update-rjsmin-to-1.2.0.patch +++ /dev/null @@ -1,1700 +0,0 @@ -diff -up chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/rjsmin.c.12 chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/rjsmin.c ---- chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/rjsmin.c.12 2022-06-28 12:50:10.167324583 +0000 -+++ chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/rjsmin.c 2021-11-14 19:50:55.000000000 +0000 -@@ -1,5 +1,5 @@ - /* -- * Copyright 2011 - 2015 -+ * Copyright 2011 - 2021 - * Andr\xe9 Malo or his licensors, as applicable - * - * Licensed under the Apache License, Version 2.0 (the "License"); -@@ -18,21 +18,21 @@ - #include "cext.h" - EXT_INIT_FUNC; - --#define RJSMIN_DULL_BIT (1 << 0) --#define RJSMIN_PRE_REGEX_BIT (1 << 1) --#define RJSMIN_REGEX_DULL_BIT (1 << 2) --#define RJSMIN_REGEX_CC_DULL_BIT (1 << 3) --#define RJSMIN_ID_LIT_BIT (1 << 4) --#define RJSMIN_ID_LIT_O_BIT (1 << 5) --#define RJSMIN_ID_LIT_C_BIT (1 << 6) --#define RJSMIN_STRING_DULL_BIT (1 << 7) --#define RJSMIN_SPACE_BIT (1 << 8) --#define RJSMIN_POST_REGEX_OFF_BIT (1 << 9) -+#define RJSMIN_DULL_BIT (1 << 0) -+#define RJSMIN_PRE_REGEX_BIT (1 << 1) -+#define RJSMIN_REGEX_DULL_BIT (1 << 2) -+#define RJSMIN_REGEX_CC_DULL_BIT (1 << 3) -+#define RJSMIN_ID_LIT_BIT (1 << 4) -+#define RJSMIN_ID_LIT_O_BIT (1 << 5) -+#define RJSMIN_ID_LIT_C_BIT (1 << 6) -+#define RJSMIN_STRING_DULL_BIT (1 << 7) -+#define RJSMIN_SPACE_BIT (1 << 8) -+#define RJSMIN_POST_REGEX_OFF_BIT (1 << 9) -+#define RJSMIN_A_Z_BIT (1 << 10) - --#ifdef EXT3 --typedef Py_UNICODE rchar; --#else - typedef unsigned char rchar; -+#ifdef U -+#undef U - #endif - #define U(c) ((rchar)(c)) - -@@ -66,66 +66,120 @@ typedef unsigned char rchar; - #define RJSMIN_IS_PRE_REGEX_1(c) ((U(c) <= 127) && \ - (rjsmin_charmask[U(c) & 0x7F] & RJSMIN_PRE_REGEX_BIT)) - -+#define RJSMIN_IS_A_Z(c) ((U(c) <= 127) && \ -+ (rjsmin_charmask[U(c) & 0x7F] & RJSMIN_A_Z_BIT)) -+ - - static const unsigned short rjsmin_charmask[128] = { -- 396, 396, 396, 396, 396, 396, 396, 396, -- 396, 396, 2, 396, 396, 2, 396, 396, -- 396, 396, 396, 396, 396, 396, 396, 396, -- 396, 396, 396, 396, 396, 396, 396, 396, -- 396, 687, 588, 653, 765, 653, 143, 588, -- 687, 205, 653, 237, 143, 237, 141, 648, -- 765, 765, 765, 765, 765, 765, 765, 765, -- 765, 765, 143, 143, 653, 143, 653, 143, -- 653, 765, 765, 765, 765, 765, 765, 765, -- 765, 765, 765, 765, 765, 765, 765, 765, -- 765, 765, 765, 765, 765, 765, 765, 765, -- 765, 765, 765, 683, 513, 197, 653, 765, -- 653, 765, 765, 765, 765, 765, 765, 765, -- 765, 765, 765, 765, 765, 765, 765, 765, -- 765, 765, 765, 765, 765, 765, 765, 765, -- 765, 765, 765, 687, 143, 207, 653, 765 -+ 396, 396, 396, 396, 396, 396, 396, 396, -+ 396, 396, 2, 396, 396, 2, 396, 396, -+ 396, 396, 396, 396, 396, 396, 396, 396, -+ 396, 396, 396, 396, 396, 396, 396, 396, -+ 396, 687, 588, 653, 765, 653, 143, 588, -+ 687, 205, 655, 239, 143, 239, 141, 648, -+ 765, 765, 765, 765, 765, 765, 765, 765, -+ 765, 765, 143, 143, 653, 143, 653, 143, -+ 653, 765, 765, 765, 765, 765, 765, 765, -+ 765, 765, 765, 765, 765, 765, 765, 765, -+ 765, 765, 765, 765, 765, 765, 765, 765, -+ 765, 765, 765, 683, 513, 197, 653, 765, -+ 588, 1789, 1789, 1789, 1789, 1789, 1789, 1789, -+ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, -+ 1789, 1789, 1789, 1789, 1789, 1789, 1789, 1789, -+ 1789, 1789, 1789, 687, 143, 207, 653, 765 - }; - -+ - static Py_ssize_t - rjsmin(const rchar *source, rchar *target, Py_ssize_t length, - int keep_bang_comments) - { -- const rchar *reset, *pcreset = NULL, *pctoken = NULL, *xtarget, -- *sentinel = source + length; -- rchar *tstart = target; -- int post_regex = 0; -- rchar c, quote, spaced = U(' '); -+ const rchar -+ *sentinel = source + length, /* never hit this pointer (source buf) */ -+ *reset, /* reset pointer (source buf) */ -+ *pcreset = NULL, /* pre-comment reset pointer (source buf) */ -+ *pctoken = NULL, /* pre-comment token pointer (target buf) -+ * Pointing to before the last kept comment, if any */ -+ *rsreset = NULL, /* regex-with-method reset pointer (source buf) */ -+ *xtarget; /* pre-regex-2 target pointer */ -+ -+ rchar *tstart = target, /* Target start pointer for reference */ -+ *rtreset = NULL; /* regex-with-method reset pointer (target buf) */ -+ -+ int rsdot, /* seen dot after regex-with-method pattern? */ -+ post_regex = 0; -+ rchar c, quote, -+ spaced = U(' '); /* the last seen kind of space (nl taking prio), -+ * init with ' ' */ - -+ /* main loop */ - while (source < sentinel) { - c = *source++; -+ - if (RJSMIN_IS_DULL(c)) { - if (post_regex) post_regex = 0; - if (pctoken) pctoken = NULL; - if (spaced == U('\n')) spaced = U(' '); -+ if (rsreset) { -+ /* both a-z and . are covered by "dull" */ -+ if (!rsdot) { -+ if (c != U('.')) { -+ /* reset regex-with-method to the starting slash */ -+ source = rsreset; -+ target = rtreset; -+ rsreset = NULL; -+ continue; /* main loop */ -+ } -+ /* Found a dot after possible regex, looking for a-z now */ -+ rsdot = 1; -+ } -+ else if (!RJSMIN_IS_A_Z(c)) { -+ /* reset regex-with-method to the starting slash */ -+ source = rsreset; -+ target = rtreset; -+ rsreset = NULL; -+ continue; /* main loop */ -+ } -+ else { -+ /* Successfull finish the regex-with-method match */ -+ rsreset = NULL; -+ } -+ } - - *target++ = c; -- continue; -+ continue; /* main loop */ - } -+ - switch (c) { - - /* String */ -- case U('\''): case U('"'): -+ case U('\''): case U('"'): case U('`'): - if (post_regex) post_regex = 0; - if (pctoken) pctoken = NULL; - if (spaced == U('\n')) spaced = U(' '); -+ if (rsreset) { -+ /* reset regex-with-method to the starting slash */ -+ source = rsreset; -+ target = rtreset; -+ rsreset = NULL; -+ continue; /* main loop */ -+ } - - reset = source; - *target++ = quote = c; -+ -+ /* string loop */ - while (source < sentinel) { - c = *source++; - *target++ = c; - if (RJSMIN_IS_STRING_DULL(c)) -- continue; -+ continue; /* string loop */ -+ - switch (c) { -- case U('\''): case U('"'): -+ case U('\''): case U('"'): case U('`'): - if (c == quote) -- goto cont; -- continue; -+ goto cont; /* main loop */ -+ continue; /* string loop */ - case U('\\'): - if (source < sentinel) { - c = *source++; -@@ -134,13 +188,18 @@ rjsmin(const rchar *source, rchar *targe - && *source == U('\n')) - *target++ = *source++; - } -- continue; -+ continue; /* string loop */ -+ case U('\r'): case U('\n'): -+ if (quote != U('`')) -+ break; /* string reset */ -+ continue; /* string loop */ - } -- break; -+ break; /* string reset */ - } -+ /* string reset */ - target -= source - reset; - source = reset; -- continue; -+ continue; /* main loop */ - - /* Comment or Regex or something else entirely */ - case U('/'): -@@ -148,6 +207,13 @@ rjsmin(const rchar *source, rchar *targe - if (post_regex) post_regex = 0; - if (pctoken) pctoken = NULL; - if (spaced == U('\n')) spaced = U(' '); -+ if (rsreset) { -+ /* reset regex-with-method to the starting slash */ -+ source = rsreset; -+ target = rtreset; -+ rsreset = NULL; -+ continue; /* main loop */ -+ } - - *target++ = c; - } -@@ -157,7 +223,19 @@ rjsmin(const rchar *source, rchar *targe - case U('*'): case U('/'): - goto skip_or_copy_ws; - -+ /* Regex or slash */ - default: -+ if (rsreset) { -+ /* reset regex-with-method to the starting slash */ -+ if (post_regex) post_regex = 0; -+ if (pctoken) pctoken = NULL; -+ if (spaced == U('\n')) spaced = U(' '); -+ source = rsreset; -+ target = rtreset; -+ rsreset = NULL; -+ continue; /* main loop */ -+ } -+ - xtarget = NULL; - if ( target == tstart - || RJSMIN_IS_PRE_REGEX_1(*((pctoken ? pctoken : target) -@@ -176,99 +254,148 @@ rjsmin(const rchar *source, rchar *targe - || !RJSMIN_IS_ID_LITERAL(*(xtarget - 7)) - ) - )) { -- -- /* Regex */ -+ /* nothing to do here, continuing down below -+ * We could unset rsreset here, but we know it already -+ * is. */ -+ ; -+ } -+ else if (*((pctoken ? pctoken : target) - 1) == U(')')) { -+ xtarget = NULL; -+ rsreset = source; -+ rtreset = target + 1; -+ rsdot = 0; -+ } -+ else { -+ /* Just a slash */ - if (post_regex) post_regex = 0; - if (pctoken) pctoken = NULL; -+ if (spaced == U('\n')) spaced = U(' '); - -- reset = source; -- if (spaced == U('\n')) { -- spaced = U(' '); -- if (xtarget) -- *target++ = U('\n'); -- } -+ *target++ = c; -+ continue; /* main loop */ -+ } - -- *target++ = U('/'); -- while (source < sentinel) { -- c = *source++; -- *target++ = c; -- if (RJSMIN_IS_REGEX_DULL(c)) -- continue; -- switch (c) { -- case U('/'): -- post_regex = 1; -- goto cont; -- case U('\\'): -- if (source < sentinel) { -- c = *source++; -- *target++ = c; -- if (c == U('\r') || c == U('\n')) -- break; -- } -- continue; -- case U('['): -- while (source < sentinel) { -- c = *source++; -- *target++ = c; -- if (RJSMIN_IS_REGEX_CC_DULL(c)) -- continue; -- switch (c) { -- case U('\\'): -- if (source < sentinel) { -- c = *source++; -- *target++ = c; -- if (c == U('\r') || c == U('\n')) -- break; -- } -- continue; -- case U(']'): -- goto cont_regex; -+ if (post_regex) post_regex = 0; -+ if (pctoken) pctoken = NULL; -+ -+ reset = source; -+ if (spaced == U('\n')) { -+ spaced = U(' '); -+ if (xtarget) -+ *target++ = U('\n'); -+ } -+ -+ *target++ = U('/'); -+ -+ /* regex loop */ -+ while (source < sentinel) { -+ c = *source++; -+ *target++ = c; -+ -+ if (RJSMIN_IS_REGEX_DULL(c)) -+ continue; /* regex loop */ -+ -+ switch (c) { -+ case U('/'): -+ while (source < sentinel -+ && RJSMIN_IS_A_Z(*source)) -+ *target++ = *source++; -+ post_regex = !rsreset; -+ /* This check is supposed to make it faster. -+ * It doesn't. It slows it down. I wonder why... -+ */ -+ /* -+ * if (!post_regex -+ * && source < sentinel - 1 -+ * && *source == U('.') -+ * && RJSMIN_IS_A_Z(*(source + 1))) -+ * rsreset = NULL; -+ */ -+ -+ goto cont; /* main loop */ -+ -+ case U('\\'): -+ if (source < sentinel) { -+ c = *source++; -+ *target++ = c; -+ if (c == U('\r') || c == U('\n')) -+ break; /* regex reset */ -+ } -+ continue; /* regex loop */ -+ -+ case U('['): -+ /* regex CC loop */ -+ while (source < sentinel) { -+ c = *source++; -+ *target++ = c; -+ -+ if (RJSMIN_IS_REGEX_CC_DULL(c)) -+ continue; /* regex CC loop */ -+ -+ switch (c) { -+ case U('\\'): -+ if (source < sentinel) { -+ c = *source++; -+ *target++ = c; -+ if (c == U('\r') || c == U('\n')) -+ break; /* regex reset */ - } -+ continue; /* regex CC loop */ -+ -+ case U(']'): -+ goto cont_regex; /* regex loop */ - } -- break; - } -- break; -- cont_regex: -- continue; -+ break; /* regex reset */ -+ - } -- target -= source - reset; -- source = reset; -- } -- else { -- /* Just a slash */ -- if (post_regex) post_regex = 0; -- if (pctoken) pctoken = NULL; -- if (spaced == U('\n')) spaced = U(' '); -+ break; /* regex reset */ - -- *target++ = c; -+ cont_regex: -+ continue; /* regex loop */ - } -- continue; -+ -+ /* regex reset */ -+ target -= source - reset; -+ source = reset; -+ rsreset = NULL; -+ continue; /* main loop */ - } - } -- continue; -+ continue; /* main loop */ /* LCOV_EXCL_LINE */ - - /* Whitespace */ - default: - skip_or_copy_ws: -+ /* remember if we've seen a newline, start with: no */ - quote = U(' '); - --source; -+ -+ /* space loop */ - while (source < sentinel) { - c = *source++; - if (RJSMIN_IS_SPACE(c)) -- continue; -+ continue; /* space loop */ -+ - switch (c) { - case U('\r'): case U('\n'): - quote = U('\n'); -- continue; -+ continue; /* space loop */ -+ -+ /* Can only be a comment at this point -+ * (or ending prematurely) */ - case U('/'): - if (source < sentinel) { - switch (*source) { -+ -+ /* multiline comment */ - case U('*'): - reset = source++; - /* copy bang comment, if requested */ - if ( keep_bang_comments && source < sentinel - && *source == U('!')) { - if (!pctoken) { -+ /* Backtracking if ending prematurely */ - pctoken = target; - pcreset = reset; - } -@@ -276,6 +403,8 @@ rjsmin(const rchar *source, rchar *targe - *target++ = U('/'); - *target++ = U('*'); - *target++ = *source++; -+ -+ /* comment loop */ - while (source < sentinel) { - c = *source++; - *target++ = c; -@@ -283,20 +412,21 @@ rjsmin(const rchar *source, rchar *targe - && *source == U('/')) { - *target++ = *source++; - reset = NULL; -- break; -+ break; /* continue space loop */ - } - } - if (!reset) -- continue; -+ continue; /* space loop */ - -+ /* comment reset */ - target -= source - reset; - source = reset; - if (pcreset == reset) { - pctoken = NULL; - pcreset = NULL; - } -- - } -+ - /* strip regular comment */ - else { - while (source < sentinel) { -@@ -305,41 +435,52 @@ rjsmin(const rchar *source, rchar *targe - && *source == U('/')) { - ++source; - reset = NULL; -- break; -+ break; /* continue space loop */ - } - } - if (!reset) -- continue; -+ continue; /* space loop */ -+ -+ /* comment reset: fallback to slash */ - source = reset; - *target++ = U('/'); - } -- goto cont; -+ goto cont; /* main loop */ -+ -+ /* single line comment */ - case U('/'): - ++source; -+ -+ /* single line comment loop */ - while (source < sentinel) { - c = *source++; - switch (c) { - case U('\n'): -- break; -+ break; /* continue space loop */ -+ - case U('\r'): - if (source < sentinel - && *source == U('\n')) - ++source; -- break; -+ break; /* continue space loop */ -+ - default: -- continue; -+ continue; /* single line comment loop */ - } -- break; -+ break; /* continue space loop */ - } - quote = U('\n'); -- continue; -+ continue; /* space loop */ - } - } - } -+ -+ /* No more spacy character found */ - --source; -- break; -+ break; /* end space loop */ - } - -+ /* Copy a space if needed */ - if ((tstart < (pctoken ? pctoken : target) && source < sentinel) - && ((quote == U('\n') - && ((RJSMIN_IS_ID_LITERAL_CLOSE(*((pctoken ? -@@ -363,8 +504,9 @@ rjsmin(const rchar *source, rchar *targe - pcreset = NULL; - spaced = quote; - } -+ - cont: -- continue; -+ continue; /* main loop */ - } - return (Py_ssize_t)(target - tstart); - } -@@ -385,15 +527,15 @@ substitution regex.\n\ - :Note: This is a hand crafted C implementation built on the regex\n\ - semantics.\n\ - \n\ --:Parameters:\n\ -- `script` : ``str``\n\ -+Parameters:\n\ -+ script (str):\n\ - Script to minify\n\ - \n\ -- `keep_bang_comments` : ``bool``\n\ -+ keep_bang_comments (bool):\n\ - Keep comments starting with an exclamation mark? (``/*!...*/``)\n\ - \n\ --:Return: Minified script\n\ --:Rtype: ``str``"); -+Returns:\n\ -+ str: Minified script"); - - static PyObject * - rjsmin_jsmin(PyObject *self, PyObject *args, PyObject *kwds) -@@ -404,15 +546,15 @@ rjsmin_jsmin(PyObject *self, PyObject *a - int keep_bang_comments; - #ifdef EXT2 - int uni; --#define UOBJ "O" - #endif - #ifdef EXT3 --#define UOBJ "U" -+ int bytes; -+ rchar *bytescript; - #endif - -- if (!PyArg_ParseTupleAndKeywords(args, kwds, UOBJ "|O", kwlist, -+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O", kwlist, - &script, &keep_bang_comments_)) -- return NULL; -+ LCOV_EXCL_LINE_RETURN(NULL); - - if (!keep_bang_comments_) - keep_bang_comments = 0; -@@ -425,28 +567,27 @@ rjsmin_jsmin(PyObject *self, PyObject *a - #ifdef EXT2 - if (PyUnicode_Check(script)) { - if (!(script = PyUnicode_AsUTF8String(script))) -- return NULL; -+ LCOV_EXCL_LINE_RETURN(NULL); - uni = 1; - } -+ else if (!PyString_Check(script)) { -+ PyErr_SetString(PyExc_TypeError, "Unexpected type"); -+ return NULL; -+ } - else { - if (!(script = PyObject_Str(script))) -- return NULL; -+ LCOV_EXCL_LINE_RETURN(NULL); - uni = 0; - } --#endif -- --#ifdef EXT3 -- Py_INCREF(script); --#define PyString_GET_SIZE PyUnicode_GET_SIZE --#define PyString_AS_STRING PyUnicode_AS_UNICODE --#define _PyString_Resize PyUnicode_Resize --#define PyString_FromStringAndSize PyUnicode_FromUnicode --#endif -- - slength = PyString_GET_SIZE(script); -+ - if (!(result = PyString_FromStringAndSize(NULL, slength))) { -+ LCOV_EXCL_START -+ - Py_DECREF(script); - return NULL; -+ -+ LCOV_EXCL_STOP - } - Py_BEGIN_ALLOW_THREADS - length = rjsmin((rchar *)PyString_AS_STRING(script), -@@ -456,30 +597,97 @@ rjsmin_jsmin(PyObject *self, PyObject *a - - Py_DECREF(script); - if (length < 0) { -+ LCOV_EXCL_START -+ - Py_DECREF(result); - return NULL; -+ -+ LCOV_EXCL_STOP - } - if (length != slength && _PyString_Resize(&result, length) == -1) -- return NULL; -+ LCOV_EXCL_LINE_RETURN(NULL); - --#ifdef EXT2 - if (uni) { - script = PyUnicode_DecodeUTF8(PyString_AS_STRING(result), - PyString_GET_SIZE(result), "strict"); - Py_DECREF(result); -- if (!script) -- return NULL; -- result = script; -+ return script; - } --#endif -+ - return result; -+ -+#else /* EXT3 */ -+ -+ if (PyUnicode_Check(script)) { -+ bytes = 0; -+ script = PyUnicode_AsUTF8String(script); -+ bytescript = (rchar *)PyBytes_AS_STRING(script); -+ slength = PyBytes_GET_SIZE(script); -+ } -+ else if (PyBytes_Check(script)) { -+ bytes = 1; -+ Py_INCREF(script); -+ bytescript = (rchar *)PyBytes_AS_STRING(script); -+ slength = PyBytes_GET_SIZE(script); -+ } -+ else if (PyByteArray_Check(script)) { -+ bytes = 2; -+ Py_INCREF(script); -+ bytescript = (rchar *)PyByteArray_AS_STRING(script); -+ slength = PyByteArray_GET_SIZE(script); -+ } -+ else { -+ PyErr_SetString(PyExc_TypeError, "Unexpected type"); -+ return NULL; -+ } -+ -+ if (!(result = PyBytes_FromStringAndSize(NULL, slength))) { -+ LCOV_EXCL_START -+ -+ Py_DECREF(script); -+ return NULL; -+ -+ LCOV_EXCL_STOP -+ } -+ Py_BEGIN_ALLOW_THREADS -+ length = rjsmin(bytescript, (rchar *)PyBytes_AS_STRING(result), -+ slength, keep_bang_comments); -+ Py_END_ALLOW_THREADS -+ -+ Py_DECREF(script); -+ if (length < 0) { -+ LCOV_EXCL_START -+ -+ Py_DECREF(result); -+ return NULL; -+ -+ LCOV_EXCL_STOP -+ } -+ -+ if (!bytes) { -+ script = PyUnicode_DecodeUTF8(PyBytes_AS_STRING(result), length, -+ "strict"); -+ Py_DECREF(result); -+ return script; -+ } -+ if (bytes == 1) { -+ if (length != slength) { -+ _PyBytes_Resize(&result, length); -+ } -+ return result; -+ } -+ /* bytes == 2: bytearray */ -+ script = PyByteArray_FromStringAndSize(PyBytes_AS_STRING(result), length); -+ Py_DECREF(result); -+ return script; -+#endif - } - - /* ------------------------ BEGIN MODULE DEFINITION ------------------------ */ - - EXT_METHODS = { - {"jsmin", -- (PyCFunction)rjsmin_jsmin, METH_VARARGS | METH_KEYWORDS, -+ EXT_CFUNC(rjsmin_jsmin), METH_VARARGS | METH_KEYWORDS, - rjsmin_jsmin__doc__}, - - {NULL} /* Sentinel */ -@@ -499,10 +707,10 @@ EXT_INIT_FUNC { - - /* Create the module and populate stuff */ - if (!(m = EXT_CREATE(&EXT_DEFINE_VAR))) -- EXT_INIT_ERROR(NULL); -+ EXT_INIT_ERROR(LCOV_EXCL_LINE(NULL)); - - EXT_ADD_UNICODE(m, "__author__", "Andr\xe9 Malo", "latin-1"); -- EXT_ADD_STRING(m, "__docformat__", "restructuredtext en"); -+ EXT_ADD_STRING(m, "__version__", STRINGIFY(EXT_VERSION)); - - EXT_INIT_RETURN(m); - } -diff -up chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/rjsmin.py.12 chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/rjsmin.py ---- chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/rjsmin.py.12 2022-07-01 20:33:39.317727375 +0000 -+++ chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/rjsmin.py 2021-11-14 20:24:16.000000000 +0000 -@@ -1,6 +1,6 @@ - #!/usr/bin/env python - # -*- coding: ascii -*- --r""" -+u""" - ===================== - Javascript Minifier - ===================== -@@ -11,7 +11,7 @@ The minifier is based on the semantics o - - :Copyright: - -- Copyright 2011 - 2015 -+ Copyright 2011 - 2021 - Andr\xe9 Malo or his licensors, as applicable - - :License: -@@ -39,9 +39,11 @@ same results as the original ``jsmin.c`` - - Newline characters are not allowed inside string and regex literals, except - for line continuations in string literals (ECMA-5). - - "return /regex/" is recognized correctly. -+- More characters are allowed before regexes. - - Line terminators after regex literals are handled more sensibly - - "+ +" and "- -" sequences are not collapsed to '++' or '--' - - Newlines before ! operators are removed more sensibly -+- (Unnested) template literals are supported (ECMA-6) - - Comments starting with an exclamation mark (``!``) can be kept optionally - - rJSmin does not handle streams, but only complete strings. (However, the - module provides a "streamy" interface). -@@ -56,20 +58,17 @@ file for details. - - rjsmin.c is a reimplementation of rjsmin.py in C and speeds it up even more. - --Both python 2 and python 3 are supported. -+Supported python versions are 2.7 and 3.6+. - - .. _jsmin.c by Douglas Crockford: - http://www.crockford.com/javascript/jsmin.c - """ --if __doc__: -- # pylint: disable = redefined-builtin -- __doc__ = __doc__.encode('ascii').decode('unicode_escape') --__author__ = r"Andr\xe9 Malo".encode('ascii').decode('unicode_escape') --__docformat__ = "restructuredtext en" -+__author__ = u"Andr\xe9 Malo" - __license__ = "Apache License, Version 2.0" --__version__ = '1.0.12' -+__version__ = '1.2.0' - __all__ = ['jsmin'] - -+import functools as _ft - import re as _re - - -@@ -80,13 +79,13 @@ def _make_jsmin(python_only=False): - .. _jsmin.c by Douglas Crockford: - http://www.crockford.com/javascript/jsmin.c - -- :Parameters: -- `python_only` : ``bool`` -+ Parameters: -+ python_only (bool): - Use only the python variant. If true, the c extension is not even - tried to be loaded. - -- :Return: Minifier -- :Rtype: ``callable`` -+ Returns: -+ callable: Minifier - """ - # pylint: disable = unused-variable - # pylint: disable = too-many-locals -@@ -97,7 +96,10 @@ def _make_jsmin(python_only=False): - except ImportError: - pass - else: -- return _rjsmin.jsmin -+ # Ensure that the C version is in sync -+ # https://github.com/ndparker/rjsmin/issues/11 -+ if getattr(_rjsmin, '__version__', None) == __version__: -+ return _rjsmin.jsmin - try: - xrange - except NameError: -@@ -110,15 +112,16 @@ def _make_jsmin(python_only=False): - space_comment_nobang = r'(?:/\*(?!!)[^*]*\*+(?:[^/*][^*]*\*+)*/)' - bang_comment = r'(?:/\*![^*]*\*+(?:[^/*][^*]*\*+)*/)' - -- string1 = \ -- r'(?:\047[^\047\\\r\n]*(?:\\(?:[^\r\n]|\r?\n|\r)[^\047\\\r\n]*)*\047)' -+ string1 = r"(?:'[^'\\\r\n]*(?:\\(?:[^\r\n]|\r?\n|\r)[^'\\\r\n]*)*')" -+ string1 = string1.replace("'", r'\047') # portability - string2 = r'(?:"[^"\\\r\n]*(?:\\(?:[^\r\n]|\r?\n|\r)[^"\\\r\n]*)*")' -- string3 = r'(?:`(?:[^`\\]|\\.)*`)' -+ string3 = r'(?:`[^`\\]*(?:\\(?:[^\r\n]|\r?\n|\r)[^`\\]*)*`)' -+ string3 = string3.replace('`', r'\140') # portability - strings = r'(?:%s|%s|%s)' % (string1, string2, string3) - - charclass = r'(?:\[[^\\\]\r\n]*(?:\\[^\r\n][^\\\]\r\n]*)*\])' - nospecial = r'[^/\\\[\r\n]' -- regex = r'(?:/(?![\r\n/*])%s*(?:(?:\\[^\r\n]|%s)%s*)*/)' % ( -+ regex = r'(?:/(?![\r\n/*])%s*(?:(?:\\[^\r\n]|%s)%s*)*/[a-z]*)' % ( - nospecial, charclass, nospecial - ) - space = r'(?:%s|%s)' % (space_chars, space_comment) -@@ -154,7 +157,7 @@ def _make_jsmin(python_only=False): - ) for first, last in result]) # noqa - - return _re.sub( -- r'([\000-\040\047])', # \047 for better portability -+ r"([\000-\040'`])", # ' and ` for better portability - lambda m: '\\%03o' % ord(m.group(1)), ( - sequentize(result) - .replace('\\', '\\\\') -@@ -180,42 +183,48 @@ def _make_jsmin(python_only=False): - return r'[%s]' % fix_charclass(result) - - not_id_literal = not_id_literal_(r'[a-zA-Z0-9_$]') -- preregex1 = r'[(,=:\[!&|?{};\r\n]' -+ preregex1 = r'[(,=:\[!&|?{};\r\n+*-]' - preregex2 = r'%(not_id_literal)sreturn' % locals() - - id_literal = id_literal_(r'[a-zA-Z0-9_$]') - id_literal_open = id_literal_(r'[a-zA-Z0-9_${\[(!+-]') -- id_literal_close = id_literal_(r'[a-zA-Z0-9_$}\])"\047+-]') -+ id_literal_close = id_literal_(r'[a-zA-Z0-9_$}\])"\047\140+-]') - post_regex_off = id_literal_(r'[^\000-\040}\])?:|,;.&=+-]') - -- dull = r'[^\047"`/\000-\040]' -+ dull = r'[^\047"\140/\000-\040]' - - space_sub_simple = _re.compile(( -- # noqa pylint: disable = bad-continuation -+ # noqa pylint: disable = bad-option-value, bad-continuation - - r'(%(dull)s+)' # 0 - r'|(%(strings)s%(dull)s*)' # 1 -- r'|(?<=%(preregex1)s)' -+ r'|(?<=[)])' - r'%(space)s*(?:%(newline)s%(space)s*)*' - r'(%(regex)s)' # 2 -- r'(%(space)s*(?:%(newline)s%(space)s*)+' # 3 -+ r'(?=%(space)s*(?:%(newline)s%(space)s*)*' -+ r'\.' -+ r'%(space)s*(?:%(newline)s%(space)s*)*[a-z])' -+ r'|(?<=%(preregex1)s)' -+ r'%(space)s*(?:%(newline)s%(space)s*)*' -+ r'(%(regex)s)' # 3 -+ r'(%(space)s*(?:%(newline)s%(space)s*)+' # 4 - r'(?=%(post_regex_off)s))?' - r'|(?<=%(preregex2)s)' -- r'%(space)s*(?:(%(newline)s)%(space)s*)*' # 4 -- r'(%(regex)s)' # 5 -- r'(%(space)s*(?:%(newline)s%(space)s*)+' # 6 -+ r'%(space)s*(?:(%(newline)s)%(space)s*)*' # 5 -+ r'(%(regex)s)' # 6 -+ r'(%(space)s*(?:%(newline)s%(space)s*)+' # 7 - r'(?=%(post_regex_off)s))?' - r'|(?<=%(id_literal_close)s)' -- r'%(space)s*(?:(%(newline)s)%(space)s*)+' # 7 -+ r'%(space)s*(?:(%(newline)s)%(space)s*)+' # 8 - r'(?=%(id_literal_open)s)' -- r'|(?<=%(id_literal)s)(%(space)s)+(?=%(id_literal)s)' # 8 -- r'|(?<=\+)(%(space)s)+(?=\+)' # 9 -- r'|(?<=-)(%(space)s)+(?=-)' # 10 -+ r'|(?<=%(id_literal)s)(%(space)s)+(?=%(id_literal)s)' # 9 -+ r'|(?<=\+)(%(space)s)+(?=\+)' # 10 -+ r'|(?<=-)(%(space)s)+(?=-)' # 11 - r'|%(space)s+' - r'|(?:%(newline)s%(space)s*)+' - ) % locals()).sub - -- # print space_sub_simple.__self__.pattern -+ # print(space_sub_simple.__self__.pattern) - - def space_subber_simple(match): - """ Substitution callback """ -@@ -227,48 +236,56 @@ def _make_jsmin(python_only=False): - elif groups[1]: - return groups[1] - elif groups[2]: -- if groups[3]: -- return groups[2] + '\n' - return groups[2] -- elif groups[5]: -+ elif groups[3]: -+ if groups[4]: -+ return groups[3] + '\n' -+ return groups[3] -+ elif groups[6]: - return "%s%s%s" % ( -- groups[4] and '\n' or '', -- groups[5], -- groups[6] and '\n' or '', -+ groups[5] and '\n' or '', -+ groups[6], -+ groups[7] and '\n' or '', - ) -- elif groups[7]: -+ elif groups[8]: - return '\n' -- elif groups[8] or groups[9] or groups[10]: -+ elif groups[9] or groups[10] or groups[11]: - return ' ' - else: - return '' - - space_sub_banged = _re.compile(( -- # noqa pylint: disable = bad-continuation -+ # noqa pylint: disable = bad-option-value, bad-continuation - - r'(%(dull)s+)' # 0 - r'|(%(strings)s%(dull)s*)' # 1 -- r'|(?<=%(preregex1)s)' -+ r'|(?<=[)])' - r'(%(space)s*(?:%(newline)s%(space)s*)*)' # 2 - r'(%(regex)s)' # 3 -- r'(%(space)s*(?:%(newline)s%(space)s*)+' # 4 -+ r'(?=%(space)s*(?:%(newline)s%(space)s*)*' -+ r'\.' -+ r'%(space)s*(?:%(newline)s%(space)s*)*[a-z])' -+ r'|(?<=%(preregex1)s)' -+ r'(%(space)s*(?:%(newline)s%(space)s*)*)' # 4 -+ r'(%(regex)s)' # 5 -+ r'(%(space)s*(?:%(newline)s%(space)s*)+' # 6 - r'(?=%(post_regex_off)s))?' - r'|(?<=%(preregex2)s)' -- r'(%(space)s*(?:(%(newline)s)%(space)s*)*)' # 5, 6 -- r'(%(regex)s)' # 7 -- r'(%(space)s*(?:%(newline)s%(space)s*)+' # 8 -+ r'(%(space)s*(?:(%(newline)s)%(space)s*)*)' # 7, 8 -+ r'(%(regex)s)' # 9 -+ r'(%(space)s*(?:%(newline)s%(space)s*)+' # 10 - r'(?=%(post_regex_off)s))?' - r'|(?<=%(id_literal_close)s)' -- r'(%(space)s*(?:%(newline)s%(space)s*)+)' # 9 -+ r'(%(space)s*(?:%(newline)s%(space)s*)+)' # 11 - r'(?=%(id_literal_open)s)' -- r'|(?<=%(id_literal)s)(%(space)s+)(?=%(id_literal)s)' # 10 -- r'|(?<=\+)(%(space)s+)(?=\+)' # 11 -- r'|(?<=-)(%(space)s+)(?=-)' # 12 -- r'|(%(space)s+)' # 13 -- r'|((?:%(newline)s%(space)s*)+)' # 14 -+ r'|(?<=%(id_literal)s)(%(space)s+)(?=%(id_literal)s)' # 12 -+ r'|(?<=\+)(%(space)s+)(?=\+)' # 13 -+ r'|(?<=-)(%(space)s+)(?=-)' # 14 -+ r'|(%(space)s+)' # 15 -+ r'|((?:%(newline)s%(space)s*)+)' # 16 - ) % locals()).sub - -- # print space_sub_banged.__self__.pattern -+ # print(space_sub_banged.__self__.pattern) - - keep = _re.compile(( - r'%(space_chars)s+|%(space_comment_nobang)s+|%(newline)s+' -@@ -276,7 +293,7 @@ def _make_jsmin(python_only=False): - ) % locals()).sub - keeper = lambda m: m.groups()[0] or '' - -- # print keep.__self__.pattern -+ # print(keep.__self__.pattern) - - def space_subber_banged(match): - """ Substitution callback """ -@@ -288,26 +305,34 @@ def _make_jsmin(python_only=False): - elif groups[1]: - return groups[1] - elif groups[3]: -- return "%s%s%s%s" % ( -+ return "%s%s" % ( - keep(keeper, groups[2]), - groups[3], -- keep(keeper, groups[4] or ''), -- groups[4] and '\n' or '', - ) -- elif groups[7]: -- return "%s%s%s%s%s" % ( -- keep(keeper, groups[5]), -+ elif groups[5]: -+ return "%s%s%s%s" % ( -+ keep(keeper, groups[4]), -+ groups[5], -+ keep(keeper, groups[6] or ''), - groups[6] and '\n' or '', -- groups[7], -- keep(keeper, groups[8] or ''), -- groups[8] and '\n' or '', - ) - elif groups[9]: -- return keep(keeper, groups[9]) + '\n' -- elif groups[10] or groups[11] or groups[12]: -- return keep(keeper, groups[10] or groups[11] or groups[12]) or ' ' -+ return "%s%s%s%s%s" % ( -+ keep(keeper, groups[7]), -+ groups[8] and '\n' or '', -+ groups[9], -+ keep(keeper, groups[10] or ''), -+ groups[10] and '\n' or '', -+ ) -+ elif groups[11]: -+ return keep(keeper, groups[11]) + '\n' -+ elif groups[12] or groups[13] or groups[14]: -+ return keep(keeper, groups[12] or groups[13] or groups[14]) or ' ' - else: -- return keep(keeper, groups[13] or groups[14]) -+ return keep(keeper, groups[15] or groups[16]) -+ -+ banged = _ft.partial(space_sub_banged, space_subber_banged) -+ simple = _ft.partial(space_sub_simple, space_subber_simple) - - def jsmin(script, keep_bang_comments=False): - r""" -@@ -320,32 +345,51 @@ def _make_jsmin(python_only=False): - .. _jsmin.c by Douglas Crockford: - http://www.crockford.com/javascript/jsmin.c - -- :Parameters: -- `script` : ``str`` -+ Parameters: -+ script (str): - Script to minify - -- `keep_bang_comments` : ``bool`` -+ keep_bang_comments (bool): - Keep comments starting with an exclamation mark? (``/*!...*/``) - -- :Return: Minified script -- :Rtype: ``str`` -+ Returns: -+ str: Minified script - """ - # pylint: disable = redefined-outer-name - -- if keep_bang_comments: -- return space_sub_banged( -- space_subber_banged, '\n%s\n' % script -- ).strip() -- else: -- return space_sub_simple( -- space_subber_simple, '\n%s\n' % script -- ).strip() -+ is_bytes, script = _as_str(script) -+ script = (banged if keep_bang_comments else simple)( -+ '\n%s\n' % script -+ ).strip() -+ if is_bytes: -+ script = script.encode('latin-1') -+ if is_bytes == 2: -+ script = bytearray(script) -+ return script - - return jsmin - - jsmin = _make_jsmin() - - -+def _as_str(script): -+ """ Make sure the script is a text string """ -+ is_bytes = False -+ if str is bytes: -+ if not isinstance(script, basestring): # noqa pylint: disable = undefined-variable -+ raise TypeError("Unexpected type") -+ elif isinstance(script, bytes): -+ is_bytes = True -+ script = script.decode('latin-1') -+ elif isinstance(script, bytearray): -+ is_bytes = 2 -+ script = script.decode('latin-1') -+ elif not isinstance(script, str): -+ raise TypeError("Unexpected type") -+ -+ return is_bytes, script -+ -+ - def jsmin_for_posers(script, keep_bang_comments=False): - r""" - Minify javascript based on `jsmin.c by Douglas Crockford`_\. -@@ -361,49 +405,61 @@ def jsmin_for_posers(script, keep_bang_c - utilizes the resulting regexes. It's here for fun and may - vanish any time. Use the `jsmin` function instead. - -- :Parameters: -- `script` : ``str`` -+ Parameters: -+ script (str): - Script to minify - -- `keep_bang_comments` : ``bool`` -+ keep_bang_comments (bool): - Keep comments starting with an exclamation mark? (``/*!...*/``) - -- :Return: Minified script -- :Rtype: ``str`` -+ Returns: -+ str: Minified script - """ - if not keep_bang_comments: - rex = ( -- r'([^\047"/\000-\040]+)|((?:(?:\047[^\047\\\r\n]*(?:\\(?:[^\r\n]' -- r'|\r?\n|\r)[^\047\\\r\n]*)*\047)|(?:"[^"\\\r\n]*(?:\\(?:[^\r\n]' -- r'|\r?\n|\r)[^"\\\r\n]*)*"))[^\047"/\000-\040]*)|(?<=[(,=:\[!&|?' -- r'{};\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*' -- r'][^*]*\*+)*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\0' -- r'14\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)*((?:/(?![\r' -- r'\n/*])[^/\\\[\r\n]*(?:(?:\\[^\r\n]|(?:\[[^\\\]\r\n]*(?:\\[^\r' -- r'\n][^\\\]\r\n]*)*\]))[^/\\\[\r\n]*)*/))((?:[\000-\011\013\014' -+ r'([^\047"\140/\000-\040]+)|((?:(?:\047[^\047\\\r\n]*(?:\\(?:[^' -+ r'\r\n]|\r?\n|\r)[^\047\\\r\n]*)*\047)|(?:"[^"\\\r\n]*(?:\\(?:[^' -+ r'\r\n]|\r?\n|\r)[^"\\\r\n]*)*")|(?:\140[^\140\\]*(?:\\(?:[^\r\n' -+ r']|\r?\n|\r)[^\140\\]*)*\140))[^\047"\140/\000-\040]*)|(?<=[)])' -+ r'(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+' -+ r')*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\0' -+ r'40]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)*((?:/(?![\r\n/*])[^/' -+ r'\\\[\r\n]*(?:(?:\\[^\r\n]|(?:\[[^\\\]\r\n]*(?:\\[^\r\n][^\\\]' -+ r'\r\n]*)*\]))[^/\\\[\r\n]*)*/[a-z]*))(?=(?:[\000-\011\013\014\0' -+ r'16-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^\r\n' -+ r']*)?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^' -+ r'/*][^*]*\*+)*/))*)*\.(?:[\000-\011\013\014\016-\040]|(?:/\*[^*' -+ r']*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\00' -+ r'0-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)' -+ r'*[a-z])|(?<=[(,=:\[!&|?{};\r\n+*-])(?:[\000-\011\013\014\016-' -+ r'\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^\r\n]*)' -+ r'?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*]' -+ r'[^*]*\*+)*/))*)*((?:/(?![\r\n/*])[^/\\\[\r\n]*(?:(?:\\[^\r\n]|' -+ r'(?:\[[^\\\]\r\n]*(?:\\[^\r\n][^\\\]\r\n]*)*\]))[^/\\\[\r\n]*)*' -+ r'/[a-z]*))((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/' -+ r'*][^*]*\*+)*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013' -+ r'\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)+(?=[^\000' -+ r'-\040&)+,.:;=?\]|}-]))?|(?<=[\000-#%-,./:-@\[-^\140{-~-]return' -+ r')(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*' -+ r'+)*/))*(?:((?:(?://[^\r\n]*)?[\r\n]))(?:[\000-\011\013\014\016' -+ r'-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)*((?:/(?![\r\n/*])' -+ r'[^/\\\[\r\n]*(?:(?:\\[^\r\n]|(?:\[[^\\\]\r\n]*(?:\\[^\r\n][^' -+ r'\\\]\r\n]*)*\]))[^/\\\[\r\n]*)*/[a-z]*))((?:[\000-\011\013\014' - r'\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^\r' - r'\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:' -- r'[^/*][^*]*\*+)*/))*)+(?=[^\000-\040&)+,.:;=?\]|}-]))?|(?<=[\00' -- r'0-#%-,./:-@\[-^`{-~-]return)(?:[\000-\011\013\014\016-\040]|(?' -- r':/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:((?:(?://[^\r\n]*)?[\r\n]' -- r'))(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*' -- r'\*+)*/))*)*((?:/(?![\r\n/*])[^/\\\[\r\n]*(?:(?:\\[^\r\n]|(?:\[' -- r'[^\\\]\r\n]*(?:\\[^\r\n][^\\\]\r\n]*)*\]))[^/\\\[\r\n]*)*/))((' -- r'?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)' -- r'*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\04' -- r'0]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)+(?=[^\000-\040&)+,.:;' -- r'=?\]|}-]))?|(?<=[^\000-!#%&(*,./:-@\[\\^`{|~])(?:[\000-\011\01' -- r'3\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:((?:(?:' -- r'//[^\r\n]*)?[\r\n]))(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]' -- r'*\*+(?:[^/*][^*]*\*+)*/))*)+(?=[^\000-\040"#%-\047)*,./:-@\\-^' -- r'`|-~])|(?<=[^\000-#%-,./:-@\[-^`{-~-])((?:[\000-\011\013\014\0' -- r'16-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/)))+(?=[^\000-#%-,./' -- r':-@\[-^`{-~-])|(?<=\+)((?:[\000-\011\013\014\016-\040]|(?:/\*[' -- r'^*]*\*+(?:[^/*][^*]*\*+)*/)))+(?=\+)|(?<=-)((?:[\000-\011\013' -- r'\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/)))+(?=-)|(?:[' -- r'\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/)' -- r')+|(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]' -- r'|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)+' -+ r'[^/*][^*]*\*+)*/))*)+(?=[^\000-\040&)+,.:;=?\]|}-]))?|(?<=[^\0' -+ r'00-!#%&(*,./:-@\[\\^{|~])(?:[\000-\011\013\014\016-\040]|(?:/' -+ r'\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:((?:(?://[^\r\n]*)?[\r\n]))' -+ r'(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+' -+ r')*/))*)+(?=[^\000-\040"#%-\047)*,./:-@\\-^\140|-~])|(?<=[^\000' -+ r'-#%-,./:-@\[-^\140{-~-])((?:[\000-\011\013\014\016-\040]|(?:/' -+ r'\*[^*]*\*+(?:[^/*][^*]*\*+)*/)))+(?=[^\000-#%-,./:-@\[-^\140{-' -+ r'~-])|(?<=\+)((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:' -+ r'[^/*][^*]*\*+)*/)))+(?=\+)|(?<=-)((?:[\000-\011\013\014\016-\0' -+ r'40]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/)))+(?=-)|(?:[\000-\011\0' -+ r'13\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))+|(?:(?:(?' -+ r'://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]' -+ r'*\*+(?:[^/*][^*]*\*+)*/))*)+' - ) - - def subber(match): -@@ -412,59 +468,72 @@ def jsmin_for_posers(script, keep_bang_c - return ( - groups[0] or - groups[1] or -- (groups[3] and (groups[2] + '\n')) or - groups[2] or -- (groups[5] and "%s%s%s" % ( -- groups[4] and '\n' or '', -- groups[5], -- groups[6] and '\n' or '', -+ (groups[4] and (groups[3] + '\n')) or -+ groups[3] or -+ (groups[6] and "%s%s%s" % ( -+ groups[5] and '\n' or '', -+ groups[6], -+ groups[7] and '\n' or '', - )) or -- (groups[7] and '\n') or -- (groups[8] and ' ') or -+ (groups[8] and '\n') or - (groups[9] and ' ') or - (groups[10] and ' ') or -+ (groups[11] and ' ') or - '' - ) - else: - rex = ( -- r'([^\047"/\000-\040]+)|((?:(?:\047[^\047\\\r\n]*(?:\\(?:[^\r\n]' -- r'|\r?\n|\r)[^\047\\\r\n]*)*\047)|(?:"[^"\\\r\n]*(?:\\(?:[^\r\n]' -- r'|\r?\n|\r)[^"\\\r\n]*)*"))[^\047"/\000-\040]*)|(?<=[(,=:\[!&|?' -- r'{};\r\n])((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/' -- r'*][^*]*\*+)*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013' -- r'\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)*)((?:/(?!' -- r'[\r\n/*])[^/\\\[\r\n]*(?:(?:\\[^\r\n]|(?:\[[^\\\]\r\n]*(?:\\[^' -- r'\r\n][^\\\]\r\n]*)*\]))[^/\\\[\r\n]*)*/))((?:[\000-\011\013\01' -- r'4\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^' -+ r'([^\047"\140/\000-\040]+)|((?:(?:\047[^\047\\\r\n]*(?:\\(?:[^' -+ r'\r\n]|\r?\n|\r)[^\047\\\r\n]*)*\047)|(?:"[^"\\\r\n]*(?:\\(?:[^' -+ r'\r\n]|\r?\n|\r)[^"\\\r\n]*)*")|(?:\140[^\140\\]*(?:\\(?:[^\r\n' -+ r']|\r?\n|\r)[^\140\\]*)*\140))[^\047"\140/\000-\040]*)|(?<=[)])' -+ r'((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*' -+ r'+)*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-' -+ r'\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)*)((?:/(?![\r\n/*])' -+ r'[^/\\\[\r\n]*(?:(?:\\[^\r\n]|(?:\[[^\\\]\r\n]*(?:\\[^\r\n][^' -+ r'\\\]\r\n]*)*\]))[^/\\\[\r\n]*)*/[a-z]*))(?=(?:[\000-\011\013\0' -+ r'14\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^' - r'\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(' -- r'?:[^/*][^*]*\*+)*/))*)+(?=[^\000-\040&)+,.:;=?\]|}-]))?|(?<=[' -- r'\000-#%-,./:-@\[-^`{-~-]return)((?:[\000-\011\013\014\016-\040' -- r']|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:((?:(?://[^\r\n]*)?[' -- r'\r\n]))(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][' -- r'^*]*\*+)*/))*)*)((?:/(?![\r\n/*])[^/\\\[\r\n]*(?:(?:\\[^\r\n]|' -- r'(?:\[[^\\\]\r\n]*(?:\\[^\r\n][^\\\]\r\n]*)*\]))[^/\\\[\r\n]*)*' -- r'/))((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]' -- r'*\*+)*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\01' -- r'6-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)+(?=[^\000-\040&)' -- r'+,.:;=?\]|}-]))?|(?<=[^\000-!#%&(*,./:-@\[\\^`{|~])((?:[\000-' -- r'\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:' -- r'(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:/' -- r'\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)+)(?=[^\000-\040"#%-\047)*,./' -- r':-@\\-^`|-~])|(?<=[^\000-#%-,./:-@\[-^`{-~-])((?:[\000-\011\01' -- r'3\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))+)(?=[^\000' -- r'-#%-,./:-@\[-^`{-~-])|(?<=\+)((?:[\000-\011\013\014\016-\040]|' -- r'(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))+)(?=\+)|(?<=-)((?:[\000-\0' -- r'11\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))+)(?=-' -- r')|((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*' -- r'\*+)*/))+)|((?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014' -- r'\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)+)' -+ r'?:[^/*][^*]*\*+)*/))*)*\.(?:[\000-\011\013\014\016-\040]|(?:/' -+ r'\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?' -+ r':[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*' -+ r'/))*)*[a-z])|(?<=[(,=:\[!&|?{};\r\n+*-])((?:[\000-\011\013\014' -+ r'\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^\r' -+ r'\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:' -+ r'[^/*][^*]*\*+)*/))*)*)((?:/(?![\r\n/*])[^/\\\[\r\n]*(?:(?:\\[^' -+ r'\r\n]|(?:\[[^\\\]\r\n]*(?:\\[^\r\n][^\\\]\r\n]*)*\]))[^/\\\[\r' -+ r'\n]*)*/[a-z]*))((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+' -+ r'(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\01' -+ r'1\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)+(?=[' -+ r'^\000-\040&)+,.:;=?\]|}-]))?|(?<=[\000-#%-,./:-@\[-^\140{-~-]r' -+ r'eturn)((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][' -+ r'^*]*\*+)*/))*(?:((?:(?://[^\r\n]*)?[\r\n]))(?:[\000-\011\013\0' -+ r'14\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)*)((?:/(?![' -+ r'\r\n/*])[^/\\\[\r\n]*(?:(?:\\[^\r\n]|(?:\[[^\\\]\r\n]*(?:\\[^' -+ r'\r\n][^\\\]\r\n]*)*\]))[^/\\\[\r\n]*)*/[a-z]*))((?:[\000-\011' -+ r'\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(' -+ r'?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*' -+ r']*\*+(?:[^/*][^*]*\*+)*/))*)+(?=[^\000-\040&)+,.:;=?\]|}-]))?|' -+ r'(?<=[^\000-!#%&(*,./:-@\[\\^{|~])((?:[\000-\011\013\014\016-\0' -+ r'40]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*(?:(?:(?://[^\r\n]*)?[' -+ r'\r\n])(?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^' -+ r'*]*\*+)*/))*)+)(?=[^\000-\040"#%-\047)*,./:-@\\-^\140|-~])|(?<' -+ r'=[^\000-#%-,./:-@\[-^\140{-~-])((?:[\000-\011\013\014\016-\040' -+ r']|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))+)(?=[^\000-#%-,./:-@\[-^' -+ r'\140{-~-])|(?<=\+)((?:[\000-\011\013\014\016-\040]|(?:/\*[^*]*' -+ r'\*+(?:[^/*][^*]*\*+)*/))+)(?=\+)|(?<=-)((?:[\000-\011\013\014' -+ r'\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))+)(?=-)|((?:[\00' -+ r'0-\011\013\014\016-\040]|(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))+)' -+ r'|((?:(?:(?://[^\r\n]*)?[\r\n])(?:[\000-\011\013\014\016-\040]|' -+ r'(?:/\*[^*]*\*+(?:[^/*][^*]*\*+)*/))*)+)' - ) - -- keep = _re.compile(( -+ keep = _re.compile( - r'[\000-\011\013\014\016-\040]+|(?:/\*(?!!)[^*]*\*+(?:[^/*][^*]*' - r'\*+)*/)+|(?:(?://[^\r\n]*)?[\r\n])+|((?:/\*![^*]*\*+(?:[^/*][^' - r'*]*\*+)*/)+)' -- ) % locals()).sub -+ ).sub - keeper = lambda m: m.groups()[0] or '' - - def subber(match): -@@ -473,27 +542,37 @@ def jsmin_for_posers(script, keep_bang_c - return ( - groups[0] or - groups[1] or -- (groups[3] and "%s%s%s%s" % ( -+ groups[3] and "%s%s" % ( - keep(keeper, groups[2]), - groups[3], -- keep(keeper, groups[4] or ''), -- groups[4] and '\n' or '', -- )) or -- (groups[7] and "%s%s%s%s%s" % ( -- keep(keeper, groups[5]), -+ ) or -+ groups[5] and "%s%s%s%s" % ( -+ keep(keeper, groups[4]), -+ groups[5], -+ keep(keeper, groups[6] or ''), - groups[6] and '\n' or '', -- groups[7], -- keep(keeper, groups[8] or ''), -+ ) or -+ groups[9] and "%s%s%s%s%s" % ( -+ keep(keeper, groups[7]), - groups[8] and '\n' or '', -- )) or -- (groups[9] and keep(keeper, groups[9] + '\n')) or -- (groups[10] and keep(keeper, groups[10]) or ' ') or -- (groups[11] and keep(keeper, groups[11]) or ' ') or -- (groups[12] and keep(keeper, groups[12]) or ' ') or -- keep(keeper, groups[13] or groups[14]) -+ groups[9], -+ keep(keeper, groups[10] or ''), -+ groups[10] and '\n' or '', -+ ) or -+ groups[11] and (keep(keeper, groups[11]) + '\n') or -+ groups[12] and (keep(keeper, groups[12]) or ' ') or -+ groups[13] and (keep(keeper, groups[13]) or ' ') or -+ groups[14] and (keep(keeper, groups[14]) or ' ') or -+ keep(keeper, groups[15] or groups[16]) - ) - -- return _re.sub(rex, subber, '\n%s\n' % script).strip() -+ is_bytes, script = _as_str(script) -+ script = _re.sub(rex, subber, '\n%s\n' % script).strip() -+ if is_bytes: -+ script = script.encode('latin-1') -+ if is_bytes == 2: -+ script = bytearray(script) -+ return script - - - if __name__ == '__main__': -diff -up chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/setup.py.12 chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/setup.py ---- chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/setup.py.12 2022-06-28 12:50:10.171324444 +0000 -+++ chromium-103.0.5060.53/third_party/catapult/common/py_vulcanize/third_party/rjsmin/setup.py 2021-11-05 17:03:12.000000000 +0000 -@@ -1,41 +1,264 @@ - #!/usr/bin/env python - # -*- coding: ascii -*- --# --# Copyright 2006 - 2013 --# Andr\xe9 Malo or his licensors, as applicable --# --# Licensed under the Apache License, Version 2.0 (the "License"); --# you may not use this file except in compliance with the License. --# You may obtain a copy of the License at --# --# http://www.apache.org/licenses/LICENSE-2.0 --# --# Unless required by applicable law or agreed to in writing, software --# distributed under the License is distributed on an "AS IS" BASIS, --# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --# See the License for the specific language governing permissions and --# limitations under the License. -+u""" -+:Copyright: - -+ Copyright 2011 - 2021 -+ Andr\xe9 Malo or his licensors, as applicable -+ -+:License: -+ -+ Licensed under the Apache License, Version 2.0 (the "License"); -+ you may not use this file except in compliance with the License. -+ You may obtain a copy of the License at -+ -+ http://www.apache.org/licenses/LICENSE-2.0 -+ -+ Unless required by applicable law or agreed to in writing, software -+ distributed under the License is distributed on an "AS IS" BASIS, -+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ See the License for the specific language governing permissions and -+ limitations under the License. -+ -+=========================================== -+ rJSmin - A Javascript Minifier For Python -+=========================================== -+ -+rJSmin - A Javascript Minifier For Python. -+""" -+from __future__ import print_function -+__author__ = u"Andr\xe9 Malo" -+__docformat__ = "restructuredtext en" -+ -+import os as _os -+import posixpath as _posixpath - import sys as _sys --from _setup import run - -+# pylint: disable = no-name-in-module, import-error, raise-missing-from -+import setuptools as _setuptools -+ -+# pylint: disable = invalid-name -+ -+ -+def _doc(filename): -+ """ Read docs file """ -+ # pylint: disable = unspecified-encoding -+ args = {} if str is bytes else dict(encoding='utf-8') -+ try: -+ with open(_os.path.join('docs', filename), **args) as fp: -+ return fp.read() -+ except IOError: -+ return None -+ -+ -+def _lines(multiline): -+ """ Split multiline string into single line % empty and comments """ -+ return [line for line in ( -+ line.strip() for line in multiline.splitlines(False) -+ ) if line and not line.startswith('#')] -+ -+ -+package = dict( -+ name='rjsmin', -+ top='.', -+ pathname='.', -+ provides=_doc('PROVIDES'), -+ desc=_doc('SUMMARY').strip(), -+ longdesc=_doc('DESCRIPTION'), -+ author=__author__, -+ email='nd@perlig.de', -+ license="Apache License, Version 2.0", -+ keywords=_lines(_doc('KEYWORDS')), -+ url='http://opensource.perlig.de/rjsmin/', -+ classifiers=_lines(_doc('CLASSIFIERS') or ''), -+ -+ packages=False, -+ py_modules=['rjsmin'], -+ version_file='rjsmin.py', -+ install_requires=[], -+) -+ -+ -+class BuildFailed(Exception): -+ """ The build has failed """ -+ -+ -+from distutils.command import build_ext as _build_ext # pylint: disable = wrong-import-order -+from distutils import errors as _errors # pylint: disable = wrong-import-order -+class build_ext(_build_ext.build_ext): # pylint: disable = no-init -+ """ Improved extension building code """ -+ -+ def run(self): -+ """ Unify exception """ -+ try: -+ _build_ext.build_ext.run(self) -+ except _errors.DistutilsPlatformError: -+ raise BuildFailed() -+ -+ -+ def build_extension(self, ext): -+ """ -+ Build C extension - with extended functionality - --def setup(args=None, _manifest=0): -- """ Main setup function """ -- from _setup.ext import Extension -+ The following features are added here: - -- if 'java' in _sys.platform.lower(): -- # no c extension for jython -- ext = None -+ - The macros ``EXT_PACKAGE`` and ``EXT_MODULE`` will be filled (or -+ unset) depending on the extensions name, but only if they are not -+ already defined. -+ -+ - "." is added to the include directories (for cext.h) -+ -+ :Parameters: -+ `ext` : `Extension` -+ The extension to build -+ -+ :Return: whatever ``distutils.command.build_ext.build_ext`` returns -+ :Rtype: any -+ """ -+ # handle name macros -+ macros = dict(ext.define_macros or ()) -+ tup = ext.name.split('.') -+ if len(tup) == 1: -+ pkg, mod = None, tup[0] -+ else: -+ pkg, mod = '.'.join(tup[:-1]), tup[-1] -+ if pkg is not None and 'EXT_PACKAGE' not in macros: -+ ext.define_macros.append(('EXT_PACKAGE', pkg)) -+ if 'EXT_MODULE' not in macros: -+ ext.define_macros.append(('EXT_MODULE', mod)) -+ if pkg is None: -+ macros = dict(ext.undef_macros or ()) -+ if 'EXT_PACKAGE' not in macros: -+ ext.undef_macros.append('EXT_PACKAGE') -+ -+ import pprint; pprint.pprint(ext.__dict__) -+ try: -+ return _build_ext.build_ext.build_extension(self, ext) -+ except (_errors.CCompilerError, _errors.DistutilsExecError, -+ _errors.DistutilsPlatformError, IOError, ValueError): -+ raise BuildFailed() -+ -+ -+class Extension(_setuptools.Extension): -+ """ improved functionality """ -+ -+ def __init__(self, *args, **kwargs): -+ """ Initialization """ -+ version = kwargs.pop('version') -+ self.depends = [] -+ if 'depends' in kwargs: -+ self.depends = kwargs['depends'] -+ _setuptools.Extension.__init__(self, *args, **kwargs) -+ self.define_macros.append(('EXT_VERSION', version)) -+ -+ # add include path -+ included = '.' -+ if included not in self.include_dirs: -+ self.include_dirs.append(included) -+ -+ # add cext.h to the dependencies -+ cext_h = _posixpath.normpath(_posixpath.join(included, 'cext.h')) -+ for item in self.depends: -+ if _posixpath.normpath(item) == cext_h: -+ break -+ else: -+ self.depends.append(cext_h) -+ -+ -+EXTENSIONS = lambda v: [Extension('_rjsmin', ["rjsmin.c"], version=v)] -+ -+ -+def do_setup(cext): -+ """ Main """ -+ # pylint: disable = too-many-branches -+ # pylint: disable = unspecified-encoding -+ -+ args = {} if str is bytes else dict(encoding='utf-8') -+ version_file = '%s/%s' % (package['pathname'], -+ package.get('version_file', '__init__.py')) -+ with open(version_file, **args) as fp: -+ for line in fp: # pylint: disable = redefined-outer-name -+ if line.startswith('__version__'): -+ version = line.split('=', 1)[1].strip() -+ if version.startswith(("'", '"')): -+ version = version[1:-1].strip() -+ break -+ else: -+ raise RuntimeError("Version not found") -+ -+ kwargs = {} -+ -+ if not cext or 'java' in _sys.platform.lower(): -+ extensions = [] - else: -- ext=[Extension('_rjsmin', sources=['rjsmin.c'])] -+ extensions = EXTENSIONS(version) -+ -+ if extensions: -+ if 'build_ext' in globals(): -+ kwargs.setdefault('cmdclass', {})['build_ext'] = build_ext -+ kwargs['ext_modules'] = extensions -+ -+ cflags = None -+ if _os.environ.get('CFLAGS') is None: -+ from distutils import ccompiler as _ccompiler -+ -+ compiler = _ccompiler.get_default_compiler() -+ try: -+ with open("debug.%s.cflags" % compiler) as fp: -+ cflags = ' '.join([ -+ line for line in (line.strip() for line in fp) -+ if line and not line.startswith('#') -+ ]).split() or None -+ except IOError: -+ pass -+ -+ if cflags: -+ gcov = 'coverage' in ' '.join(cflags) -+ for ext in extensions: -+ # pylint: disable = attribute-defined-outside-init -+ ext.extra_compile_args = \ -+ getattr(ext, 'extra_compile_args', []) + cflags -+ if gcov: -+ ext.libraries.append('gcov') -+ -+ -+ if package.get('packages', True): -+ kwargs['packages'] = [package['top']] + [ -+ '%s.%s' % (package['top'], item) -+ for item in -+ _setuptools.find_packages(package['pathname']) -+ ] -+ if package.get('py_modules'): -+ kwargs['py_modules'] = package['py_modules'] - -- return run(script_args=args, ext=ext, manifest_only=_manifest) -+ _setuptools.setup( -+ name=package['name'], -+ author=package['author'], -+ author_email=package['email'], -+ license=package['license'], -+ classifiers=package['classifiers'], -+ description=package['desc'], -+ long_description=package['longdesc'], -+ url=package['url'], -+ install_requires=package['install_requires'], -+ version=version, -+ zip_safe=False, -+ **kwargs -+ ) - - --def manifest(): -- """ Create List of packaged files """ -- return setup((), _manifest=1) -+def setup(): -+ """ Run setup """ -+ try: -+ do_setup(True) -+ except BuildFailed: -+ env = 'SETUP_CEXT_REQUIRED' -+ if _os.environ.get(env, '') not in ('', '0'): -+ raise -+ print("C extension build failed - building python only version now. " -+ "Set '%s' environment variable to '1' to make it fail." -+ % (env,), file=_sys.stderr) -+ do_setup(False) - - - if __name__ == '__main__': diff --git a/chromium-105.0.5195.52-python-six-1.16.0.patch b/chromium-105.0.5195.52-python-six-1.16.0.patch deleted file mode 100644 index ece7e226963e22c6757b1cee7cd9b4b12c9ace09..0000000000000000000000000000000000000000 --- a/chromium-105.0.5195.52-python-six-1.16.0.patch +++ /dev/null @@ -1,50 +0,0 @@ -diff --git a/third_party/catapult/third_party/six/six.py b/third_party/catapult/third_party/six/six.py -index 83f69783d1..4e15675d8b 100644 ---- a/third_party/catapult/third_party/six/six.py -+++ b/third_party/catapult/third_party/six/six.py -@@ -29,7 +29,7 @@ import sys - import types - - __author__ = "Benjamin Peterson " --__version__ = "1.15.0" -+__version__ = "1.16.0" - - - # Useful for very coarse version differentiation. -@@ -71,6 +71,11 @@ else: - MAXSIZE = int((1 << 63) - 1) - del X - -+if PY34: -+ from importlib.util import spec_from_loader -+else: -+ spec_from_loader = None -+ - - def _add_doc(func, doc): - """Add documentation to a function.""" -@@ -186,6 +191,11 @@ class _SixMetaPathImporter(object): - return self - return None - -+ def find_spec(self, fullname, path, target=None): -+ if fullname in self.known_modules: -+ return spec_from_loader(fullname, self) -+ return None -+ - def __get_module(self, fullname): - try: - return self.known_modules[fullname] -@@ -223,6 +233,12 @@ class _SixMetaPathImporter(object): - return None - get_source = get_code # same as get_code - -+ def create_module(self, spec): -+ return self.load_module(spec.name) -+ -+ def exec_module(self, module): -+ pass -+ - _importer = _SixMetaPathImporter(__name__) - - diff --git a/chromium-107-ffmpeg-5.x-duration.patch b/chromium-106-ffmpeg-duration.patch similarity index 71% rename from chromium-107-ffmpeg-5.x-duration.patch rename to chromium-106-ffmpeg-duration.patch index ee01cd9e0ade8d26047def08ed22b0bcfbe49f43..bef339e29f059f813aaed6c09ed6d53211a7738d 100644 --- a/chromium-107-ffmpeg-5.x-duration.patch +++ b/chromium-106-ffmpeg-duration.patch @@ -1,6 +1,7 @@ -diff -up chromium-107.0.5304.121/media/filters/audio_file_reader.cc.me chromium-107.0.5304.121/media/filters/audio_file_reader.cc ---- chromium-107.0.5304.121/media/filters/audio_file_reader.cc.me 2022-12-17 08:27:12.204753071 +0100 -+++ chromium-107.0.5304.121/media/filters/audio_file_reader.cc 2022-12-17 08:28:40.908211808 +0100 +Index: chromium-106.0.5249.91/media/filters/audio_file_reader.cc +=================================================================== +--- chromium-106.0.5249.91.orig/media/filters/audio_file_reader.cc ++++ chromium-106.0.5249.91/media/filters/audio_file_reader.cc @@ -243,10 +243,10 @@ bool AudioFileReader::OnNewFrame( // silence from being output. In the case where we are also discarding some // portion of the packet (as indicated by a negative pts), we further want to diff --git a/chromium-108-system-opus.patch b/chromium-108-system-opus.patch deleted file mode 100644 index 3c7d9f2ff28f2f45cabe138ace706534d369299f..0000000000000000000000000000000000000000 --- a/chromium-108-system-opus.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up chromium-108.0.5359.124/media/audio/audio_opus_encoder.h.me chromium-108.0.5359.124/media/audio/audio_opus_encoder.h ---- chromium-108.0.5359.124/media/audio/audio_opus_encoder.h.me 2022-12-31 09:49:17.100277502 +0100 -+++ chromium-108.0.5359.124/media/audio/audio_opus_encoder.h 2022-12-31 09:49:57.101016710 +0100 -@@ -12,7 +12,7 @@ - #include "media/base/audio_converter.h" - #include "media/base/audio_encoder.h" - #include "media/base/audio_timestamp_helper.h" --#include "third_party/opus/src/include/opus.h" -+#include - - namespace media { - diff --git a/chromium-115-clang-warnings.patch b/chromium-115-clang-warnings.patch deleted file mode 100644 index 2bbd08f50b1b905d84709d68f9be7dae97d8e0eb..0000000000000000000000000000000000000000 --- a/chromium-115-clang-warnings.patch +++ /dev/null @@ -1,57 +0,0 @@ -diff -up chromium-115.0.5790.98/sql/recover_module/cursor.h.me chromium-115.0.5790.98/sql/recover_module/cursor.h ---- chromium-115.0.5790.98/sql/recover_module/cursor.h.me 2023-07-21 20:13:43.587451992 +0200 -+++ chromium-115.0.5790.98/sql/recover_module/cursor.h 2023-07-21 20:16:24.989457148 +0200 -@@ -61,6 +61,10 @@ class VirtualCursor { - // The VirtualCursor instance that embeds a given SQLite virtual table cursor. - // - // |sqlite_cursor| must have been returned by VirtualTable::SqliteCursor(). -+#ifdef __GNUC__ -+#pragma GCC diagnostic push -+#pragma GCC diagnostic ignored "-Winvalid-offsetof" -+#endif - static inline VirtualCursor* FromSqliteCursor( - sqlite3_vtab_cursor* sqlite_cursor) { - VirtualCursor* result = reinterpret_cast( -@@ -69,6 +73,9 @@ class VirtualCursor { - CHECK_EQ(sqlite_cursor, &result->sqlite_cursor_); - return result; - } -+#ifdef __GNUC__ -+#pragma GCC diagnostic pop -+#endif - - // Seeks the cursor to the first readable row. Returns a SQLite status code. - int First(); -diff -up chromium-115.0.5790.98/third_party/angle/src/libANGLE/BlobCache.cpp.me chromium-115.0.5790.98/third_party/angle/src/libANGLE/BlobCache.cpp ---- chromium-115.0.5790.98/third_party/angle/src/libANGLE/BlobCache.cpp.me 2023-07-21 20:10:05.119385885 +0200 -+++ chromium-115.0.5790.98/third_party/angle/src/libANGLE/BlobCache.cpp 2023-07-21 20:10:14.386558331 +0200 -@@ -14,7 +14,6 @@ - #include "libANGLE/histogram_macros.h" - #include "platform/PlatformMethods.h" - --#define USE_SYSTEM_ZLIB - #include "compression_utils_portable.h" - - namespace egl -diff -up chromium-115.0.5790.98/third_party/angle/src/libANGLE/MemoryProgramCache.cpp.me chromium-115.0.5790.98/third_party/angle/src/libANGLE/MemoryProgramCache.cpp ---- chromium-115.0.5790.98/third_party/angle/src/libANGLE/MemoryProgramCache.cpp.me 2023-07-21 20:10:36.864976619 +0200 -+++ chromium-115.0.5790.98/third_party/angle/src/libANGLE/MemoryProgramCache.cpp 2023-07-21 20:11:07.629549228 +0200 -@@ -8,7 +8,6 @@ - // layer to warm up the cache from disk. - - // Include zlib first, otherwise FAR gets defined elsewhere. --#define USE_SYSTEM_ZLIB - #include "compression_utils_portable.h" - - #include "libANGLE/MemoryProgramCache.h" -diff -up chromium-115.0.5790.98/third_party/angle/src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.cpp.me chromium-115.0.5790.98/third_party/angle/src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.cpp ---- chromium-115.0.5790.98/third_party/angle/src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.cpp.me 2023-07-21 20:09:44.206996746 +0200 -+++ chromium-115.0.5790.98/third_party/angle/src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.cpp 2023-07-21 20:09:51.834138674 +0200 -@@ -10,7 +10,6 @@ - - #include "libANGLE/renderer/vulkan/vk_internal_shaders_autogen.h" - --#define USE_SYSTEM_ZLIB - #include "compression_utils_portable.h" - - namespace rx diff --git a/chromium-116-system-brotli.patch b/chromium-116-system-brotli.patch deleted file mode 100644 index b62b12853dbc2df1dbd04837d58af1724f0448f1..0000000000000000000000000000000000000000 --- a/chromium-116-system-brotli.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff -up chromium-116.0.5845.50/net/filter/brotli_source_stream.cc.system-brotli chromium-116.0.5845.50/net/filter/brotli_source_stream.cc ---- chromium-116.0.5845.50/net/filter/brotli_source_stream.cc.system-brotli 2023-07-30 13:06:06.284705823 +0200 -+++ chromium-116.0.5845.50/net/filter/brotli_source_stream.cc 2023-07-30 13:08:43.398218141 +0200 -@@ -12,8 +12,8 @@ - #include "base/memory/raw_ptr.h" - #include "base/metrics/histogram_macros.h" - #include "net/base/io_buffer.h" --#include "third_party/brotli/include/brotli/decode.h" --#include "third_party/brotli/include/brotli/shared_dictionary.h" -+#include -+#include - - namespace net { - -diff -up chromium-116.0.5845.50/net/ssl/cert_compression.cc.system-brotli chromium-116.0.5845.50/net/ssl/cert_compression.cc ---- chromium-116.0.5845.50/net/ssl/cert_compression.cc.system-brotli 2023-07-26 17:43:01.000000000 +0200 -+++ chromium-116.0.5845.50/net/ssl/cert_compression.cc 2023-07-30 13:06:06.284705823 +0200 -@@ -9,7 +9,7 @@ - #include "third_party/boringssl/src/include/openssl/ssl.h" - - #if !defined(NET_DISABLE_BROTLI) --#include "third_party/brotli/include/brotli/decode.h" -+#include - #endif - - namespace net { -diff -up chromium-116.0.5845.50/ui/base/resource/resource_bundle.cc.system-brotli chromium-116.0.5845.50/ui/base/resource/resource_bundle.cc ---- chromium-116.0.5845.50/ui/base/resource/resource_bundle.cc.system-brotli 2023-07-26 17:43:23.000000000 +0200 -+++ chromium-116.0.5845.50/ui/base/resource/resource_bundle.cc 2023-07-30 13:06:06.284705823 +0200 -@@ -32,7 +32,7 @@ - #include "net/filter/gzip_header.h" - #include "skia/ext/image_operations.h" - #include "third_party/abseil-cpp/absl/types/variant.h" --#include "third_party/brotli/include/brotli/decode.h" -+#include - #include "third_party/skia/include/core/SkBitmap.h" - #include "third_party/skia/include/core/SkColor.h" - #include "third_party/zlib/google/compression_utils.h" diff --git a/chromium-117-mnemonic-error.patch b/chromium-117-mnemonic-error.patch deleted file mode 100644 index 455b3e571350eff011ff02a2c21cfacc45bede42..0000000000000000000000000000000000000000 --- a/chromium-117-mnemonic-error.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up chromium-117.0.5938.48/third_party/blink/renderer/core/BUILD.gn.me chromium-117.0.5938.48/third_party/blink/renderer/core/BUILD.gn ---- chromium-117.0.5938.48/third_party/blink/renderer/core/BUILD.gn.me 2023-09-10 16:54:00.804385139 +0200 -+++ chromium-117.0.5938.48/third_party/blink/renderer/core/BUILD.gn 2023-09-10 16:54:13.540625077 +0200 -@@ -1694,8 +1694,6 @@ action_foreach("element_locator_test_pro - python_path_root = "${root_out_dir}/pyproto" - python_path_proto = "${python_path_root}/third_party/blink/renderer/core/lcp_critical_path_predictor" - -- mnemonic = "ELOC_PROTO" -- - source_dir = "lcp_critical_path_predictor/test_proto" - sources = rebase_path([ "lcp_image_id.asciipb" ], "", source_dir) - diff --git a/chromium-117-system-zstd.patch b/chromium-117-system-zstd.patch index 0fcd3efc3a0554ab25178d141fd032ebc4bc51a1..1000b346d1b8022c0e9ff3aca23ec6d18b873863 100644 --- a/chromium-117-system-zstd.patch +++ b/chromium-117-system-zstd.patch @@ -3,18 +3,22 @@ From: Matt Jolly Date: Sun, 17 Sep 2023 16:51:42 +1000 Subject: [PATCH] Add system-zstd ---- a/build/linux/unbundle/replace_gn_files.py -+++ b/build/linux/unbundle/replace_gn_files.py -@@ -74,6 +74,7 @@ REPLACEMENTS = { - # +Index: chromium-120.0.6099.18/build/linux/unbundle/replace_gn_files.py +=================================================================== +--- chromium-120.0.6099.18.orig/build/linux/unbundle/replace_gn_files.py ++++ chromium-120.0.6099.18/build/linux/unbundle/replace_gn_files.py +@@ -79,6 +79,7 @@ REPLACEMENTS = { + 'vulkan_memory_allocator' : 'third_party/vulkan_memory_allocator/BUILD.gn', 'woff2': 'third_party/woff2/BUILD.gn', 'zlib': 'third_party/zlib/BUILD.gn', + 'zstd': 'third_party/zstd/BUILD.gn', } +Index: chromium-120.0.6099.18/build/linux/unbundle/zstd.gn +=================================================================== --- /dev/null -+++ b/build/linux/unbundle/zstd.gn ++++ chromium-120.0.6099.18/build/linux/unbundle/zstd.gn @@ -0,0 +1,25 @@ +import("//build/config/linux/pkg_config.gni") +import("//build/shim_headers.gni") @@ -41,6 +45,3 @@ Subject: [PATCH] Add system-zstd + deps = [ ":zstd_shim" ] + public_configs = [ ":system_zstd" ] +} --- -2.42.0 - diff --git a/chromium-117-typename.patch b/chromium-117-typename.patch deleted file mode 100644 index d3b00e73236036dfc3dcb4f5d50674cbd1fcc843..0000000000000000000000000000000000000000 --- a/chromium-117-typename.patch +++ /dev/null @@ -1,164 +0,0 @@ -diff -up chromium-115.0.5790.24/chrome/browser/download/bubble/download_bubble_update_service.cc.me chromium-115.0.5790.24/chrome/browser/download/bubble/download_bubble_update_service.cc ---- chromium-115.0.5790.24/chrome/browser/download/bubble/download_bubble_update_service.cc.me 2023-06-17 14:50:56.342591702 +0200 -+++ chromium-115.0.5790.24/chrome/browser/download/bubble/download_bubble_update_service.cc 2023-06-17 14:57:48.024377375 +0200 -@@ -91,7 +91,7 @@ ItemSortKey GetSortKey(const Item& item) - // Helper to get an iterator to the last element in the cache. The cache - // must not be empty. - template --SortedItems::const_iterator GetLastIter(const SortedItems& cache) { -+typename SortedItems::const_iterator GetLastIter(const SortedItems& cache) { - CHECK(!cache.empty()); - auto it = cache.end(); - return std::prev(it); -@@ -967,9 +967,9 @@ bool DownloadBubbleUpdateService::CacheM - } - - template --SortedItems::iterator -+typename SortedItems::iterator - DownloadBubbleUpdateService::CacheManager::RemoveItemFromCacheByIter( -- SortedItems::iterator iter, -+ typename SortedItems::iterator iter, - SortedItems& cache, - IterMap& iter_map) { - CHECK(iter != cache.end()); -diff -up chromium-115.0.5790.32/components/optimization_guide/core/tflite_model_executor.h.me chromium-115.0.5790.32/components/optimization_guide/core/tflite_model_executor.h ---- chromium-115.0.5790.32/components/optimization_guide/core/tflite_model_executor.h.me 2023-06-18 21:52:53.515625237 +0200 -+++ chromium-115.0.5790.32/components/optimization_guide/core/tflite_model_executor.h 2023-06-18 21:53:06.881881293 +0200 -@@ -189,7 +189,7 @@ class TFLiteModelExecutor : public Model - void SendForBatchExecution( - BatchExecutionCallback callback_on_complete, - base::TimeTicks start_time, -- ModelExecutor::ConstRefInputVector inputs) -+ typename ModelExecutor::ConstRefInputVector inputs) - override { - DCHECK(execution_task_runner_->RunsTasksInCurrentSequence()); - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); -diff -up chromium-115.0.5790.32/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc.me chromium-115.0.5790.32/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc ---- chromium-115.0.5790.32/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc.me 2023-06-19 10:03:32.319218678 +0200 -+++ chromium-115.0.5790.32/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc 2023-06-19 10:04:12.023942232 +0200 -@@ -169,7 +169,7 @@ class HTMLFastPathParser { - using Span = base::span; - using USpan = base::span; - // 32 matches that used by HTMLToken::Attribute. -- typedef std::conditional, -+ typedef typename std::conditional, - UCharLiteralBuffer<32>, - LCharLiteralBuffer<32>>::type LiteralBufferType; - typedef UCharLiteralBuffer<32> UCharLiteralBufferType; -diff -up chromium-116.0.5845.50/content/public/browser/web_ui_browser_interface_broker_registry.h.me chromium-116.0.5845.50/content/public/browser/web_ui_browser_interface_broker_registry.h ---- chromium-116.0.5845.50/content/public/browser/web_ui_browser_interface_broker_registry.h.me 2023-08-02 16:18:30.380108125 +0200 -+++ chromium-116.0.5845.50/content/public/browser/web_ui_browser_interface_broker_registry.h 2023-08-02 16:20:59.660024578 +0200 -@@ -127,10 +127,10 @@ class CONTENT_EXPORT WebUIBrowserInterfa - // - // TODO(crbug.com/1407936): Point to WebUIJsBridge documentation. - template -- JsBridgeTraits::BinderInitializer& ForWebUIWithJsBridge() { -+ typename JsBridgeTraits::BinderInitializer& ForWebUIWithJsBridge() { - using Traits = JsBridgeTraits; -- using Interface = Traits::Interface; -- using JsBridgeBinderInitializer = Traits::BinderInitializer; -+ using Interface = typename Traits::Interface; -+ using JsBridgeBinderInitializer = typename Traits::BinderInitializer; - - // WebUIController::GetType() requires an instantiated WebUIController - // (because it's a virtual method and can't be static). Here we only have -diff -up chromium-116.0.5845.50/third_party/blink/renderer/core/paint/object_paint_properties_sparse.h.me chromium-116.0.5845.50/third_party/blink/renderer/core/paint/object_paint_properties_sparse.h ---- chromium-116.0.5845.50/third_party/blink/renderer/core/paint/object_paint_properties_sparse.h.me 2023-08-02 20:41:23.984729462 +0200 -+++ chromium-116.0.5845.50/third_party/blink/renderer/core/paint/object_paint_properties_sparse.h 2023-08-02 20:41:53.737583093 +0200 -@@ -270,8 +270,8 @@ class CORE_EXPORT ObjectPaintPropertiesS - NodeList& nodes, - NodeId node_id, - const ParentType& parent, -- NodeType::State&& state, -- const NodeType::AnimationState& animation_state = -+ typename NodeType::State&& state, -+ const typename NodeType::AnimationState& animation_state = - NodeType::AnimationState()) { - // First, check if we need to add a new node. - if (!nodes.HasField(node_id)) { -diff -up chromium-117.0.5938.62/components/optimization_guide/core/tflite_model_executor.h.me chromium-117.0.5938.62/components/optimization_guide/core/tflite_model_executor.h ---- chromium-117.0.5938.62/components/optimization_guide/core/tflite_model_executor.h.me 2023-09-15 10:22:51.889698402 +0200 -+++ chromium-117.0.5938.62/components/optimization_guide/core/tflite_model_executor.h 2023-09-15 10:28:26.702716224 +0200 -@@ -234,7 +234,7 @@ class TFLiteModelExecutor : public Model - // Starts the synchronous execution of the model. Returns model outputs. - // Model needs to be loaded. Synchronous calls do not load or unload model. - std::vector> SendForBatchExecutionSync( -- ModelExecutor::ConstRefInputVector inputs) -+ typename ModelExecutor::ConstRefInputVector inputs) - override { - DCHECK(execution_task_runner_->RunsTasksInCurrentSequence()); - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); -@@ -389,7 +389,7 @@ class TFLiteModelExecutor : public Model - // executes it on the model execution thread. - void LoadModelFileAndBatchExecute( - BatchExecutionCallback callback_on_complete, -- ModelExecutor::ConstRefInputVector inputs) { -+ typename ModelExecutor::ConstRefInputVector inputs) { - DCHECK(execution_task_runner_->RunsTasksInCurrentSequence()); - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - -@@ -406,7 +406,7 @@ class TFLiteModelExecutor : public Model - - // Batch executes the loaded model for inputs. - void BatchExecuteLoadedModel( -- ModelExecutor::ConstRefInputVector inputs, -+ typename ModelExecutor::ConstRefInputVector inputs, - std::vector>* outputs) { - DCHECK(execution_task_runner_->RunsTasksInCurrentSequence()); - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); -@@ -466,7 +466,7 @@ class TFLiteModelExecutor : public Model - // Unloads the model if needed. - void BatchExecuteLoadedModelAndRunCallback( - BatchExecutionCallback callback_on_complete, -- ModelExecutor::ConstRefInputVector inputs, -+ typename ModelExecutor::ConstRefInputVector inputs, - ExecutionStatus execution_status) { - DCHECK(execution_task_runner_->RunsTasksInCurrentSequence()); - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); -diff -up chromium-117.0.5938.62/components/supervised_user/core/browser/proto_fetcher.cc.me chromium-117.0.5938.62/components/supervised_user/core/browser/proto_fetcher.cc ---- chromium-117.0.5938.62/components/supervised_user/core/browser/proto_fetcher.cc.me 2023-09-15 17:20:22.550657586 +0200 -+++ chromium-117.0.5938.62/components/supervised_user/core/browser/proto_fetcher.cc 2023-09-15 17:24:11.396716734 +0200 -@@ -399,7 +399,7 @@ class RetryingFetcherImpl final : public - RetryingFetcherImpl(const RetryingFetcherImpl&) = delete; - RetryingFetcherImpl& operator=(const RetryingFetcherImpl&) = delete; - -- void Start(ProtoFetcher::Callback callback) override { -+ void Start(typename ProtoFetcher::Callback callback) override { - callback_ = std::move(callback); - Retry(); - } -@@ -435,7 +435,7 @@ class RetryingFetcherImpl final : public - } - - // Client callback. -- ProtoFetcher::Callback callback_; -+ typename ProtoFetcher::Callback callback_; - - // Retry controls. - base::OneShotTimer timer_; -@@ -578,7 +578,7 @@ ParallelFetchManager: - template - void ParallelFetchManager::Fetch( - const Request& request, -- Fetcher::Callback callback) { -+ typename Fetcher::Callback callback) { - CHECK(callback) << "Use base::DoNothing() instead of empty callback."; - KeyType key = requests_in_flight_.Add(MakeFetcher(request)); - requests_in_flight_.Lookup(key)->Start( -diff -up chromium-117.0.5938.62/components/supervised_user/core/browser/proto_fetcher.h.me chromium-117.0.5938.62/components/supervised_user/core/browser/proto_fetcher.h ---- chromium-117.0.5938.62/components/supervised_user/core/browser/proto_fetcher.h.me 2023-09-15 17:20:56.540460391 +0200 -+++ chromium-117.0.5938.62/components/supervised_user/core/browser/proto_fetcher.h 2023-09-15 17:22:18.246237817 +0200 -@@ -165,10 +165,10 @@ class ParallelFetchManager { - - // Starts the fetch. Underlying fetcher is stored internally, and will be - // cleaned up after finish or when this manager is destroyed. -- void Fetch(const Request& request, Fetcher::Callback callback); -+ void Fetch(const Request& request, typename Fetcher::Callback callback); - - private: -- using KeyType = base::IDMap>::KeyType; -+ using KeyType = typename base::IDMap>::KeyType; - - // Remove fetcher under key from requests_in_flight_. - void Remove(KeyType key); diff --git a/chromium-117-widevine-other-locations.patch b/chromium-117-widevine-other-locations.patch deleted file mode 100644 index 38f3a27801308364304d5e00489be64f29fdb5b5..0000000000000000000000000000000000000000 --- a/chromium-117-widevine-other-locations.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff -up chromium-108.0.5359.124/chrome/common/chrome_paths.cc.widevine-other-locations chromium-108.0.5359.124/chrome/common/chrome_paths.cc ---- chromium-108.0.5359.124/chrome/common/chrome_paths.cc.widevine-other-locations 2023-01-02 11:10:03.951330305 +0100 -+++ chromium-108.0.5359.124/chrome/common/chrome_paths.cc 2023-01-02 13:42:26.781022150 +0100 -@@ -319,6 +319,16 @@ bool PathProvider(int key, base::FilePat - - #if BUILDFLAG(ENABLE_WIDEVINE) - case chrome::DIR_BUNDLED_WIDEVINE_CDM: -+ base::PathService::Get(base::DIR_HOME, &cur); -+ cur = cur.Append(FILE_PATH_LITERAL(".config/chromium/WidevineCdm")); -+ if (base::PathExists(cur)) { -+ break; -+ } -+ // Yes, this has an arch hardcoded in the path, but at this time, it is the only place to find libwidevinecdm.so -+ if (base::PathExists(base::FilePath(FILE_PATH_LITERAL("/opt/google/chrome/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so")))) { -+ cur = base::FilePath(FILE_PATH_LITERAL("/opt/google/chrome/WidevineCdm")); -+ break; -+ } - if (!GetComponentDirectory(&cur)) { - return false; - } - cur = cur.AppendASCII(kWidevineCdmBaseDirectory); -diff -up chromium-108.0.5359.124/third_party/widevine/cdm/BUILD.gn.widevine-other-locations chromium-108.0.5359.124/third_party/widevine/cdm/BUILD.gn ---- chromium-108.0.5359.124/third_party/widevine/cdm/BUILD.gn.widevine-other-locations 2023-01-02 11:10:45.953114153 +0100 -+++ chromium-108.0.5359.124/third_party/widevine/cdm/BUILD.gn 2023-01-02 11:10:45.953114153 +0100 -@@ -22,7 +22,7 @@ buildflag_header("buildflags") { - - flags = [ - "ENABLE_WIDEVINE=$enable_widevine", -- "BUNDLE_WIDEVINE_CDM=$bundle_widevine_cdm", -+ "BUNDLE_WIDEVINE_CDM=true", - "ENABLE_WIDEVINE_CDM_COMPONENT=$enable_widevine_cdm_component", - "ENABLE_MEDIA_FOUNDATION_WIDEVINE_CDM=$enable_media_foundation_widevine_cdm", - ] diff --git a/chromium-117-workaround_for_crash_on_BTI_capable_system.patch b/chromium-117-workaround_for_crash_on_BTI_capable_system.patch deleted file mode 100644 index c0ff2ae09d48c9ddf91499c48184b4110e028934..0000000000000000000000000000000000000000 --- a/chromium-117-workaround_for_crash_on_BTI_capable_system.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up chromium-117.0.5938.132/build/config/arm.gni.me chromium-117.0.5938.132/build/config/arm.gni ---- chromium-117.0.5938.132/build/config/arm.gni.me 2023-09-29 15:37:18.281122162 +0200 -+++ chromium-117.0.5938.132/build/config/arm.gni 2023-09-29 15:38:24.855369796 +0200 -@@ -140,7 +140,7 @@ if (current_cpu == "arm" || v8_current_c - # target_cpu == "arm64" filters out some cases (e.g. the ChromeOS x64 - # MSAN build) where the target platform is x64, but V8 is configured to - # use the arm64 simulator. -- arm_control_flow_integrity = "standard" -+ arm_control_flow_integrity = "pac" - } - } - assert(arm_control_flow_integrity == "none" || diff --git a/chromium-118-arm64-memory_tagging.patch b/chromium-118-arm64-memory_tagging.patch deleted file mode 100644 index 463fb37ac6cb561d61c9a3c83fbf4ac2d68319c0..0000000000000000000000000000000000000000 --- a/chromium-118-arm64-memory_tagging.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -up chromium-118.0.5993.32/base/allocator/partition_allocator/partition_alloc_config.h.me chromium-118.0.5993.32/base/allocator/partition_allocator/partition_alloc_config.h ---- chromium-118.0.5993.32/base/allocator/partition_allocator/partition_alloc_config.h.me 2023-10-03 20:25:01.282782425 +0200 -+++ chromium-118.0.5993.32/base/allocator/partition_allocator/partition_alloc_config.h 2023-10-03 20:25:27.151236664 +0200 -@@ -152,10 +152,7 @@ static_assert(sizeof(void*) != 8, ""); - (!BUILDFLAG(PUT_REF_COUNT_IN_PREVIOUS_SLOT) && \ - defined(ARCH_CPU_LITTLE_ENDIAN)) - --#define PA_CONFIG_HAS_MEMORY_TAGGING() \ -- (defined(ARCH_CPU_ARM64) && defined(__clang__) && \ -- !defined(ADDRESS_SANITIZER) && \ -- (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID))) -+#define PA_CONFIG_HAS_MEMORY_TAGGING() 0 - - #if PA_CONFIG(HAS_MEMORY_TAGGING) - static_assert(sizeof(void*) == 8); diff --git a/chromium-118-dma_buf_export_sync_file-conflict.patch b/chromium-118-dma_buf_export_sync_file-conflict.patch deleted file mode 100644 index fe2ee4c27976086f3f14ea126de9366d18faccbb..0000000000000000000000000000000000000000 --- a/chromium-118-dma_buf_export_sync_file-conflict.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up chromium-118.0.5993.32/ui/gfx/linux/dmabuf_uapi.h.me chromium-118.0.5993.32/ui/gfx/linux/dmabuf_uapi.h ---- chromium-118.0.5993.32/ui/gfx/linux/dmabuf_uapi.h.me 2023-10-04 22:18:44.259800011 +0200 -+++ chromium-118.0.5993.32/ui/gfx/linux/dmabuf_uapi.h 2023-10-04 22:28:17.068756669 +0200 -@@ -28,7 +28,7 @@ constexpr unsigned long DMA_BUF_IOCTL_SY - _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync); - #endif - --#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0) -+#if 0 - struct dma_buf_export_sync_file { - __u32 flags; - __s32 fd; diff --git a/chromium-118-python-3.12-deprecated.patch b/chromium-118-python-3.12-deprecated.patch deleted file mode 100644 index 5837ae584117db1d61002389f96b566ec21d46f2..0000000000000000000000000000000000000000 --- a/chromium-118-python-3.12-deprecated.patch +++ /dev/null @@ -1,138 +0,0 @@ -diff -up chromium-115.0.5790.102/base/write_build_date_header.py.me chromium-115.0.5790.102/base/write_build_date_header.py ---- chromium-115.0.5790.102/base/write_build_date_header.py.me 2023-07-22 14:23:42.620679397 +0200 -+++ chromium-115.0.5790.102/base/write_build_date_header.py 2023-07-22 15:24:46.833310310 +0200 -@@ -17,7 +17,7 @@ def main(): - args = argument_parser.parse_args() - - date_val = int(args.timestamp) -- date = datetime.datetime.utcfromtimestamp(date_val) -+ date = datetime.datetime.fromtimestamp(date_val, datetime.timezone.utc) - output = ('// Generated by //base/write_build_date_header.py\n' - '#ifndef BASE_GENERATED_BUILD_DATE_TIMESTAMP \n' - f'#define BASE_GENERATED_BUILD_DATE_TIMESTAMP {date_val}' -diff -up chromium-115.0.5790.102/build/write_buildflag_header.py.me chromium-115.0.5790.102/build/write_buildflag_header.py ---- chromium-115.0.5790.102/build/write_buildflag_header.py.me 2023-07-22 14:16:14.196975451 +0200 -+++ chromium-115.0.5790.102/build/write_buildflag_header.py 2023-07-22 14:20:24.977239994 +0200 -@@ -44,7 +44,7 @@ def GetOptions(): - header_guard = cmdline_options.output.upper() - if header_guard[0].isdigit(): - header_guard = '_' + header_guard -- header_guard = re.sub('[^\w]', '_', header_guard) -+ header_guard = re.sub(r'[^\w]', '_', header_guard) - header_guard += '_' - - # The actual output file is inside the gen dir. -diff -up chromium-115.0.5790.102/components/resources/protobufs/binary_proto_generator.py.me chromium-115.0.5790.102/components/resources/protobufs/binary_proto_generator.py ---- chromium-115.0.5790.102/components/resources/protobufs/binary_proto_generator.py.me 2023-07-22 14:47:34.230764210 +0200 -+++ chromium-115.0.5790.102/components/resources/protobufs/binary_proto_generator.py 2023-07-22 15:11:50.360983383 +0200 -@@ -9,7 +9,8 @@ - """ - from __future__ import print_function - import abc --import imp -+import types -+import importlib - import optparse - import os - import re -@@ -40,6 +41,12 @@ class GoogleProtobufModuleImporter: - return filepath - return None - -+ def load_source(name: str, path: str) -> types.ModuleType: -+ spec = importlib.util.spec_from_file_location(name, path) -+ module = importlib.util.module_from_spec(spec) -+ spec.loader.exec_module(module) -+ return module -+ - def _module_exists(self, fullname): - return self._fullname_to_filepath(fullname) is not None - -@@ -68,7 +75,7 @@ class GoogleProtobufModuleImporter: - raise ImportError(fullname) - - filepath = self._fullname_to_filepath(fullname) -- return imp.load_source(fullname, filepath) -+ return load_source(fullname, filepath) - - class BinaryProtoGenerator: - -diff -up chromium-115.0.5790.102/mojo/public/tools/bindings/concatenate_and_replace_closure_exports.py.me chromium-115.0.5790.102/mojo/public/tools/bindings/concatenate_and_replace_closure_exports.py ---- chromium-115.0.5790.102/mojo/public/tools/bindings/concatenate_and_replace_closure_exports.py.me 2023-07-22 15:17:19.114258801 +0200 -+++ chromium-115.0.5790.102/mojo/public/tools/bindings/concatenate_and_replace_closure_exports.py 2023-07-22 15:17:43.368200491 +0200 -@@ -32,7 +32,7 @@ def FilterLine(filename, line, output): - return - - if line.startswith("goog.provide"): -- match = re.match("goog.provide\('([^']+)'\);", line) -+ match = re.match(r"goog.provide\('([^']+)'\);", line) - if not match: - print("Invalid goog.provide line in %s:\n%s" % (filename, line)) - sys.exit(1) -diff -up chromium-115.0.5790.102/third_party/catapult/common/py_vulcanize/py_vulcanize/html_generation_controller.py.me chromium-115.0.5790.102/third_party/catapult/common/py_vulcanize/py_vulcanize/html_generation_controller.py ---- chromium-115.0.5790.102/third_party/catapult/common/py_vulcanize/py_vulcanize/html_generation_controller.py.me 2023-07-22 15:12:41.850895179 +0200 -+++ chromium-115.0.5790.102/third_party/catapult/common/py_vulcanize/py_vulcanize/html_generation_controller.py 2023-07-22 15:12:55.844871207 +0200 -@@ -18,7 +18,7 @@ class HTMLGenerationController(object): - - def GetHTMLForInlineStylesheet(self, contents): - if self.current_module is None: -- if re.search('url\(.+\)', contents): -+ if re.search(r'url\(.+\)', contents): - raise Exception( - 'Default HTMLGenerationController cannot handle inline style urls') - return contents -diff -up chromium-115.0.5790.102/third_party/catapult/common/py_vulcanize/py_vulcanize/js_utils.py.me chromium-115.0.5790.102/third_party/catapult/common/py_vulcanize/py_vulcanize/js_utils.py ---- chromium-115.0.5790.102/third_party/catapult/common/py_vulcanize/py_vulcanize/js_utils.py.me 2023-07-22 15:14:06.923717910 +0200 -+++ chromium-115.0.5790.102/third_party/catapult/common/py_vulcanize/py_vulcanize/js_utils.py 2023-07-22 15:18:03.704150614 +0200 -@@ -4,4 +4,4 @@ - - - def EscapeJSIfNeeded(js): -- return js.replace('', '<\/script>') -+ return js.replace(r'', r'<\/script>') -diff -up chromium-115.0.5790.102/third_party/catapult/common/py_vulcanize/py_vulcanize/parse_html_deps.py.me chromium-115.0.5790.102/third_party/catapult/common/py_vulcanize/py_vulcanize/parse_html_deps.py ---- chromium-115.0.5790.102/third_party/catapult/common/py_vulcanize/py_vulcanize/parse_html_deps.py.me 2023-07-22 15:14:30.105662532 +0200 -+++ chromium-115.0.5790.102/third_party/catapult/common/py_vulcanize/py_vulcanize/parse_html_deps.py 2023-07-22 15:14:57.977595950 +0200 -@@ -293,6 +293,6 @@ class HTMLModuleParser(): - html = '' - else: - if html.find('< /script>') != -1: -- raise Exception('Escape script tags with <\/script>') -+ raise Exception(r'Escape script tags with <\/script>') - - return HTMLModuleParserResults(html) -diff -up chromium-115.0.5790.102/third_party/catapult/common/py_vulcanize/py_vulcanize/style_sheet.py.me chromium-115.0.5790.102/third_party/catapult/common/py_vulcanize/py_vulcanize/style_sheet.py ---- chromium-115.0.5790.102/third_party/catapult/common/py_vulcanize/py_vulcanize/style_sheet.py.me 2023-07-22 15:13:12.316842990 +0200 -+++ chromium-115.0.5790.102/third_party/catapult/common/py_vulcanize/py_vulcanize/style_sheet.py 2023-07-22 15:13:49.684759091 +0200 -@@ -60,7 +60,7 @@ class ParsedStyleSheet(object): - return 'url(data:image/%s;base64,%s)' % (ext[1:], data.decode('utf-8')) - - # I'm assuming we only have url()'s associated with images -- return re.sub('url\((?P"|\'|)(?P[^"\'()]*)(?P=quote)\)', -+ return re.sub(r'url\((?P"|\'|)(?P[^"\'()]*)(?P=quote)\)', - InlineUrl, self.contents) - - def AppendDirectlyDependentFilenamesTo(self, dependent_filenames): -@@ -72,7 +72,7 @@ class ParsedStyleSheet(object): - raise Exception('@imports are not supported') - - matches = re.findall( -- 'url\((?:["|\']?)([^"\'()]*)(?:["|\']?)\)', -+ r'url\((?:["|\']?)([^"\'()]*)(?:["|\']?)\)', - self.contents) - - def resolve_url(url): -diff -up chromium-115.0.5790.102/third_party/dawn/generator/generator_lib.py.me chromium-115.0.5790.102/third_party/dawn/generator/generator_lib.py ---- chromium-115.0.5790.102/third_party/dawn/generator/generator_lib.py.me 2023-07-22 15:11:56.826972306 +0200 -+++ chromium-115.0.5790.102/third_party/dawn/generator/generator_lib.py 2023-07-22 15:12:37.550902545 +0200 -@@ -119,8 +119,8 @@ class _PreprocessingLoader(jinja2.BaseLo - source = self.preprocess(f.read()) - return source, path, lambda: mtime == os.path.getmtime(path) - -- blockstart = re.compile('{%-?\s*(if|elif|else|for|block|macro)[^}]*%}') -- blockend = re.compile('{%-?\s*(end(if|for|block|macro)|elif|else)[^}]*%}') -+ blockstart = re.compile(r'{%-?\s*(if|elif|else|for|block|macro)[^}]*%}') -+ blockend = re.compile(r'{%-?\s*(end(if|for|block|macro)|elif|else)[^}]*%}') - - def preprocess(self, source): - lines = source.split('\n') diff --git a/chromium-118-sigtrap_system_ffmpeg.patch b/chromium-118-sigtrap_system_ffmpeg.patch deleted file mode 100644 index 053e59ea4eb1b3745121d40900eb0e58fa689667..0000000000000000000000000000000000000000 --- a/chromium-118-sigtrap_system_ffmpeg.patch +++ /dev/null @@ -1,16 +0,0 @@ -fix tab crash with SIGTRAP when opening website like ge.globo.com - -author: Than Ngo - -diff -up chromium-118.0.5993.70/media/filters/ffmpeg_glue.cc.me chromium-118.0.5993.70/media/filters/ffmpeg_glue.cc ---- chromium-118.0.5993.70/media/filters/ffmpeg_glue.cc.me 2023-10-16 12:52:01.716573884 +0200 -+++ chromium-118.0.5993.70/media/filters/ffmpeg_glue.cc 2023-10-16 12:56:03.476075446 +0200 -@@ -157,7 +157,7 @@ bool FFmpegGlue::OpenContext(bool is_loc - container_ = container_names::MediaContainerName::kContainerAVI; - - // For a successfully opened file, we will get a container we've compiled in. -- CHECK_NE(container_, container_names::MediaContainerName::kContainerUnknown); -+ DCHECK_NE(container_, container_names::MediaContainerName::kContainerUnknown); - LogContainer(is_local_file, container_); - - return true; diff --git a/chromium-118-workaround_clang_bug-structured_binding.patch b/chromium-118-workaround_clang_bug-structured_binding.patch deleted file mode 100644 index 3b79f512487ae9f2bf955c256b9fbe94d7e1afe3..0000000000000000000000000000000000000000 --- a/chromium-118-workaround_clang_bug-structured_binding.patch +++ /dev/null @@ -1,96 +0,0 @@ -diff -up chromium-115.0.5790.24/media/base/cdm_promise_adapter.cc.workaround_clang_bug-structured_binding chromium-115.0.5790.24/media/base/cdm_promise_adapter.cc ---- chromium-115.0.5790.24/media/base/cdm_promise_adapter.cc.workaround_clang_bug-structured_binding 2023-06-07 21:48:37.000000000 +0200 -+++ chromium-115.0.5790.24/media/base/cdm_promise_adapter.cc 2023-06-17 16:53:20.216628557 +0200 -@@ -94,7 +94,9 @@ void CdmPromiseAdapter::RejectPromise(ui - void CdmPromiseAdapter::Clear(ClearReason reason) { - // Reject all outstanding promises. - DCHECK(thread_checker_.CalledOnValidThread()); -- for (auto& [promise_id, promise] : promises_) { -+ for (auto& [p_i, p_e] : promises_) { -+ auto& promise_id = p_i; -+ auto& promise = p_e; - TRACE_EVENT_NESTABLE_ASYNC_END1( - "media", "CdmPromise", TRACE_ID_WITH_SCOPE("CdmPromise", promise_id), - "status", "cleared"); -diff -up chromium-115.0.5790.24/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc.workaround_clang_bug-structured_binding chromium-115.0.5790.24/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc ---- chromium-115.0.5790.24/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc.workaround_clang_bug-structured_binding 2023-06-07 21:48:41.000000000 +0200 -+++ chromium-115.0.5790.24/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc 2023-06-17 18:47:06.001403966 +0200 -@@ -655,8 +658,10 @@ NGGridSizingTree NGGridLayoutAlgorithm:: - NGGridSizingTree sizing_tree; - - if (const auto* layout_subtree = ConstraintSpace().GridLayoutSubtree()) { -- auto& [grid_items, layout_data, subtree_size] = -- sizing_tree.CreateSizingData(); -+ auto& [g_i, l_d, s_s] = sizing_tree.CreateSizingData(); -+ auto& grid_items = g_i; -+ auto& layout_data = l_d; -+ auto& subtree_size = s_s; - - const auto& node = Node(); - grid_items = -@@ -1798,8 +1803,10 @@ void NGGridLayoutAlgorithm::CompleteTrac - bool* opt_needs_additional_pass) const { - DCHECK(sizing_subtree); - -- auto& [grid_items, layout_data, subtree_size] = -- sizing_subtree.SubtreeRootData(); -+ auto& [g_i, l_d, s_s] = sizing_subtree.SubtreeRootData(); -+ auto& grid_items = g_i; -+ auto& layout_data = l_d; -+ auto& subtree_size = s_s; - - const bool is_for_columns = track_direction == kForColumns; - const bool has_non_definite_track = -@@ -1924,8 +1931,10 @@ template - void NGGridLayoutAlgorithm::ForEachSubgrid( - const NGGridSizingSubtree& sizing_subtree, - const CallbackFunc& callback_func) const { -- auto& [grid_items, layout_data, subtree_size] = -- sizing_subtree.SubtreeRootData(); -+ auto& [g_i, l_d, s_s] = sizing_subtree.SubtreeRootData(); -+ auto& grid_items = g_i; -+ auto& layout_data = l_d; -+ auto& subtree_size = s_s; - - // If we know this subtree doesn't have nested subgrids we can exit early - // instead of iterating over every grid item looking for them. -diff -up chromium-115.0.5790.32/content/browser/service_worker/service_worker_context_wrapper.cc.me chromium-115.0.5790.32/content/browser/service_worker/service_worker_context_wrapper.cc ---- chromium-115.0.5790.32/content/browser/service_worker/service_worker_context_wrapper.cc.me 2023-06-19 08:04:02.287072722 +0200 -+++ chromium-115.0.5790.32/content/browser/service_worker/service_worker_context_wrapper.cc 2023-06-19 08:18:24.576814950 +0200 -@@ -1393,7 +1393,8 @@ void ServiceWorkerContextWrapper::MaybeP - return; - } - -- auto [document_url, key, callback] = std::move(*request); -+ auto [d_u, key, callback] = std::move(*request); -+ auto document_url = d_u; - - DCHECK(document_url.is_valid()); - TRACE_EVENT1("ServiceWorker", -diff -up chromium-117.0.5938.62/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc.me chromium-117.0.5938.62/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc ---- chromium-117.0.5938.62/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc.me 2023-09-15 13:03:00.787257048 +0200 -+++ chromium-117.0.5938.62/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc 2023-09-15 13:15:05.502706522 +0200 -@@ -3437,7 +3437,10 @@ void NGGridLayoutAlgorithm::PlaceGridIte - DCHECK(out_row_break_between); - - const auto& container_space = ConstraintSpace(); -- const auto& [grid_items, layout_data, tree_size] = sizing_tree.TreeRootData(); -+ const auto& [g_i, l_d, t_s] = sizing_tree.TreeRootData(); -+ const auto& grid_items = g_i; -+ const auto& layout_data = l_d; -+ const auto& tree_size = t_s; - - const auto* cached_layout_subtree = container_space.GridLayoutSubtree(); - const auto container_writing_direction = -@@ -3601,7 +3604,10 @@ void NGGridLayoutAlgorithm::PlaceGridIte - - // TODO(ikilpatrick): Update |SetHasSeenAllChildren| and early exit if true. - const auto& constraint_space = ConstraintSpace(); -- const auto& [grid_items, layout_data, tree_size] = sizing_tree.TreeRootData(); -+ const auto& [g_i, l_d, t_s] = sizing_tree.TreeRootData(); -+ const auto& grid_items = g_i; -+ const auto& layout_data = l_d; -+ const auto& tree_size =t_s; - - const auto* cached_layout_subtree = constraint_space.GridLayoutSubtree(); - const auto container_writing_direction = diff --git a/chromium-119-constexpr.patch b/chromium-119-constexpr.patch deleted file mode 100644 index b195ff408ba81bfcebbeb91e2cdddb98a6b5c889..0000000000000000000000000000000000000000 --- a/chromium-119-constexpr.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up chromium-119.0.6045.59/components/miracle_parameter/common/public/miracle_parameter.h.me chromium-119.0.6045.59/components/miracle_parameter/common/public/miracle_parameter.h ---- chromium-119.0.6045.59/components/miracle_parameter/common/public/miracle_parameter.h.me 2023-10-31 21:05:05.548565241 +0100 -+++ chromium-119.0.6045.59/components/miracle_parameter/common/public/miracle_parameter.h 2023-10-31 21:20:53.945532094 +0100 -@@ -93,7 +93,7 @@ class MiracleParameter { - template <> - class MiracleParameter : public MiracleParameterBase { - public: -- constexpr MiracleParameter(const base::Feature* feature, -+ MiracleParameter(const base::Feature* feature, - const char* param_name, - std::string default_value) - : MiracleParameterBase(feature, param_name, std::move(default_value)) {} diff --git a/chromium-119-disable-GlobalMediaControlsCastStartStop.patch b/chromium-119-disable-GlobalMediaControlsCastStartStop.patch deleted file mode 100644 index 208209540a9f90505f3ea027c0cf8de0f05a9036..0000000000000000000000000000000000000000 --- a/chromium-119-disable-GlobalMediaControlsCastStartStop.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -up chromium-119.0.6045.105/chrome/browser/media/router/media_router_feature.cc.disable-GlobalMediaControlsCastStartStop chromium-119.0.6045.105/chrome/browser/media/router/media_router_feature.cc ---- chromium-119.0.6045.105/chrome/browser/media/router/media_router_feature.cc.disable-GlobalMediaControlsCastStartStop 2023-11-06 12:57:04.096696491 +0100 -+++ chromium-119.0.6045.105/chrome/browser/media/router/media_router_feature.cc 2023-11-06 13:00:30.480926343 +0100 -@@ -68,15 +68,9 @@ BASE_FEATURE(kCastMirroringPlayoutDelay, - base::FEATURE_DISABLED_BY_DEFAULT); - const base::FeatureParam kCastMirroringPlayoutDelayMs{ - &kCastMirroringPlayoutDelay, "cast_mirroring_playout_delay_ms", -1}; --#if BUILDFLAG(IS_CHROMEOS) - BASE_FEATURE(kGlobalMediaControlsCastStartStop, - "GlobalMediaControlsCastStartStop", - base::FEATURE_DISABLED_BY_DEFAULT); --#else --BASE_FEATURE(kGlobalMediaControlsCastStartStop, -- "GlobalMediaControlsCastStartStop", -- base::FEATURE_ENABLED_BY_DEFAULT); --#endif // BUILDFLAG(IS_CHROMEOS) - #endif // !BUILDFLAG(IS_ANDROID) - - namespace { diff --git a/chromium-119-dont-redefine-ATSPI-version-macros.patch b/chromium-119-dont-redefine-ATSPI-version-macros.patch deleted file mode 100644 index ab64c54d0cdb7dc7c859fcc6ed8cbd450f06f9de..0000000000000000000000000000000000000000 --- a/chromium-119-dont-redefine-ATSPI-version-macros.patch +++ /dev/null @@ -1,50 +0,0 @@ -commit fc09363b2278893790d131c72a4ed96ec9837624 -Author: Elly -Date: Thu Sep 21 22:09:59 2023 +0000 - - a11y: don't redefine ATSPI version macros - - As of ATSPI 2.49.90, the library itself defines these, and if we - redefine them on the compiler command line, we get a build warning. - See: https://gitlab.gnome.org/GNOME/at-spi2-core/-/issues/129 - - Bug: None - Change-Id: I5cc655bd32c90d7af52c9dca60724f334c4a2a65 - Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4883576 - Auto-Submit: Elly FJ - Reviewed-by: Thomas Anderson - Commit-Queue: Thomas Anderson - Cr-Commit-Position: refs/heads/main@{#1199870} - -diff --git a/build/config/linux/atspi2/BUILD.gn b/build/config/linux/atspi2/BUILD.gn -index 51b6d33aab3c2..d1629205c82a3 100644 ---- a/build/config/linux/atspi2/BUILD.gn -+++ b/build/config/linux/atspi2/BUILD.gn -@@ -17,13 +17,19 @@ if (use_atk) { - "--version-as-components", - ], - "value") -- atspi_major_version = atspi_version[0] -- atspi_minor_version = atspi_version[1] -- atspi_micro_version = atspi_version[2] -- defines = [ -- "ATSPI_MAJOR_VERSION=$atspi_major_version", -- "ATSPI_MINOR_VERSION=$atspi_minor_version", -- "ATSPI_MICRO_VERSION=$atspi_micro_version", -- ] -+ major = atspi_version[0] -+ minor = atspi_version[1] -+ micro = atspi_version[2] -+ -+ # ATSPI 2.49.90 now defines these for us and it's an error for us to -+ # redefine them on the compiler command line. -+ # See ATSPI 927344a34cd5bf81fc64da4968241735ecb4f03b -+ if (minor < 49 || (minor == 49 && micro < 90)) { -+ defines = [ -+ "ATSPI_MAJOR_VERSION=$major", -+ "ATSPI_MINOR_VERSION=$minor", -+ "ATSPI_MICRO_VERSION=$micro", -+ ] -+ } - } - } diff --git a/chromium-119-ffmpeg-first_dts.patch b/chromium-119-ffmpeg-first_dts.patch deleted file mode 100644 index 19cf84bc1c055d2f102162659652f424ab5817de..0000000000000000000000000000000000000000 --- a/chromium-119-ffmpeg-first_dts.patch +++ /dev/null @@ -1,94 +0,0 @@ -diff -up chromium-119.0.6045.105/media/filters/ffmpeg_demuxer.cc.first_dts chromium-119.0.6045.105/media/filters/ffmpeg_demuxer.cc ---- chromium-119.0.6045.105/media/filters/ffmpeg_demuxer.cc.first_dts 2023-11-01 19:10:31.000000000 +0100 -+++ chromium-119.0.6045.105/media/filters/ffmpeg_demuxer.cc 2023-11-06 13:05:09.819011697 +0100 -@@ -101,7 +101,7 @@ static base::TimeDelta FramesToTimeDelta - sample_rate); - } - --static base::TimeDelta ExtractStartTime(AVStream* stream) { -+static base::TimeDelta ExtractStartTime(AVStream* stream, int64_t first_dts) { - // The default start time is zero. - base::TimeDelta start_time; - -@@ -111,12 +111,12 @@ static base::TimeDelta ExtractStartTime( - - // Next try to use the first DTS value, for codecs where we know PTS == DTS - // (excludes all H26x codecs). The start time must be returned in PTS. -- if (av_stream_get_first_dts(stream) != kNoFFmpegTimestamp && -+ if (first_dts != AV_NOPTS_VALUE && - stream->codecpar->codec_id != AV_CODEC_ID_HEVC && - stream->codecpar->codec_id != AV_CODEC_ID_H264 && - stream->codecpar->codec_id != AV_CODEC_ID_MPEG4) { - const base::TimeDelta first_pts = -- ConvertFromTimeBase(stream->time_base, av_stream_get_first_dts(stream)); -+ ConvertFromTimeBase(stream->time_base, first_dts); - if (first_pts < start_time) - start_time = first_pts; - } -@@ -274,6 +274,7 @@ FFmpegDemuxerStream::FFmpegDemuxerStream - fixup_negative_timestamps_(false), - fixup_chained_ogg_(false), - num_discarded_packet_warnings_(0), -+ first_dts_(AV_NOPTS_VALUE), - last_packet_pos_(AV_NOPTS_VALUE), - last_packet_dts_(AV_NOPTS_VALUE) { - DCHECK(demuxer_); -@@ -336,6 +337,10 @@ void FFmpegDemuxerStream::EnqueuePacket( - int64_t packet_dts = - packet->dts == AV_NOPTS_VALUE ? packet->pts : packet->dts; - -+ if (first_dts_ == AV_NOPTS_VALUE) { -+ first_dts_ = packet_dts; -+ } -+ - // Chained ogg files have non-monotonically increasing position and time stamp - // values, which prevents us from using them to determine if a packet should - // be dropped. Since chained ogg is only allowed on single track audio only -@@ -1442,7 +1447,8 @@ void FFmpegDemuxer::OnFindStreamInfoDone - - max_duration = std::max(max_duration, streams_[i]->duration()); - -- base::TimeDelta start_time = ExtractStartTime(stream); -+ base::TimeDelta start_time = -+ ExtractStartTime(stream, streams_[i]->first_dts()); - - // Note: This value is used for seeking, so we must take the true value and - // not the one possibly clamped to zero below. -@@ -1604,7 +1610,7 @@ FFmpegDemuxerStream* FFmpegDemuxer::Find - for (const auto& stream : streams_) { - if (!stream || stream->IsEnabled() != enabled) - continue; -- if (av_stream_get_first_dts(stream->av_stream()) == kInvalidPTSMarker) -+ if (stream->first_dts() == AV_NOPTS_VALUE) - continue; - if (!lowest_start_time_stream || - stream->start_time() < lowest_start_time_stream->start_time()) { -@@ -1625,7 +1631,7 @@ FFmpegDemuxerStream* FFmpegDemuxer::Find - if (stream->type() != DemuxerStream::VIDEO) - continue; - -- if (av_stream_get_first_dts(stream->av_stream()) == kInvalidPTSMarker) -+ if (stream->first_dts() == AV_NOPTS_VALUE) - continue; - - if (!stream->IsEnabled()) -diff -up chromium-119.0.6045.105/media/filters/ffmpeg_demuxer.h.first_dts chromium-119.0.6045.105/media/filters/ffmpeg_demuxer.h ---- chromium-119.0.6045.105/media/filters/ffmpeg_demuxer.h.first_dts 2023-11-01 19:10:31.000000000 +0100 -+++ chromium-119.0.6045.105/media/filters/ffmpeg_demuxer.h 2023-11-06 13:08:43.425784988 +0100 -@@ -142,6 +142,8 @@ class MEDIA_EXPORT FFmpegDemuxerStream : - base::TimeDelta start_time() const { return start_time_; } - void set_start_time(base::TimeDelta time) { start_time_ = time; } - -+ int64_t first_dts() const { return first_dts_; } -+ - private: - friend class FFmpegDemuxerTest; - -@@ -198,6 +200,7 @@ class MEDIA_EXPORT FFmpegDemuxerStream : - bool fixup_chained_ogg_; - - int num_discarded_packet_warnings_; -+ int64_t first_dts_; - int64_t last_packet_pos_; - int64_t last_packet_dts_; - // Requested buffer count. The actual returned buffer count could be less diff --git a/chromium-119-hide-UseChromeOSDirectVideoDecoder-flag-on-VA-API-devices.patch b/chromium-119-hide-UseChromeOSDirectVideoDecoder-flag-on-VA-API-devices.patch deleted file mode 100644 index 10db5510cea394a57dab364d7aa001ac0a399c6e..0000000000000000000000000000000000000000 --- a/chromium-119-hide-UseChromeOSDirectVideoDecoder-flag-on-VA-API-devices.patch +++ /dev/null @@ -1,189 +0,0 @@ -commit 87fca7f1759e800bd72b5ab6511eea17d6400a76 -Author: Pilar Molina Lopez -Date: Tue Oct 24 19:57:55 2023 +0000 - - video: hide UseChromeOSDirectVideoDecoder flag on VA-API devices - - We are seeing crashes causes by this CHECK statement: - https://source.chromium.org/chromium/chromium/src/+/main:content/public/browser/gpu_utils.cc;l=151;drc=0e777ba9b6c34611705d5b145c92bcd09539011c - It's triggered when the user manually disables the UseChromeOSDirectVideoDecoder - flag on VA-API devices (Intel and AMD). This flag is supported only on - non-Intel and non-AMD devices. This CL adds this information to the flag - description and hides the flag in case VA-API is used. - - Bug: 1469285 - Test: manual test on volteer - Change-Id: I153b9ccb3815498c91ce5eee966834060749e247 - Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4960919 - Reviewed-by: Dale Curtis - Reviewed-by: Andres Calderon Jaramillo - Reviewed-by: Avi Drissman - Commit-Queue: Pilar Molina Lopez - Cr-Commit-Position: refs/heads/main@{#1214411} - -diff -up chromium-119.0.6045.105/chrome/browser/about_flags.cc.hide-UseChromeOSDirectVideoDecoder-flag-on-VA-API-devices chromium-119.0.6045.105/chrome/browser/about_flags.cc ---- chromium-119.0.6045.105/chrome/browser/about_flags.cc.hide-UseChromeOSDirectVideoDecoder-flag-on-VA-API-devices 2023-11-01 19:10:09.000000000 +0100 -+++ chromium-119.0.6045.105/chrome/browser/about_flags.cc 2023-11-06 17:12:08.057984291 +0100 -@@ -7771,11 +7771,13 @@ const FeatureEntry kFeatureEntries[] = { - #endif // BUILDFLAG(IS_CHROMEOS_ASH) - - #if BUILDFLAG(IS_CHROMEOS) && BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION) -+#if !BUILDFLAG(USE_VAAPI) - {"chromeos-direct-video-decoder", - flag_descriptions::kChromeOSDirectVideoDecoderName, - flag_descriptions::kChromeOSDirectVideoDecoderDescription, - kOsCrOS | kOsLacros, - FEATURE_VALUE_TYPE(media::kUseChromeOSDirectVideoDecoder)}, -+#endif // !BUILDFLAG(USE_VAAPI) - - {"enable-vbr-encode-acceleration", - flag_descriptions::kChromeOSHWVBREncodingName, -diff -up chromium-119.0.6045.105/chrome/browser/DEPS.hide-UseChromeOSDirectVideoDecoder-flag-on-VA-API-devices chromium-119.0.6045.105/chrome/browser/DEPS ---- chromium-119.0.6045.105/chrome/browser/DEPS.hide-UseChromeOSDirectVideoDecoder-flag-on-VA-API-devices 2023-11-01 19:10:09.000000000 +0100 -+++ chromium-119.0.6045.105/chrome/browser/DEPS 2023-11-06 17:12:08.055984248 +0100 -@@ -415,6 +415,7 @@ include_rules = [ - "+media/base", # For media switches - "+media/capabilities", # For InMemoryVideoDecodeStatsDB - "+media/cdm", -+ "+media/gpu/buildflags.h", - "+media/remoting/device_capability_checker.h", - "+media/capture", - "+media/midi", # For midi switches -diff -up chromium-119.0.6045.105/chrome/browser/flag_descriptions.cc.hide-UseChromeOSDirectVideoDecoder-flag-on-VA-API-devices chromium-119.0.6045.105/chrome/browser/flag_descriptions.cc ---- chromium-119.0.6045.105/chrome/browser/flag_descriptions.cc.hide-UseChromeOSDirectVideoDecoder-flag-on-VA-API-devices 2023-11-01 19:10:12.000000000 +0100 -+++ chromium-119.0.6045.105/chrome/browser/flag_descriptions.cc 2023-11-06 17:12:08.059984335 +0100 -@@ -7,6 +7,7 @@ - #include "build/build_config.h" - #include "build/chromeos_buildflags.h" - #include "components/supervised_user/core/common/buildflags.h" -+#include "media/gpu/buildflags.h" - #include "pdf/buildflags.h" - - // Keep in identical order as the header file, see the comment at the top -@@ -7424,6 +7425,7 @@ const char kVaapiVP9kSVCEncoderDescripti - #endif // defined(ARCH_CPU_X86_FAMILY) && BUILDFLAG(IS_CHROMEOS) - - #if BUILDFLAG(IS_CHROMEOS) && BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION) -+#if !BUILDFLAG(USE_VAAPI) - const char kChromeOSDirectVideoDecoderName[] = "ChromeOS Direct Video Decoder"; - const char kChromeOSDirectVideoDecoderDescription[] = - "Enables the hardware-accelerated ChromeOS direct media::VideoDecoder " -@@ -7431,7 +7433,8 @@ const char kChromeOSDirectVideoDecoderDe - "--platform-disallows-chromeos-direct-video-decoder command line switch " - "which is added for platforms where said direct VideoDecoder does not work " - "or is not well tested (see the disable_cros_video_decoder USE flag in " -- "ChromeOS)"; -+ "ChromeOS). This flag is supported only on non-Intel and non-AMD devices."; -+#endif // !BUILDFLAG(USE_VAAPI) - const char kChromeOSHWVBREncodingName[] = - "ChromeOS Hardware Variable Bitrate Encoding"; - const char kChromeOSHWVBREncodingDescription[] = -diff -up chromium-119.0.6045.105/content/public/browser/gpu_utils.cc.hide-UseChromeOSDirectVideoDecoder-flag-on-VA-API-devices chromium-119.0.6045.105/content/public/browser/gpu_utils.cc ---- chromium-119.0.6045.105/content/public/browser/gpu_utils.cc.hide-UseChromeOSDirectVideoDecoder-flag-on-VA-API-devices 2023-11-01 19:10:26.000000000 +0100 -+++ chromium-119.0.6045.105/content/public/browser/gpu_utils.cc 2023-11-06 17:12:08.059984335 +0100 -@@ -133,20 +133,26 @@ const gpu::GpuPreferences GetGpuPreferen - #if BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION) - // The direct VideoDecoder is disallowed on some particular SoC/platforms. - const bool should_use_direct_video_decoder = -+#if BUILDFLAG(USE_VAAPI) -+ true; -+#else - !command_line->HasSwitch( - switches::kPlatformDisallowsChromeOSDirectVideoDecoder) && - base::FeatureList::IsEnabled(media::kUseChromeOSDirectVideoDecoder); -+#endif // BUILDFLAG(USE_VAAPI) -+ -+ gpu_preferences.enable_chromeos_direct_video_decoder = -+#if BUILDFLAG(USE_VAAPI) -+ should_use_direct_video_decoder; -+#else -+ // For testing purposes, the following flag allows using the "other" video -+ // decoder implementation. -+ base::FeatureList::IsEnabled( -+ media::kUseAlternateVideoDecoderImplementation) -+ ? !should_use_direct_video_decoder -+ : should_use_direct_video_decoder; -+#endif // BUILDFLAG(USE_VAAPI) - -- // For testing purposes, the following flag allows using the "other" video -- // decoder implementation. -- if (base::FeatureList::IsEnabled( -- media::kUseAlternateVideoDecoderImplementation)) { -- gpu_preferences.enable_chromeos_direct_video_decoder = -- !should_use_direct_video_decoder; -- } else { -- gpu_preferences.enable_chromeos_direct_video_decoder = -- should_use_direct_video_decoder; -- } - #if BUILDFLAG(USE_VAAPI) - CHECK(gpu_preferences.enable_chromeos_direct_video_decoder); - #endif // BUILDFLAG(USE_VAAPI) -diff -up chromium-119.0.6045.105/media/base/media_switches.cc.hide-UseChromeOSDirectVideoDecoder-flag-on-VA-API-devices chromium-119.0.6045.105/media/base/media_switches.cc ---- chromium-119.0.6045.105/media/base/media_switches.cc.hide-UseChromeOSDirectVideoDecoder-flag-on-VA-API-devices 2023-11-01 19:10:31.000000000 +0100 -+++ chromium-119.0.6045.105/media/base/media_switches.cc 2023-11-06 17:12:08.060984356 +0100 -@@ -1202,6 +1202,7 @@ BASE_FEATURE(kChromeOSHWVBREncoding, - "ChromeOSHWVBREncoding", - base::FEATURE_DISABLED_BY_DEFAULT); - -+#if !BUILDFLAG(USE_VAAPI) - // Enable the hardware-accelerated direct video decoder instead of the one - // needing the VdaVideoDecoder adapter. This flag is used mainly as a - // chrome:flag for developers debugging issues as well as to be able to -@@ -1210,6 +1211,7 @@ BASE_FEATURE(kChromeOSHWVBREncoding, - BASE_FEATURE(kUseChromeOSDirectVideoDecoder, - "UseChromeOSDirectVideoDecoder", - base::FEATURE_ENABLED_BY_DEFAULT); -+#endif // !BUILDFLAG(USE_VAAPI) - - // Limit the number of concurrent hardware decoder instances on ChromeOS. - BASE_FEATURE(kLimitConcurrentDecoderInstances, -@@ -1238,7 +1240,7 @@ BASE_FEATURE(kPreferSoftwareMT21, - "PreferSoftwareMT21", - base::FEATURE_DISABLED_BY_DEFAULT); - #endif // defined(ARCH_CPU_ARM_FAMILY) --#if BUILDFLAG(IS_CHROMEOS) -+#if BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(USE_VAAPI) - // ChromeOS has one of two VideoDecoder implementations active based on - // SoC/board specific configurations that are sent via command line flags. This - // switch allows using the non default implementation for testing. -@@ -1246,7 +1248,7 @@ BASE_FEATURE(kPreferSoftwareMT21, - BASE_FEATURE(kUseAlternateVideoDecoderImplementation, - "UseAlternateVideoDecoderImplementation", - base::FEATURE_DISABLED_BY_DEFAULT); --#endif // BUILDFLAG(IS_CHROMEOS) -+#endif // BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(USE_VAAPI) - #endif // BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION) - - #if BUILDFLAG(IS_WIN) -diff -up chromium-119.0.6045.105/media/base/media_switches.h.hide-UseChromeOSDirectVideoDecoder-flag-on-VA-API-devices chromium-119.0.6045.105/media/base/media_switches.h ---- chromium-119.0.6045.105/media/base/media_switches.h.hide-UseChromeOSDirectVideoDecoder-flag-on-VA-API-devices 2023-11-01 19:10:31.000000000 +0100 -+++ chromium-119.0.6045.105/media/base/media_switches.h 2023-11-06 17:12:08.060984356 +0100 -@@ -14,6 +14,7 @@ - #include "build/build_config.h" - #include "build/chromeos_buildflags.h" - #include "media/base/media_export.h" -+#include "media/gpu/buildflags.h" - #include "media/media_buildflags.h" - - namespace base { -@@ -382,16 +383,18 @@ MEDIA_EXPORT BASE_DECLARE_FEATURE(kBuilt - #if BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION) - MEDIA_EXPORT BASE_DECLARE_FEATURE(kChromeOSHWAV1Decoder); - MEDIA_EXPORT BASE_DECLARE_FEATURE(kChromeOSHWVBREncoding); -+#if !BUILDFLAG(USE_VAAPI) - MEDIA_EXPORT BASE_DECLARE_FEATURE(kUseChromeOSDirectVideoDecoder); -+#endif // !BUILDFLAG(USE_VAAPI) - MEDIA_EXPORT BASE_DECLARE_FEATURE(kLimitConcurrentDecoderInstances); - MEDIA_EXPORT BASE_DECLARE_FEATURE(kUSeSequencedTaskRunnerForVEA); - #if defined(ARCH_CPU_ARM_FAMILY) - MEDIA_EXPORT BASE_DECLARE_FEATURE(kPreferGLImageProcessor); - MEDIA_EXPORT BASE_DECLARE_FEATURE(kPreferSoftwareMT21); - #endif // defined(ARCH_CPU_ARM_FAMILY) --#if BUILDFLAG(IS_CHROMEOS) -+#if BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(USE_VAAPI) - MEDIA_EXPORT BASE_DECLARE_FEATURE(kUseAlternateVideoDecoderImplementation); --#endif // BUILDFLAG(IS_CHROMEOS) -+#endif // BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(USE_VAAPI) - #endif // BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION) - - #if BUILDFLAG(IS_WIN) diff --git a/chromium-119-missing-header-files.patch b/chromium-119-missing-header-files.patch deleted file mode 100644 index c19a1f5d05deca43165d13b5dab415e90efef9f7..0000000000000000000000000000000000000000 --- a/chromium-119-missing-header-files.patch +++ /dev/null @@ -1,470 +0,0 @@ -diff -up chromium-119.0.6045.105/base/check_op.h.missing-header-files chromium-119.0.6045.105/base/check_op.h ---- chromium-119.0.6045.105/base/check_op.h.missing-header-files 2023-11-01 19:10:05.000000000 +0100 -+++ chromium-119.0.6045.105/base/check_op.h 2023-11-06 14:34:01.808868982 +0100 -@@ -5,6 +5,7 @@ - #ifndef BASE_CHECK_OP_H_ - #define BASE_CHECK_OP_H_ - -+#include - #include - #include - #include -diff -up chromium-119.0.6045.105/base/containers/flat_map.h.missing-header-files chromium-119.0.6045.105/base/containers/flat_map.h ---- chromium-119.0.6045.105/base/containers/flat_map.h.missing-header-files 2023-11-01 19:10:05.000000000 +0100 -+++ chromium-119.0.6045.105/base/containers/flat_map.h 2023-11-06 14:34:01.813869089 +0100 -@@ -5,6 +5,7 @@ - #ifndef BASE_CONTAINERS_FLAT_MAP_H_ - #define BASE_CONTAINERS_FLAT_MAP_H_ - -+#include - #include - #include - #include -diff -up chromium-119.0.6045.105/base/debug/profiler.h.missing-header-files chromium-119.0.6045.105/base/debug/profiler.h ---- chromium-119.0.6045.105/base/debug/profiler.h.missing-header-files 2023-11-01 19:10:05.000000000 +0100 -+++ chromium-119.0.6045.105/base/debug/profiler.h 2023-11-06 14:34:01.809869004 +0100 -@@ -8,6 +8,7 @@ - #include - #include - -+#include - #include - - #include "base/base_export.h" -diff -up chromium-119.0.6045.105/base/memory/ref_counted.h.missing-header-files chromium-119.0.6045.105/base/memory/ref_counted.h ---- chromium-119.0.6045.105/base/memory/ref_counted.h.missing-header-files 2023-11-01 19:10:05.000000000 +0100 -+++ chromium-119.0.6045.105/base/memory/ref_counted.h 2023-11-06 14:34:01.808868982 +0100 -@@ -6,6 +6,7 @@ - #define BASE_MEMORY_REF_COUNTED_H_ - - #include -+#include - - #include - #include -diff -up chromium-119.0.6045.105/chrome/browser/privacy_budget/encountered_surface_tracker.h.missing-header-files chromium-119.0.6045.105/chrome/browser/privacy_budget/encountered_surface_tracker.h ---- chromium-119.0.6045.105/chrome/browser/privacy_budget/encountered_surface_tracker.h.missing-header-files 2023-11-01 19:10:13.000000000 +0100 -+++ chromium-119.0.6045.105/chrome/browser/privacy_budget/encountered_surface_tracker.h 2023-11-06 14:34:01.814869110 +0100 -@@ -7,6 +7,7 @@ - - #include - -+#include - #include - - #include "base/containers/flat_set.h" -diff -up chromium-119.0.6045.105/chrome/browser/webauthn/authenticator_request_dialog_model.h.missing-header-files chromium-119.0.6045.105/chrome/browser/webauthn/authenticator_request_dialog_model.h ---- chromium-119.0.6045.105/chrome/browser/webauthn/authenticator_request_dialog_model.h.missing-header-files 2023-11-01 19:10:16.000000000 +0100 -+++ chromium-119.0.6045.105/chrome/browser/webauthn/authenticator_request_dialog_model.h 2023-11-06 14:34:01.817869174 +0100 -@@ -8,6 +8,7 @@ - #include - #include - #include -+#include - - #include "base/containers/span.h" - #include "base/functional/callback_forward.h" -diff -up chromium-119.0.6045.105/chrome/test/chromedriver/chrome/web_view_impl.cc.missing-header-files chromium-119.0.6045.105/chrome/test/chromedriver/chrome/web_view_impl.cc ---- chromium-119.0.6045.105/chrome/test/chromedriver/chrome/web_view_impl.cc.missing-header-files 2023-11-01 19:10:16.000000000 +0100 -+++ chromium-119.0.6045.105/chrome/test/chromedriver/chrome/web_view_impl.cc 2023-11-06 14:34:01.818869196 +0100 -@@ -11,6 +11,7 @@ - #include - #include - #include -+#include - - #include "base/check.h" - #include "base/files/file_path.h" -diff -up chromium-119.0.6045.105/components/autofill/core/browser/autofill_ablation_study.h.missing-header-files chromium-119.0.6045.105/components/autofill/core/browser/autofill_ablation_study.h ---- chromium-119.0.6045.105/components/autofill/core/browser/autofill_ablation_study.h.missing-header-files 2023-11-01 19:10:19.000000000 +0100 -+++ chromium-119.0.6045.105/components/autofill/core/browser/autofill_ablation_study.h 2023-11-06 14:34:01.815869132 +0100 -@@ -7,6 +7,7 @@ - - #include - -+#include - #include - - class GURL; -diff -up chromium-119.0.6045.105/components/crash/core/app/crash_reporter_client.h.missing-header-files chromium-119.0.6045.105/components/crash/core/app/crash_reporter_client.h ---- chromium-119.0.6045.105/components/crash/core/app/crash_reporter_client.h.missing-header-files 2023-11-01 19:10:20.000000000 +0100 -+++ chromium-119.0.6045.105/components/crash/core/app/crash_reporter_client.h 2023-11-06 14:34:01.813869089 +0100 -@@ -7,6 +7,7 @@ - - #include - -+#include - #include - - #include "build/build_config.h" -diff -up chromium-119.0.6045.105/components/feature_engagement/internal/event_storage_validator.h.missing-header-files chromium-119.0.6045.105/components/feature_engagement/internal/event_storage_validator.h ---- chromium-119.0.6045.105/components/feature_engagement/internal/event_storage_validator.h.missing-header-files 2023-11-01 19:10:21.000000000 +0100 -+++ chromium-119.0.6045.105/components/feature_engagement/internal/event_storage_validator.h 2023-11-06 14:34:01.814869110 +0100 -@@ -7,6 +7,7 @@ - - #include - -+#include - #include - - namespace feature_engagement { -diff -up chromium-119.0.6045.105/components/feature_engagement/internal/never_event_storage_validator.h.missing-header-files chromium-119.0.6045.105/components/feature_engagement/internal/never_event_storage_validator.h ---- chromium-119.0.6045.105/components/feature_engagement/internal/never_event_storage_validator.h.missing-header-files 2023-11-01 19:10:21.000000000 +0100 -+++ chromium-119.0.6045.105/components/feature_engagement/internal/never_event_storage_validator.h 2023-11-06 14:34:01.814869110 +0100 -@@ -5,6 +5,7 @@ - #ifndef COMPONENTS_FEATURE_ENGAGEMENT_INTERNAL_NEVER_EVENT_STORAGE_VALIDATOR_H_ - #define COMPONENTS_FEATURE_ENGAGEMENT_INTERNAL_NEVER_EVENT_STORAGE_VALIDATOR_H_ - -+#include - #include - - #include "components/feature_engagement/internal/event_storage_validator.h" -diff -up chromium-119.0.6045.105/components/omnibox/browser/on_device_head_model.h.missing-header-files chromium-119.0.6045.105/components/omnibox/browser/on_device_head_model.h ---- chromium-119.0.6045.105/components/omnibox/browser/on_device_head_model.h.missing-header-files 2023-11-01 19:10:21.000000000 +0100 -+++ chromium-119.0.6045.105/components/omnibox/browser/on_device_head_model.h 2023-11-06 14:34:01.815869132 +0100 -@@ -7,6 +7,7 @@ - - #include - -+#include - #include - #include - #include -diff -up chromium-119.0.6045.105/components/password_manager/core/browser/generation/password_generator.h.missing-header-files chromium-119.0.6045.105/components/password_manager/core/browser/generation/password_generator.h ---- chromium-119.0.6045.105/components/password_manager/core/browser/generation/password_generator.h.missing-header-files 2023-11-01 19:10:21.000000000 +0100 -+++ chromium-119.0.6045.105/components/password_manager/core/browser/generation/password_generator.h 2023-11-06 14:34:01.814869110 +0100 -@@ -7,6 +7,7 @@ - - #include - -+#include - #include - - -diff -up chromium-119.0.6045.105/components/payments/content/utility/fingerprint_parser.h.missing-header-files chromium-119.0.6045.105/components/payments/content/utility/fingerprint_parser.h ---- chromium-119.0.6045.105/components/payments/content/utility/fingerprint_parser.h.missing-header-files 2023-11-01 19:10:21.000000000 +0100 -+++ chromium-119.0.6045.105/components/payments/content/utility/fingerprint_parser.h 2023-11-06 14:34:01.815869132 +0100 -@@ -5,6 +5,7 @@ - #ifndef COMPONENTS_PAYMENTS_CONTENT_UTILITY_FINGERPRINT_PARSER_H_ - #define COMPONENTS_PAYMENTS_CONTENT_UTILITY_FINGERPRINT_PARSER_H_ - -+#include - #include - #include - -diff -up chromium-119.0.6045.105/gin/time_clamper.h.missing-header-files chromium-119.0.6045.105/gin/time_clamper.h ---- chromium-119.0.6045.105/gin/time_clamper.h.missing-header-files 2023-11-01 19:10:28.000000000 +0100 -+++ chromium-119.0.6045.105/gin/time_clamper.h 2023-11-06 14:34:01.818869196 +0100 -@@ -48,7 +48,7 @@ class GIN_EXPORT TimeClamper { - const int64_t micros = now_micros % 1000; - // abs() is necessary for devices with times before unix-epoch (most likely - // configured incorrectly). -- if (abs(micros) + kResolutionMicros < 1000) { -+ if (std::abs(micros) + kResolutionMicros < 1000) { - return now_micros / 1000; - } - return ClampTimeResolution(now_micros) / 1000; -diff -up chromium-119.0.6045.105/gpu/config/gpu_feature_info.h.missing-header-files chromium-119.0.6045.105/gpu/config/gpu_feature_info.h ---- chromium-119.0.6045.105/gpu/config/gpu_feature_info.h.missing-header-files 2023-11-01 19:10:28.000000000 +0100 -+++ chromium-119.0.6045.105/gpu/config/gpu_feature_info.h 2023-11-06 14:34:01.809869004 +0100 -@@ -7,6 +7,7 @@ - - #include - -+#include - #include - #include - -diff -up chromium-119.0.6045.105/net/base/net_export.h.missing-header-files chromium-119.0.6045.105/net/base/net_export.h ---- chromium-119.0.6045.105/net/base/net_export.h.missing-header-files 2023-11-01 19:10:32.000000000 +0100 -+++ chromium-119.0.6045.105/net/base/net_export.h 2023-11-06 14:34:01.809869004 +0100 -@@ -5,6 +5,8 @@ - #ifndef NET_BASE_NET_EXPORT_H_ - #define NET_BASE_NET_EXPORT_H_ - -+#include -+ - // Defines NET_EXPORT so that functionality implemented by the net module can - // be exported to consumers, and NET_EXPORT_PRIVATE that allows unit tests to - // access features not intended to be used directly by real consumers. -diff -up chromium-119.0.6045.105/pdf/document_attachment_info.h.missing-header-files chromium-119.0.6045.105/pdf/document_attachment_info.h ---- chromium-119.0.6045.105/pdf/document_attachment_info.h.missing-header-files 2023-11-01 19:10:34.000000000 +0100 -+++ chromium-119.0.6045.105/pdf/document_attachment_info.h 2023-11-06 14:34:01.815869132 +0100 -@@ -7,6 +7,7 @@ - - #include - -+#include - #include - - -diff -up chromium-119.0.6045.105/sandbox/linux/syscall_broker/broker_file_permission.h.missing-header-files chromium-119.0.6045.105/sandbox/linux/syscall_broker/broker_file_permission.h ---- chromium-119.0.6045.105/sandbox/linux/syscall_broker/broker_file_permission.h.missing-header-files 2023-11-01 19:10:34.000000000 +0100 -+++ chromium-119.0.6045.105/sandbox/linux/syscall_broker/broker_file_permission.h 2023-11-06 14:34:01.809869004 +0100 -@@ -5,6 +5,7 @@ - #ifndef SANDBOX_LINUX_SYSCALL_BROKER_BROKER_FILE_PERMISSION_H_ - #define SANDBOX_LINUX_SYSCALL_BROKER_BROKER_FILE_PERMISSION_H_ - -+#include - #include - #include - #include -diff -up chromium-119.0.6045.105/services/device/public/cpp/generic_sensor/sensor_reading.h.missing-header-files chromium-119.0.6045.105/services/device/public/cpp/generic_sensor/sensor_reading.h ---- chromium-119.0.6045.105/services/device/public/cpp/generic_sensor/sensor_reading.h.missing-header-files 2023-11-01 19:10:35.000000000 +0100 -+++ chromium-119.0.6045.105/services/device/public/cpp/generic_sensor/sensor_reading.h 2023-11-06 14:34:01.820869238 +0100 -@@ -8,6 +8,9 @@ - #include - #include - -+#include -+#include -+ - #include - - namespace device { -diff -up chromium-119.0.6045.105/skia/ext/skcolorspace_trfn.cc.missing-header-files chromium-119.0.6045.105/skia/ext/skcolorspace_trfn.cc ---- chromium-119.0.6045.105/skia/ext/skcolorspace_trfn.cc.missing-header-files 2023-11-01 19:10:35.000000000 +0100 -+++ chromium-119.0.6045.105/skia/ext/skcolorspace_trfn.cc 2023-11-06 14:34:01.818869196 +0100 -@@ -3,6 +3,7 @@ - // found in the LICENSE file. - - #include "skia/ext/skcolorspace_trfn.h" -+#include - - #include - -diff -up chromium-119.0.6045.105/third_party/abseil-cpp/absl/strings/string_view.h.missing-header-files chromium-119.0.6045.105/third_party/abseil-cpp/absl/strings/string_view.h ---- chromium-119.0.6045.105/third_party/abseil-cpp/absl/strings/string_view.h.missing-header-files 2023-11-01 19:10:36.000000000 +0100 -+++ chromium-119.0.6045.105/third_party/abseil-cpp/absl/strings/string_view.h 2023-11-06 14:34:01.809869004 +0100 -@@ -27,6 +27,7 @@ - #ifndef ABSL_STRINGS_STRING_VIEW_H_ - #define ABSL_STRINGS_STRING_VIEW_H_ - -+#include - #include - #include - #include -diff -up chromium-119.0.6045.105/third_party/angle/include/GLSLANG/ShaderVars.h.missing-header-files chromium-119.0.6045.105/third_party/angle/include/GLSLANG/ShaderVars.h ---- chromium-119.0.6045.105/third_party/angle/include/GLSLANG/ShaderVars.h.missing-header-files 2023-11-01 19:11:59.000000000 +0100 -+++ chromium-119.0.6045.105/third_party/angle/include/GLSLANG/ShaderVars.h 2023-11-06 14:34:01.810869025 +0100 -@@ -10,6 +10,7 @@ - #ifndef GLSLANG_SHADERVARS_H_ - #define GLSLANG_SHADERVARS_H_ - -+#include - #include - #include - #include -diff -up chromium-119.0.6045.105/third_party/blink/public/common/bluetooth/web_bluetooth_device_id.h.missing-header-files chromium-119.0.6045.105/third_party/blink/public/common/bluetooth/web_bluetooth_device_id.h ---- chromium-119.0.6045.105/third_party/blink/public/common/bluetooth/web_bluetooth_device_id.h.missing-header-files 2023-11-01 19:10:37.000000000 +0100 -+++ chromium-119.0.6045.105/third_party/blink/public/common/bluetooth/web_bluetooth_device_id.h 2023-11-06 14:34:01.810869025 +0100 -@@ -7,6 +7,7 @@ - - #include - -+#include - #include - #include - #include -diff -up chromium-119.0.6045.105/third_party/dawn/src/tint/lang/spirv/reader/ast_parser/namer.h.missing-header-files chromium-119.0.6045.105/third_party/dawn/src/tint/lang/spirv/reader/ast_parser/namer.h ---- chromium-119.0.6045.105/third_party/dawn/src/tint/lang/spirv/reader/ast_parser/namer.h.missing-header-files 2023-11-01 19:13:50.000000000 +0100 -+++ chromium-119.0.6045.105/third_party/dawn/src/tint/lang/spirv/reader/ast_parser/namer.h 2023-11-06 14:34:01.810869025 +0100 -@@ -15,6 +15,7 @@ - #ifndef SRC_TINT_LANG_SPIRV_READER_AST_PARSER_NAMER_H_ - #define SRC_TINT_LANG_SPIRV_READER_AST_PARSER_NAMER_H_ - -+#include - #include - #include - #include -diff -up chromium-119.0.6045.105/third_party/ipcz/src/ipcz/router_link.h.missing-header-files chromium-119.0.6045.105/third_party/ipcz/src/ipcz/router_link.h ---- chromium-119.0.6045.105/third_party/ipcz/src/ipcz/router_link.h.missing-header-files 2023-11-01 19:11:20.000000000 +0100 -+++ chromium-119.0.6045.105/third_party/ipcz/src/ipcz/router_link.h 2023-11-06 14:34:01.819869217 +0100 -@@ -5,6 +5,7 @@ - #ifndef IPCZ_SRC_IPCZ_ROUTER_LINK_H_ - #define IPCZ_SRC_IPCZ_ROUTER_LINK_H_ - -+#include - #include - #include - #include -diff -up chromium-119.0.6045.105/third_party/material_color_utilities/src/cpp/palettes/tones.cc.missing-header-files chromium-119.0.6045.105/third_party/material_color_utilities/src/cpp/palettes/tones.cc ---- chromium-119.0.6045.105/third_party/material_color_utilities/src/cpp/palettes/tones.cc.missing-header-files 2023-11-01 19:11:53.000000000 +0100 -+++ chromium-119.0.6045.105/third_party/material_color_utilities/src/cpp/palettes/tones.cc 2023-11-06 14:34:01.819869217 +0100 -@@ -14,6 +14,7 @@ - * limitations under the License. - */ - -+#include - #include "cpp/palettes/tones.h" - - #include "cpp/cam/cam.h" -diff -up chromium-119.0.6045.105/third_party/openscreen/src/discovery/dnssd/public/dns_sd_txt_record.h.missing-header-files chromium-119.0.6045.105/third_party/openscreen/src/discovery/dnssd/public/dns_sd_txt_record.h ---- chromium-119.0.6045.105/third_party/openscreen/src/discovery/dnssd/public/dns_sd_txt_record.h.missing-header-files 2023-11-01 19:11:59.000000000 +0100 -+++ chromium-119.0.6045.105/third_party/openscreen/src/discovery/dnssd/public/dns_sd_txt_record.h 2023-11-06 14:34:01.810869025 +0100 -@@ -7,6 +7,7 @@ - - #include - -+#include - #include - #include - #include -diff -up chromium-119.0.6045.105/third_party/pdfium/constants/annotation_flags.h.missing-header-files chromium-119.0.6045.105/third_party/pdfium/constants/annotation_flags.h ---- chromium-119.0.6045.105/third_party/pdfium/constants/annotation_flags.h.missing-header-files 2023-11-01 19:14:48.000000000 +0100 -+++ chromium-119.0.6045.105/third_party/pdfium/constants/annotation_flags.h 2023-11-06 14:34:01.815869132 +0100 -@@ -7,6 +7,8 @@ - - #include - -+#include -+ - namespace pdfium { - namespace annotation_flags { - -diff -up chromium-119.0.6045.105/third_party/ruy/src/ruy/profiler/instrumentation.h.missing-header-files chromium-119.0.6045.105/third_party/ruy/src/ruy/profiler/instrumentation.h ---- chromium-119.0.6045.105/third_party/ruy/src/ruy/profiler/instrumentation.h.missing-header-files 2023-11-01 19:12:02.000000000 +0100 -+++ chromium-119.0.6045.105/third_party/ruy/src/ruy/profiler/instrumentation.h 2023-11-06 14:34:01.813869089 +0100 -@@ -17,6 +17,7 @@ limitations under the License. - #define RUY_RUY_PROFILER_INSTRUMENTATION_H_ - - #ifdef RUY_PROFILER -+#include - #include - #include - #include -diff -up chromium-119.0.6045.105/third_party/swiftshader/src/System/LRUCache.hpp.missing-header-files chromium-119.0.6045.105/third_party/swiftshader/src/System/LRUCache.hpp ---- chromium-119.0.6045.105/third_party/swiftshader/src/System/LRUCache.hpp.missing-header-files 2023-11-01 19:12:15.000000000 +0100 -+++ chromium-119.0.6045.105/third_party/swiftshader/src/System/LRUCache.hpp 2023-11-06 14:34:01.810869025 +0100 -@@ -17,6 +17,7 @@ - - #include "System/Debug.hpp" - -+#include - #include - #include - #include -diff -up chromium-119.0.6045.105/third_party/swiftshader/third_party/llvm-10.0/llvm/lib/Support/Unix/Signals.inc.missing-header-files chromium-119.0.6045.105/third_party/swiftshader/third_party/llvm-10.0/llvm/lib/Support/Unix/Signals.inc ---- chromium-119.0.6045.105/third_party/swiftshader/third_party/llvm-10.0/llvm/lib/Support/Unix/Signals.inc.missing-header-files 2023-11-01 19:12:42.000000000 +0100 -+++ chromium-119.0.6045.105/third_party/swiftshader/third_party/llvm-10.0/llvm/lib/Support/Unix/Signals.inc 2023-11-06 14:34:01.814869110 +0100 -@@ -45,6 +45,7 @@ - #include "llvm/Support/SaveAndRestore.h" - #include "llvm/Support/raw_ostream.h" - #include -+#include - #include - #include - #ifdef HAVE_BACKTRACE -diff -up chromium-119.0.6045.105/third_party/tflite/src/tensorflow/lite/kernels/internal/spectrogram.h.missing-header-files chromium-119.0.6045.105/third_party/tflite/src/tensorflow/lite/kernels/internal/spectrogram.h ---- chromium-119.0.6045.105/third_party/tflite/src/tensorflow/lite/kernels/internal/spectrogram.h.missing-header-files 2023-11-01 19:13:20.000000000 +0100 -+++ chromium-119.0.6045.105/third_party/tflite/src/tensorflow/lite/kernels/internal/spectrogram.h 2023-11-06 14:34:01.813869089 +0100 -@@ -31,6 +31,7 @@ limitations under the License. - #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_SPECTROGRAM_H_ - #define TENSORFLOW_LITE_KERNELS_INTERNAL_SPECTROGRAM_H_ - -+#include - #include - #include - #include -diff -up chromium-119.0.6045.105/third_party/vulkan-deps/vulkan-validation-layers/src/layers/external/vma/vk_mem_alloc.h.missing-header-files chromium-119.0.6045.105/third_party/vulkan-deps/vulkan-validation-layers/src/layers/external/vma/vk_mem_alloc.h ---- chromium-119.0.6045.105/third_party/vulkan-deps/vulkan-validation-layers/src/layers/external/vma/vk_mem_alloc.h.missing-header-files 2023-11-01 19:12:45.000000000 +0100 -+++ chromium-119.0.6045.105/third_party/vulkan-deps/vulkan-validation-layers/src/layers/external/vma/vk_mem_alloc.h 2023-11-06 14:34:01.817869174 +0100 -@@ -2884,6 +2884,7 @@ static void vma_aligned_free(void* VMA_N - - // Define this macro to 1 to enable functions: vmaBuildStatsString, vmaFreeStatsString. - #if VMA_STATS_STRING_ENABLED -+#include - static inline void VmaUint32ToStr(char* VMA_NOT_NULL outStr, size_t strLen, uint32_t num) - { - snprintf(outStr, strLen, "%u", static_cast(num)); -diff -up chromium-119.0.6045.105/third_party/vulkan_memory_allocator/include/vk_mem_alloc.h.missing-header-files chromium-119.0.6045.105/third_party/vulkan_memory_allocator/include/vk_mem_alloc.h ---- chromium-119.0.6045.105/third_party/vulkan_memory_allocator/include/vk_mem_alloc.h.missing-header-files 2023-11-01 19:12:13.000000000 +0100 -+++ chromium-119.0.6045.105/third_party/vulkan_memory_allocator/include/vk_mem_alloc.h 2023-11-06 14:34:01.812869068 +0100 -@@ -2388,6 +2388,7 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeV - #ifdef VMA_IMPLEMENTATION - #undef VMA_IMPLEMENTATION - -+#include - #include - #include - #include -diff -up chromium-119.0.6045.105/third_party/webrtc/audio/utility/channel_mixer.cc.missing-header-files chromium-119.0.6045.105/third_party/webrtc/audio/utility/channel_mixer.cc ---- chromium-119.0.6045.105/third_party/webrtc/audio/utility/channel_mixer.cc.missing-header-files 2023-11-01 19:14:05.000000000 +0100 -+++ chromium-119.0.6045.105/third_party/webrtc/audio/utility/channel_mixer.cc 2023-11-06 14:34:01.819869217 +0100 -@@ -8,6 +8,8 @@ - * be found in the AUTHORS file in the root of the source tree. - */ - -+#include -+ - #include "audio/utility/channel_mixer.h" - - #include "audio/utility/channel_mixing_matrix.h" -diff -up chromium-119.0.6045.105/third_party/webrtc/common_video/h264/sps_parser.h.missing-header-files chromium-119.0.6045.105/third_party/webrtc/common_video/h264/sps_parser.h ---- chromium-119.0.6045.105/third_party/webrtc/common_video/h264/sps_parser.h.missing-header-files 2023-11-01 19:14:06.000000000 +0100 -+++ chromium-119.0.6045.105/third_party/webrtc/common_video/h264/sps_parser.h 2023-11-06 14:34:01.819869217 +0100 -@@ -11,6 +11,7 @@ - #ifndef COMMON_VIDEO_H264_SPS_PARSER_H_ - #define COMMON_VIDEO_H264_SPS_PARSER_H_ - -+#include - #include "absl/types/optional.h" - #include "rtc_base/bitstream_reader.h" - -diff -up chromium-119.0.6045.105/third_party/webrtc/modules/include/module_common_types_public.h.missing-header-files chromium-119.0.6045.105/third_party/webrtc/modules/include/module_common_types_public.h ---- chromium-119.0.6045.105/third_party/webrtc/modules/include/module_common_types_public.h.missing-header-files 2023-11-01 19:14:11.000000000 +0100 -+++ chromium-119.0.6045.105/third_party/webrtc/modules/include/module_common_types_public.h 2023-11-06 14:34:01.819869217 +0100 -@@ -11,6 +11,7 @@ - #ifndef MODULES_INCLUDE_MODULE_COMMON_TYPES_PUBLIC_H_ - #define MODULES_INCLUDE_MODULE_COMMON_TYPES_PUBLIC_H_ - -+#include - #include - - #include "absl/types/optional.h" -diff -up chromium-119.0.6045.105/third_party/webrtc/modules/video_coding/utility/ivf_file_reader.cc.missing-header-files chromium-119.0.6045.105/third_party/webrtc/modules/video_coding/utility/ivf_file_reader.cc ---- chromium-119.0.6045.105/third_party/webrtc/modules/video_coding/utility/ivf_file_reader.cc.missing-header-files 2023-11-01 19:14:12.000000000 +0100 -+++ chromium-119.0.6045.105/third_party/webrtc/modules/video_coding/utility/ivf_file_reader.cc 2023-11-06 14:34:01.819869217 +0100 -@@ -10,6 +10,7 @@ - - #include "modules/video_coding/utility/ivf_file_reader.h" - -+#include - #include - #include - -diff -up chromium-119.0.6045.105/ui/base/prediction/kalman_filter.h.missing-header-files chromium-119.0.6045.105/ui/base/prediction/kalman_filter.h ---- chromium-119.0.6045.105/ui/base/prediction/kalman_filter.h.missing-header-files 2023-11-01 19:11:28.000000000 +0100 -+++ chromium-119.0.6045.105/ui/base/prediction/kalman_filter.h 2023-11-06 14:34:01.814869110 +0100 -@@ -7,6 +7,8 @@ - - #include - -+#include -+ - #include "base/component_export.h" - #include "ui/gfx/geometry/matrix3_f.h" - -diff -up chromium-119.0.6045.105/ui/gfx/geometry/linear_gradient.h.missing-header-files chromium-119.0.6045.105/ui/gfx/geometry/linear_gradient.h ---- chromium-119.0.6045.105/ui/gfx/geometry/linear_gradient.h.missing-header-files 2023-11-01 19:11:28.000000000 +0100 -+++ chromium-119.0.6045.105/ui/gfx/geometry/linear_gradient.h 2023-11-06 14:34:01.812869068 +0100 -@@ -7,6 +7,7 @@ - - #include - -+#include - #include - #include - #include -diff -up chromium-119.0.6045.105/ui/gfx/linux/drm_util_linux.h.missing-header-files chromium-119.0.6045.105/ui/gfx/linux/drm_util_linux.h ---- chromium-119.0.6045.105/ui/gfx/linux/drm_util_linux.h.missing-header-files 2023-11-01 19:11:28.000000000 +0100 -+++ chromium-119.0.6045.105/ui/gfx/linux/drm_util_linux.h 2023-11-06 14:34:01.819869217 +0100 -@@ -9,6 +9,8 @@ - - #include "ui/gfx/buffer_types.h" - -+#include -+ - namespace ui { - - int GetFourCCFormatFromBufferFormat(gfx::BufferFormat format); diff --git a/chromium-119-nullptr_t-without-namespace-std.patch b/chromium-119-nullptr_t-without-namespace-std.patch deleted file mode 100644 index 5cb969f4f40cf72e909b1517b73d891b829185cd..0000000000000000000000000000000000000000 --- a/chromium-119-nullptr_t-without-namespace-std.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -up chromium-119.0.6045.59/third_party/blink/renderer/core/paint/fragment_data_iterator.h.me chromium-119.0.6045.59/third_party/blink/renderer/core/paint/fragment_data_iterator.h ---- chromium-119.0.6045.59/third_party/blink/renderer/core/paint/fragment_data_iterator.h.me 2023-10-27 20:07:16.421230815 +0200 -+++ chromium-119.0.6045.59/third_party/blink/renderer/core/paint/fragment_data_iterator.h 2023-10-27 20:07:36.883600085 +0200 -@@ -52,7 +52,7 @@ class FragmentDataIterator - public: - explicit FragmentDataIterator(const LayoutObject& object) - : FragmentDataIteratorBase(&object.FirstFragment()) {} -- explicit FragmentDataIterator(nullptr_t) -+ explicit FragmentDataIterator(std::nullptr_t) - : FragmentDataIteratorBase(nullptr) {} - }; - -@@ -63,7 +63,7 @@ class MutableFragmentDataIterator - explicit MutableFragmentDataIterator(const LayoutObject& object) - : FragmentDataIteratorBase( - &object.GetMutableForPainting().FirstFragment()) {} -- explicit MutableFragmentDataIterator(nullptr_t) -+ explicit MutableFragmentDataIterator(std::nullptr_t) - : FragmentDataIteratorBase(nullptr) {} - }; - diff --git a/chromium-119-nvidia-use-separate-bo-to-verify-modifier.patch b/chromium-119-nvidia-use-separate-bo-to-verify-modifier.patch deleted file mode 100644 index 717d897446c7c43dc3f352715e7170ef963c124c..0000000000000000000000000000000000000000 --- a/chromium-119-nvidia-use-separate-bo-to-verify-modifier.patch +++ /dev/null @@ -1,164 +0,0 @@ -commit bdcc23e0a5e7e220660d3f54c97262f9a4c31606 -Author: Nick Diego Yamane -Date: Thu Nov 2 17:26:25 2023 +0000 - - gbm: nvidia: use separate bo to verify modifiers - - Buggy Nvidia drivers fail to return FDs for planes of a BO which had - already an imported BO destroyed before. This is a workaround for that - issue, which consists of creating/destroying a separate 1x1 BO for - validating the modifiers before actually creating the final requested - BO, which for now is limited to IS_LINUX builds. - - The Nvidia driver bug is being tracked under internal bug 4315529. There - seems to be other issues when running under Wayland with Nvidia, which - will be tracked and addressed in separate patches. - - R=dcastagna, msisov@igalia.com - - with ozone/wayland backend and verify GPU acceleration is not broken. - - Test: In a single Nvidia GPU setup, with proprietary driver, run Chrome - Bug: 1273758, 1478684, 1463851 - Change-Id: I9f322bcf40b460bcd4ead02f05dd2e9a8d271cea - Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4989782 - Reviewed-by: Maksim Sisov - Commit-Queue: Nick Yamane - Cr-Commit-Position: refs/heads/main@{#1218924} - -diff --git a/ui/gfx/linux/gbm_wrapper.cc b/ui/gfx/linux/gbm_wrapper.cc -index bf90b76605f68..14918c19c0ab0 100644 ---- a/ui/gfx/linux/gbm_wrapper.cc -+++ b/ui/gfx/linux/gbm_wrapper.cc -@@ -11,6 +11,7 @@ - #include "base/logging.h" - #include "base/memory/raw_ptr.h" - #include "base/memory/raw_ptr_exclusion.h" -+#include "base/numerics/safe_conversions.h" - #include "base/posix/eintr_wrapper.h" - #include "skia/ext/legacy_display_globals.h" - #include "third_party/skia/include/core/SkSurface.h" -@@ -71,6 +72,7 @@ base::ScopedFD GetPlaneFdForBo(gbm_bo* bo, size_t plane) { - int ret; - // Use DRM_RDWR to allow the fd to be mappable in another process. - ret = drmPrimeHandleToFD(dev_fd, plane_handle, DRM_CLOEXEC | DRM_RDWR, &fd); -+ PLOG_IF(ERROR, ret != 0) << "Failed to get fd for plane."; - - // Older DRM implementations blocked DRM_RDWR, but gave a read/write mapping - // anyways -@@ -301,58 +303,82 @@ class Device final : public ui::GbmDevice { - - std::unique_ptr CreateBufferWithModifiers( - uint32_t format, -- const gfx::Size& size, -+ const gfx::Size& requested_size, - uint32_t flags, - const std::vector& modifiers) override { -- if (modifiers.empty()) -- return CreateBuffer(format, size, flags); -- -- std::vector filtered_modifiers = -- GetFilteredModifiers(format, flags, modifiers); -- struct gbm_bo* bo = nullptr; -- while (filtered_modifiers.size() > 0) { -- bo = gbm_bo_create_with_modifiers(device_, size.width(), size.height(), -- format, filtered_modifiers.data(), -- filtered_modifiers.size()); -- if (!bo) { -+ if (modifiers.empty()) { -+ return CreateBuffer(format, requested_size, flags); -+ } -+ -+ // Buggy drivers prevent us from getting plane FDs from a BO which had its -+ // previously imported BO destroyed. E.g: Nvidia. Thus, on Linux Desktop, we -+ // do the create/import modifiers validation loop below using a separate set -+ // of 1x1 BOs which are destroyed before creating the final BO creation used -+ // to instantiate the returned GbmBuffer. -+ gfx::Size size = -+#if BUILDFLAG(IS_LINUX) -+ gfx::Size(1, 1); -+#else -+ requested_size; -+#endif -+ auto filtered_modifiers = GetFilteredModifiers(format, flags, modifiers); -+ struct gbm_bo* created_bo = nullptr; -+ bool valid_modifiers = false; -+ -+ while (!valid_modifiers && !filtered_modifiers.empty()) { -+ created_bo = gbm_bo_create_with_modifiers( -+ device_, size.width(), size.height(), format, -+ filtered_modifiers.data(), filtered_modifiers.size()); -+ if (!created_bo) { - return nullptr; - } - -- struct gbm_import_fd_modifier_data fd_data; -- fd_data.width = size.width(); -- fd_data.height = size.height(); -- fd_data.format = format; -- fd_data.num_fds = gbm_bo_get_plane_count(bo); -- fd_data.modifier = gbm_bo_get_modifier(bo); -- -- // Store fds in the vector of base::ScopedFDs. Will be released -- // automatically. -+ const int planes_count = gbm_bo_get_plane_count(created_bo); -+ struct gbm_import_fd_modifier_data fd_data = { -+ .width = base::checked_cast(size.width()), -+ .height = base::checked_cast(size.height()), -+ .format = format, -+ .num_fds = base::checked_cast(planes_count), -+ .modifier = gbm_bo_get_modifier(created_bo)}; -+ // Store fds in a base::ScopedFDs vector. Will be released automatically. - std::vector fds; - for (size_t i = 0; i < static_cast(fd_data.num_fds); ++i) { -- fds.emplace_back(GetPlaneFdForBo(bo, i)); -+ fds.emplace_back(GetPlaneFdForBo(created_bo, i)); - fd_data.fds[i] = fds.back().get(); -- fd_data.strides[i] = gbm_bo_get_stride_for_plane(bo, i); -- fd_data.offsets[i] = gbm_bo_get_offset(bo, i); -+ fd_data.strides[i] = gbm_bo_get_stride_for_plane(created_bo, i); -+ fd_data.offsets[i] = gbm_bo_get_offset(created_bo, i); - } - -- struct gbm_bo* bo_import = -+ struct gbm_bo* imported_bo = - gbm_bo_import(device_, GBM_BO_IMPORT_FD_MODIFIER, &fd_data, flags); -- if (bo_import) { -- gbm_bo_destroy(bo_import); -- break; -+ -+ if (imported_bo) { -+ valid_modifiers = true; -+ gbm_bo_destroy(imported_bo); - } else { -- gbm_bo_destroy(bo); -- bo = nullptr; - AddModifierToBlocklist(format, flags, fd_data.modifier); - filtered_modifiers = - GetFilteredModifiers(format, flags, filtered_modifiers); - } -+ -+ if (!valid_modifiers || size != requested_size) { -+ gbm_bo_destroy(created_bo); -+ created_bo = nullptr; -+ } - } -- if (!bo) { -- return nullptr; -+ -+ // If modifiers were successfully verified though `created_bo` is null here, -+ // it it means that the buffer created for verification could not be reused, -+ // ie: different size, so create it now with the `requested_size`. -+ if (valid_modifiers && !created_bo) { -+ created_bo = gbm_bo_create_with_modifiers( -+ device_, requested_size.width(), requested_size.height(), format, -+ filtered_modifiers.data(), filtered_modifiers.size()); -+ PLOG_IF(ERROR, !created_bo) << "Failed to create BO with modifiers."; - } - -- return CreateBufferForBO(bo, format, size, flags); -+ return created_bo ? CreateBufferForBO(created_bo, format, size, flags) -+ : nullptr; - } - - std::unique_ptr CreateBufferFromHandle( diff --git a/chromium-119-revert-av1enc-el9.patch b/chromium-119-revert-av1enc-el9.patch deleted file mode 100644 index b533ab9f304e7f49c10afda7e0aa3f8a44e718e9..0000000000000000000000000000000000000000 --- a/chromium-119-revert-av1enc-el9.patch +++ /dev/null @@ -1,121 +0,0 @@ -diff -up chromium-114.0.5735.35/media/gpu/vaapi/vaapi_video_encode_accelerator.cc.me chromium-114.0.5735.35/media/gpu/vaapi/vaapi_video_encode_accelerator.cc ---- chromium-114.0.5735.35/media/gpu/vaapi/vaapi_video_encode_accelerator.cc.me 2023-05-21 10:05:00.357860329 +0200 -+++ chromium-114.0.5735.35/media/gpu/vaapi/vaapi_video_encode_accelerator.cc 2023-05-21 10:18:09.665432735 +0200 -@@ -41,7 +41,6 @@ - #include "media/gpu/gpu_video_encode_accelerator_helpers.h" - #include "media/gpu/h264_dpb.h" - #include "media/gpu/macros.h" --#include "media/gpu/vaapi/av1_vaapi_video_encoder_delegate.h" - #include "media/gpu/vaapi/h264_vaapi_video_encoder_delegate.h" - #include "media/gpu/vaapi/va_surface.h" - #include "media/gpu/vaapi/vaapi_common.h" -@@ -200,7 +199,7 @@ bool VaapiVideoEncodeAccelerator::Initia - - const VideoCodec codec = VideoCodecProfileToVideoCodec(config.output_profile); - if (codec != VideoCodec::kH264 && codec != VideoCodec::kVP8 && -- codec != VideoCodec::kVP9 && codec != VideoCodec::kAV1) { -+ codec != VideoCodec::kVP9) { - MEDIA_LOG(ERROR, media_log.get()) - << "Unsupported profile: " << GetProfileName(config.output_profile); - return false; -@@ -293,7 +292,6 @@ void VaapiVideoEncodeAccelerator::Initia - break; - case VideoCodec::kVP8: - case VideoCodec::kVP9: -- case VideoCodec::kAV1: - mode = VaapiWrapper::kEncodeConstantQuantizationParameter; - break; - default: -@@ -356,12 +354,6 @@ void VaapiVideoEncodeAccelerator::Initia - vaapi_wrapper_, error_cb); - } - break; -- case VideoCodec::kAV1: -- if (!IsConfiguredForTesting()) { -- encoder_ = std::make_unique( -- vaapi_wrapper_, error_cb); -- } -- break; - default: - NOTREACHED() << "Unsupported codec type " << GetCodecName(output_codec_); - return; -@@ -835,10 +827,6 @@ VaapiVideoEncodeAccelerator::CreateEncod - case VideoCodec::kVP9: - picture = new VaapiVP9Picture(std::move(reconstructed_surface)); - break; -- case VideoCodec::kAV1: -- picture = new VaapiAV1Picture(/*display_va_surface=*/nullptr, -- std::move(reconstructed_surface)); -- break; - default: - return nullptr; - } -diff -up chromium-114.0.5735.35/media/gpu/BUILD.gn.revert-av1enc chromium-114.0.5735.35/media/gpu/BUILD.gn ---- chromium-114.0.5735.35/media/gpu/BUILD.gn.revert-av1enc 2023-05-18 00:37:57.000000000 +0200 -+++ chromium-114.0.5735.35/media/gpu/BUILD.gn 2023-05-20 13:14:10.755183630 +0200 -@@ -373,10 +373,7 @@ source_set("common") { - "vp9_svc_layers.h", - ] - configs += [ "//third_party/libvpx:libvpx_config" ] -- deps += [ -- "//third_party/libaom:libaomrc", -- "//third_party/libvpx:libvpxrc", -- ] -+ deps += [ "//third_party/libvpx:libvpxrc" ] - } - if (use_libgav1_parser) { - sources += [ -diff -up chromium-114.0.5735.35/media/gpu/vaapi/BUILD.gn.revert-av1enc chromium-114.0.5735.35/media/gpu/vaapi/BUILD.gn ---- chromium-114.0.5735.35/media/gpu/vaapi/BUILD.gn.revert-av1enc 2023-05-18 00:37:57.000000000 +0200 -+++ chromium-114.0.5735.35/media/gpu/vaapi/BUILD.gn 2023-05-20 13:14:10.756183626 +0200 -@@ -38,8 +38,6 @@ source_set("vaapi") { - sources = [ - "av1_vaapi_video_decoder_delegate.cc", - "av1_vaapi_video_decoder_delegate.h", -- "av1_vaapi_video_encoder_delegate.cc", -- "av1_vaapi_video_encoder_delegate.h", - "h264_vaapi_video_decoder_delegate.cc", - "h264_vaapi_video_decoder_delegate.h", - "h264_vaapi_video_encoder_delegate.cc", -@@ -107,7 +105,6 @@ source_set("vaapi") { - "//media/gpu/chromeos:common", - "//media/parsers", - "//mojo/public/cpp/bindings", -- "//third_party/libaom:libaomrc", - "//third_party/libvpx:libvpxrc", - "//third_party/libyuv", - "//ui/gfx", -diff -up chromium-119.0.6045.105/media/gpu/vaapi/vaapi_wrapper.cc.me chromium-119.0.6045.105/media/gpu/vaapi/vaapi_wrapper.cc ---- chromium-119.0.6045.105/media/gpu/vaapi/vaapi_wrapper.cc.me 2023-11-02 15:08:30.921325747 +0100 -+++ chromium-119.0.6045.105/media/gpu/vaapi/vaapi_wrapper.cc 2023-11-02 15:09:46.123692602 +0100 -@@ -3124,6 +3124,7 @@ bool VaapiWrapper::GetSupportedPackedHea - return true; - } - -+#if 0 //disable AV1 due to old libva on epel9 - bool VaapiWrapper::GetMinAV1SegmentSize(VideoCodecProfile profile, - uint32_t& min_seg_size) { - CHECK(!enforce_sequence_affinity_ || -@@ -3141,6 +3142,7 @@ bool VaapiWrapper::GetMinAV1SegmentSize( - - return true; - } -+#endif - - bool VaapiWrapper::BlitSurface(const VASurface& va_surface_src, - const VASurface& va_surface_dest, -diff -up chromium-119.0.6045.105/media/gpu/vaapi/vaapi_wrapper.h.me chromium-119.0.6045.105/media/gpu/vaapi/vaapi_wrapper.h ---- chromium-119.0.6045.105/media/gpu/vaapi/vaapi_wrapper.h.me 2023-11-02 15:09:58.973928395 +0100 -+++ chromium-119.0.6045.105/media/gpu/vaapi/vaapi_wrapper.h 2023-11-02 15:10:45.990791114 +0100 -@@ -553,9 +553,11 @@ class MEDIA_GPU_EXPORT VaapiWrapper - bool& packed_pps, - bool& packed_slice); - -+#if 0 //disable AV1 due to old libva on epel9 - // Gets the minimum segment block size supported for AV1 encoding. - [[nodiscard]] bool GetMinAV1SegmentSize(VideoCodecProfile profile, - uint32_t& min_seg_size); -+#endif - - // Blits a VASurface |va_surface_src| into another VASurface - // |va_surface_dest| applying pixel format conversion, cropping diff --git a/chromium-119-system-libusb.patch b/chromium-119-system-libusb.patch deleted file mode 100644 index d147fe07aabab1ae99981a2fdc4242aa738db56f..0000000000000000000000000000000000000000 --- a/chromium-119-system-libusb.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff -up chromium-119.0.6045.105/build/linux/unbundle/libusb.gn.gnsystem chromium-119.0.6045.105/build/linux/unbundle/libusb.gn ---- chromium-119.0.6045.105/build/linux/unbundle/libusb.gn.gnsystem 2023-11-06 12:22:08.550625387 +0100 -+++ chromium-119.0.6045.105/build/linux/unbundle/libusb.gn 2023-11-06 12:22:08.550625387 +0100 -@@ -0,0 +1,24 @@ -+# Copyright 2016 The Chromium Authors. All rights reserved. -+# Use of this source code is governed by a BSD-style license that can be -+# found in the LICENSE file. -+ -+import("//build/config/linux/pkg_config.gni") -+import("//build/shim_headers.gni") -+ -+pkg_config("system_libusb") { -+ packages = [ "libusb-1.0" ] -+} -+ -+shim_headers("libusb_shim") { -+ root_path = "src/libusb" -+ headers = [ -+ "libusb.h", -+ ] -+} -+ -+source_set("libusb") { -+ deps = [ -+ ":libusb_shim", -+ ] -+ public_configs = [ ":system_libusb" ] -+} -diff -up chromium-119.0.6045.105/build/linux/unbundle/replace_gn_files.py.gnsystem chromium-119.0.6045.105/build/linux/unbundle/replace_gn_files.py ---- chromium-119.0.6045.105/build/linux/unbundle/replace_gn_files.py.gnsystem 2023-11-06 12:22:08.550625387 +0100 -+++ chromium-119.0.6045.105/build/linux/unbundle/replace_gn_files.py 2023-11-06 12:28:28.295776501 +0100 -@@ -54,6 +54,7 @@ REPLACEMENTS = { - 'libevent': 'third_party/libevent/BUILD.gn', - 'libjpeg': 'third_party/libjpeg.gni', - 'libpng': 'third_party/libpng/BUILD.gn', -+ 'libusb': 'third_party/libusb/BUILD.gn', - 'libvpx': 'third_party/libvpx/BUILD.gn', - 'libwebp': 'third_party/libwebp/BUILD.gn', - 'libxml': 'third_party/libxml/BUILD.gn', diff --git a/chromium-119-system-minizip-header-fix.patch b/chromium-119-system-minizip-header-fix.patch deleted file mode 100644 index 14ac00b47067ac41173fe518878f11722bd7a68e..0000000000000000000000000000000000000000 --- a/chromium-119-system-minizip-header-fix.patch +++ /dev/null @@ -1,65 +0,0 @@ -diff -up chromium-119.0.6045.105/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc.system-minizip chromium-119.0.6045.105/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc ---- chromium-119.0.6045.105/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc.system-minizip 2023-11-06 12:42:34.928657960 +0100 -+++ chromium-119.0.6045.105/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc 2023-11-06 12:51:12.547834851 +0100 -@@ -28,9 +28,8 @@ limitations under the License. - #include "tensorflow_lite_support/cc/port/status_macros.h" - #include "tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h" - #include "tensorflow_lite_support/metadata/metadata_schema_generated.h" --#include "third_party/zlib/contrib/minizip/ioapi.h" --#include "third_party/zlib/contrib/minizip/unzip.h" -- -+#include -+#include - - namespace tflite { - namespace metadata { -diff -up chromium-119.0.6045.105/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc.system-minizip chromium-119.0.6045.105/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc ---- chromium-119.0.6045.105/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc.system-minizip 2023-11-01 19:11:24.000000000 +0100 -+++ chromium-119.0.6045.105/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc 2023-11-06 12:42:34.928657960 +0100 -@@ -26,8 +26,8 @@ limitations under the License. - #include "tensorflow_lite_support/cc/port/statusor.h" - #include "tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h" - #include "tensorflow_lite_support/metadata/metadata_schema_generated.h" --#include "third_party/zlib/contrib/minizip/ioapi.h" --#include "third_party/zlib/contrib/minizip/unzip.h" -+#include -+#include - - namespace tflite { - namespace metadata { -diff -up chromium-119.0.6045.105/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc.system-minizip chromium-119.0.6045.105/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc ---- chromium-119.0.6045.105/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc.system-minizip 2023-11-01 19:11:24.000000000 +0100 -+++ chromium-119.0.6045.105/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc 2023-11-06 12:42:34.929657982 +0100 -@@ -19,7 +19,7 @@ limitations under the License. - #include - - #include "absl/strings/string_view.h" // from @com_google_absl --#include "third_party/zlib/contrib/minizip/ioapi.h" -+#include - - namespace tflite { - namespace metadata { -diff -up chromium-119.0.6045.105/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc.system-minizip chromium-119.0.6045.105/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc ---- chromium-119.0.6045.105/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc.system-minizip 2023-11-01 19:11:24.000000000 +0100 -+++ chromium-119.0.6045.105/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc 2023-11-06 12:42:34.929657982 +0100 -@@ -19,7 +19,7 @@ limitations under the License. - #include - - #include "absl/strings/string_view.h" // from @com_google_absl --#include "third_party/zlib/contrib/minizip/ioapi.h" -+#include - - namespace tflite { - namespace metadata { -diff -up chromium-119.0.6045.105/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h.system-minizip chromium-119.0.6045.105/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h ---- chromium-119.0.6045.105/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h.system-minizip 2023-11-01 19:11:24.000000000 +0100 -+++ chromium-119.0.6045.105/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h 2023-11-06 12:42:34.929657982 +0100 -@@ -19,7 +19,7 @@ limitations under the License. - #include - - #include "absl/strings/string_view.h" // from @com_google_absl --#include "third_party/zlib/contrib/minizip/ioapi.h" -+#include - - namespace tflite { - namespace metadata { diff --git a/chromium-120-emplace.patch b/chromium-120-emplace.patch new file mode 100644 index 0000000000000000000000000000000000000000..f12d325bff9f27f5cf267f2c498febaa46aa8320 --- /dev/null +++ b/chromium-120-emplace.patch @@ -0,0 +1,463 @@ +Index: chromium-123.0.6312.46/third_party/webrtc/modules/congestion_controller/goog_cc/loss_based_bwe_v2.cc +=================================================================== +--- chromium-123.0.6312.46.orig/third_party/webrtc/modules/congestion_controller/goog_cc/loss_based_bwe_v2.cc ++++ chromium-123.0.6312.46/third_party/webrtc/modules/congestion_controller/goog_cc/loss_based_bwe_v2.cc +@@ -549,7 +549,7 @@ absl::optional L + if (!enabled.Get()) { + return config; + } +- config.emplace(); ++ config.emplace(Config()); + config->bandwidth_rampup_upper_bound_factor = + bandwidth_rampup_upper_bound_factor.Get(); + config->bandwidth_rampup_upper_bound_factor_in_hold = +Index: chromium-123.0.6312.46/ui/gfx/x/generated_protos/randr.cc +=================================================================== +--- chromium-123.0.6312.46.orig/ui/gfx/x/generated_protos/randr.cc ++++ chromium-123.0.6312.46/ui/gfx/x/generated_protos/randr.cc +@@ -305,7 +305,7 @@ void ReadEvent(RandR + // data + auto data_expr = subCode; + if (CaseEq(data_expr, RandR::Notify::CrtcChange)) { +- data.cc.emplace(); ++ data.cc.emplace(RandR::NotifyEvent::Cc()); + auto& timestamp = (*data.cc).timestamp; + auto& window = (*data.cc).window; + auto& crtc = (*data.cc).crtc; +@@ -349,7 +349,7 @@ void ReadEvent(RandR + Read(&height, &buf); + } + if (CaseEq(data_expr, RandR::Notify::OutputChange)) { +- data.oc.emplace(); ++ data.oc.emplace(RandR::NotifyEvent::Oc()); + auto& timestamp = (*data.oc).timestamp; + auto& config_timestamp = (*data.oc).config_timestamp; + auto& window = (*data.oc).window; +@@ -394,7 +394,7 @@ void ReadEvent(RandR + subpixel_order = static_cast(tmp6); + } + if (CaseEq(data_expr, RandR::Notify::OutputProperty)) { +- data.op.emplace(); ++ data.op.emplace(RandR::NotifyEvent::Op()); + auto& window = (*data.op).window; + auto& output = (*data.op).output; + auto& atom = (*data.op).atom; +@@ -422,7 +422,7 @@ void ReadEvent(RandR + Pad(&buf, 11); + } + if (CaseEq(data_expr, RandR::Notify::ProviderChange)) { +- data.pc.emplace(); ++ data.pc.emplace(RandR::NotifyEvent::Pc()); + auto& timestamp = (*data.pc).timestamp; + auto& window = (*data.pc).window; + auto& provider = (*data.pc).provider; +@@ -440,7 +440,7 @@ void ReadEvent(RandR + Pad(&buf, 16); + } + if (CaseEq(data_expr, RandR::Notify::ProviderProperty)) { +- data.pp.emplace(); ++ data.pp.emplace(RandR::NotifyEvent::Pp()); + auto& window = (*data.pp).window; + auto& provider = (*data.pp).provider; + auto& atom = (*data.pp).atom; +@@ -466,7 +466,7 @@ void ReadEvent(RandR + Pad(&buf, 11); + } + if (CaseEq(data_expr, RandR::Notify::ResourceChange)) { +- data.rc.emplace(); ++ data.rc.emplace(RandR::NotifyEvent::Rc()); + auto& timestamp = (*data.rc).timestamp; + auto& window = (*data.rc).window; + +@@ -480,7 +480,7 @@ void ReadEvent(RandR + Pad(&buf, 20); + } + if (CaseEq(data_expr, RandR::Notify::Lease)) { +- data.lc.emplace(); ++ data.lc.emplace(RandR::NotifyEvent::Lc()); + auto& timestamp = (*data.lc).timestamp; + auto& window = (*data.lc).window; + auto& lease = (*data.lc).lease; +Index: chromium-123.0.6312.46/ui/gfx/x/generated_protos/xkb.cc +=================================================================== +--- chromium-123.0.6312.46.orig/ui/gfx/x/generated_protos/xkb.cc ++++ chromium-123.0.6312.46/ui/gfx/x/generated_protos/xkb.cc +@@ -5276,7 +5276,7 @@ std::unique_ptr + if (CaseAnd(replies_expr, Xkb::GBNDetail::Types) || + CaseAnd(replies_expr, Xkb::GBNDetail::ClientSymbols) || + CaseAnd(replies_expr, Xkb::GBNDetail::ServerSymbols)) { +- replies.types.emplace(); ++ replies.types.emplace(Xkb::GetKbdByNameReply::Types()); + auto& getmap_type = (*replies.types).getmap_type; + auto& typeDeviceID = (*replies.types).typeDeviceID; + auto& getmap_sequence = (*replies.types).getmap_sequence; +@@ -5708,7 +5708,7 @@ std::unique_ptr + } + } + if (CaseAnd(replies_expr, Xkb::GBNDetail::CompatMap)) { +- replies.compat_map.emplace(); ++ replies.compat_map.emplace(Xkb::GetKbdByNameReply::CompatMap()); + auto& compatmap_type = (*replies.compat_map).compatmap_type; + auto& compatDeviceID = (*replies.compat_map).compatDeviceID; + auto& compatmap_sequence = (*replies.compat_map).compatmap_sequence; +@@ -5832,7 +5832,7 @@ std::unique_ptr + } + } + if (CaseAnd(replies_expr, Xkb::GBNDetail::IndicatorMaps)) { +- replies.indicator_maps.emplace(); ++ replies.indicator_maps.emplace(Xkb::GetKbdByNameReply::IndicatorMaps()); + auto& indicatormap_type = (*replies.indicator_maps).indicatormap_type; + auto& indicatorDeviceID = (*replies.indicator_maps).indicatorDeviceID; + auto& indicatormap_sequence = +@@ -5926,7 +5926,7 @@ std::unique_ptr + } + if (CaseAnd(replies_expr, Xkb::GBNDetail::KeyNames) || + CaseAnd(replies_expr, Xkb::GBNDetail::OtherNames)) { +- replies.key_names.emplace(); ++ replies.key_names.emplace(Xkb::GetKbdByNameReply::KeyNames()); + auto& keyname_type = (*replies.key_names).keyname_type; + auto& keyDeviceID = (*replies.key_names).keyDeviceID; + auto& keyname_sequence = (*replies.key_names).keyname_sequence; +@@ -6185,7 +6185,7 @@ std::unique_ptr + } + } + if (CaseAnd(replies_expr, Xkb::GBNDetail::Geometry)) { +- replies.geometry.emplace(); ++ replies.geometry.emplace(Xkb::GetKbdByNameReply::Geometry()); + auto& geometry_type = (*replies.geometry).geometry_type; + auto& geometryDeviceID = (*replies.geometry).geometryDeviceID; + auto& geometry_sequence = (*replies.geometry).geometry_sequence; +Index: chromium-123.0.6312.46/mojo/public/cpp/bindings/lib/multiplex_router.cc +=================================================================== +--- chromium-123.0.6312.46.orig/mojo/public/cpp/bindings/lib/multiplex_router.cc ++++ chromium-123.0.6312.46/mojo/public/cpp/bindings/lib/multiplex_router.cc +@@ -870,7 +870,7 @@ bool MultiplexRouter::ExclusiveSyncWaitF + DCHECK(!exclusive_sync_wait_); + + scoped_refptr keep_alive(this); +- exclusive_sync_wait_.emplace(); ++ exclusive_sync_wait_.emplace(MultiplexRouter::ExclusiveSyncWaitInfo()); + exclusive_sync_wait_->interface_id = interface_id; + exclusive_sync_wait_->request_id = request_id; + while (!exclusive_sync_wait_->finished) { +Index: chromium-123.0.6312.46/ui/gfx/x/generated_protos/xinput.cc +=================================================================== +--- chromium-123.0.6312.46.orig/ui/gfx/x/generated_protos/xinput.cc ++++ chromium-123.0.6312.46/ui/gfx/x/generated_protos/xinput.cc +@@ -567,7 +567,7 @@ void ReadEventclock_time_ = base::TimeTicks::Now(); + live_anchor_time_->media_time_ = MediaElement().currentTime(); + } +Index: chromium-123.0.6312.46/third_party/blink/renderer/platform/graphics/paint/geometry_mapper_transform_cache.cc +=================================================================== +--- chromium-123.0.6312.46.orig/third_party/blink/renderer/platform/graphics/paint/geometry_mapper_transform_cache.cc ++++ chromium-123.0.6312.46/third_party/blink/renderer/platform/graphics/paint/geometry_mapper_transform_cache.cc +@@ -70,7 +70,7 @@ void GeometryMapperTransformCache::Updat + to_2d_translation_root_ += translation; + + if (parent.plane_root_transform_) { +- plane_root_transform_.emplace(); ++ plane_root_transform_.emplace(GeometryMapperTransformCache::PlaneRootTransform()); + plane_root_transform_->plane_root = parent.plane_root(); + plane_root_transform_->to_plane_root = parent.to_plane_root(); + plane_root_transform_->to_plane_root.Translate(translation.x(), +@@ -98,7 +98,7 @@ void GeometryMapperTransformCache::Updat + // as the 2d translation root. + plane_root_transform_ = std::nullopt; + } else { +- plane_root_transform_.emplace(); ++ plane_root_transform_.emplace(GeometryMapperTransformCache::PlaneRootTransform()); + plane_root_transform_->plane_root = parent.plane_root(); + plane_root_transform_->to_plane_root.MakeIdentity(); + parent.ApplyToPlaneRoot(plane_root_transform_->to_plane_root); +@@ -140,7 +140,7 @@ void GeometryMapperTransformCache::Updat + parent_node->UpdateScreenTransform(); + const auto& parent = parent_node->GetTransformCache(); + +- screen_transform_.emplace(); ++ screen_transform_.emplace(GeometryMapperTransformCache::ScreenTransform()); + parent.ApplyToScreen(screen_transform_->to_screen); + if (node.FlattensInheritedTransform()) + screen_transform_->to_screen.Flatten(); diff --git a/chromium-120-make_unique-struct.patch b/chromium-120-make_unique-struct.patch new file mode 100644 index 0000000000000000000000000000000000000000..c848f46f6fec796eac5ce31c9f762d42628410b6 --- /dev/null +++ b/chromium-120-make_unique-struct.patch @@ -0,0 +1,12 @@ +diff --git a/service_worker_global_scope.h b/service_worker_global_scope.h.new +index ac4cac0..8c7d744 100644 +--- a/third_party/blink/renderer/modules/service_worker/service_worker_global_scope.h ++++ b/third_party/blink/renderer/modules/service_worker/service_worker_global_scope.h +@@ -777,6 +777,7 @@ class MODULES_EXPORT ServiceWorkerGlobalScope final + blink::BlinkStorageKey storage_key_; + + struct RaceNetworkRequestInfo { ++ RaceNetworkRequestInfo(int _fetch_event_id, String _token, mojo::PendingRemote _url_loader_factory) : fetch_event_id{_fetch_event_id}, token{_token}, url_loader_factory{std::move(_url_loader_factory)} {} + int fetch_event_id; + String token; + mojo::PendingRemote diff --git a/chromium-121-nullptr_t-without-namespace-std.patch b/chromium-121-nullptr_t-without-namespace-std.patch new file mode 100644 index 0000000000000000000000000000000000000000..3defc393c084f8bc1bfbd1b3b23a54ae89a08e91 --- /dev/null +++ b/chromium-121-nullptr_t-without-namespace-std.patch @@ -0,0 +1,12 @@ +diff -up chromium-120.0.6099.56/third_party/blink/renderer/core/paint/fragment_data_iterator.h.than chromium-120.0.6099.56/third_party/blink/renderer/core/paint/fragment_data_iterator.h +--- chromium-120.0.6099.56/third_party/blink/renderer/core/paint/fragment_data_iterator.h.than 2023-12-04 10:20:45.350540897 +0100 ++++ chromium-120.0.6099.56/third_party/blink/renderer/core/paint/fragment_data_iterator.h 2023-12-04 10:23:17.335339670 +0100 +@@ -21,7 +21,7 @@ class FragmentDataIteratorBase { + + public: + explicit FragmentDataIteratorBase(Head& head) : fragment_head_(head) {} +- explicit FragmentDataIteratorBase(nullptr_t) {} ++ explicit FragmentDataIteratorBase(std::nullptr_t) {} + + Data* GetFragmentData() const { + return !IsDone() ? &fragment_head_.at(idx_) : nullptr; diff --git a/chromium-121-rust-clang_lib.patch b/chromium-121-rust-clang_lib.patch new file mode 100644 index 0000000000000000000000000000000000000000..0701fd2059ad0c91bfdda355d6c8fd5b54452544 --- /dev/null +++ b/chromium-121-rust-clang_lib.patch @@ -0,0 +1,68 @@ +From ce943790ea147d492f317097eb707745f78193a1 Mon Sep 17 00:00:00 2001 +From: misaka00251 +Date: Fri, 29 Mar 2024 15:12:35 +0800 +Subject: [PATCH] Fix rust clang lib for openEuler + +--- + build/config/clang/BUILD.gn | 31 +++++++++++++++++++++++++++++-- + 1 file changed, 29 insertions(+), 2 deletions(-) + +diff --git a/build/config/clang/BUILD.gn b/build/config/clang/BUILD.gn +index d3054d1..8b956ed 100644 +--- a/build/config/clang/BUILD.gn ++++ b/build/config/clang/BUILD.gn +@@ -105,6 +105,7 @@ template("clang_lib") { + _prefix = "lib" + _suffix = "" + _ext = "a" ++ _libprefix = "" + if (is_win) { + _dir = "windows" + _prefix = "" +@@ -120,7 +121,33 @@ template("clang_lib") { + } + } else if (is_apple) { + _dir = "darwin" +- } else if (is_linux || is_chromeos) { ++ } else if (is_linux) { ++ _libprefix = "64" ++ if (current_cpu == "x64") { ++ if (clang_version == "17") { ++ _dir = "x86_64-openEuler-linux-gnu" ++ } else { ++ _dir = "linux" ++ _suffix ="-x86_64" ++ } ++ } else if (current_cpu == "arm64") { ++ if (clang_version == "17") { ++ _dir = "aarch64-openEuler-linux-gnu" ++ } else { ++ _dir = "linux" ++ _suffix = "-aarch64" ++ } ++ } else if (current_cpu == "riscv64") { ++ if (clang_version == "17") { ++ _dir = "riscv64-openEuler-linux-gnu" ++ } else { ++ _dir = "linux" ++ _suffix = "-riscv64" ++ } ++ } else { ++ assert(false) # Unhandled cpu type ++ } ++ } else if (is_chromeos) { + if (current_cpu == "x64") { + _dir = "x86_64-unknown-linux-gnu" + } else if (current_cpu == "x86") { +@@ -159,7 +186,7 @@ template("clang_lib") { + assert(false) # Unhandled target platform + } + +- _clang_lib_dir = "$clang_base_path/lib/clang/$clang_version/lib" ++ _clang_lib_dir = "$clang_base_path/lib${_libprefix}/clang/$clang_version/lib/" + _lib_file = "${_prefix}clang_rt.${_libname}${_suffix}.${_ext}" + libs = [ "$_clang_lib_dir/$_dir/$_lib_file" ] + } +-- +2.39.3 (Apple Git-146) + diff --git a/chromium-122-workaround_clang_bug-structured_binding.patch b/chromium-122-workaround_clang_bug-structured_binding.patch new file mode 100644 index 0000000000000000000000000000000000000000..1a5ca3f2ef8de24bf051b154b45f19c2d43ebc02 --- /dev/null +++ b/chromium-122-workaround_clang_bug-structured_binding.patch @@ -0,0 +1,70 @@ +Index: chromium-123.0.6312.46/media/base/cdm_promise_adapter.cc +=================================================================== +--- chromium-123.0.6312.46.orig/media/base/cdm_promise_adapter.cc ++++ chromium-123.0.6312.46/media/base/cdm_promise_adapter.cc +@@ -94,7 +94,9 @@ void CdmPromiseAdapter::RejectPromise(ui + void CdmPromiseAdapter::Clear(ClearReason reason) { + // Reject all outstanding promises. + DCHECK(thread_checker_.CalledOnValidThread()); +- for (auto& [promise_id, promise] : promises_) { ++ for (auto& [p_i, p_e] : promises_) { ++ auto& promise_id = p_i; ++ auto& promise = p_e; + TRACE_EVENT_NESTABLE_ASYNC_END1( + "media", "CdmPromise", TRACE_ID_WITH_SCOPE("CdmPromise", promise_id), + "status", "cleared"); +Index: chromium-123.0.6312.46/content/browser/service_worker/service_worker_context_wrapper.cc +=================================================================== +--- chromium-123.0.6312.46.orig/content/browser/service_worker/service_worker_context_wrapper.cc ++++ chromium-123.0.6312.46/content/browser/service_worker/service_worker_context_wrapper.cc +@@ -1474,7 +1474,8 @@ void ServiceWorkerContextWrapper::MaybeP + return; + } + +- auto [document_url, key, callback] = std::move(*request); ++ auto [d_u, key, callback] = std::move(*request); ++ auto document_url = d_u; + + DCHECK(document_url.is_valid()); + TRACE_EVENT1("ServiceWorker", +Index: chromium-123.0.6312.46/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.cc +=================================================================== +--- chromium-123.0.6312.46.orig/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.cc ++++ chromium-123.0.6312.46/third_party/blink/renderer/core/layout/grid/grid_layout_algorithm.cc +@@ -3503,8 +3503,8 @@ void GridLayoutAlgorithm::PlaceGridItems + DCHECK(out_row_break_between); + + const auto& container_space = GetConstraintSpace(); +- const auto& [grid_items, layout_data, tree_size] = sizing_tree.TreeRootData(); +- ++ const auto& [grid_items, l_d, tree_size] = sizing_tree.TreeRootData(); ++ const auto& layout_data = l_d; + const auto* cached_layout_subtree = container_space.GetGridLayoutSubtree(); + const auto container_writing_direction = + container_space.GetWritingDirection(); +@@ -3666,8 +3666,9 @@ void GridLayoutAlgorithm::PlaceGridItems + + // TODO(ikilpatrick): Update |SetHasSeenAllChildren| and early exit if true. + const auto& constraint_space = GetConstraintSpace(); +- const auto& [grid_items, layout_data, tree_size] = sizing_tree.TreeRootData(); +- ++ const auto& [g_i, l_d, tree_size] = sizing_tree.TreeRootData(); ++ const auto& grid_items = g_i; ++ const auto& layout_data = l_d; + const auto* cached_layout_subtree = constraint_space.GetGridLayoutSubtree(); + const auto container_writing_direction = + constraint_space.GetWritingDirection(); +Index: chromium-123.0.6312.46/chrome/browser/predictors/lcp_critical_path_predictor/prewarm_http_disk_cache_manager.cc +=================================================================== +--- chromium-123.0.6312.46.orig/chrome/browser/predictors/lcp_critical_path_predictor/prewarm_http_disk_cache_manager.cc ++++ chromium-123.0.6312.46/chrome/browser/predictors/lcp_critical_path_predictor/prewarm_http_disk_cache_manager.cc +@@ -136,7 +136,8 @@ void PrewarmHttpDiskCacheManager::MaybeP + std::pair origin_and_url; + std::swap(origin_and_url, queued_jobs_.front()); + queued_jobs_.pop(); +- const auto& [origin, url] = origin_and_url; ++ const auto& [origin, u] = origin_and_url; ++ const auto& url = u; + TRACE_EVENT_WITH_FLOW1( + "loading", "PrewarmHttpDiskCacheManager::MaybeProcessNextQueuedJob", + TRACE_ID_LOCAL(this), diff --git a/chromium-123-missing-QtGui.patch b/chromium-123-missing-QtGui.patch new file mode 100644 index 0000000000000000000000000000000000000000..52601052a69e32c8c9bfbe673b24fdf945edd37b --- /dev/null +++ b/chromium-123-missing-QtGui.patch @@ -0,0 +1,12 @@ +diff --git a/ui/qt/BUILD.gn b/ui/qt/BUILD.gn.new +index 2da7845..02ae3c8 100644 +--- a/ui/qt/BUILD.gn ++++ b/ui/qt/BUILD.gn +@@ -61,6 +61,7 @@ template("qt_shim") { + packages = [ + "Qt" + invoker.qt_version + "Core", + "Qt" + invoker.qt_version + "Widgets", ++ "Qt" + invoker.qt_version + "Gui", + ] + } + diff --git a/chromium-123-stats-collector.patch b/chromium-123-stats-collector.patch new file mode 100644 index 0000000000000000000000000000000000000000..7766d4f367e887fe20323c6971372e8d50031ac7 --- /dev/null +++ b/chromium-123-stats-collector.patch @@ -0,0 +1,19 @@ +reported upstream: https://issues.chromium.org/issues/330361615 + +The forward header includes the declaration of deallocate(), but not the +definition. Since the definition is in a header (and presumably it gets +inlined by the compiler), the definition doesn't actually end up in an +object file unless the non-forward header gets included. Not having the +definition makes the linker sad. + +--- a/base/allocator/partition_allocator/src/partition_alloc/starscan/stats_collector.h ++++ b/base/allocator/partition_allocator/src/partition_alloc/starscan/stats_collector.h +@@ -14,7 +14,7 @@ + #include + #include + +-#include "partition_alloc/internal_allocator_forward.h" ++#include "partition_alloc/internal_allocator.h" + #include "partition_alloc/partition_alloc_base/threading/platform_thread.h" + #include "partition_alloc/partition_alloc_base/time/time.h" + #include "partition_alloc/partition_alloc_check.h" diff --git a/chromium-124-size_t.patch b/chromium-124-size_t.patch new file mode 100644 index 0000000000000000000000000000000000000000..3ca84eef6c0eee8c09eb0247ef11cb9498545c3d --- /dev/null +++ b/chromium-124-size_t.patch @@ -0,0 +1,16 @@ +diff -up chromium-124.0.6367.118/third_party/perfetto/src/tracing/core/id_allocator.h.me chromium-124.0.6367.118/third_party/perfetto/src/tracing/core/id_allocator.h +--- chromium-124.0.6367.118/third_party/perfetto/src/tracing/core/id_allocator.h.me 2024-05-06 08:32:09.637210958 +0200 ++++ chromium-124.0.6367.118/third_party/perfetto/src/tracing/core/id_allocator.h 2024-05-06 08:32:26.485518448 +0200 +@@ -63,10 +63,10 @@ class IdAllocator : public IdAllocatorGe + + // Tries to allocate `n` IDs. Returns a vector of `n` valid IDs or an empty + // vector, if not enough IDs are available. +- std::vector AllocateMultiple(size_t n) { ++ std::vector AllocateMultiple(std::size_t n) { + std::vector res; + res.reserve(n); +- for (size_t i = 0; i < n; i++) { ++ for (std::size_t i = 0; i < n; i++) { + T id = Allocate(); + if (id) { + res.push_back(id); diff --git a/chromium-124-system-libxml.patch b/chromium-124-system-libxml.patch new file mode 100644 index 0000000000000000000000000000000000000000..da463c26d323a485c97730322d7d0b455994e359 --- /dev/null +++ b/chromium-124-system-libxml.patch @@ -0,0 +1,24 @@ +diff -up chromium-121.0.6167.139/third_party/blink/renderer/core/xml/xslt_processor.h.me chromium-121.0.6167.139/third_party/blink/renderer/core/xml/xslt_processor.h +--- chromium-121.0.6167.139/third_party/blink/renderer/core/xml/xslt_processor.h.me 2024-02-06 08:22:36.013021582 +0100 ++++ chromium-121.0.6167.139/third_party/blink/renderer/core/xml/xslt_processor.h 2024-02-06 08:23:08.281607499 +0100 +@@ -77,7 +77,7 @@ class XSLTProcessor final : public Scrip + + void reset(); + +- static void ParseErrorFunc(void* user_data, const xmlError*); ++ static void ParseErrorFunc(void* user_data, xmlError*); + static void GenericErrorFunc(void* user_data, const char* msg, ...); + + // Only for libXSLT callbacks +diff -up chromium-121.0.6167.139/third_party/blink/renderer/core/xml/xslt_processor_libxslt.cc.me chromium-121.0.6167.139/third_party/blink/renderer/core/xml/xslt_processor_libxslt.cc +--- chromium-121.0.6167.139/third_party/blink/renderer/core/xml/xslt_processor_libxslt.cc.me 2024-02-06 08:14:32.368066214 +0100 ++++ chromium-121.0.6167.139/third_party/blink/renderer/core/xml/xslt_processor_libxslt.cc 2024-02-06 08:23:08.282607518 +0100 +@@ -66,7 +66,7 @@ void XSLTProcessor::GenericErrorFunc(voi + // It would be nice to do something with this error message. + } + +-void XSLTProcessor::ParseErrorFunc(void* user_data, const xmlError* error) { ++void XSLTProcessor::ParseErrorFunc(void* user_data, xmlError* error) { + FrameConsole* console = static_cast(user_data); + if (!console) + return; diff --git a/chromium-125-appservice-include.patch b/chromium-125-appservice-include.patch new file mode 100644 index 0000000000000000000000000000000000000000..d1b5c46c70abb2056635419ef44978078e4e1e9b --- /dev/null +++ b/chromium-125-appservice-include.patch @@ -0,0 +1,26 @@ +commit 54c4f460f35e0a4003aa4dd01007188ff00295cc +Author: Jose Dapena Paz +Date: Wed Apr 17 08:19:26 2024 +0000 + + IWYU: missing include for std::optional usage in app_types.h + + Bug: 40939315 + Change-Id: I845f4dd1598e38cbe5b22fe472079c41d24a8bd5 + Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5456358 + Reviewed-by: Tim Sergeant + Commit-Queue: José Dapena Paz + Cr-Commit-Position: refs/heads/main@{#1288572} + +diff --git a/components/services/app_service/public/cpp/app_types.h b/components/services/app_service/public/cpp/app_types.h +index 988b6b30f48ff..833ce6d975b0b 100644 +--- a/components/services/app_service/public/cpp/app_types.h ++++ b/components/services/app_service/public/cpp/app_types.h +@@ -5,6 +5,8 @@ + #ifndef COMPONENTS_SERVICES_APP_SERVICE_PUBLIC_CPP_APP_TYPES_H_ + #define COMPONENTS_SERVICES_APP_SERVICE_PUBLIC_CPP_APP_TYPES_H_ + ++#include ++ + #include "base/component_export.h" + #include "components/services/app_service/public/cpp/macros.h" + #include "components/services/app_service/public/protos/app_types.pb.h" diff --git a/chromium-125-assert.patch b/chromium-125-assert.patch new file mode 100644 index 0000000000000000000000000000000000000000..c28aafd8926f50cf4b22b0e839a09c80a0ad1c8a --- /dev/null +++ b/chromium-125-assert.patch @@ -0,0 +1,12 @@ +diff -up chromium-125.0.6422.60/chrome/browser/ui/webui/top_chrome/webui_contents_wrapper.h.assert chromium-125.0.6422.60/chrome/browser/ui/webui/top_chrome/webui_contents_wrapper.h +--- chromium-125.0.6422.60/chrome/browser/ui/webui/top_chrome/webui_contents_wrapper.h.assert 2024-05-18 19:33:37.165243577 +0200 ++++ chromium-125.0.6422.60/chrome/browser/ui/webui/top_chrome/webui_contents_wrapper.h 2024-05-18 19:45:51.224995489 +0200 +@@ -185,7 +185,7 @@ class WebUIContentsWrapperT : public Web + supports_draggable_regions, + T::GetWebUIName()), + webui_url_(webui_url) { +- static_assert( ++ assert( + views_metrics::IsValidWebUINameVariant("." + T::GetWebUIName())); + if (is_ready_to_show()) { + CHECK(GetWebUIController()); diff --git a/chromium-125-compiler.patch b/chromium-125-compiler.patch new file mode 100644 index 0000000000000000000000000000000000000000..96ced25a1c10fcfeee422c160e843ede7a9e8bfa --- /dev/null +++ b/chromium-125-compiler.patch @@ -0,0 +1,270 @@ +From 307a0f63dd9b118f4b8470ed3d7567e81fdb7a6d Mon Sep 17 00:00:00 2001 +From: Mike Gilbert +Date: Tue, 15 Nov 2022 10:27:58 +0000 +Subject: [PATCH] Disable various compiler configs + +--- + build/config/compiler/BUILD.gn | 134 +++++---------------------------- + 1 file changed, 17 insertions(+), 117 deletions(-) + +Index: chromium-120.0.6099.35/build/config/compiler/BUILD.gn +=================================================================== +--- chromium-120.0.6099.35.orig/build/config/compiler/BUILD.gn ++++ chromium-120.0.6099.35/build/config/compiler/BUILD.gn +@@ -320,9 +320,7 @@ config("compiler") { + + configs += [ + # See the definitions below. +- ":clang_revision", + ":rustc_revision", +- ":compiler_cpu_abi", + ":compiler_codegen", + ":compiler_deterministic", + ] +@@ -591,55 +589,6 @@ config("compiler") { + ldflags += [ "-Wl,-z,keep-text-section-prefix" ] + } + +- if (is_clang && !is_nacl && current_os != "zos") { +- cflags += [ "-fcrash-diagnostics-dir=" + clang_diagnostic_dir ] +- if (save_reproducers_on_lld_crash && use_lld) { +- ldflags += [ +- "-fcrash-diagnostics=all", +- "-fcrash-diagnostics-dir=" + clang_diagnostic_dir, +- ] +- } +- +- # TODO(hans): Remove this once Clang generates better optimized debug info +- # by default. https://crbug.com/765793 +- cflags += [ +- "-mllvm", +- "-instcombine-lower-dbg-declare=0", +- ] +- if (!is_debug && use_thin_lto && is_a_target_toolchain) { +- if (is_win) { +- ldflags += [ "-mllvm:-instcombine-lower-dbg-declare=0" ] +- } else { +- ldflags += [ "-Wl,-mllvm,-instcombine-lower-dbg-declare=0" ] +- } +- } +- +- # TODO(crbug.com/1488374): This causes binary size growth and potentially +- # other problems. +- # TODO(crbug.com/1491036): This isn't supported by Cronet's mainline llvm version. +- if (default_toolchain != "//build/toolchain/cros:target" && +- !llvm_android_mainline) { +- cflags += [ +- "-mllvm", +- "-split-threshold-for-reg-with-hint=0", +- ] +- if (use_thin_lto && is_a_target_toolchain) { +- if (is_win) { +- ldflags += [ "-mllvm:-split-threshold-for-reg-with-hint=0" ] +- } else { +- ldflags += [ "-Wl,-mllvm,-split-threshold-for-reg-with-hint=0" ] +- } +- } +- } +- +- # TODO(crbug.com/1235145): Investigate why/if this should be needed. +- if (is_win) { +- cflags += [ "/clang:-ffp-contract=off" ] +- } else { +- cflags += [ "-ffp-contract=off" ] +- } +- } +- + # C11/C++11 compiler flags setup. + # --------------------------- + if (is_linux || is_chromeos || is_android || (is_nacl && is_clang) || +@@ -1488,46 +1488,6 @@ + } + } + +- # Makes builds independent of absolute file path. +- if (is_clang && strip_absolute_paths_from_debug_symbols) { +- # If debug option is given, clang includes $cwd in debug info by default. +- # For such build, this flag generates reproducible obj files even we use +- # different build directory like "out/feature_a" and "out/feature_b" if +- # we build same files with same compile flag. +- # Other paths are already given in relative, no need to normalize them. +- if (is_nacl) { +- # TODO(https://crbug.com/1231236): Use -ffile-compilation-dir= here. +- cflags += [ +- "-Xclang", +- "-fdebug-compilation-dir", +- "-Xclang", +- ".", +- ] +- } else { +- # -ffile-compilation-dir is an alias for both -fdebug-compilation-dir= +- # and -fcoverage-compilation-dir=. +- cflags += [ "-ffile-compilation-dir=." ] +- swiftflags += [ "-file-compilation-dir=." ] +- } +- if (!is_win) { +- # We don't use clang -cc1as on Windows (yet? https://crbug.com/762167) +- asmflags = [ "-Wa,-fdebug-compilation-dir,." ] +- } +- +- if (is_win && use_lld) { +- if (symbol_level == 2 || (is_clang && using_sanitizer)) { +- # Absolutize source file paths for PDB. Pass the real build directory +- # if the pdb contains source-level debug information and if linker +- # reproducibility is not critical. +- ldflags += [ "/PDBSourcePath:" + rebase_path(root_build_dir) ] +- } else { +- # Use a fake fixed base directory for paths in the pdb to make the pdb +- # output fully deterministic and independent of the build directory. +- ldflags += [ "/PDBSourcePath:o:\fake\prefix" ] +- } +- } +- } +- + # Tells the compiler not to use absolute paths when passing the default + # paths to the tools it invokes. We don't want this because we don't + # really need it and it can mess up the RBE cache entries. +@@ -1572,27 +1481,6 @@ config("compiler_deterministic") { + } + } + +-config("clang_revision") { +- if (is_clang && clang_base_path == default_clang_base_path) { +- update_args = [ +- "--print-revision", +- "--verify-version=$clang_version", +- ] +- if (llvm_force_head_revision) { +- update_args += [ "--llvm-force-head-revision" ] +- } +- clang_revision = exec_script("//tools/clang/scripts/update.py", +- update_args, +- "trim string") +- +- # This is here so that all files get recompiled after a clang roll and +- # when turning clang on or off. (defines are passed via the command line, +- # and build system rebuild things when their commandline changes). Nothing +- # should ever read this define. +- defines = [ "CR_CLANG_REVISION=\"$clang_revision\"" ] +- } +-} +- + config("rustc_revision") { + if (rustc_revision != "") { + # Similar to the above config, this is here so that all files get recompiled +@@ -1959,10 +1847,6 @@ config("chromium_code") { + } + } else { + cflags = [ "-Wall" ] +- if (is_clang) { +- # Enable extra warnings for chromium_code when we control the compiler. +- cflags += [ "-Wextra" ] +- } + + # In Chromium code, we define __STDC_foo_MACROS in order to get the + # C99 macros on Mac and Linux. +@@ -1971,24 +1855,6 @@ config("chromium_code") { + "__STDC_FORMAT_MACROS", + ] + +- if (!is_debug && !using_sanitizer && current_cpu != "s390x" && +- current_cpu != "s390" && current_cpu != "ppc64" && +- current_cpu != "mips" && current_cpu != "mips64" && +- current_cpu != "riscv64" && current_cpu != "loong64") { +- # Non-chromium code is not guaranteed to compile cleanly with +- # _FORTIFY_SOURCE. Also, fortified build may fail when optimizations are +- # disabled, so only do that for Release build. +- fortify_level = "2" +- +- # ChromeOS's toolchain supports a high-quality _FORTIFY_SOURCE=3 +- # implementation with a few custom glibc patches. Use that if it's +- # available. +- if (is_chromeos_device && !lacros_use_chromium_toolchain) { +- fortify_level = "3" +- } +- defines += [ "_FORTIFY_SOURCE=" + fortify_level ] +- } +- + if (is_apple) { + cflags_objc = [ "-Wimplicit-retain-self" ] + cflags_objcc = [ "-Wimplicit-retain-self" ] +@@ -2335,7 +2295,8 @@ + # [0]: https://pinpoint-dot-chromeperf.appspot.com/job/147634a8be0000 + # [1]: https://pinpoint-dot-chromeperf.appspot.com/job/132bc772be0000 + # [2]: https://crrev.com/c/5447532 +-config("optimize") { ++config("optimize") { } ++config("xoptimize") { + if (is_win) { + cflags = [ "/O2" ] + common_optimize_on_cflags + +@@ -2430,7 +2297,8 @@ config("optimize") { + } + + # Turn off optimizations. +-config("no_optimize") { ++config("no_optimize") { } ++config("xno_optimize") { + if (is_win) { + cflags = [ + "/Od", # Disable optimization. +@@ -2417,7 +2377,8 @@ + # Turns up the optimization level. Used to explicitly enable -O2 instead of + # -Os for select targets on platforms that use optimize_for_size. No-op + # elsewhere. +-config("optimize_max") { ++config("optimize_max") { } ++config("xoptimize_max") { + if (is_nacl && is_nacl_irt) { + # The NaCl IRT is a special case and always wants its own config. + # Various components do: +@@ -2503,7 +2372,8 @@ config("optimize_max") { + # + # TODO(crbug.com/621335) - rework how all of these configs are related + # so that we don't need this disclaimer. +-config("optimize_speed") { ++config("optimize_speed") { } ++config("xoptimize_speed") { + if (is_nacl && is_nacl_irt) { + # The NaCl IRT is a special case and always wants its own config. + # Various components do: +@@ -2529,7 +2399,8 @@ config("optimize_speed") { + } + } + +-config("optimize_fuzzing") { ++config("optimize_fuzzing") { } ++config("xoptimize_fuzzing") { + cflags = [ "-O1" ] + common_optimize_on_cflags + rustflags = [ "-Copt-level=1" ] + ldflags = common_optimize_on_ldflags +@@ -2662,7 +2533,8 @@ config("win_pdbaltpath") { + } + + # Full symbols. +-config("symbols") { ++config("symbols") { } ++config("xsymbols") { + rustflags = [] + if (is_win) { + if (is_clang) { +@@ -2811,7 +2683,8 @@ config("symbols") { + # Minimal symbols. + # This config guarantees to hold symbol for stack trace which are shown to user + # when crash happens in unittests running on buildbot. +-config("minimal_symbols") { ++config("minimal_symbols") { } ++config("xminimal_symbols") { + rustflags = [] + if (is_win) { + # Functions, files, and line tables only. +@@ -2896,7 +2769,8 @@ config("minimal_symbols") { + # This configuration contains function names only. That is, the compiler is + # told to not generate debug information and the linker then just puts function + # names in the final debug information. +-config("no_symbols") { ++config("no_symbols") { } ++config("xno_symbols") { + if (is_win) { + ldflags = [ "/DEBUG" ] + diff --git a/chromium-125-debian-bad-font-gc0.patch b/chromium-125-debian-bad-font-gc0.patch new file mode 100644 index 0000000000000000000000000000000000000000..9e7630480614bc92fc3cd794b54917b869dff713 --- /dev/null +++ b/chromium-125-debian-bad-font-gc0.patch @@ -0,0 +1,250 @@ +Revert the following commit: + +commit 886c849ee96e3026d28d7615cdd5af9628a2e5c8 +Author: Ian Kilpatrick +Date: Tue Feb 20 18:18:04 2024 +0000 + + [gc] Make UnicodeRangeSet gc'd. + + There should be no user-visible behaviour change. + + Bug: 41490008 + Change-Id: I7f0003b7ff7c464d4ee36442bcff8c63da79b20c + Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5302778 + Reviewed-by: Dominik Röttsches + Commit-Queue: Ian Kilpatrick + Cr-Commit-Position: refs/heads/main@{#1262789} + +--- a/third_party/blink/renderer/core/css/css_font_face.cc ++++ b/third_party/blink/renderer/core/css/css_font_face.cc +@@ -291,7 +291,6 @@ bool CSSFontFace::UpdatePeriod() { + void CSSFontFace::Trace(Visitor* visitor) const { + visitor->Trace(segmented_font_faces_); + visitor->Trace(sources_); +- visitor->Trace(ranges_); + visitor->Trace(font_face_); + } + +--- a/third_party/blink/renderer/core/css/css_font_face.h ++++ b/third_party/blink/renderer/core/css/css_font_face.h +@@ -47,8 +47,8 @@ class SimpleFontData; + + class CORE_EXPORT CSSFontFace final : public GarbageCollected { + public: +- CSSFontFace(FontFace* font_face, HeapVector&& ranges) +- : ranges_(MakeGarbageCollected(std::move(ranges))), ++ CSSFontFace(FontFace* font_face, Vector& ranges) ++ : ranges_(base::AdoptRef(new UnicodeRangeSet(ranges))), + font_face_(font_face) { + DCHECK(font_face_); + } +@@ -61,7 +61,7 @@ class CORE_EXPORT CSSFontFace final : pu + } + FontFace* GetFontFace() const { return font_face_.Get(); } + +- const UnicodeRangeSet* Ranges() { return ranges_.Get(); } ++ scoped_refptr Ranges() { return ranges_; } + + void AddSegmentedFontFace(CSSSegmentedFontFace*); + void RemoveSegmentedFontFace(CSSSegmentedFontFace*); +@@ -98,9 +98,9 @@ class CORE_EXPORT CSSFontFace final : pu + private: + void SetLoadStatus(FontFace::LoadStatusType); + ++ scoped_refptr ranges_; + HeapHashSet> segmented_font_faces_; + HeapDeque> sources_; +- Member ranges_; + Member font_face_; + }; + +--- a/third_party/blink/renderer/core/css/font_face.cc ++++ b/third_party/blink/renderer/core/css/font_face.cc +@@ -90,7 +90,7 @@ const CSSValue* ParseCSSValue(const Exec + + CSSFontFace* CreateCSSFontFace(FontFace* font_face, + const CSSValue* unicode_range) { +- HeapVector ranges; ++ Vector ranges; + if (const auto* range_list = To(unicode_range)) { + unsigned num_ranges = range_list->length(); + for (unsigned i = 0; i < num_ranges; i++) { +@@ -100,7 +100,7 @@ CSSFontFace* CreateCSSFontFace(FontFace* + } + } + +- return MakeGarbageCollected(font_face, std::move(ranges)); ++ return MakeGarbageCollected(font_face, ranges); + } + + const CSSValue* ConvertFontMetricOverrideValue(const CSSValue* parsed_value) { +--- a/third_party/blink/renderer/platform/fonts/font_data_for_range_set.h ++++ b/third_party/blink/renderer/platform/fonts/font_data_for_range_set.h +@@ -39,18 +39,16 @@ class SimpleFontData; + class PLATFORM_EXPORT FontDataForRangeSet + : public GarbageCollected { + public: +- explicit FontDataForRangeSet(const SimpleFontData* font_data = nullptr, +- const UnicodeRangeSet* range_set = nullptr) +- : font_data_(font_data), range_set_(range_set) {} ++ explicit FontDataForRangeSet( ++ const SimpleFontData* font_data = nullptr, ++ scoped_refptr range_set = nullptr) ++ : font_data_(font_data), range_set_(std::move(range_set)) {} + + FontDataForRangeSet(const FontDataForRangeSet& other); + + virtual ~FontDataForRangeSet() = default; + +- void Trace(Visitor* visitor) const { +- visitor->Trace(font_data_); +- visitor->Trace(range_set_); +- } ++ void Trace(Visitor* visitor) const { visitor->Trace(font_data_); } + + bool Contains(UChar32 test_char) const { + return !range_set_ || range_set_->Contains(test_char); +@@ -58,7 +56,7 @@ class PLATFORM_EXPORT FontDataForRangeSe + bool IsEntireRange() const { + return !range_set_ || range_set_->IsEntireRange(); + } +- const UnicodeRangeSet* Ranges() const { return range_set_.Get(); } ++ UnicodeRangeSet* Ranges() const { return range_set_.get(); } + bool HasFontData() const { return font_data_; } + const SimpleFontData* FontData() const { return font_data_.Get(); } + +@@ -74,7 +72,7 @@ class PLATFORM_EXPORT FontDataForRangeSe + + protected: + Member font_data_; +- Member range_set_; ++ scoped_refptr range_set_; + }; + + } // namespace blink +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc +@@ -508,10 +508,10 @@ const OpenTypeVerticalData& HarfBuzzFace + return *harfbuzz_font_data_->VerticalData(); + } + +-hb_font_t* HarfBuzzFace::GetScaledFont(const UnicodeRangeSet* range_set, ++hb_font_t* HarfBuzzFace::GetScaledFont(scoped_refptr range_set, + VerticalLayoutCallbacks vertical_layout, + float specified_size) const { +- harfbuzz_font_data_->range_set_ = range_set; ++ harfbuzz_font_data_->range_set_ = std::move(range_set); + harfbuzz_font_data_->UpdateFallbackMetricsAndScale(*platform_data_, + vertical_layout); + +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h +@@ -66,7 +66,7 @@ class HarfBuzzFace final : public Garbag + // Passing in specified_size in order to control selecting the right value + // from the trak table. If not set, the size of the internal FontPlatformData + // object will be used. +- hb_font_t* GetScaledFont(const UnicodeRangeSet*, ++ hb_font_t* GetScaledFont(scoped_refptr, + VerticalLayoutCallbacks, + float specified_size) const; + +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h +@@ -32,7 +32,7 @@ struct HarfBuzzFontData final : public G + HarfBuzzFontData(const HarfBuzzFontData&) = delete; + HarfBuzzFontData& operator=(const HarfBuzzFontData&) = delete; + +- void Trace(Visitor* visitor) const { visitor->Trace(range_set_); } ++ void Trace(Visitor*) const {} + + // The vertical origin and vertical advance functions in HarfBuzzFace require + // the ascent and height metrics as fallback in case no specific vertical +@@ -98,7 +98,7 @@ struct HarfBuzzFontData final : public G + SpaceGlyphInOpenTypeTables::kUnknown; + + scoped_refptr vertical_data_; +- Member range_set_; ++ scoped_refptr range_set_; + }; + + } // namespace blink +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.cc ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.cc +@@ -289,7 +289,7 @@ void RoundHarfBuzzBufferPositions(hb_buf + inline bool ShapeRange(hb_buffer_t* buffer, + const FontFeatures& font_features, + const SimpleFontData* current_font, +- const UnicodeRangeSet* current_font_range_set, ++ scoped_refptr current_font_range_set, + UScriptCode current_run_script, + hb_direction_t direction, + hb_language_t language, +@@ -325,7 +325,7 @@ inline bool ShapeRange(hb_buffer_t* buff + hb_buffer_set_direction(buffer, direction); + + hb_font_t* hb_font = +- face->GetScaledFont(current_font_range_set, ++ face->GetScaledFont(std::move(current_font_range_set), + HB_DIRECTION_IS_VERTICAL(direction) + ? HarfBuzzFace::kPrepareForVerticalLayout + : HarfBuzzFace::kNoVerticalLayout, +--- a/third_party/blink/renderer/platform/fonts/unicode_range_set.cc ++++ b/third_party/blink/renderer/platform/fonts/unicode_range_set.cc +@@ -31,8 +31,8 @@ + + namespace blink { + +-UnicodeRangeSet::UnicodeRangeSet(HeapVector&& ranges) +- : ranges_(std::move(ranges)) { ++UnicodeRangeSet::UnicodeRangeSet(const Vector& ranges) ++ : ranges_(ranges) { + if (ranges_.empty()) + return; + +--- a/third_party/blink/renderer/platform/fonts/unicode_range_set.h ++++ b/third_party/blink/renderer/platform/fonts/unicode_range_set.h +@@ -26,12 +26,13 @@ + #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_UNICODE_RANGE_SET_H_ + #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_UNICODE_RANGE_SET_H_ + +-#include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" +-#include "third_party/blink/renderer/platform/heap/garbage_collected.h" + #include "third_party/blink/renderer/platform/platform_export.h" ++#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" + #include "third_party/blink/renderer/platform/wtf/text/character_names.h" + #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" + #include "third_party/blink/renderer/platform/wtf/text/wtf_uchar.h" ++#include "third_party/blink/renderer/platform/wtf/thread_safe_ref_counted.h" ++#include "third_party/blink/renderer/platform/wtf/vector.h" + + namespace blink { + +@@ -55,14 +56,13 @@ struct PLATFORM_EXPORT UnicodeRange fina + UChar32 to_; + }; + +-class PLATFORM_EXPORT UnicodeRangeSet +- : public GarbageCollected { ++class PLATFORM_EXPORT UnicodeRangeSet : public RefCounted { ++ USING_FAST_MALLOC(UnicodeRangeSet); ++ + public: +- explicit UnicodeRangeSet(HeapVector&&); ++ explicit UnicodeRangeSet(const Vector&); + UnicodeRangeSet() = default; + +- void Trace(Visitor* visitor) const { visitor->Trace(ranges_); } +- + bool Contains(UChar32) const; + bool IntersectsWith(const String&) const; + bool IsEntireRange() const { return ranges_.empty(); } +@@ -71,8 +71,7 @@ class PLATFORM_EXPORT UnicodeRangeSet + bool operator==(const UnicodeRangeSet& other) const; + + private: +- HeapVector +- ranges_; // If empty, represents the whole code space. ++ Vector ranges_; // If empty, represents the whole code space. + }; + + } // namespace blink diff --git a/chromium-125-debian-bad-font-gc00.patch b/chromium-125-debian-bad-font-gc00.patch new file mode 100644 index 0000000000000000000000000000000000000000..ff3a15e4519ec820b6683248fc20bcc60a73a4b3 --- /dev/null +++ b/chromium-125-debian-bad-font-gc00.patch @@ -0,0 +1,159 @@ +Revert the following commit: + +commit 59daae50fc3c47f7a8dbcc828446fdaa9f8c12c4 +Author: Ian Kilpatrick +Date: Tue Feb 20 18:35:11 2024 +0000 + + [gc] Make OpenTypeVerticalData gc'd. + + There should be no user-visible behaviour change. + + Bug: 41490008 + Change-Id: Id93c85a7beb710944e07cff614cff2409c818436 + Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5302893 + Commit-Queue: Ian Kilpatrick + Reviewed-by: Dominik Röttsches + Cr-Commit-Position: refs/heads/main@{#1262805} + +--- a/third_party/blink/renderer/platform/fonts/font_platform_data.cc ++++ b/third_party/blink/renderer/platform/fonts/font_platform_data.cc +@@ -308,6 +308,11 @@ SkFont FontPlatformData::CreateSkFont(co + } + #endif // !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_IOS) + ++scoped_refptr FontPlatformData::CreateVerticalData() ++ const { ++ return OpenTypeVerticalData::CreateUnscaled(typeface_); ++} ++ + IdentifiableToken FontPlatformData::ComputeTypefaceDigest() const { + DCHECK(typeface_); + int table_count = typeface_->countTables(); +--- a/third_party/blink/renderer/platform/fonts/font_platform_data.h ++++ b/third_party/blink/renderer/platform/fonts/font_platform_data.h +@@ -59,6 +59,7 @@ typedef const struct __CTFont* CTFontRef + namespace blink { + + class HarfBuzzFace; ++class OpenTypeVerticalData; + + class PLATFORM_EXPORT FontPlatformData + : public GarbageCollected { +@@ -137,6 +138,8 @@ class PLATFORM_EXPORT FontPlatformData + + SkFont CreateSkFont(const FontDescription* = nullptr) const; + ++ scoped_refptr CreateVerticalData() const; ++ + // Computes a digest from the typeface. The digest only depends on the + // underlying font itself, and does not vary by the style (size, weight, + // italics, etc). This is aimed at discovering the fingerprinting information +--- a/third_party/blink/renderer/platform/fonts/opentype/open_type_vertical_data.h ++++ b/third_party/blink/renderer/platform/fonts/opentype/open_type_vertical_data.h +@@ -27,10 +27,10 @@ + + #include "base/memory/scoped_refptr.h" + #include "third_party/blink/renderer/platform/fonts/glyph.h" +-#include "third_party/blink/renderer/platform/heap/garbage_collected.h" + #include "third_party/blink/renderer/platform/platform_export.h" + #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" + #include "third_party/blink/renderer/platform/wtf/hash_map.h" ++#include "third_party/blink/renderer/platform/wtf/ref_counted.h" + #include "third_party/blink/renderer/platform/wtf/vector.h" + #include "third_party/skia/include/core/SkRefCnt.h" + #include "third_party/skia/include/core/SkTypeface.h" +@@ -40,11 +40,14 @@ class SkFont; + namespace blink { + + class PLATFORM_EXPORT OpenTypeVerticalData +- : public GarbageCollected { +- public: +- explicit OpenTypeVerticalData(sk_sp); ++ : public RefCounted { ++ USING_FAST_MALLOC(OpenTypeVerticalData); + +- void Trace(Visitor*) const {} ++ public: ++ static scoped_refptr CreateUnscaled( ++ sk_sp typeface) { ++ return base::AdoptRef(new OpenTypeVerticalData(typeface)); ++ } + + void SetScaleAndFallbackMetrics(float size_per_unit, + float ascent, +@@ -60,6 +63,8 @@ class PLATFORM_EXPORT OpenTypeVerticalDa + float* out_xy_array) const; + + private: ++ explicit OpenTypeVerticalData(sk_sp); ++ + void LoadMetrics(sk_sp); + bool HasVORG() const { return !vert_origin_y_.empty(); } + +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc +@@ -202,7 +202,8 @@ + void* user_data) { + HarfBuzzFontData* hb_font_data = + reinterpret_cast(font_data); +- OpenTypeVerticalData* vertical_data = hb_font_data->VerticalData(); ++ scoped_refptr vertical_data = ++ hb_font_data->VerticalData(); + if (!vertical_data) { + return false; + } +@@ -223,7 +223,8 @@ static hb_position_t HarfBuzzGetGlyphVer + void* user_data) { + HarfBuzzFontData* hb_font_data = + reinterpret_cast(font_data); +- OpenTypeVerticalData* vertical_data = hb_font_data->VerticalData(); ++ scoped_refptr vertical_data = ++ hb_font_data->VerticalData(); + if (!vertical_data) { + return SkiaScalarToHarfBuzzPosition(hb_font_data->height_fallback_); + } +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h +@@ -32,10 +32,7 @@ struct HarfBuzzFontData final : public G + HarfBuzzFontData(const HarfBuzzFontData&) = delete; + HarfBuzzFontData& operator=(const HarfBuzzFontData&) = delete; + +- void Trace(Visitor* visitor) const { +- visitor->Trace(vertical_data_); +- visitor->Trace(range_set_); +- } ++ void Trace(Visitor* visitor) const { visitor->Trace(range_set_); } + + // The vertical origin and vertical advance functions in HarfBuzzFace require + // the ascent and height metrics as fallback in case no specific vertical +@@ -70,18 +67,18 @@ struct HarfBuzzFontData final : public G + } + } + +- OpenTypeVerticalData* VerticalData() { ++ scoped_refptr VerticalData() { + if (!vertical_data_) { + DCHECK_NE(ascent_fallback_, kInvalidFallbackMetricsValue); + DCHECK_NE(height_fallback_, kInvalidFallbackMetricsValue); + DCHECK_NE(size_per_unit_, kInvalidFallbackMetricsValue); + + vertical_data_ = +- MakeGarbageCollected(font_.refTypeface()); ++ OpenTypeVerticalData::CreateUnscaled(font_.refTypeface()); + } + vertical_data_->SetScaleAndFallbackMetrics(size_per_unit_, ascent_fallback_, + height_fallback_); +- return vertical_data_.Get(); ++ return vertical_data_; + } + + const hb::unique_ptr unscaled_font_; +@@ -100,7 +97,7 @@ struct HarfBuzzFontData final : public G + SpaceGlyphInOpenTypeTables space_in_gsub_ = + SpaceGlyphInOpenTypeTables::kUnknown; + +- Member vertical_data_; ++ scoped_refptr vertical_data_; + Member range_set_; + }; + diff --git a/chromium-125-debian-bad-font-gc000.patch b/chromium-125-debian-bad-font-gc000.patch new file mode 100644 index 0000000000000000000000000000000000000000..18e6c103ca784fca7b2586602696385e2ce247d5 --- /dev/null +++ b/chromium-125-debian-bad-font-gc000.patch @@ -0,0 +1,107 @@ +Revert the following commit: + +commit 5ffa0446f51e34d06dc0539810a8a5d35ec9e3fc +Author: Ian Kilpatrick +Date: Thu Feb 22 17:08:22 2024 +0000 + + [fonts][perf] Explicitly leak SimpleFontDatas via a LRU cache. + + This adds a strong LRU cache to FontDataCache to retain the most + recently used fonts. + + This covers the case where a large amount of DOM is destroyed, and + previously we'd release all the font related objects if the GC kicked + in. + + Speedometer3 appears to peak at ~75 objects in the cache. + + Results for different cache sizes: + + Cache size: 64 | 32 | 16 + Speedometer3: +0.9% | +0.5% | +0% + + Bug: 41490008 + Change-Id: I131b6a79f246e61e13a7d44dddbc1f9e625ed44a + Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5314842 + Reviewed-by: Dominik Röttsches + Commit-Queue: Ian Kilpatrick + Cr-Commit-Position: refs/heads/main@{#1264027} + +--- a/third_party/blink/renderer/platform/fonts/font_data_cache.cc ++++ b/third_party/blink/renderer/platform/fonts/font_data_cache.cc +@@ -36,15 +36,6 @@ + + namespace blink { + +-namespace { +- +-// The maximum number of strong references to retain via the LRU. +-// This explicitly leaks fonts (and related objects) unless under extreme +-// memory pressure where it will be cleared. DO NOT increase unnecessarily. +-const wtf_size_t kMaxSize = 64; +- +-} // namespace +- + const SimpleFontData* FontDataCache::Get(const FontPlatformData* platform_data, + bool subpixel_ascent_descent) { + if (!platform_data) +@@ -64,16 +55,7 @@ const SimpleFontData* FontDataCache::Get + add_result.stored_value->value = MakeGarbageCollected( + platform_data, nullptr, subpixel_ascent_descent); + } +- +- const SimpleFontData* result = add_result.stored_value->value; +- +- // Update our LRU to keep a strong reference to `result`. +- strong_reference_lru_.PrependOrMoveToFirst(result); +- while (strong_reference_lru_.size() > kMaxSize) { +- strong_reference_lru_.pop_back(); +- } +- +- return result; ++ return add_result.stored_value->value; + } + + } // namespace blink +--- a/third_party/blink/renderer/platform/fonts/font_data_cache.h ++++ b/third_party/blink/renderer/platform/fonts/font_data_cache.h +@@ -34,7 +34,6 @@ + #include "third_party/blink/renderer/platform/fonts/font_platform_data.h" + #include "third_party/blink/renderer/platform/fonts/simple_font_data.h" + #include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h" +-#include "third_party/blink/renderer/platform/heap/collection_support/heap_linked_hash_set.h" + + namespace blink { + +@@ -59,29 +58,17 @@ class FontDataCache final { + FontDataCache(const FontDataCache&) = delete; + FontDataCache& operator=(const FontDataCache&) = delete; + +- void Trace(Visitor* visitor) const { +- visitor->Trace(cache_); +- visitor->Trace(strong_reference_lru_); +- } ++ void Trace(Visitor* visitor) const { visitor->Trace(cache_); } + + const SimpleFontData* Get(const FontPlatformData*, + bool subpixel_ascent_descent = false); +- void Clear() { +- cache_.clear(); +- strong_reference_lru_.clear(); +- } ++ void Clear() { cache_.clear(); } + + private: + HeapHashMap, + WeakMember, + FontDataCacheKeyHashTraits> + cache_; +- +- // The above `cache_` is weak, meaning its entries will potentially be +- // cleared if no other references exist. +- // This LRU keeps a small (limited) number of strong references alive so they +- // won't be cleared in the above cache for performance reasons. +- HeapLinkedHashSet> strong_reference_lru_; + }; + + } // namespace blink diff --git a/chromium-125-debian-bad-font-gc0000.patch b/chromium-125-debian-bad-font-gc0000.patch new file mode 100644 index 0000000000000000000000000000000000000000..7eaa721d8d3e7d0ffdba89d25b2ce0a07d6d9675 --- /dev/null +++ b/chromium-125-debian-bad-font-gc0000.patch @@ -0,0 +1,425 @@ +Revert the following commit: + + +commit cc6c0b2a9e1dbc96f3ebed713dc71960a29dc4f1 +Author: Ian Kilpatrick +Date: Tue Mar 5 20:27:13 2024 +0000 + + Reland "[gc] Make FontFamily immutable." + + This reverts commit 748ed11510ec5bb09cc8b92f67f1f62964f023fa. + + Reason for revert: Previous patch which caused MSAN issue was reapplied. + + Original change's description: + > Revert "[gc] Make FontFamily immutable." + > + > This reverts commit ca3d3085d8b01fc74623d639c615fc57842cd26d. + > + > Reason for revert: crrev.com/c/5328767 is the reason for failure on some tests on MSAN. Please see crbug.com/327969288 for more details. + > + > Original change's description: + > > [gc] Make FontFamily immutable. + > > + > > Previously we'd build up font-family lists front to back, but would + > > need to mutate them to do so. Instead just build them backwards. + > > + > > This removes a bunch of problematic APIs (like AppendFamily - which + > > doesn't append), and simplifies the code. + > > + > > This will help avoid atomic write barriers once converted to oilpan. + > > + > > Bug: 41490008 + > > Change-Id: Icfcec2d0a1716585cf42985616c02b42b6647943 + > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5322929 + > > Commit-Queue: Ian Kilpatrick + > > Reviewed-by: Dominik Röttsches + > > Cr-Commit-Position: refs/heads/main@{#1267168} + > + > Bug: 41490008, 327969288 + > Change-Id: Ic69a5707d00cc98b97dcae3f4b8207b452ce5cbd + > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5333950 + > Bot-Commit: Rubber Stamper + > Commit-Queue: Taiyo Mizuhashi + > Owners-Override: Taiyo Mizuhashi + > Cr-Commit-Position: refs/heads/main@{#1267674} + + Bug: 41490008, 327969288 + Change-Id: If1d395e324b0be15488ef5410e9bcdb219bb19c6 + Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5344844 + Commit-Queue: Ian Kilpatrick + Bot-Commit: Rubber Stamper + Cr-Commit-Position: refs/heads/main@{#1268654} + +--- a/third_party/blink/renderer/core/css/css_font_face.cc ++++ b/third_party/blink/renderer/core/css/css_font_face.cc +@@ -216,8 +216,9 @@ bool CSSFontFace::MaybeLoadFont(const Fo + + void CSSFontFace::Load() { + FontDescription font_description; +- font_description.SetFamily( +- FontFamily(font_face_->family(), FontFamily::Type::kFamilyName)); ++ FontFamily font_family; ++ font_family.SetFamily(font_face_->family(), FontFamily::Type::kFamilyName); ++ font_description.SetFamily(font_family); + Load(font_description); + } + +--- a/third_party/blink/renderer/core/css/font_face_set_document.cc ++++ b/third_party/blink/renderer/core/css/font_face_set_document.cc +@@ -195,10 +195,13 @@ bool FontFaceSetDocument::ResolveFontSty + ComputedStyleBuilder builder = + GetDocument()->GetStyleResolver().CreateComputedStyleBuilder(); + +- FontDescription default_font_description; +- default_font_description.SetFamily(FontFamily( ++ FontFamily font_family; ++ font_family.SetFamily( + FontFaceSet::DefaultFontFamily(), +- FontFamily::InferredTypeFor(FontFaceSet::DefaultFontFamily()))); ++ FontFamily::InferredTypeFor(FontFaceSet::DefaultFontFamily())); ++ ++ FontDescription default_font_description; ++ default_font_description.SetFamily(font_family); + default_font_description.SetSpecifiedSize(FontFaceSet::kDefaultFontSize); + default_font_description.SetComputedSize(FontFaceSet::kDefaultFontSize); + +--- a/third_party/blink/renderer/core/css/font_face_set_worker.cc ++++ b/third_party/blink/renderer/core/css/font_face_set_worker.cc +@@ -84,10 +84,13 @@ bool FontFaceSetWorker::ResolveFontStyle + return false; + } + +- FontDescription default_font_description; +- default_font_description.SetFamily(FontFamily( ++ FontFamily font_family; ++ font_family.SetFamily( + FontFaceSet::DefaultFontFamily(), +- FontFamily::InferredTypeFor(FontFaceSet::DefaultFontFamily()))); ++ FontFamily::InferredTypeFor(FontFaceSet::DefaultFontFamily())); ++ ++ FontDescription default_font_description; ++ default_font_description.SetFamily(font_family); + default_font_description.SetSpecifiedSize(FontFaceSet::kDefaultFontSize); + default_font_description.SetComputedSize(FontFaceSet::kDefaultFontSize); + +--- a/third_party/blink/renderer/core/css/resolver/font_builder.cc ++++ b/third_party/blink/renderer/core/css/resolver/font_builder.cc +@@ -54,9 +54,11 @@ void FontBuilder::DidChangeWritingMode() + } + + FontFamily FontBuilder::StandardFontFamily() const { ++ FontFamily family; + const AtomicString& standard_font_family = StandardFontFamilyName(); +- return FontFamily(standard_font_family, +- FontFamily::InferredTypeFor(standard_font_family)); ++ family.SetFamily(standard_font_family, ++ FontFamily::InferredTypeFor(standard_font_family)); ++ return family; + } + + AtomicString FontBuilder::StandardFontFamilyName() const { +--- a/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc ++++ b/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc +@@ -379,8 +379,8 @@ FontDescription::FamilyDescription Style + + if (const auto* system_font = + DynamicTo(value)) { +- desc.family = FontFamily(system_font->ResolveFontFamily(), +- FontFamily::Type::kFamilyName); ++ desc.family.SetFamily(system_font->ResolveFontFamily(), ++ FontFamily::Type::kFamilyName); + return desc; + } + +@@ -410,8 +410,10 @@ FontDescription::FamilyDescription Style + // Take the previous value and wrap it in a `SharedFontFamily` adding to + // the linked list. + if (has_value) { +- next = +- SharedFontFamily::Create(family_name, family_type, std::move(next)); ++ scoped_refptr shared = SharedFontFamily::Create(); ++ shared->SetFamily(family_name, family_type); ++ shared->AppendFamily(next); ++ next = shared; + } + family_name = next_family_name; + family_type = is_generic ? FontFamily::Type::kGenericFamily +@@ -442,7 +444,8 @@ FontDescription::FamilyDescription Style + } + #endif + +- desc.family = FontFamily(family_name, family_type, std::move(next)); ++ desc.family.SetFamily(family_name, family_type); ++ desc.family.AppendFamily(next); + return desc; + } + +--- a/third_party/blink/renderer/core/html/canvas/canvas_font_cache.cc ++++ b/third_party/blink/renderer/core/html/canvas/canvas_font_cache.cc +@@ -29,9 +29,11 @@ const int defaultFontSize = 10; + + const ComputedStyle* CreateDefaultFontStyle(const Document& document) { + const AtomicString& default_font_family = font_family_names::kSansSerif; ++ FontFamily font_family; ++ font_family.SetFamily(default_font_family, ++ FontFamily::InferredTypeFor(default_font_family)); + FontDescription default_font_description; +- default_font_description.SetFamily(FontFamily( +- default_font_family, FontFamily::InferredTypeFor(default_font_family))); ++ default_font_description.SetFamily(font_family); + default_font_description.SetSpecifiedSize(defaultFontSize); + default_font_description.SetComputedSize(defaultFontSize); + ComputedStyleBuilder builder = +--- a/third_party/blink/renderer/core/page/drag_image.cc ++++ b/third_party/blink/renderer/core/page/drag_image.cc +@@ -127,9 +127,11 @@ static Font DeriveDragLabelFont(int size + const AtomicString& family = + LayoutThemeFontProvider::SystemFontFamily(CSSValueID::kNone); + ++ FontFamily font_family; ++ font_family.SetFamily(family, FontFamily::InferredTypeFor(family)); ++ + FontDescription description; +- description.SetFamily( +- FontFamily(family, FontFamily::InferredTypeFor(family))); ++ description.SetFamily(font_family); + description.SetWeight(font_weight); + description.SetSpecifiedSize(size); + description.SetComputedSize(size); +--- a/third_party/blink/renderer/core/paint/embedded_object_painter.cc ++++ b/third_party/blink/renderer/core/paint/embedded_object_painter.cc +@@ -32,9 +32,11 @@ static Font ReplacementTextFont(const Do + const float size = LayoutThemeFontProvider::SystemFontSize( + CSSValueID::kWebkitSmallControl, document); + ++ FontFamily font_family; ++ font_family.SetFamily(family, FontFamily::InferredTypeFor(family)); ++ + FontDescription font_description; +- font_description.SetFamily( +- FontFamily(family, FontFamily::InferredTypeFor(family))); ++ font_description.SetFamily(font_family); + font_description.SetWeight(kBoldWeightValue); + font_description.SetSpecifiedSize(size); + font_description.SetComputedSize(size); +--- a/third_party/blink/renderer/platform/exported/web_font_description.cc ++++ b/third_party/blink/renderer/platform/exported/web_font_description.cc +@@ -49,10 +49,13 @@ WebFontDescription::WebFontDescription(c + } + + WebFontDescription::operator FontDescription() const { ++ FontFamily font_family; ++ font_family.SetFamily(family, family_is_generic ++ ? FontFamily::Type::kGenericFamily ++ : FontFamily::Type::kFamilyName); ++ + FontDescription desc; +- desc.SetFamily(FontFamily(family, family_is_generic +- ? FontFamily::Type::kGenericFamily +- : FontFamily::Type::kFamilyName)); ++ desc.SetFamily(font_family); + desc.SetGenericFamily( + static_cast(generic_family)); + desc.SetSpecifiedSize(size); +--- a/third_party/blink/renderer/platform/fonts/font_description.h ++++ b/third_party/blink/renderer/platform/fonts/font_description.h +@@ -195,6 +195,7 @@ class PLATFORM_EXPORT FontDescription { + FamilyDescription GetFamilyDescription() const { + return FamilyDescription(GenericFamily(), Family()); + } ++ FontFamily& FirstFamily() { return family_list_; } + const FontFamily& FirstFamily() const { return family_list_; } + Size GetSize() const { + return Size(KeywordSize(), SpecifiedSize(), IsAbsoluteSize()); +@@ -450,6 +451,10 @@ class PLATFORM_EXPORT FontDescription { + return fields_.subpixel_ascent_descent_; + } + ++ void SetHashCategory(HashCategory category) { ++ fields_.hash_category_ = category; ++ } ++ + HashCategory GetHashCategory() const { + return static_cast(fields_.hash_category_); + } +--- a/third_party/blink/renderer/platform/fonts/font_fallback_list.cc ++++ b/third_party/blink/renderer/platform/fonts/font_fallback_list.cc +@@ -178,8 +178,9 @@ const FontData* FontFallbackList::GetFon + + if (font_selector_) { + // Try the user's preferred standard font. +- FontFamily font_family(font_family_names::kWebkitStandard, +- FontFamily::Type::kGenericFamily); ++ FontFamily font_family; ++ font_family.SetFamily(font_family_names::kWebkitStandard, ++ FontFamily::Type::kGenericFamily); + if (const FontData* data = + font_selector_->GetFontData(font_description, font_family)) { + return data; +--- a/third_party/blink/renderer/platform/fonts/font_family.cc ++++ b/third_party/blink/renderer/platform/fonts/font_family.cc +@@ -49,6 +49,20 @@ bool operator==(const FontFamily& a, con + return true; + } + ++wtf_size_t FontFamily::CountNames() const { ++ wtf_size_t count = 0; ++ for (const FontFamily* font_family = this; font_family; ++ font_family = font_family->Next()) ++ ++count; ++ return count; ++} ++ ++void FontFamily::AppendFamily(AtomicString family_name, Type family_type) { ++ scoped_refptr appended_family = SharedFontFamily::Create(); ++ appended_family->SetFamily(family_name, family_type); ++ AppendFamily(appended_family); ++} ++ + String FontFamily::ToString() const { + StringBuilder builder; + builder.Append(family_name_); +--- a/third_party/blink/renderer/platform/fonts/font_family.h ++++ b/third_party/blink/renderer/platform/fonts/font_family.h +@@ -39,18 +39,16 @@ class PLATFORM_EXPORT FontFamily { + DISALLOW_NEW(); + + public: +- // https://drafts.csswg.org/css-fonts/#font-family-prop +- enum class Type : uint8_t { kFamilyName, kGenericFamily }; +- +- FontFamily(const AtomicString& family_name, +- Type family_type, +- scoped_refptr next = nullptr) +- : family_name_(family_name), +- next_(std::move(next)), +- family_type_(family_type) {} + FontFamily() = default; + ~FontFamily(); + ++ // https://drafts.csswg.org/css-fonts/#font-family-prop ++ enum class Type : uint8_t { kFamilyName, kGenericFamily }; ++ ++ void SetFamily(const AtomicString& family_name, Type family_type) { ++ family_name_ = family_name; ++ family_type_ = family_type; ++ } + // Return this font family's name. Note that it is never quoted nor escaped. + // For web-exposed serialization, please rely instead on the functions + // ComputedStyleUtils::ValueForFontFamily(const FontFamily&) and +@@ -59,8 +57,13 @@ class PLATFORM_EXPORT FontFamily { + const AtomicString& FamilyName() const { return family_name_; } + bool FamilyIsGeneric() const { return family_type_ == Type::kGenericFamily; } + ++ // Returns number of linked `FontFamily` including `this`, so return value is ++ // greater than or equal to 1. When `Next()` is `nullptr`, return value is 1. ++ wtf_size_t CountNames() const; + const FontFamily* Next() const; + ++ void AppendFamily(scoped_refptr); ++ void AppendFamily(AtomicString family_name, Type family_type); + scoped_refptr ReleaseNext(); + + bool IsPrewarmed() const { return is_prewarmed_; } +@@ -93,19 +96,12 @@ class PLATFORM_EXPORT SharedFontFamily : + SharedFontFamily(const SharedFontFamily&) = delete; + SharedFontFamily& operator=(const SharedFontFamily&) = delete; + +- static scoped_refptr Create( +- const AtomicString& family_name, +- Type family_type, +- scoped_refptr next = nullptr) { +- return base::AdoptRef( +- new SharedFontFamily(family_name, family_type, std::move(next))); ++ static scoped_refptr Create() { ++ return base::AdoptRef(new SharedFontFamily); + } + + private: +- SharedFontFamily(const AtomicString& family_name, +- Type family_type, +- scoped_refptr next) +- : FontFamily(family_name, family_type, std::move(next)) {} ++ SharedFontFamily() = default; + }; + + PLATFORM_EXPORT bool operator==(const FontFamily&, const FontFamily&); +@@ -125,6 +121,10 @@ inline const FontFamily* FontFamily::Nex + return next_.get(); + } + ++inline void FontFamily::AppendFamily(scoped_refptr family) { ++ next_ = std::move(family); ++} ++ + inline scoped_refptr FontFamily::ReleaseNext() { + return std::move(next_); + } +--- a/third_party/blink/renderer/platform/graphics/placeholder_image.cc ++++ b/third_party/blink/renderer/platform/graphics/placeholder_image.cc +@@ -85,18 +85,23 @@ void DrawCenteredIcon(cc::PaintCanvas* c + } + + FontDescription CreatePlaceholderFontDescription(float scale_factor) { +- scoped_refptr arial = SharedFontFamily::Create( +- font_family_names::kArial, FontFamily::Type::kFamilyName); +- scoped_refptr helvetica = SharedFontFamily::Create( +- font_family_names::kHelvetica, FontFamily::Type::kFamilyName, arial); +- scoped_refptr helvetica_neue = +- SharedFontFamily::Create(font_family_names::kHelveticaNeue, +- FontFamily::Type::kFamilyName, helvetica); +- FontFamily roboto(font_family_names::kRoboto, FontFamily::Type::kFamilyName, +- helvetica_neue); +- + FontDescription description; +- description.SetFamily(roboto); ++ description.FirstFamily().SetFamily(font_family_names::kRoboto, ++ FontFamily::Type::kFamilyName); ++ ++ scoped_refptr helvetica_neue = SharedFontFamily::Create(); ++ helvetica_neue->SetFamily(font_family_names::kHelveticaNeue, ++ FontFamily::Type::kFamilyName); ++ scoped_refptr helvetica = SharedFontFamily::Create(); ++ helvetica->SetFamily(font_family_names::kHelvetica, ++ FontFamily::Type::kFamilyName); ++ scoped_refptr arial = SharedFontFamily::Create(); ++ arial->SetFamily(font_family_names::kArial, FontFamily::Type::kFamilyName); ++ ++ helvetica->AppendFamily(std::move(arial)); ++ helvetica_neue->AppendFamily(std::move(helvetica)); ++ description.FirstFamily().AppendFamily(std::move(helvetica_neue)); ++ + description.SetGenericFamily(FontDescription::kSansSerifFamily); + description.SetComputedSize(scale_factor * kFontSize); + description.SetWeight(FontSelectionValue(500)); +--- a/third_party/blink/renderer/platform/testing/font_test_helpers.cc ++++ b/third_party/blink/renderer/platform/testing/font_test_helpers.cc +@@ -127,9 +127,11 @@ Font CreateTestFont(const AtomicString& + size_t data_size, + float size, + const FontDescription::VariantLigatures* ligatures) { ++ FontFamily family; ++ family.SetFamily(family_name, FontFamily::Type::kFamilyName); ++ + FontDescription font_description; +- font_description.SetFamily( +- FontFamily(family_name, FontFamily::Type::kFamilyName)); ++ font_description.SetFamily(family); + font_description.SetSpecifiedSize(size); + font_description.SetComputedSize(size); + if (ligatures) +@@ -143,9 +145,11 @@ Font CreateTestFont(const AtomicString& + float size, + const FontDescription::VariantLigatures* ligatures, + void (*init_font_description)(FontDescription*)) { ++ FontFamily family; ++ family.SetFamily(family_name, FontFamily::Type::kFamilyName); ++ + FontDescription font_description; +- font_description.SetFamily( +- FontFamily(family_name, FontFamily::Type::kFamilyName)); ++ font_description.SetFamily(family); + font_description.SetSpecifiedSize(size); + font_description.SetComputedSize(size); + if (ligatures) diff --git a/chromium-125-debian-bad-font-gc1.patch b/chromium-125-debian-bad-font-gc1.patch new file mode 100644 index 0000000000000000000000000000000000000000..6cbf1c3195a058a1ab07f591c91d87616f64ba5f --- /dev/null +++ b/chromium-125-debian-bad-font-gc1.patch @@ -0,0 +1,258 @@ +This is a revert of the commit below. While it doesn't strictly fix any +bugs, it's needed to support bad-font-gc2.patch building. + +commit 9a8fc2e22363c954af239c06798bf85a9c928295 +Author: Ian Kilpatrick +Date: Wed Feb 14 19:35:11 2024 +0000 + + [gc] Make FontCustomPlatformData gc'd. + + There should be no user-visible behaviour change. + + Bug: 41490008 + Change-Id: I6364bf4c5b5dce9f99d8e2d7e1f84537c5493c33 + Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5293060 + Commit-Queue: Ian Kilpatrick + Reviewed-by: Dominik Röttsches + Cr-Commit-Position: refs/heads/main@{#1260637} + +--- a/third_party/blink/renderer/core/css/binary_data_font_face_source.cc ++++ b/third_party/blink/renderer/core/css/binary_data_font_face_source.cc +@@ -27,16 +27,13 @@ BinaryDataFontFaceSource::BinaryDataFont + return; + } + probe::FontsUpdated(context, font_face, String(), +- custom_platform_data_.Get()); ++ custom_platform_data_.get()); + } + +-void BinaryDataFontFaceSource::Trace(Visitor* visitor) const { +- visitor->Trace(custom_platform_data_); +- CSSFontFaceSource::Trace(visitor); +-} ++BinaryDataFontFaceSource::~BinaryDataFontFaceSource() = default; + + bool BinaryDataFontFaceSource::IsValid() const { +- return custom_platform_data_; ++ return custom_platform_data_.get(); + } + + SimpleFontData* BinaryDataFontFaceSource::CreateFontData( +--- a/third_party/blink/renderer/core/css/binary_data_font_face_source.h ++++ b/third_party/blink/renderer/core/css/binary_data_font_face_source.h +@@ -16,14 +16,14 @@ class FontCustomPlatformData; + class BinaryDataFontFaceSource final : public CSSFontFaceSource { + public: + BinaryDataFontFaceSource(CSSFontFace*, SharedBuffer*, String&); +- void Trace(Visitor*) const override; ++ ~BinaryDataFontFaceSource() override; + bool IsValid() const override; + + private: + SimpleFontData* CreateFontData(const FontDescription&, + const FontSelectionCapabilities&) override; + +- Member custom_platform_data_; ++ scoped_refptr custom_platform_data_; + }; + + } // namespace blink +--- a/third_party/blink/renderer/core/css/remote_font_face_source.cc ++++ b/third_party/blink/renderer/core/css/remote_font_face_source.cc +@@ -262,7 +262,7 @@ void RemoteFontFaceSource::NotifyFinishe + FontInvalidationReason::kFontFaceLoaded); + if (custom_font_data_) { + probe::FontsUpdated(execution_context, face_->GetFontFace(), +- resource->Url().GetString(), custom_font_data_.Get()); ++ resource->Url().GetString(), custom_font_data_.get()); + } + } + } +@@ -456,7 +456,6 @@ void RemoteFontFaceSource::BeginLoadIfNe + void RemoteFontFaceSource::Trace(Visitor* visitor) const { + visitor->Trace(face_); + visitor->Trace(font_selector_); +- visitor->Trace(custom_font_data_); + CSSFontFaceSource::Trace(visitor); + FontResourceClient::Trace(visitor); + } +--- a/third_party/blink/renderer/core/css/remote_font_face_source.h ++++ b/third_party/blink/renderer/core/css/remote_font_face_source.h +@@ -43,7 +43,7 @@ class RemoteFontFaceSource final : publi + bool IsPendingDataUrl() const override; + + const FontCustomPlatformData* GetCustomPlaftormData() const override { +- return custom_font_data_.Get(); ++ return custom_font_data_.get(); + } + + void BeginLoadIfNeeded() override; +@@ -157,7 +157,7 @@ class RemoteFontFaceSource final : publi + Member font_selector_; + + // |nullptr| if font is not loaded or failed to decode. +- Member custom_font_data_; ++ scoped_refptr custom_font_data_; + // |nullptr| if font is not loaded or failed to decode. + String url_; + +--- a/third_party/blink/renderer/core/loader/resource/font_resource.cc ++++ b/third_party/blink/renderer/core/loader/resource/font_resource.cc +@@ -112,7 +112,7 @@ void FontResource::StartLoadLimitTimersI + kFontLoadWaitLong); + } + +-const FontCustomPlatformData* FontResource::GetCustomFontData() { ++scoped_refptr FontResource::GetCustomFontData() { + if (!font_data_ && !ErrorOccurred() && !IsLoading()) { + if (Data()) { + auto decode_start_time = base::TimeTicks::Now(); +@@ -225,7 +225,6 @@ void FontResource::AddClearDataObserver( + } + + void FontResource::Trace(Visitor* visitor) const { +- visitor->Trace(font_data_); + visitor->Trace(clear_data_observers_); + Resource::Trace(visitor); + } +--- a/third_party/blink/renderer/core/loader/resource/font_resource.h ++++ b/third_party/blink/renderer/core/loader/resource/font_resource.h +@@ -72,7 +72,7 @@ class CORE_EXPORT FontResource final : p + + String OtsParsingMessage() const { return ots_parsing_message_; } + +- const FontCustomPlatformData* GetCustomFontData(); ++ scoped_refptr GetCustomFontData(); + + // Returns true if the loading priority of the remote font resource can be + // lowered. The loading priority of the font can be lowered only if the +@@ -112,7 +112,7 @@ class CORE_EXPORT FontResource final : p + kMaxValue = kLongLimitExceeded, + }; + +- Member font_data_; ++ scoped_refptr font_data_; + String ots_parsing_message_; + LoadLimitState load_limit_state_; + bool cors_failed_; +--- a/third_party/blink/renderer/platform/fonts/font_custom_platform_data.cc ++++ b/third_party/blink/renderer/platform/fonts/font_custom_platform_data.cc +@@ -115,7 +115,7 @@ const FontPlatformData* FontCustomPlatfo + const ResolvedFontFeatures& resolved_font_features, + FontOrientation orientation, + const FontVariationSettings* variation_settings, +- const FontPalette* palette) const { ++ const FontPalette* palette) { + DCHECK(base_typeface_); + + sk_sp return_typeface = base_typeface_; +@@ -304,7 +304,7 @@ String FontCustomPlatformData::FamilyNam + localized_string.fString.size()); + } + +-FontCustomPlatformData* FontCustomPlatformData::Create( ++scoped_refptr FontCustomPlatformData::Create( + SharedBuffer* buffer, + String& ots_parse_message) { + DCHECK(buffer); +@@ -321,8 +321,8 @@ FontCustomPlatformData* FontCustomPlatfo + if (v8::Isolate* isolate = v8::Isolate::TryGetCurrent()) { + isolate->AdjustAmountOfExternalAllocatedMemory(data_size); + } +- return MakeGarbageCollected(std::move(typeface), +- data_size); ++ return base::AdoptRef( ++ new FontCustomPlatformData(std::move(typeface), data_size)); + } + + bool FontCustomPlatformData::MayBeIconFont() const { +--- a/third_party/blink/renderer/platform/fonts/font_custom_platform_data.h ++++ b/third_party/blink/renderer/platform/fonts/font_custom_platform_data.h +@@ -39,7 +39,6 @@ + #include "third_party/blink/renderer/platform/fonts/opentype/variable_axes_names.h" + #include "third_party/blink/renderer/platform/fonts/resolved_font_features.h" + #include "third_party/blink/renderer/platform/fonts/text_rendering_mode.h" +-#include "third_party/blink/renderer/platform/heap/garbage_collected.h" + #include "third_party/blink/renderer/platform/platform_export.h" + #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" + #include "third_party/blink/renderer/platform/wtf/forward.h" +@@ -55,17 +54,16 @@ class FontPlatformData; + class FontVariationSettings; + + class PLATFORM_EXPORT FontCustomPlatformData +- : public GarbageCollected { ++ : public RefCounted { ++ USING_FAST_MALLOC(FontCustomPlatformData); ++ + public: +- static FontCustomPlatformData* Create(SharedBuffer*, +- String& ots_parse_message); +- FontCustomPlatformData(sk_sp, size_t data_size); ++ static scoped_refptr Create(SharedBuffer*, ++ String& ots_parse_message); + FontCustomPlatformData(const FontCustomPlatformData&) = delete; + FontCustomPlatformData& operator=(const FontCustomPlatformData&) = delete; + ~FontCustomPlatformData(); + +- void Trace(Visitor*) const {} +- + // The size argument should come from EffectiveFontSize() and + // adjusted_specified_size should come from AdjustedSpecifiedSize() of + // FontDescription. The latter is needed for correctly applying +@@ -82,7 +80,7 @@ class PLATFORM_EXPORT FontCustomPlatform + const ResolvedFontFeatures& resolved_font_features, + FontOrientation = FontOrientation::kHorizontal, + const FontVariationSettings* = nullptr, +- const FontPalette* = nullptr) const; ++ const FontPalette* = nullptr); + + String FamilyNameForInspector() const; + +@@ -93,6 +91,7 @@ class PLATFORM_EXPORT FontCustomPlatform + bool MayBeIconFont() const; + + private: ++ FontCustomPlatformData(sk_sp, size_t data_size); + sk_sp base_typeface_; + size_t data_size_; + +--- a/third_party/blink/renderer/platform/testing/font_test_helpers.cc ++++ b/third_party/blink/renderer/platform/testing/font_test_helpers.cc +@@ -29,7 +29,7 @@ class TestFontSelector : public FontSele + static TestFontSelector* Create(const uint8_t* data, size_t size) { + scoped_refptr font_buffer = SharedBuffer::Create(data, size); + String ots_parse_message; +- FontCustomPlatformData* font_custom_platform_data = ++ scoped_refptr font_custom_platform_data = + FontCustomPlatformData::Create(font_buffer.get(), ots_parse_message); + if (!font_custom_platform_data) + return nullptr; +@@ -37,17 +37,12 @@ class TestFontSelector : public FontSele + std::move(font_custom_platform_data)); + } + +- TestFontSelector(FontCustomPlatformData* custom_platform_data) +- : custom_platform_data_(custom_platform_data) { ++ TestFontSelector(scoped_refptr custom_platform_data) ++ : custom_platform_data_(std::move(custom_platform_data)) { + DCHECK(custom_platform_data_); + } + ~TestFontSelector() override = default; + +- void Trace(Visitor* visitor) const override { +- visitor->Trace(custom_platform_data_); +- FontSelector::Trace(visitor); +- } +- + FontData* GetFontData(const FontDescription& font_description, + const FontFamily&) override { + FontSelectionCapabilities normal_capabilities( +@@ -117,7 +112,7 @@ class TestFontSelector : public FontSele + } + + private: +- Member custom_platform_data_; ++ scoped_refptr custom_platform_data_; + }; + + } // namespace diff --git a/chromium-125-debian-bad-font-gc11.patch b/chromium-125-debian-bad-font-gc11.patch new file mode 100644 index 0000000000000000000000000000000000000000..da3019974efcc38b10a9fac7a4e7f80ae040e60c --- /dev/null +++ b/chromium-125-debian-bad-font-gc11.patch @@ -0,0 +1,420 @@ +Revert the following commit: + +commit 2eefeabb12fb7e92f2508116a5ed959c57659be1 +Author: Ian Kilpatrick +Date: Tue Feb 20 17:40:39 2024 +0000 + + [gc] Make HarfBuzzFontData & friends gc'd. + + Previously we had a HbFontCacheEntry which was used to hold onto the + HarfBuzzFontData, and a hb_font_t. + + HarfBuzzFontData is used for holding data specific for various + harfbuzz callbacks, but we can also hold onto the hb_font_t there. + + There should be no user-visible behaviour change. + + Bug: 41490008 + Change-Id: Icaa7ad3b2f75e9807b88014a9a15406cb76eb52e + Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5302175 + Reviewed-by: Dominik Röttsches + Commit-Queue: Ian Kilpatrick + Cr-Commit-Position: refs/heads/main@{#1262752} + +--- a/third_party/blink/renderer/platform/fonts/font_global_context.cc ++++ b/third_party/blink/renderer/platform/fonts/font_global_context.cc +@@ -8,6 +8,7 @@ + #include "third_party/blink/renderer/platform/fonts/font_cache.h" + #include "third_party/blink/renderer/platform/fonts/font_unique_name_lookup.h" + #include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h" ++#include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h" + #include "third_party/blink/renderer/platform/privacy_budget/identifiability_digest_helpers.h" + #include "third_party/blink/renderer/platform/wtf/thread_specific.h" + +@@ -50,6 +51,15 @@ FontUniqueNameLookup* FontGlobalContext: + return Get().font_unique_name_lookup_.get(); + } + ++HarfBuzzFontCache& FontGlobalContext::GetHarfBuzzFontCache() { ++ std::unique_ptr& global_context_harfbuzz_font_cache = ++ Get().harfbuzz_font_cache_; ++ if (!global_context_harfbuzz_font_cache) { ++ global_context_harfbuzz_font_cache = std::make_unique(); ++ } ++ return *global_context_harfbuzz_font_cache; ++} ++ + IdentifiableToken FontGlobalContext::GetOrComputeTypefaceDigest( + const FontPlatformData& source) { + SkTypeface* typeface = source.Typeface(); +--- a/third_party/blink/renderer/platform/fonts/font_global_context.h ++++ b/third_party/blink/renderer/platform/fonts/font_global_context.h +@@ -9,7 +9,6 @@ + #include "base/types/pass_key.h" + #include "third_party/blink/public/common/privacy_budget/identifiable_token.h" + #include "third_party/blink/renderer/platform/fonts/font_cache.h" +-#include "third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h" + #include "third_party/blink/renderer/platform/platform_export.h" + #include "third_party/blink/renderer/platform/text/layout_locale.h" + #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" +@@ -34,19 +33,14 @@ class PLATFORM_EXPORT FontGlobalContext + static FontGlobalContext& Get(); + static FontGlobalContext* TryGet(); + +- void Trace(Visitor* visitor) const { +- visitor->Trace(font_cache_); +- visitor->Trace(harfbuzz_font_cache_); +- } ++ void Trace(Visitor* visitor) const { visitor->Trace(font_cache_); } + + FontGlobalContext(const FontGlobalContext&) = delete; + FontGlobalContext& operator=(const FontGlobalContext&) = delete; + + static inline FontCache& GetFontCache() { return Get().font_cache_; } + +- static HarfBuzzFontCache& GetHarfBuzzFontCache() { +- return Get().harfbuzz_font_cache_; +- } ++ static HarfBuzzFontCache& GetHarfBuzzFontCache(); + + static FontUniqueNameLookup* GetFontUniqueNameLookup(); + +@@ -62,7 +56,7 @@ class PLATFORM_EXPORT FontGlobalContext + + private: + FontCache font_cache_; +- HarfBuzzFontCache harfbuzz_font_cache_; ++ std::unique_ptr harfbuzz_font_cache_; + std::unique_ptr font_unique_name_lookup_; + base::HashingLRUCache typeface_digest_cache_; + base::HashingLRUCache +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc +@@ -65,14 +65,20 @@ + + HarfBuzzFace::HarfBuzzFace(const FontPlatformData* platform_data, + uint64_t unique_id) +- : platform_data_(platform_data), +- harfbuzz_font_data_(FontGlobalContext::GetHarfBuzzFontCache().GetOrCreate( +- unique_id, +- platform_data)) {} ++ : platform_data_(platform_data), unique_id_(unique_id) { ++ HbFontCacheEntry* const cache_entry = ++ FontGlobalContext::GetHarfBuzzFontCache().RefOrNew(unique_id_, ++ platform_data); ++ unscaled_font_ = cache_entry->HbFont(); ++ harfbuzz_font_data_ = cache_entry->HbFontData(); ++} ++ ++HarfBuzzFace::~HarfBuzzFace() { ++ FontGlobalContext::GetHarfBuzzFontCache().Remove(unique_id_); ++} + + void HarfBuzzFace::Trace(Visitor* visitor) const { + visitor->Trace(platform_data_); +- visitor->Trace(harfbuzz_font_data_); + } + + bool HarfBuzzFace::ignore_variation_selectors_ = false; +@@ -234,17 +240,14 @@ bool HarfBuzzFace::HasSpaceInLigaturesOr + + hb::unique_ptr glyphs(hb_set_create()); + +- hb_font_t* unscaled_font = harfbuzz_font_data_->unscaled_font_.get(); +- + // Check whether computing is needed and compute for gpos/gsub. + if (features & kKerning && + harfbuzz_font_data_->space_in_gpos_ == + HarfBuzzFontData::SpaceGlyphInOpenTypeTables::kUnknown) { +- if (space == kInvalidCodepoint && !GetSpaceGlyph(unscaled_font, space)) { ++ if (space == kInvalidCodepoint && !GetSpaceGlyph(unscaled_font_, space)) + return false; +- } + // Compute for gpos. +- hb_face_t* face = hb_font_get_face(unscaled_font); ++ hb_face_t* face = hb_font_get_face(unscaled_font_); + DCHECK(face); + harfbuzz_font_data_->space_in_gpos_ = + hb_ot_layout_has_positioning(face) && +@@ -258,11 +261,10 @@ bool HarfBuzzFace::HasSpaceInLigaturesOr + if (features & kLigatures && + harfbuzz_font_data_->space_in_gsub_ == + HarfBuzzFontData::SpaceGlyphInOpenTypeTables::kUnknown) { +- if (space == kInvalidCodepoint && !GetSpaceGlyph(unscaled_font, space)) { ++ if (space == kInvalidCodepoint && !GetSpaceGlyph(unscaled_font_, space)) + return false; +- } + // Compute for gpos. +- hb_face_t* face = hb_font_get_face(unscaled_font); ++ hb_face_t* face = hb_font_get_face(unscaled_font_); + DCHECK(face); + harfbuzz_font_data_->space_in_gsub_ = + hb_ot_layout_has_substitution(face) && +@@ -280,14 +282,14 @@ bool HarfBuzzFace::HasSpaceInLigaturesOr + } + + unsigned HarfBuzzFace::UnitsPerEmFromHeadTable() { +- hb_face_t* face = hb_font_get_face(harfbuzz_font_data_->unscaled_font_.get()); ++ hb_face_t* face = hb_font_get_face(unscaled_font_); + return hb_face_get_upem(face); + } + + Glyph HarfBuzzFace::HbGlyphForCharacter(UChar32 character) { + hb_codepoint_t glyph = 0; +- HarfBuzzGetNominalGlyph(harfbuzz_font_data_->unscaled_font_.get(), +- harfbuzz_font_data_, character, &glyph, nullptr); ++ HarfBuzzGetNominalGlyph(unscaled_font_, harfbuzz_font_data_, character, ++ &glyph, nullptr); + return glyph; + } + +@@ -329,7 +331,7 @@ hb_codepoint_t HarfBuzzFace::HarfBuzzGet + UChar32 variation_selector) { + DCHECK(RuntimeEnabledFeatures::FontVariationSequencesEnabled()); + hb_codepoint_t glyph = 0; +- HarfBuzzGetGlyph(harfbuzz_font_data_->unscaled_font_.get(), ++ HarfBuzzGetGlyph(unscaled_font_, + harfbuzz_font_data_, character, variation_selector, &glyph, + nullptr); + return glyph; +@@ -444,10 +446,9 @@ static hb::unique_ptr CreateF + return face; + } + +-namespace { +- +-HarfBuzzFontData* CreateHarfBuzzFontData(hb_face_t* face, +- SkTypeface* typeface) { ++static scoped_refptr CreateHbFontCacheEntry( ++ hb_face_t* face, ++ SkTypeface* typeface) { + hb::unique_ptr ot_font(hb_font_create(face)); + hb_ot_font_set_funcs(ot_font.get()); + +@@ -466,26 +467,25 @@ HarfBuzzFontData* CreateHarfBuzzFontData + // Creating a sub font means that non-available functions + // are found from the parent. + hb_font_t* const unscaled_font = hb_font_create_sub_font(ot_font.get()); +- HarfBuzzFontData* data = +- MakeGarbageCollected(unscaled_font); ++ scoped_refptr cache_entry = ++ HbFontCacheEntry::Create(unscaled_font); + hb_font_set_funcs(unscaled_font, +- HarfBuzzSkiaFontFuncs::Get().GetFunctions(typeface), data, +- nullptr); +- return data; ++ HarfBuzzSkiaFontFuncs::Get().GetFunctions(typeface), ++ cache_entry->HbFontData(), nullptr); ++ return cache_entry; + } + +-} // namespace +- +-HarfBuzzFontData* HarfBuzzFontCache::GetOrCreate( ++HbFontCacheEntry* HarfBuzzFontCache::RefOrNew( + uint64_t unique_id, + const FontPlatformData* platform_data) { + const auto& result = font_map_.insert(unique_id, nullptr); + if (result.is_new_entry) { + hb::unique_ptr face = CreateFace(platform_data); + result.stored_value->value = +- CreateHarfBuzzFontData(face.get(), platform_data->Typeface()); ++ CreateHbFontCacheEntry(face.get(), platform_data->Typeface()); + } +- return result.stored_value->value.Get(); ++ result.stored_value->value->AddRef(); ++ return result.stored_value->value.get(); + } + + static_assert( +@@ -516,18 +516,17 @@ hb_font_t* HarfBuzzFace::GetScaledFont(s + vertical_layout); + + int scale = SkiaScalarToHarfBuzzPosition(platform_data_->size()); +- hb_font_t* unscaled_font = harfbuzz_font_data_->unscaled_font_.get(); +- hb_font_set_scale(unscaled_font, scale, scale); ++ hb_font_set_scale(unscaled_font_, scale, scale); + // See contended discussion in https://github.com/harfbuzz/harfbuzz/pull/1484 + // Setting ptem here is critical for HarfBuzz to know where to lookup spacing + // offset in the AAT trak table, the unit pt in ptem here means "CoreText" + // points. After discussion on the pull request and with Apple developers, the + // meaning of HarfBuzz' hb_font_set_ptem API was changed to expect the + // equivalent of CSS pixels here. +- hb_font_set_ptem(unscaled_font, specified_size > 0 ? specified_size +- : platform_data_->size()); ++ hb_font_set_ptem(unscaled_font_, specified_size > 0 ? specified_size ++ : platform_data_->size()); + +- return unscaled_font; ++ return unscaled_font_; + } + + hb_font_t* HarfBuzzFace::GetScaledFont() const { +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h +@@ -55,6 +55,7 @@ class HarfBuzzFace final : public Garbag + HarfBuzzFace(const FontPlatformData* platform_data, uint64_t); + HarfBuzzFace(const HarfBuzzFace&) = delete; + HarfBuzzFace& operator=(const HarfBuzzFace&) = delete; ++ ~HarfBuzzFace(); + + void Trace(Visitor*) const; + +@@ -106,7 +106,11 @@ + void PrepareHarfBuzzFontData(); + + Member platform_data_; +- Member harfbuzz_font_data_; ++ const uint64_t unique_id_; ++ // TODO(crbug.com/1489080): When briefly given MiraclePtr protection, ++ // these members were both found dangling. ++ hb_font_t* unscaled_font_; ++ HarfBuzzFontData* harfbuzz_font_data_; + static bool ignore_variation_selectors_; + }; + +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.cc ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.cc +@@ -8,8 +8,38 @@ + + namespace blink { + +-void HarfBuzzFontCache::Trace(Visitor* visitor) const { +- visitor->Trace(font_map_); ++HbFontCacheEntry::HbFontCacheEntry(hb_font_t* font) ++ : hb_font_(hb::unique_ptr(font)), ++ hb_font_data_(std::make_unique()) {} ++ ++HbFontCacheEntry::~HbFontCacheEntry() = default; ++ ++scoped_refptr HbFontCacheEntry::Create(hb_font_t* hb_font) { ++ DCHECK(hb_font); ++ return base::AdoptRef(new HbFontCacheEntry(hb_font)); ++} ++ ++HarfBuzzFontCache::HarfBuzzFontCache() = default; ++HarfBuzzFontCache::~HarfBuzzFontCache() = default; ++ ++// See "harfbuzz_face.cc" for |HarfBuzzFontCache::GetOrCreateFontData()| ++// implementation. ++ ++void HarfBuzzFontCache::Remove(uint64_t unique_id) { ++ auto it = font_map_.find(unique_id); ++ // TODO(https://crbug.com/1417160): In tests such as FontObjectThreadedTest ++ // that test taking down FontGlobalContext an object may not be found due to ++ // existing issues with refcounting of font objects at thread destruction ++ // time. ++ if (it == font_map_.end()) { ++ return; ++ } ++ DCHECK(!it.Get()->value->HasOneRef()); ++ it.Get()->value->Release(); ++ if (!it.Get()->value->HasOneRef()) { ++ return; ++ } ++ font_map_.erase(it); + } + + } // namespace blink +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h +@@ -6,9 +6,12 @@ + #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_SHAPING_HARFBUZZ_FONT_CACHE_H_ + + #include "third_party/blink/renderer/platform/fonts/font_metrics.h" +-#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h" +-#include "third_party/blink/renderer/platform/heap/garbage_collected.h" +-#include "third_party/blink/renderer/platform/heap/member.h" ++#include "third_party/blink/renderer/platform/fonts/unicode_range_set.h" ++ ++#include ++#include ++ ++#include + + namespace blink { + +@@ -22,21 +25,39 @@ struct HarfBuzzFontData; + // FIXME, crbug.com/609099: We should fix the FontCache to only keep one + // FontPlatformData object independent of size, then consider using this here. + +-class HarfBuzzFontCache final { +- DISALLOW_NEW(); ++class HbFontCacheEntry : public RefCounted { ++ USING_FAST_MALLOC(HbFontCacheEntry); ++ ++ public: ++ static scoped_refptr Create(hb_font_t* hb_font); ++ ++ hb_font_t* HbFont() { return hb_font_.get(); } ++ HarfBuzzFontData* HbFontData() { return hb_font_data_.get(); } ++ ++ ~HbFontCacheEntry(); + ++ private: ++ explicit HbFontCacheEntry(hb_font_t* font); ++ ++ hb::unique_ptr hb_font_; ++ std::unique_ptr hb_font_data_; ++}; ++ ++class HarfBuzzFontCache final { + public: +- void Trace(Visitor* visitor) const; +- // See "harfbuzz_face.cc" for |HarfBuzzFontCache::GetOrCreateFontData()| +- // implementation. +- HarfBuzzFontData* GetOrCreate(uint64_t unique_id, +- const FontPlatformData* platform_data); ++ HarfBuzzFontCache(); ++ ~HarfBuzzFontCache(); ++ ++ HbFontCacheEntry* RefOrNew(uint64_t unique_id, ++ const FontPlatformData* platform_data); ++ void Remove(uint64_t unique_id); + + private: +- HeapHashMap, +- IntWithZeroKeyHashTraits> +- font_map_; ++ using HbFontDataMap = HashMap, ++ IntWithZeroKeyHashTraits>; ++ ++ HbFontDataMap font_map_; + }; + + } // namespace blink +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_data.h +@@ -22,18 +22,15 @@ const unsigned kInvalidFallbackMetricsVa + // The HarfBuzzFontData struct carries user-pointer data for + // |hb_font_t| callback functions/operations. It contains metrics and OpenType + // layout information related to a font scaled to a particular size. +-struct HarfBuzzFontData final : public GarbageCollected { ++struct HarfBuzzFontData final { ++ USING_FAST_MALLOC(HarfBuzzFontData); ++ + public: +- explicit HarfBuzzFontData(hb_font_t* unscaled_font) +- : unscaled_font_(hb::unique_ptr(unscaled_font)), +- vertical_data_(nullptr), +- range_set_(nullptr) {} ++ HarfBuzzFontData() : vertical_data_(nullptr), range_set_(nullptr) {} + + HarfBuzzFontData(const HarfBuzzFontData&) = delete; + HarfBuzzFontData& operator=(const HarfBuzzFontData&) = delete; + +- void Trace(Visitor*) const {} +- + // The vertical origin and vertical advance functions in HarfBuzzFace require + // the ascent and height metrics as fallback in case no specific vertical + // layout information is found from the font. +@@ -81,7 +78,6 @@ struct HarfBuzzFontData final : public G + return vertical_data_; + } + +- const hb::unique_ptr unscaled_font_; + SkFont font_; + + // Capture these scaled fallback metrics from FontPlatformData so that a diff --git a/chromium-125-debian-bad-font-gc2.patch b/chromium-125-debian-bad-font-gc2.patch new file mode 100644 index 0000000000000000000000000000000000000000..b718479331bab3f374945a807e86fd91bab82329 --- /dev/null +++ b/chromium-125-debian-bad-font-gc2.patch @@ -0,0 +1,3727 @@ +Chromium 123 was buggy, with tabs regularly hanging/crashing. The culprit +was the GC cleaning up font cache stuff, and deadlocking in a FontCacheKey +destructor: + +Thread 54 (Thread 0x7fffc55fe6c0 (LWP 413811) "Chrome_InProcRe"): +#0 0x00007ffff6720719 in syscall () from /lib/x86_64-linux-gnu/libc.so.6 +#1 0x000055555c1752d9 in partition_alloc::internal::SpinningMutex::LockSlow() () +#2 0x000055555c185529 in allocator_shim::internal::PartitionFree(allocator_shim::AllocatorDispatch const*, void*, void*) () +#3 0x000055555f7db46b in blink::FontCacheKey::~FontCacheKey() () +#4 0x000055555f7db6f4 in WTF::WeakProcessingHashTableHelper<(WTF::WeakHandlingFlag)1, blink::FontCacheKey, WTF::KeyValuePair >, WTF::KeyValuePairExtractor, WTF::HashMapValueTraits, WTF::HashTraits > >, WTF::HashTraits, blink::HeapAllocator>::Process(cppgc::LivenessBroker const&, void const*) () +#5 0x0000555559544bef in cppgc::internal::MarkerBase::ProcessWeakness() () +#6 0x000055555954487e in cppgc::internal::MarkerBase::LeaveAtomicPause() () +#7 0x0000555558e8115a in v8::internal::CppHeap::FinishMarkingAndStartSweeping() () +#8 0x0000555558ebcdc0 in v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GarbageCollectionReason, char const*) () +#9 0x0000555558ecfe14 in v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags)::$_0::operator()() const () +#10 0x0000555558ecfb65 in void heap::base::Stack::SetMarkerAndCallbackImpl(heap::base::Stack*, void*, void const*) () +--Type for more, q to quit, c to continue without paging-- +#11 0x000055555955216b in PushAllRegistersAndIterateStack () +#12 0x0000555558eb8c19 in v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) () +#13 0x0000555558eba3eb in v8::internal::Heap::FinalizeIncrementalMarkingAtomically(v8::internal::GarbageCollectionReason) () +#14 0x0000555558ed20db in v8::internal::IncrementalMarkingJob::Task::RunInternal() () +#15 0x000055555c0c49d6 in base::TaskAnnotator::RunTaskImpl(base::PendingTask&) () +#16 0x000055555c0daf88 in base::sequence_manager::internal::ThreadControllerImpl::DoWork(base::sequence_manager::internal::ThreadControllerImpl::WorkType) () +#17 0x000055555c0c49d6 in base::TaskAnnotator::RunTaskImpl(base::PendingTask&) () +#18 0x000055555c0dd8f9 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*) () +#19 0x000055555c0dd3bf in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() () +#20 0x000055555c0ddd75 in non-virtual thunk to base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() () +#21 0x000055555c07eb4f in base::MessagePumpDefault::Run(base::MessagePump::Delegate*) () +#22 0x000055555c0de110 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, base::TimeDelta) () +#23 0x000055555c0a4c26 in base::RunLoop::Run(base::Location const&) () +#24 0x000055555c100155 in base::Thread::Run(base::RunLoop*) () +#25 0x000055555c100342 in base::Thread::ThreadMain() () + + +The commit below modified font stuff to go from using scoped_refptrs to +getting cleaned up via GC. Reverting it fixes chromium's behavior for us. +It would be good to get a proper fix for this, but reverting this will +have to do for now. + + +commit bff9ec6754f7bf97c61d84663ee2ccc5055e9eb3 +Author: Ian Kilpatrick +Date: Tue Feb 13 19:15:19 2024 +0000 + + [gc] Make SimpleFontData & FontPlatformData & friends gc'd. + + The largest change is making the associated caches for these objects + weak collections instead of relying on the relatively complex purging + logic. + + https://variable-lizards.glitch.me/ appears not to leak. + + There should be no user-visible behaviour change. + + Bug: 41490008 + Change-Id: Iba581842459cf31f7f4fe60d83665f393a7d06a3 + Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5262982 + Reviewed-by: Caleb Raitto + Reviewed-by: Dominik Röttsches + Commit-Queue: Ian Kilpatrick + Cr-Commit-Position: refs/heads/main@{#1259965} + +--- a/third_party/blink/renderer/core/css/binary_data_font_face_source.cc ++++ b/third_party/blink/renderer/core/css/binary_data_font_face_source.cc +@@ -36,10 +36,10 @@ bool BinaryDataFontFaceSource::IsValid() + return custom_platform_data_.get(); + } + +-SimpleFontData* BinaryDataFontFaceSource::CreateFontData( ++scoped_refptr BinaryDataFontFaceSource::CreateFontData( + const FontDescription& font_description, + const FontSelectionCapabilities& font_selection_capabilities) { +- return MakeGarbageCollected( ++ return SimpleFontData::Create( + custom_platform_data_->GetFontPlatformData( + font_description.EffectiveFontSize(), + font_description.AdjustedSpecifiedSize(), +@@ -56,7 +56,7 @@ SimpleFontData* BinaryDataFontFaceSource + : ResolvedFontFeatures(), + font_description.Orientation(), font_description.VariationSettings(), + font_description.GetFontPalette()), +- MakeGarbageCollected()); ++ CustomFontData::Create()); + } + + } // namespace blink +--- a/third_party/blink/renderer/core/css/binary_data_font_face_source.h ++++ b/third_party/blink/renderer/core/css/binary_data_font_face_source.h +@@ -20,8 +20,9 @@ class BinaryDataFontFaceSource final : p + bool IsValid() const override; + + private: +- SimpleFontData* CreateFontData(const FontDescription&, +- const FontSelectionCapabilities&) override; ++ scoped_refptr CreateFontData( ++ const FontDescription&, ++ const FontSelectionCapabilities&) override; + + scoped_refptr custom_platform_data_; + }; +--- a/third_party/blink/renderer/core/css/css_custom_font_data.h ++++ b/third_party/blink/renderer/core/css/css_custom_font_data.h +@@ -31,18 +31,13 @@ class CSSCustomFontData final : public C + public: + enum FallbackVisibility { kInvisibleFallback, kVisibleFallback }; + +- CSSCustomFontData(CSSFontFaceSource* source, FallbackVisibility visibility) +- : font_face_source_(source), fallback_visibility_(visibility) { +- if (source) { +- is_loading_ = source->IsLoading(); +- } ++ static scoped_refptr Create( ++ CSSFontFaceSource* source, ++ FallbackVisibility visibility) { ++ return base::AdoptRef(new CSSCustomFontData(source, visibility)); + } +- ~CSSCustomFontData() override = default; + +- void Trace(Visitor* visitor) const override { +- visitor->Trace(font_face_source_); +- CustomFontData::Trace(visitor); +- } ++ ~CSSCustomFontData() override = default; + + bool ShouldSkipDrawing() const override { + if (font_face_source_) { +@@ -66,7 +61,16 @@ class CSSCustomFontData final : public C + } + + private: +- Member font_face_source_; ++ CSSCustomFontData(CSSFontFaceSource* source, FallbackVisibility visibility) ++ : font_face_source_(source), fallback_visibility_(visibility) { ++ if (source) { ++ is_loading_ = source->IsLoading(); ++ } ++ } ++ ++ // TODO(Oilpan): consider moving (Custom)FontFace hierarchy to the heap, ++ // thereby making this reference a Member<>. ++ WeakPersistent font_face_source_; + FallbackVisibility fallback_visibility_; + mutable bool is_loading_ = false; + }; +--- a/third_party/blink/renderer/core/css/css_font_face.cc ++++ b/third_party/blink/renderer/core/css/css_font_face.cc +@@ -114,7 +114,7 @@ bool CSSFontFace::FallbackVisibilityChan + return true; + } + +-const SimpleFontData* CSSFontFace::GetFontData( ++scoped_refptr CSSFontFace::GetFontData( + const FontDescription& font_description) { + if (!IsValid()) { + return nullptr; +@@ -140,7 +140,7 @@ const SimpleFontData* CSSFontFace::GetFo + return nullptr; + } + +- if (const SimpleFontData* result = ++ if (scoped_refptr result = + source->GetFontData(size_adjusted_description, + font_face_->GetFontSelectionCapabilities())) { + // The font data here is created using the primary font's description. +@@ -149,7 +149,7 @@ const SimpleFontData* CSSFontFace::GetFo + if (size_adjusted_description.HasSizeAdjust()) { + if (auto adjusted_size = + FontSizeFunctions::MetricsMultiplierAdjustedFontSize( +- result, size_adjusted_description)) { ++ result.get(), size_adjusted_description)) { + size_adjusted_description.SetAdjustedSize(adjusted_size.value()); + result = + source->GetFontData(size_adjusted_description, +--- a/third_party/blink/renderer/core/css/css_font_face.h ++++ b/third_party/blink/renderer/core/css/css_font_face.h +@@ -76,7 +76,7 @@ class CORE_EXPORT CSSFontFace final : pu + bool FontLoaded(CSSFontFaceSource*); + bool FallbackVisibilityChanged(RemoteFontFaceSource*); + +- const SimpleFontData* GetFontData(const FontDescription&); ++ scoped_refptr GetFontData(const FontDescription&); + + FontFace::LoadStatusType LoadStatus() const { + return font_face_->LoadStatus(); +--- a/third_party/blink/renderer/core/css/css_font_face_source.cc ++++ b/third_party/blink/renderer/core/css/css_font_face_source.cc +@@ -31,11 +31,22 @@ + #include "third_party/blink/renderer/platform/fonts/font_face_creation_params.h" + #include "third_party/blink/renderer/platform/fonts/simple_font_data.h" + ++namespace { ++// An excessive amount of SimpleFontData objects is generated from ++// CSSFontFaceSource if a lot of varying FontDescriptions point to a web ++// font. These FontDescriptions can vary in size, font-feature-settings or ++// font-variation settings. Well known cases are animations of font-variation ++// settings, compare crbug.com/778352. For a start, let's reduce this number to ++// 1024, which is still a large number and should have enough steps for font ++// animations from the same font face source, but avoids unbounded growth. ++const size_t kMaxCachedFontData = 1024; ++} // namespace ++ + namespace blink { + + CSSFontFaceSource::~CSSFontFaceSource() = default; + +-const SimpleFontData* CSSFontFaceSource::GetFontData( ++scoped_refptr CSSFontFaceSource::GetFontData( + const FontDescription& font_description, + const FontSelectionCapabilities& font_selection_capabilities) { + // If the font hasn't loaded or an error occurred, then we've got nothing. +@@ -53,12 +64,52 @@ const SimpleFontData* CSSFontFaceSource: + FontCacheKey key = + font_description.CacheKey(FontFaceCreationParams(), is_unique_match); + +- auto result = font_data_table_.insert(key, nullptr); +- if (result.is_new_entry) { +- result.stored_value->value = +- CreateFontData(font_description, font_selection_capabilities); ++ // Get or create the font data. Take care to avoid dangling references into ++ // font_data_table_, because it is modified below during pruning. ++ scoped_refptr font_data; ++ { ++ auto* it = font_data_table_.insert(key, nullptr).stored_value; ++ if (!it->value) { ++ it->value = CreateFontData(font_description, font_selection_capabilities); ++ } ++ font_data = it->value; ++ } ++ ++ font_cache_key_age.PrependOrMoveToFirst(key); ++ PruneOldestIfNeeded(); ++ ++ DCHECK_LE(font_data_table_.size(), kMaxCachedFontData); ++ // No release, because fontData is a reference to a RefPtr that is held in the ++ // font_data_table_. ++ return font_data; ++} ++ ++void CSSFontFaceSource::PruneOldestIfNeeded() { ++ if (font_cache_key_age.size() > kMaxCachedFontData) { ++ DCHECK_EQ(font_cache_key_age.size() - 1, kMaxCachedFontData); ++ const FontCacheKey& key = font_cache_key_age.back(); ++ auto font_data_entry = font_data_table_.Take(key); ++ font_cache_key_age.pop_back(); ++ DCHECK_EQ(font_cache_key_age.size(), kMaxCachedFontData); ++ if (font_data_entry && font_data_entry->GetCustomFontData()) { ++ font_data_entry->GetCustomFontData()->ClearFontFaceSource(); ++ } ++ } ++} ++ ++void CSSFontFaceSource::PruneTable() { ++ if (font_data_table_.empty()) { ++ return; ++ } ++ ++ for (const auto& item : font_data_table_) { ++ SimpleFontData* font_data = item.value.get(); ++ if (font_data && font_data->GetCustomFontData()) { ++ font_data->GetCustomFontData()->ClearFontFaceSource(); ++ } + } +- return result.stored_value->value.Get(); ++ font_cache_key_age.clear(); ++ font_data_table_.clear(); + } + + } // namespace blink +--- a/third_party/blink/renderer/core/css/css_font_face_source.h ++++ b/third_party/blink/renderer/core/css/css_font_face_source.h +@@ -30,9 +30,7 @@ + #include "third_party/blink/renderer/core/css/font_display.h" + #include "third_party/blink/renderer/platform/fonts/font_cache_key.h" + #include "third_party/blink/renderer/platform/fonts/font_selection_types.h" +-#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h" + #include "third_party/blink/renderer/platform/heap/garbage_collected.h" +-#include "third_party/blink/renderer/platform/heap/member.h" + #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" + #include "third_party/blink/renderer/platform/wtf/hash_map.h" + #include "third_party/blink/renderer/platform/wtf/linked_hash_set.h" +@@ -71,8 +69,8 @@ class CORE_EXPORT CSSFontFaceSource + return nullptr; + } + +- const SimpleFontData* GetFontData(const FontDescription&, +- const FontSelectionCapabilities&); ++ scoped_refptr GetFontData(const FontDescription&, ++ const FontSelectionCapabilities&); + + // TODO(https://crbug.com/947461): IsLocalFontAvailable must not have a + // FontDescription argument. +@@ -93,29 +91,28 @@ class CORE_EXPORT CSSFontFaceSource + virtual bool HadBlankText() { return false; } + virtual void PaintRequested() {} + +- virtual void Trace(Visitor* visitor) const { +- visitor->Trace(font_data_table_); +- } ++ virtual void Trace(Visitor* visitor) const {} + + protected: + CSSFontFaceSource() = default; +- virtual const SimpleFontData* CreateFontData( ++ virtual scoped_refptr CreateFontData( + const FontDescription&, + const FontSelectionCapabilities&) = 0; +- +- void ClearTable() { font_data_table_.clear(); } ++ void PruneTable(); + + // Report the font lookup for metrics collection. Only used for local font + // face sources currently. + virtual void ReportFontLookup(const FontDescription& font_description, +- const SimpleFontData* font_data, ++ SimpleFontData* font_data, + bool is_loading_fallback = false) {} + + private: +- using FontDataTable = +- HeapHashMap>; ++ void PruneOldestIfNeeded(); ++ using FontDataTable = HashMap>; ++ using FontCacheKeyAgeList = LinkedHashSet; + + FontDataTable font_data_table_; ++ FontCacheKeyAgeList font_cache_key_age; + }; + + } // namespace blink +--- a/third_party/blink/renderer/core/css/css_font_selector.cc ++++ b/third_party/blink/renderer/core/css/css_font_selector.cc +@@ -162,7 +162,7 @@ void CSSFontSelector::FontCacheInvalidat + DispatchInvalidationCallbacks(FontInvalidationReason::kGeneralInvalidation); + } + +-const FontData* CSSFontSelector::GetFontData( ++scoped_refptr CSSFontSelector::GetFontData( + const FontDescription& font_description, + const FontFamily& font_family) { + const auto& family_name = font_family.FamilyName(); +@@ -252,13 +252,13 @@ const FontData* CSSFontSelector::GetFont + family_name, request_description.GetScript(), + request_description.GenericFamily(), settings_family_name); + +- const SimpleFontData* font_data = ++ scoped_refptr font_data = + FontCache::Get().GetFontData(request_description, settings_family_name); + if (font_data && request_description.HasSizeAdjust()) { + DCHECK(RuntimeEnabledFeatures::CSSFontSizeAdjustEnabled()); + if (auto adjusted_size = + FontSizeFunctions::MetricsMultiplierAdjustedFontSize( +- font_data, request_description)) { ++ font_data.get(), request_description)) { + FontDescription size_adjusted_description(request_description); + size_adjusted_description.SetAdjustedSize(adjusted_size.value()); + font_data = FontCache::Get().GetFontData(size_adjusted_description, +--- a/third_party/blink/renderer/core/css/css_font_selector.h ++++ b/third_party/blink/renderer/core/css/css_font_selector.h +@@ -49,8 +49,8 @@ class CORE_EXPORT CSSFontSelector : publ + + unsigned Version() const override { return font_face_cache_->Version(); } + +- const FontData* GetFontData(const FontDescription&, +- const FontFamily&) override; ++ scoped_refptr GetFontData(const FontDescription&, ++ const FontFamily&) override; + + void FontFaceInvalidated(FontInvalidationReason) override; + +--- a/third_party/blink/renderer/core/css/css_font_selector_base.cc ++++ b/third_party/blink/renderer/core/css/css_font_selector_base.cc +@@ -87,21 +87,21 @@ void CSSFontSelectorBase::ReportFailedLo + void CSSFontSelectorBase::ReportFontLookupByUniqueOrFamilyName( + const AtomicString& name, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) { ++ scoped_refptr resulting_font_data) { + if (FontMatchingMetrics* font_matching_metrics = GetFontMatchingMetrics()) { + font_matching_metrics->ReportFontLookupByUniqueOrFamilyName( +- name, font_description, resulting_font_data); ++ name, font_description, resulting_font_data.get()); + } + } + + void CSSFontSelectorBase::ReportFontLookupByUniqueNameOnly( + const AtomicString& name, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data, ++ scoped_refptr resulting_font_data, + bool is_loading_fallback) { + if (FontMatchingMetrics* font_matching_metrics = GetFontMatchingMetrics()) { + font_matching_metrics->ReportFontLookupByUniqueNameOnly( +- name, font_description, resulting_font_data, is_loading_fallback); ++ name, font_description, resulting_font_data.get(), is_loading_fallback); + } + } + +@@ -109,20 +109,20 @@ void CSSFontSelectorBase::ReportFontLook + UChar32 fallback_character, + FontFallbackPriority fallback_priority, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) { ++ scoped_refptr resulting_font_data) { + if (FontMatchingMetrics* font_matching_metrics = GetFontMatchingMetrics()) { + font_matching_metrics->ReportFontLookupByFallbackCharacter( + fallback_character, fallback_priority, font_description, +- resulting_font_data); ++ resulting_font_data.get()); + } + } + + void CSSFontSelectorBase::ReportLastResortFallbackFontLookup( + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) { ++ scoped_refptr resulting_font_data) { + if (FontMatchingMetrics* font_matching_metrics = GetFontMatchingMetrics()) { + font_matching_metrics->ReportLastResortFallbackFontLookup( +- font_description, resulting_font_data); ++ font_description, resulting_font_data.get()); + } + } + +--- a/third_party/blink/renderer/core/css/css_font_selector_base.h ++++ b/third_party/blink/renderer/core/css/css_font_selector_base.h +@@ -46,23 +46,23 @@ class CORE_EXPORT CSSFontSelectorBase : + void ReportFontLookupByUniqueOrFamilyName( + const AtomicString& name, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) override; ++ scoped_refptr resulting_font_data) override; + + void ReportFontLookupByUniqueNameOnly( + const AtomicString& name, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data, ++ scoped_refptr resulting_font_data, + bool is_loading_fallback = false) override; + + void ReportFontLookupByFallbackCharacter( + UChar32 fallback_character, + FontFallbackPriority fallback_priority, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) override; ++ scoped_refptr resulting_font_data) override; + + void ReportLastResortFallbackFontLookup( + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) override; ++ scoped_refptr resulting_font_data) override; + + void ReportFontFamilyLookupByGenericFamily( + const AtomicString& generic_font_family_name, +--- a/third_party/blink/renderer/core/css/css_segmented_font_face.cc ++++ b/third_party/blink/renderer/core/css/css_segmented_font_face.cc +@@ -38,16 +38,42 @@ + #include "third_party/blink/renderer/platform/fonts/segmented_font_data.h" + #include "third_party/blink/renderer/platform/fonts/simple_font_data.h" + ++// See comment below in CSSSegmentedFontFace::GetFontData - the cache from ++// CSSSegmentedFontFace (which represents a group of @font-face declarations ++// with identical FontSelectionCapabilities but differing by unicode-range) to ++// FontData/SegmentedFontData, (i.e. the actual font blobs that can be used for ++// shaping and painting retrieved from a CSSFontFaceSource) is usually small ++// (less than a dozen, up to tens) for non-animation-cases, but grows fast to ++// thousands when animating variable font parameters. Set a limit until we start ++// dropping cache entries in animation scenarios. ++static constexpr size_t kFontDataTableMaxSize = 250; ++ + namespace blink { + ++// static ++CSSSegmentedFontFace* CSSSegmentedFontFace::Create( ++ FontSelectionCapabilities capabilities) { ++ return MakeGarbageCollected(capabilities); ++} ++ + CSSSegmentedFontFace::CSSSegmentedFontFace( + FontSelectionCapabilities font_selection_capabilities) + : font_selection_capabilities_(font_selection_capabilities), ++ font_data_table_(kFontDataTableMaxSize), + font_faces_(MakeGarbageCollected()), + approximate_character_count_(0) {} + + CSSSegmentedFontFace::~CSSSegmentedFontFace() = default; + ++void CSSSegmentedFontFace::PruneTable() { ++ // Make sure the glyph page tree prunes out all uses of this custom font. ++ if (!font_data_table_.size()) { ++ return; ++ } ++ ++ font_data_table_.Clear(); ++} ++ + bool CSSSegmentedFontFace::IsValid() const { + // Valid if at least one font face is valid. + return font_faces_->ForEachUntilTrue( +@@ -57,12 +83,12 @@ bool CSSSegmentedFontFace::IsValid() con + } + + void CSSSegmentedFontFace::FontFaceInvalidated() { +- font_data_table_.clear(); ++ PruneTable(); + } + + void CSSSegmentedFontFace::AddFontFace(FontFace* font_face, + bool css_connected) { +- font_data_table_.clear(); ++ PruneTable(); + font_face->CssFontFace()->AddSegmentedFontFace(this); + font_faces_->Insert(font_face, css_connected); + } +@@ -72,11 +98,11 @@ void CSSSegmentedFontFace::RemoveFontFac + return; + } + +- font_data_table_.clear(); ++ PruneTable(); + font_face->CssFontFace()->RemoveSegmentedFontFace(this); + } + +-const FontData* CSSSegmentedFontFace::GetFontData( ++scoped_refptr CSSSegmentedFontFace::GetFontData( + const FontDescription& font_description) { + if (!IsValid()) { + return nullptr; +@@ -98,16 +124,16 @@ const FontData* CSSSegmentedFontFace::Ge + // usually only a small number of FontData/SegmentedFontData instances created + // per CSSSegmentedFontFace. Whereas in variable font animations, this number + // grows rapidly. +- auto it = font_data_table_.find(key); ++ auto it = font_data_table_.Get(key); + if (it != font_data_table_.end()) { +- const SegmentedFontData* cached_font_data = it->value.Get(); ++ scoped_refptr cached_font_data = it->second; + if (cached_font_data && cached_font_data->NumFaces()) { + return cached_font_data; + } + } + +- SegmentedFontData* created_font_data = +- MakeGarbageCollected(); ++ scoped_refptr created_font_data = ++ SegmentedFontData::Create(); + + FontDescription requested_font_description(font_description); + const FontSelectionRequest& font_selection_request = +@@ -126,16 +152,26 @@ const FontData* CSSSegmentedFontFace::Ge + if (!font_face->CssFontFace()->IsValid()) { + return; + } +- if (const SimpleFontData* face_font_data = ++ if (scoped_refptr face_font_data = + font_face->CssFontFace()->GetFontData(requested_font_description)) { + DCHECK(!face_font_data->IsSegmented()); +- created_font_data->AppendFace(MakeGarbageCollected( +- std::move(face_font_data), font_face->CssFontFace()->Ranges())); ++ if (face_font_data->IsCustomFont()) { ++ created_font_data->AppendFace(base::AdoptRef(new FontDataForRangeSet( ++ std::move(face_font_data), font_face->CssFontFace()->Ranges()))); ++ } else { ++ created_font_data->AppendFace( ++ base::AdoptRef(new FontDataForRangeSetFromCache( ++ std::move(face_font_data), ++ font_face->CssFontFace()->Ranges()))); ++ } + } + }); + + if (created_font_data->NumFaces()) { +- font_data_table_.insert(std::move(key), created_font_data); ++ scoped_refptr put_to_cache(created_font_data); ++ font_data_table_.Put(std::move(key), std::move(put_to_cache)); ++ // No release, we have a reference to an object in the cache which should ++ // retain the ref count it has. + return created_font_data; + } + +@@ -186,7 +222,6 @@ void CSSSegmentedFontFace::Match(const S + } + + void CSSSegmentedFontFace::Trace(Visitor* visitor) const { +- visitor->Trace(font_data_table_); + visitor->Trace(font_faces_); + } + +--- a/third_party/blink/renderer/core/css/css_segmented_font_face.h ++++ b/third_party/blink/renderer/core/css/css_segmented_font_face.h +@@ -32,7 +32,6 @@ + #include "third_party/blink/renderer/platform/fonts/font_cache_key.h" + #include "third_party/blink/renderer/platform/fonts/font_selection_types.h" + #include "third_party/blink/renderer/platform/fonts/segmented_font_data.h" +-#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h" + #include "third_party/blink/renderer/platform/heap/collection_support/heap_linked_hash_set.h" + #include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" + #include "third_party/blink/renderer/platform/heap/garbage_collected.h" +@@ -84,6 +83,8 @@ class FontFaceList : public GarbageColle + class CSSSegmentedFontFace final + : public GarbageCollected { + public: ++ static CSSSegmentedFontFace* Create(FontSelectionCapabilities); ++ + explicit CSSSegmentedFontFace(FontSelectionCapabilities); + ~CSSSegmentedFontFace(); + +@@ -99,7 +100,7 @@ class CSSSegmentedFontFace final + void RemoveFontFace(FontFace*); + bool IsEmpty() const { return font_faces_->IsEmpty(); } + +- const FontData* GetFontData(const FontDescription&); ++ scoped_refptr GetFontData(const FontDescription&); + + bool CheckFont(UChar32) const; + void Match(const String&, HeapVector>*) const; +@@ -112,11 +113,12 @@ class CSSSegmentedFontFace final + void Trace(Visitor*) const; + + private: ++ void PruneTable(); + bool IsValid() const; + + FontSelectionCapabilities font_selection_capabilities_; + +- HeapHashMap> ++ base::HashingLRUCache> + font_data_table_; + + // All non-CSS-connected FontFaces are stored after the CSS-connected ones. +--- a/third_party/blink/renderer/core/css/font_face_cache.cc ++++ b/third_party/blink/renderer/core/css/font_face_cache.cc +@@ -85,8 +85,8 @@ void FontFaceCache::CapabilitiesSet::Add + const auto result = + map_.insert(font_face->GetFontSelectionCapabilities(), nullptr); + if (result.is_new_entry) { +- result.stored_value->value = MakeGarbageCollected( +- font_face->GetFontSelectionCapabilities()); ++ result.stored_value->value = ++ CSSSegmentedFontFace::Create(font_face->GetFontSelectionCapabilities()); + } + + result.stored_value->value->AddFontFace(font_face, css_connected); +--- a/third_party/blink/renderer/core/css/local_font_face_source.cc ++++ b/third_party/blink/renderer/core/css/local_font_face_source.cc +@@ -52,22 +52,23 @@ bool LocalFontFaceSource::IsLocalFontAva + return font_available; + } + +-const SimpleFontData* LocalFontFaceSource::CreateLoadingFallbackFontData( ++scoped_refptr ++LocalFontFaceSource::CreateLoadingFallbackFontData( + const FontDescription& font_description) { + FontCachePurgePreventer font_cache_purge_preventer; +- const SimpleFontData* temporary_font = +- FontCache::Get().GetLastResortFallbackFont(font_description); ++ scoped_refptr temporary_font = ++ FontCache::Get().GetLastResortFallbackFont(font_description, ++ kDoNotRetain); + if (!temporary_font) { + NOTREACHED(); + return nullptr; + } +- CSSCustomFontData* css_font_data = MakeGarbageCollected( +- this, CSSCustomFontData::kVisibleFallback); +- return MakeGarbageCollected(&temporary_font->PlatformData(), +- css_font_data); ++ scoped_refptr css_font_data = ++ CSSCustomFontData::Create(this, CSSCustomFontData::kVisibleFallback); ++ return SimpleFontData::Create(temporary_font->PlatformData(), css_font_data); + } + +-const SimpleFontData* LocalFontFaceSource::CreateFontData( ++scoped_refptr LocalFontFaceSource::CreateFontData( + const FontDescription& font_description, + const FontSelectionCapabilities&) { + if (!IsValid()) { +@@ -84,9 +85,9 @@ const SimpleFontData* LocalFontFaceSourc + } + + if (IsValid() && IsLoading()) { +- const SimpleFontData* fallback_font_data = ++ scoped_refptr fallback_font_data = + CreateLoadingFallbackFontData(font_description); +- ReportFontLookup(font_description, fallback_font_data, ++ ReportFontLookup(font_description, fallback_font_data.get(), + true /* is_loading_fallback */); + return fallback_font_data; + } +@@ -110,10 +111,10 @@ const SimpleFontData* LocalFontFaceSourc + #endif + // TODO(https://crbug.com/1302264): Enable passing down of font-palette + // information here (font_description.GetFontPalette()). +- const SimpleFontData* font_data = FontCache::Get().GetFontData( ++ scoped_refptr font_data = FontCache::Get().GetFontData( + unstyled_description, font_name_, AlternateFontName::kLocalUniqueFace); +- histograms_.Record(font_data); +- ReportFontLookup(unstyled_description, font_data); ++ histograms_.Record(font_data.get()); ++ ReportFontLookup(unstyled_description, font_data.get()); + return font_data; + } + +@@ -132,7 +133,7 @@ void LocalFontFaceSource::BeginLoadIfNee + } + + void LocalFontFaceSource::NotifyFontUniqueNameLookupReady() { +- ClearTable(); ++ PruneTable(); + + if (face_->FontLoaded(this)) { + font_selector_->FontFaceInvalidated( +@@ -168,7 +169,7 @@ void LocalFontFaceSource::Trace(Visitor* + + void LocalFontFaceSource::ReportFontLookup( + const FontDescription& font_description, +- const SimpleFontData* font_data, ++ SimpleFontData* font_data, + bool is_loading_fallback) { + font_selector_->ReportFontLookupByUniqueNameOnly( + font_name_, font_description, font_data, is_loading_fallback); +--- a/third_party/blink/renderer/core/css/local_font_face_source.h ++++ b/third_party/blink/renderer/core/css/local_font_face_source.h +@@ -48,15 +48,16 @@ class LocalFontFaceSource final : public + void NotifyFontUniqueNameLookupReady(); + + protected: +- const SimpleFontData* CreateLoadingFallbackFontData(const FontDescription&); ++ scoped_refptr CreateLoadingFallbackFontData( ++ const FontDescription&); + + private: +- const SimpleFontData* CreateFontData( ++ scoped_refptr CreateFontData( + const FontDescription&, + const FontSelectionCapabilities&) override; + + void ReportFontLookup(const FontDescription& font_description, +- const SimpleFontData* font_data, ++ SimpleFontData* font_data, + bool is_loading_fallback = false) override; + + class LocalFontHistograms { +--- a/third_party/blink/renderer/core/css/offscreen_font_selector.cc ++++ b/third_party/blink/renderer/core/css/offscreen_font_selector.cc +@@ -39,7 +39,7 @@ void OffscreenFontSelector::RegisterForI + void OffscreenFontSelector::UnregisterForInvalidationCallbacks( + FontSelectorClient* client) {} + +-const FontData* OffscreenFontSelector::GetFontData( ++scoped_refptr OffscreenFontSelector::GetFontData( + const FontDescription& font_description, + const FontFamily& font_family) { + const auto& family_name = font_family.FamilyName(); +@@ -60,11 +60,11 @@ const FontData* OffscreenFontSelector::G + family_name, font_description.GetScript(), + font_description.GenericFamily(), settings_family_name); + +- const auto* font_data = ++ auto font_data = + FontCache::Get().GetFontData(font_description, settings_family_name); + + ReportFontLookupByUniqueOrFamilyName(settings_family_name, font_description, +- font_data); ++ font_data.get()); + + return font_data; + } +--- a/third_party/blink/renderer/core/css/offscreen_font_selector.h ++++ b/third_party/blink/renderer/core/css/offscreen_font_selector.h +@@ -26,8 +26,8 @@ class CORE_EXPORT OffscreenFontSelector + + unsigned Version() const override { return 1; } + +- const FontData* GetFontData(const FontDescription&, +- const FontFamily&) override; ++ scoped_refptr GetFontData(const FontDescription&, ++ const FontFamily&) override; + + void RegisterForInvalidationCallbacks(FontSelectorClient*) override; + void UnregisterForInvalidationCallbacks(FontSelectorClient*) override; +--- a/third_party/blink/renderer/core/css/remote_font_face_source.cc ++++ b/third_party/blink/renderer/core/css/remote_font_face_source.cc +@@ -240,7 +240,8 @@ void RemoteFontFaceSource::NotifyFinishe + } + + ClearResource(); +- ClearTable(); ++ ++ PruneTable(); + + if (GetDocument()) { + if (!GetDocument()->RenderingHasBegun()) { +@@ -305,7 +306,7 @@ bool RemoteFontFaceSource::UpdatePeriod( + // Invalidate the font if its fallback visibility has changed. + if (IsLoading() && period_ != new_period && + (period_ == kBlockPeriod || new_period == kBlockPeriod)) { +- ClearTable(); ++ PruneTable(); + if (face_->FallbackVisibilityChanged(this)) { + font_selector_->FontFaceInvalidated( + FontInvalidationReason::kGeneralInvalidation); +@@ -349,7 +350,7 @@ bool RemoteFontFaceSource::IsLowPriority + return is_intervention_triggered_; + } + +-const SimpleFontData* RemoteFontFaceSource::CreateFontData( ++scoped_refptr RemoteFontFaceSource::CreateFontData( + const FontDescription& font_description, + const FontSelectionCapabilities& font_selection_capabilities) { + if (period_ == kFailurePeriod || !IsValid()) { +@@ -362,7 +363,7 @@ const SimpleFontData* RemoteFontFaceSour + + histograms_.RecordFallbackTime(); + +- return MakeGarbageCollected( ++ return SimpleFontData::Create( + custom_font_data_->GetFontPlatformData( + font_description.EffectiveFontSize(), + font_description.AdjustedSpecifiedSize(), +@@ -379,24 +380,25 @@ const SimpleFontData* RemoteFontFaceSour + : ResolvedFontFeatures(), + font_description.Orientation(), font_description.VariationSettings(), + font_description.GetFontPalette()), +- MakeGarbageCollected()); ++ CustomFontData::Create()); + } + +-const SimpleFontData* RemoteFontFaceSource::CreateLoadingFallbackFontData( ++scoped_refptr ++RemoteFontFaceSource::CreateLoadingFallbackFontData( + const FontDescription& font_description) { + // This temporary font is not retained and should not be returned. + FontCachePurgePreventer font_cache_purge_preventer; +- const SimpleFontData* temporary_font = +- FontCache::Get().GetLastResortFallbackFont(font_description); ++ scoped_refptr temporary_font = ++ FontCache::Get().GetLastResortFallbackFont(font_description, ++ kDoNotRetain); + if (!temporary_font) { + DUMP_WILL_BE_NOTREACHED_NORETURN(); + return nullptr; + } +- CSSCustomFontData* css_font_data = MakeGarbageCollected( ++ scoped_refptr css_font_data = CSSCustomFontData::Create( + this, period_ == kBlockPeriod ? CSSCustomFontData::kInvisibleFallback + : CSSCustomFontData::kVisibleFallback); +- return MakeGarbageCollected(&temporary_font->PlatformData(), +- css_font_data); ++ return SimpleFontData::Create(temporary_font->PlatformData(), css_font_data); + } + + void RemoteFontFaceSource::BeginLoadIfNeeded() { +--- a/third_party/blink/renderer/core/css/remote_font_face_source.h ++++ b/third_party/blink/renderer/core/css/remote_font_face_source.h +@@ -66,10 +66,11 @@ class RemoteFontFaceSource final : publi + void Trace(Visitor*) const override; + + protected: +- const SimpleFontData* CreateFontData( ++ scoped_refptr CreateFontData( + const FontDescription&, + const FontSelectionCapabilities&) override; +- const SimpleFontData* CreateLoadingFallbackFontData(const FontDescription&); ++ scoped_refptr CreateLoadingFallbackFontData( ++ const FontDescription&); + + private: + // Periods of the Font Display Timeline. +--- a/third_party/blink/renderer/core/frame/font_matching_metrics.cc ++++ b/third_party/blink/renderer/core/frame/font_matching_metrics.cc +@@ -127,7 +127,7 @@ void FontMatchingMetrics::ReportLocalFon + } + + void FontMatchingMetrics::InsertFontHashIntoMap(IdentifiableTokenKey input_key, +- const SimpleFontData* font_data, ++ SimpleFontData* font_data, + TokenToTokenHashMap& hash_map) { + DCHECK(IdentifiabilityStudyShouldSampleFonts()); + if (hash_map.Contains(input_key)) { +@@ -160,7 +160,7 @@ FontMatchingMetrics::GetTokenBuilderWith + void FontMatchingMetrics::ReportFontLookupByUniqueOrFamilyName( + const AtomicString& name, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) { ++ SimpleFontData* resulting_font_data) { + Dactyloscoper::TraceFontLookup( + execution_context_, name, font_description, + Dactyloscoper::FontLookupType::kUniqueOrFamilyName); +@@ -184,7 +184,7 @@ void FontMatchingMetrics::ReportFontLook + void FontMatchingMetrics::ReportFontLookupByUniqueNameOnly( + const AtomicString& name, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data, ++ SimpleFontData* resulting_font_data, + bool is_loading_fallback) { + // We ignore lookups that result in loading fallbacks for now as they should + // only be temporary. +@@ -217,7 +217,7 @@ void FontMatchingMetrics::ReportFontLook + UChar32 fallback_character, + FontFallbackPriority fallback_priority, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) { ++ SimpleFontData* resulting_font_data) { + if (!IdentifiabilityStudySettings::Get()->ShouldSampleType( + IdentifiableSurface::Type::kLocalFontLookupByFallbackCharacter)) { + return; +@@ -236,7 +236,7 @@ void FontMatchingMetrics::ReportFontLook + + void FontMatchingMetrics::ReportLastResortFallbackFontLookup( + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) { ++ SimpleFontData* resulting_font_data) { + if (!IdentifiabilityStudySettings::Get()->ShouldSampleType( + IdentifiableSurface::Type::kLocalFontLookupAsLastResort)) { + return; +@@ -361,8 +361,7 @@ void FontMatchingMetrics::PublishAllMetr + PublishEmojiGlyphMetrics(); + } + +-int64_t FontMatchingMetrics::GetHashForFontData( +- const SimpleFontData* font_data) { ++int64_t FontMatchingMetrics::GetHashForFontData(SimpleFontData* font_data) { + return font_data ? FontGlobalContext::Get() + .GetOrComputeTypefaceDigest(font_data->PlatformData()) + .ToUkmMetricValue() +@@ -370,7 +369,7 @@ int64_t FontMatchingMetrics::GetHashForF + } + + IdentifiableToken FontMatchingMetrics::GetPostScriptNameTokenForFontData( +- const SimpleFontData* font_data) { ++ SimpleFontData* font_data) { + DCHECK(font_data); + return FontGlobalContext::Get().GetOrComputePostScriptNameDigest( + font_data->PlatformData()); +--- a/third_party/blink/renderer/core/frame/font_matching_metrics.h ++++ b/third_party/blink/renderer/core/frame/font_matching_metrics.h +@@ -100,16 +100,15 @@ class FontMatchingMetrics { + void ReportFontLookupByUniqueOrFamilyName( + const AtomicString& name, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data); ++ SimpleFontData* resulting_font_data); + + // Reports a local font was looked up by a name and font description. This + // only includes lookups where the name is allowed to match PostScript names + // and full font names, but not family names. +- void ReportFontLookupByUniqueNameOnly( +- const AtomicString& name, +- const FontDescription& font_description, +- const SimpleFontData* resulting_font_data, +- bool is_loading_fallback = false); ++ void ReportFontLookupByUniqueNameOnly(const AtomicString& name, ++ const FontDescription& font_description, ++ SimpleFontData* resulting_font_data, ++ bool is_loading_fallback = false); + + // Reports a font was looked up by a fallback character, fallback priority, + // and a font description. +@@ -117,12 +116,12 @@ class FontMatchingMetrics { + UChar32 fallback_character, + FontFallbackPriority fallback_priority, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data); ++ SimpleFontData* resulting_font_data); + + // Reports a last-resort fallback font was looked up by a font description. + void ReportLastResortFallbackFontLookup( + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data); ++ SimpleFontData* resulting_font_data); + + // Reports a generic font family name was matched according to the script and + // the user's preferences to a font family name. +@@ -171,7 +170,7 @@ class FontMatchingMetrics { + // nullptr, then the typeface digest will also be saved with its PostScript + // name in |font_load_postscript_name_|. + void InsertFontHashIntoMap(IdentifiableTokenKey input_key, +- const SimpleFontData* font_data, ++ SimpleFontData* font_data, + TokenToTokenHashMap& hash_map); + + // Reports a local font's existence was looked up by a name, but its actual +@@ -194,14 +193,14 @@ class FontMatchingMetrics { + + // Get a hash that uniquely represents the font data. Returns 0 if |font_data| + // is nullptr. +- int64_t GetHashForFontData(const SimpleFontData* font_data); ++ int64_t GetHashForFontData(SimpleFontData* font_data); + + void Initialize(); + + // Get a token that uniquely represents the typeface's PostScript name. May + // represent the empty string if no PostScript name was found. + IdentifiableToken GetPostScriptNameTokenForFontData( +- const SimpleFontData* font_data); ++ SimpleFontData* font_data); + + TokenToTokenHashMap font_lookups_by_unique_or_family_name_; + TokenToTokenHashMap font_lookups_by_unique_name_only_; +--- a/third_party/blink/renderer/core/html/forms/internal_popup_menu.cc ++++ b/third_party/blink/renderer/core/html/forms/internal_popup_menu.cc +@@ -132,8 +132,8 @@ class PopupMenuCSSFontSelector : public + + // We don't override willUseFontData() for now because the old PopupListBox + // only worked with fonts loaded when opening the popup. +- const FontData* GetFontData(const FontDescription&, +- const FontFamily&) override; ++ scoped_refptr GetFontData(const FontDescription&, ++ const FontFamily&) override; + + void Trace(Visitor*) const override; + +@@ -152,7 +152,7 @@ PopupMenuCSSFontSelector::PopupMenuCSSFo + + PopupMenuCSSFontSelector::~PopupMenuCSSFontSelector() = default; + +-const FontData* PopupMenuCSSFontSelector::GetFontData( ++scoped_refptr PopupMenuCSSFontSelector::GetFontData( + const FontDescription& description, + const FontFamily& font_family) { + return owner_font_selector_->GetFontData(description, font_family); +--- a/third_party/blink/renderer/core/inspector/inspector_css_agent.cc ++++ b/third_party/blink/renderer/core/inspector/inspector_css_agent.cc +@@ -122,7 +122,6 @@ + #include "third_party/blink/renderer/platform/fonts/font_custom_platform_data.h" + #include "third_party/blink/renderer/platform/fonts/shaping/caching_word_shaper.h" + #include "third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h" +-#include "third_party/blink/renderer/platform/heap/collection_support/clear_collection_scope.h" + #include "third_party/blink/renderer/platform/heap/garbage_collected.h" + #include "third_party/blink/renderer/platform/text/text_run.h" + #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" +@@ -200,10 +199,10 @@ HeapVector> FilterD + } + + void CollectPlatformFontsFromRunFontDataList( +- const HeapVector& run_font_data_list, ++ const Vector& run_font_data_list, + HashMap, std::pair>* font_stats) { + for (const auto& run_font_data : run_font_data_list) { +- const auto* simple_font_data = run_font_data.font_data_.Get(); ++ const auto* simple_font_data = run_font_data.font_data_; + String family_name = simple_font_data->PlatformData().FontFamilyName(); + if (family_name.IsNull()) + family_name = ""; +@@ -1733,8 +1732,7 @@ void InspectorCSSAgent::CollectPlatformF + if (!shape_result) { + continue; + } +- HeapVector run_font_data_list; +- ClearCollectionScope clear_scope(&run_font_data_list); ++ Vector run_font_data_list; + shape_result->GetRunFontData(&run_font_data_list); + CollectPlatformFontsFromRunFontDataList(run_font_data_list, font_stats); + } +--- a/third_party/blink/renderer/core/layout/inline/inline_box_state.cc ++++ b/third_party/blink/renderer/core/layout/inline/inline_box_state.cc +@@ -19,7 +19,6 @@ + #include "third_party/blink/renderer/core/style/computed_style.h" + #include "third_party/blink/renderer/core/svg/svg_length_functions.h" + #include "third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h" +-#include "third_party/blink/renderer/platform/heap/collection_support/clear_collection_scope.h" + + namespace blink { + +@@ -169,8 +168,7 @@ void InlineBoxState::EnsureTextMetrics(c + + void InlineBoxState::AccumulateUsedFonts(const ShapeResultView* shape_result) { + const auto baseline_type = style->GetFontBaseline(); +- HeapHashSet> fallback_fonts; +- ClearCollectionScope clear_scope(&fallback_fonts); ++ HashSet fallback_fonts; + shape_result->FallbackFonts(&fallback_fonts); + for (const SimpleFontData* const fallback_font : fallback_fonts) { + FontHeight fallback_metrics = +--- a/third_party/blink/renderer/core/layout/inline/ruby_utils.cc ++++ b/third_party/blink/renderer/core/layout/inline/ruby_utils.cc +@@ -12,7 +12,6 @@ + #include "third_party/blink/renderer/core/layout/layout_object_inlines.h" + #include "third_party/blink/renderer/core/layout/physical_box_fragment.h" + #include "third_party/blink/renderer/platform/fonts/font_height.h" +-#include "third_party/blink/renderer/platform/heap/collection_support/clear_collection_scope.h" + + namespace blink { + +@@ -33,10 +32,11 @@ std::tuple Adjus + primary_font_data->GetFontMetrics().FixedAscent(font_baseline); + const LayoutUnit primary_descent = line_height - primary_ascent; + ++ DCHECK(IsMainThread()); ++ DEFINE_STATIC_LOCAL(Vector, run_fonts, ()); ++ DCHECK_EQ(run_fonts.size(), 0u); + // We don't use ShapeResultView::FallbackFonts() because we can't know if the + // primary font is actually used with FallbackFonts(). +- HeapVector run_fonts; +- ClearCollectionScope clear_scope(&run_fonts); + shape_view.GetRunFontData(&run_fonts); + const LayoutUnit kNoDiff = LayoutUnit::Max(); + LayoutUnit over_diff = kNoDiff; +@@ -60,6 +60,7 @@ std::tuple Adjus + over_diff = std::min(over_diff, current_over_diff); + under_diff = std::min(under_diff, current_under_diff); + } ++ run_fonts.resize(0); + if (over_diff == kNoDiff) + over_diff = LayoutUnit(); + if (under_diff == kNoDiff) +@@ -956,8 +957,7 @@ FontHeight ComputeEmHeight(const Logical + FontHeight result_height; + // We don't use ShapeResultView::FallbackFonts() because we can't know if + // the primary font is actually used with FallbackFonts(). +- HeapVector run_fonts; +- ClearCollectionScope clear_scope(&run_fonts); ++ Vector run_fonts; + shape_result_view->GetRunFontData(&run_fonts); + for (const auto& run_font : run_fonts) { + const SimpleFontData* font_data = run_font.font_data_; +--- a/third_party/blink/renderer/core/layout/layout_font_accessor_win.cc ++++ b/third_party/blink/renderer/core/layout/layout_font_accessor_win.cc +@@ -16,7 +16,6 @@ + #include "third_party/blink/renderer/platform/fonts/font_platform_data.h" + #include "third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h" + #include "third_party/blink/renderer/platform/fonts/simple_font_data.h" +-#include "third_party/blink/renderer/platform/heap/collection_support/clear_collection_scope.h" + + namespace blink { + +@@ -36,8 +35,7 @@ void GetFontsUsedByFragment(const Physic + shape_result_view->PrimaryFont()->PlatformData().FontFamilyName(); + if (!font_family.empty()) + result.font_names.insert(font_family); +- HeapHashSet> fallback_font_data; +- ClearCollectionScope clear_scope(&fallback_font_data); ++ HashSet fallback_font_data; + shape_result_view->FallbackFonts(&fallback_font_data); + for (const SimpleFontData* font_data : fallback_font_data) { + result.font_names.insert(font_data->PlatformData().FontFamilyName()); +--- a/third_party/blink/renderer/modules/font_access/font_metadata.cc ++++ b/third_party/blink/renderer/modules/font_access/font_metadata.cc +@@ -77,7 +77,7 @@ void FontMetadata::BlobImpl(ScriptPromis + SetUpFontUniqueLookupIfNecessary(); + + FontDescription description; +- const SimpleFontData* font_data = ++ scoped_refptr font_data = + FontCache::Get().GetFontData(description, AtomicString(postscriptName), + AlternateFontName::kLocalUniqueFace); + if (!font_data) { +--- a/third_party/blink/renderer/platform/BUILD.gn ++++ b/third_party/blink/renderer/platform/BUILD.gn +@@ -621,6 +621,7 @@ component("platform") { + "fonts/font_cache_memory_dump_provider.h", + "fonts/font_custom_platform_data.cc", + "fonts/font_custom_platform_data.h", ++ "fonts/font_data.cc", + "fonts/font_data.h", + "fonts/font_data_cache.cc", + "fonts/font_data_cache.h", +--- a/third_party/blink/renderer/platform/fonts/android/font_cache_android.cc ++++ b/third_party/blink/renderer/platform/fonts/android/font_cache_android.cc +@@ -127,7 +127,7 @@ sk_sp FontCache::CreateLocal + return nullptr; + } + +-const SimpleFontData* FontCache::PlatformFallbackFontForCharacter( ++scoped_refptr FontCache::PlatformFallbackFontForCharacter( + const FontDescription& font_description, + UChar32 c, + const SimpleFontData*, +@@ -158,7 +158,7 @@ const SimpleFontData* FontCache::Platfor + if (fallback_priority == FontFallbackPriority::kEmojiEmoji && + base::FeatureList::IsEnabled(features::kGMSCoreEmoji)) { + auto skia_fallback_is_noto_color_emoji = [&]() { +- const FontPlatformData* skia_fallback_result = GetFontPlatformData( ++ FontPlatformData* skia_fallback_result = GetFontPlatformData( + font_description, FontFaceCreationParams(family_name)); + + // Determining the PostScript name is required as Skia on Android gives +@@ -175,14 +175,15 @@ const SimpleFontData* FontCache::Platfor + }; + + if (family_name.empty() || skia_fallback_is_noto_color_emoji()) { +- const FontPlatformData* emoji_gms_core_font = GetFontPlatformData( ++ FontPlatformData* emoji_gms_core_font = GetFontPlatformData( + font_description, + FontFaceCreationParams(AtomicString(kNotoColorEmojiCompat))); + if (emoji_gms_core_font) { + SkTypeface* probe_coverage_typeface = emoji_gms_core_font->Typeface(); + if (probe_coverage_typeface && + probe_coverage_typeface->unicharToGlyph(c)) { +- return FontDataFromFontPlatformData(emoji_gms_core_font); ++ return FontDataFromFontPlatformData(emoji_gms_core_font, ++ kDoNotRetain); + } + } + } +@@ -192,10 +193,12 @@ const SimpleFontData* FontCache::Platfor + // font was not found or an OEM emoji font was not to be overridden. + + if (family_name.empty()) +- return GetLastResortFallbackFont(font_description); ++ return GetLastResortFallbackFont(font_description, kDoNotRetain); + +- return FontDataFromFontPlatformData(GetFontPlatformData( +- font_description, FontFaceCreationParams(family_name))); ++ return FontDataFromFontPlatformData( ++ GetFontPlatformData(font_description, ++ FontFaceCreationParams(family_name)), ++ kDoNotRetain); + } + + // static +--- a/third_party/blink/renderer/platform/fonts/custom_font_data.h ++++ b/third_party/blink/renderer/platform/fonts/custom_font_data.h +@@ -22,8 +22,8 @@ + #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_CUSTOM_FONT_DATA_H_ + + #include "base/memory/scoped_refptr.h" +-#include "third_party/blink/renderer/platform/heap/garbage_collected.h" + #include "third_party/blink/renderer/platform/platform_export.h" ++#include "third_party/blink/renderer/platform/wtf/thread_safe_ref_counted.h" + + namespace blink { + +@@ -34,17 +34,22 @@ namespace blink { + // * `BinaryDataFontFaceSource` as loaded font resource + // * `LocalFontFaceSource` as derived class `CSSCustomFontData` + // * `RemoteFontFaceSource` as derived class `CSSCustomFontData` +-class PLATFORM_EXPORT CustomFontData : public GarbageCollected { ++class PLATFORM_EXPORT CustomFontData : public RefCounted { + public: +- CustomFontData() = default; ++ static scoped_refptr Create() { ++ return base::AdoptRef(new CustomFontData()); ++ } ++ + virtual ~CustomFontData() = default; +- virtual void Trace(Visitor*) const {} + + virtual void BeginLoadIfNeeded() const {} + virtual bool IsLoading() const { return false; } + virtual bool IsLoadingFallback() const { return false; } + virtual bool ShouldSkipDrawing() const { return false; } + virtual bool IsPendingDataUrl() const { return false; } ++ ++ protected: ++ CustomFontData() = default; + }; + + } // namespace blink +--- a/third_party/blink/renderer/platform/fonts/font_cache.cc ++++ b/third_party/blink/renderer/platform/fonts/font_cache.cc +@@ -87,7 +87,10 @@ FontCache& FontCache::Get() { + return FontGlobalContext::GetFontCache(); + } + +-FontCache::FontCache() : font_manager_(sk_ref_sp(static_font_manager_)) { ++FontCache::FontCache() ++ : font_manager_(sk_ref_sp(static_font_manager_)), ++ font_platform_data_cache_(FontPlatformDataCache::Create()), ++ font_data_cache_(FontDataCache::Create()) { + #if BUILDFLAG(IS_WIN) + if (!font_manager_ || should_use_test_font_mgr) { + // This code path is only for unit tests. This SkFontMgr does not work in +@@ -113,14 +116,12 @@ FontCache::~FontCache() = default; + + void FontCache::Trace(Visitor* visitor) const { + visitor->Trace(font_cache_clients_); +- visitor->Trace(font_platform_data_cache_); +- visitor->Trace(fallback_list_shaper_cache_); +- visitor->Trace(font_data_cache_); + visitor->Trace(font_fallback_map_); ++ visitor->Trace(fallback_list_shaper_cache_); + } + + #if !BUILDFLAG(IS_MAC) +-const FontPlatformData* FontCache::SystemFontPlatformData( ++FontPlatformData* FontCache::SystemFontPlatformData( + const FontDescription& font_description) { + const AtomicString& family = FontCache::SystemFontFamily(); + #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_FUCHSIA) || \ +@@ -135,7 +136,7 @@ const FontPlatformData* FontCache::Syste + } + #endif + +-const FontPlatformData* FontCache::GetFontPlatformData( ++FontPlatformData* FontCache::GetFontPlatformData( + const FontDescription& font_description, + const FontFaceCreationParams& creation_params, + AlternateFontName alternate_font_name) { +@@ -153,7 +154,7 @@ const FontPlatformData* FontCache::GetFo + } + #endif + +- return font_platform_data_cache_.GetOrCreateFontPlatformData( ++ return font_platform_data_cache_->GetOrCreateFontPlatformData( + this, font_description, creation_params, alternate_font_name); + } + +@@ -175,26 +176,34 @@ void FontCache::AcceptLanguagesChanged(c + Get().InvalidateShapeCache(); + } + +-const SimpleFontData* FontCache::GetFontData( ++scoped_refptr FontCache::GetFontData( + const FontDescription& font_description, + const AtomicString& family, +- AlternateFontName altername_font_name) { +- if (const FontPlatformData* platform_data = GetFontPlatformData( ++ AlternateFontName altername_font_name, ++ ShouldRetain should_retain) { ++ if (FontPlatformData* platform_data = GetFontPlatformData( + font_description, + FontFaceCreationParams( + AdjustFamilyNameToAvoidUnsupportedFonts(family)), + altername_font_name)) { + return FontDataFromFontPlatformData( +- platform_data, font_description.SubpixelAscentDescent()); ++ platform_data, should_retain, font_description.SubpixelAscentDescent()); + } + + return nullptr; + } + +-const SimpleFontData* FontCache::FontDataFromFontPlatformData( ++scoped_refptr FontCache::FontDataFromFontPlatformData( + const FontPlatformData* platform_data, ++ ShouldRetain should_retain, + bool subpixel_ascent_descent) { +- return font_data_cache_.Get(platform_data, subpixel_ascent_descent); ++#if DCHECK_IS_ON() ++ if (should_retain == kDoNotRetain) ++ DCHECK(purge_prevent_count_); ++#endif ++ ++ return font_data_cache_->Get(platform_data, should_retain, ++ subpixel_ascent_descent); + } + + bool FontCache::IsPlatformFamilyMatchAvailable( +@@ -223,7 +232,15 @@ String FontCache::FirstAvailableOrFirst( + gfx::FontList::FirstAvailableOrFirst(families.Utf8().c_str())); + } + +-const SimpleFontData* FontCache::FallbackFontForCharacter( ++SimpleFontData* FontCache::GetNonRetainedLastResortFallbackFont( ++ const FontDescription& font_description) { ++ auto font = GetLastResortFallbackFont(font_description, kDoNotRetain); ++ if (font) ++ font->AddRef(); ++ return font.get(); ++} ++ ++scoped_refptr FontCache::FallbackFontForCharacter( + const FontDescription& description, + UChar32 lookup_char, + const SimpleFontData* font_data_to_substitute, +@@ -240,12 +257,21 @@ const SimpleFontData* FontCache::Fallbac + Character::IsNonCharacter(lookup_char)) + return nullptr; + base::ElapsedTimer timer; +- const SimpleFontData* result = PlatformFallbackFontForCharacter( ++ scoped_refptr result = PlatformFallbackFontForCharacter( + description, lookup_char, font_data_to_substitute, fallback_priority); + FontPerformance::AddSystemFallbackFontTime(timer.Elapsed()); + return result; + } + ++void FontCache::ReleaseFontData(const SimpleFontData* font_data) { ++ font_data_cache_->Release(font_data); ++} ++ ++void FontCache::PurgePlatformFontDataCache() { ++ TRACE_EVENT0("fonts,ui", "FontCache::PurgePlatformFontDataCache"); ++ font_platform_data_cache_->Purge(*font_data_cache_); ++} ++ + void FontCache::PurgeFallbackListShaperCache() { + TRACE_EVENT0("fonts,ui", "FontCache::PurgeFallbackListShaperCache"); + for (auto& shape_cache : fallback_list_shaper_cache_.Values()) { +@@ -257,13 +283,17 @@ void FontCache::InvalidateShapeCache() { + PurgeFallbackListShaperCache(); + } + +-void FontCache::Purge() { ++void FontCache::Purge(PurgeSeverity purge_severity) { + // Ideally we should never be forcing the purge while the + // FontCachePurgePreventer is in scope, but we call purge() at any timing + // via MemoryPressureListenerRegistry. + if (purge_prevent_count_) + return; + ++ if (!font_data_cache_->Purge(purge_severity)) ++ return; ++ ++ PurgePlatformFontDataCache(); + PurgeFallbackListShaperCache(); + } + +@@ -279,15 +309,14 @@ uint16_t FontCache::Generation() { + + void FontCache::Invalidate() { + TRACE_EVENT0("fonts,ui", "FontCache::Invalidate"); +- font_platform_data_cache_.Clear(); +- font_data_cache_.Clear(); ++ font_platform_data_cache_->Clear(); + generation_++; + + for (const auto& client : font_cache_clients_) { + client->FontCacheInvalidated(); + } + +- Purge(); ++ Purge(kForcePurge); + } + + void FontCache::CrashWithFontInfo(const FontDescription* font_description) { +@@ -320,6 +349,16 @@ void FontCache::CrashWithFontInfo(const + CHECK(false); + } + ++void FontCache::DumpFontPlatformDataCache( ++ base::trace_event::ProcessMemoryDump* memory_dump) { ++ DCHECK(IsMainThread()); ++ base::trace_event::MemoryAllocatorDump* dump = ++ memory_dump->CreateAllocatorDump("font_caches/font_platform_data_cache"); ++ dump->AddScalar("size", "bytes", font_platform_data_cache_->ByteSize()); ++ memory_dump->AddSuballocation(dump->guid(), ++ WTF::Partitions::kAllocatedObjectPoolName); ++} ++ + void FontCache::DumpShapeResultCache( + base::trace_event::ProcessMemoryDump* memory_dump) { + DCHECK(IsMainThread()); +--- a/third_party/blink/renderer/platform/fonts/font_cache.h ++++ b/third_party/blink/renderer/platform/fonts/font_cache.h +@@ -36,13 +36,13 @@ + #include + + #include "base/gtest_prod_util.h" ++#include "base/memory/scoped_refptr.h" + #include "build/build_config.h" + #include "third_party/blink/renderer/platform/fonts/fallback_list_composite_key.h" + #include "third_party/blink/renderer/platform/fonts/font_cache_client.h" + #include "third_party/blink/renderer/platform/fonts/font_data_cache.h" + #include "third_party/blink/renderer/platform/fonts/font_face_creation_params.h" + #include "third_party/blink/renderer/platform/fonts/font_fallback_priority.h" +-#include "third_party/blink/renderer/platform/fonts/font_platform_data_cache.h" + #include "third_party/blink/renderer/platform/fonts/shaping/shape_cache.h" + #include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_set.h" + #include "third_party/blink/renderer/platform/platform_export.h" +@@ -75,6 +75,7 @@ class FontFaceCreationParams; + class FontFallbackMap; + class FontGlobalContext; + class FontPlatformData; ++class FontPlatformDataCache; + class SimpleFontData; + class WebFontPrewarmer; + +@@ -106,7 +107,9 @@ class PLATFORM_EXPORT FontCache final { + + void Trace(Visitor*) const; + +- const SimpleFontData* FallbackFontForCharacter( ++ void ReleaseFontData(const SimpleFontData*); ++ ++ scoped_refptr FallbackFontForCharacter( + const FontDescription&, + UChar32, + const SimpleFontData* font_data_to_substitute, +@@ -115,11 +118,14 @@ class PLATFORM_EXPORT FontCache final { + // Also implemented by the platform. + void PlatformInit(); + +- const SimpleFontData* GetFontData( ++ scoped_refptr GetFontData( + const FontDescription&, + const AtomicString&, +- AlternateFontName = AlternateFontName::kAllowAlternate); +- const SimpleFontData* GetLastResortFallbackFont(const FontDescription&); ++ AlternateFontName = AlternateFontName::kAllowAlternate, ++ ShouldRetain = kRetain); ++ scoped_refptr GetLastResortFallbackFont(const FontDescription&, ++ ShouldRetain = kRetain); ++ SimpleFontData* GetNonRetainedLastResortFallbackFont(const FontDescription&); + + // Should be used in determining whether family names listed in font-family: + // ... are available locally. Only returns true if family name matches. +@@ -212,12 +218,12 @@ class PLATFORM_EXPORT FontCache final { + return *status_font_family_name_; + } + +- const SimpleFontData* GetFallbackFamilyNameFromHardcodedChoices( ++ scoped_refptr GetFallbackFamilyNameFromHardcodedChoices( + const FontDescription&, + UChar32 codepoint, + FontFallbackPriority fallback_priority); + +- const SimpleFontData* GetDWriteFallbackFamily( ++ scoped_refptr GetDWriteFallbackFamily( + const FontDescription&, + UChar32 codepoint, + FontFallbackPriority fallback_priority); +@@ -245,8 +251,9 @@ class PLATFORM_EXPORT FontCache final { + gfx::FallbackFontData*); + #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) + +- const SimpleFontData* FontDataFromFontPlatformData( ++ scoped_refptr FontDataFromFontPlatformData( + const FontPlatformData*, ++ ShouldRetain = kRetain, + bool subpixel_ascent_descent = false); + + void InvalidateShapeCache(); +@@ -254,6 +261,7 @@ class PLATFORM_EXPORT FontCache final { + static void CrashWithFontInfo(const FontDescription*); + + // Memory reporting ++ void DumpFontPlatformDataCache(base::trace_event::ProcessMemoryDump*); + void DumpShapeResultCache(base::trace_event::ProcessMemoryDump*); + + FontFallbackMap& GetFontFallbackMap(); +@@ -268,7 +276,7 @@ class PLATFORM_EXPORT FontCache final { + // elements. + using Bcp47Vector = WTF::Vector; + +- const SimpleFontData* PlatformFallbackFontForCharacter( ++ scoped_refptr PlatformFallbackFontForCharacter( + const FontDescription&, + UChar32, + const SimpleFontData* font_data_to_substitute, +@@ -283,26 +291,26 @@ class PLATFORM_EXPORT FontCache final { + friend class FontGlobalContext; + FontCache(); + +- void Purge(); ++ void Purge(PurgeSeverity = kPurgeIfNeeded); + + void DisablePurging() { purge_prevent_count_++; } + void EnablePurging() { + DCHECK(purge_prevent_count_); + if (!--purge_prevent_count_) +- Purge(); ++ Purge(kPurgeIfNeeded); + } + + // FIXME: This method should eventually be removed. +- const FontPlatformData* GetFontPlatformData( ++ FontPlatformData* GetFontPlatformData( + const FontDescription&, + const FontFaceCreationParams&, + AlternateFontName = AlternateFontName::kAllowAlternate); + #if !BUILDFLAG(IS_MAC) +- const FontPlatformData* SystemFontPlatformData(const FontDescription&); ++ FontPlatformData* SystemFontPlatformData(const FontDescription&); + #endif // !BUILDFLAG(IS_MAC) + + // These methods are implemented by each platform. +- const FontPlatformData* CreateFontPlatformData( ++ std::unique_ptr CreateFontPlatformData( + const FontDescription&, + const FontFaceCreationParams&, + float font_size, +@@ -321,8 +329,9 @@ class PLATFORM_EXPORT FontCache final { + #endif // BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) || + // BUILDFLAG(IS_CHROMEOS) + +- const SimpleFontData* FallbackOnStandardFontStyle(const FontDescription&, +- UChar32); ++ scoped_refptr FallbackOnStandardFontStyle( ++ const FontDescription&, ++ UChar32); + + // Don't purge if this count is > 0; + int purge_prevent_count_ = 0; +@@ -356,16 +365,17 @@ class PLATFORM_EXPORT FontCache final { + uint16_t generation_ = 0; + bool platform_init_ = false; + HeapHashSet> font_cache_clients_; +- FontPlatformDataCache font_platform_data_cache_; ++ std::unique_ptr font_platform_data_cache_; + HeapHashMap, + FallbackListCompositeKeyTraits> + fallback_list_shaper_cache_; + +- FontDataCache font_data_cache_; ++ std::unique_ptr font_data_cache_; + + Member font_fallback_map_; + ++ void PurgePlatformFontDataCache(); + void PurgeFallbackListShaperCache(); + + friend class SimpleFontData; // For fontDataFromFontPlatformData +--- a/third_party/blink/renderer/platform/fonts/font_cache_memory_dump_provider.cc ++++ b/third_party/blink/renderer/platform/fonts/font_cache_memory_dump_provider.cc +@@ -21,6 +21,7 @@ bool FontCacheMemoryDumpProvider::OnMemo + DCHECK(IsMainThread()); + if (auto* context = FontGlobalContext::TryGet()) { + FontCache& cache = context->GetFontCache(); ++ cache.DumpFontPlatformDataCache(memory_dump); + cache.DumpShapeResultCache(memory_dump); + } + return true; +--- a/third_party/blink/renderer/platform/fonts/font_custom_platform_data.cc ++++ b/third_party/blink/renderer/platform/fonts/font_custom_platform_data.cc +@@ -103,7 +103,7 @@ FontCustomPlatformData::~FontCustomPlatf + } + } + +-const FontPlatformData* FontCustomPlatformData::GetFontPlatformData( ++FontPlatformData FontCustomPlatformData::GetFontPlatformData( + float size, + float adjusted_specified_size, + bool bold, +@@ -276,11 +276,10 @@ const FontPlatformData* FontCustomPlatfo + return_typeface = palette_typeface; + } + } +- return MakeGarbageCollected( +- std::move(return_typeface), std::string(), size, +- synthetic_bold && !base_typeface_->isBold(), +- synthetic_italic && !base_typeface_->isItalic(), text_rendering, +- resolved_font_features, orientation); ++ return FontPlatformData(std::move(return_typeface), std::string(), size, ++ synthetic_bold && !base_typeface_->isBold(), ++ synthetic_italic && !base_typeface_->isItalic(), ++ text_rendering, resolved_font_features, orientation); + } + + Vector FontCustomPlatformData::GetVariationAxes() const { +--- a/third_party/blink/renderer/platform/fonts/font_custom_platform_data.h ++++ b/third_party/blink/renderer/platform/fonts/font_custom_platform_data.h +@@ -68,7 +68,7 @@ class PLATFORM_EXPORT FontCustomPlatform + // adjusted_specified_size should come from AdjustedSpecifiedSize() of + // FontDescription. The latter is needed for correctly applying + // font-optical-sizing: auto; independent of zoom level. +- const FontPlatformData* GetFontPlatformData( ++ FontPlatformData GetFontPlatformData( + float size, + float adjusted_specified_size, + bool bold, +--- /dev/null ++++ b/third_party/blink/renderer/platform/fonts/font_data.cc +@@ -0,0 +1,32 @@ ++/* ++ * Copyright (C) 2008 Apple Inc. All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY ++ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR ++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY ++ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#include "third_party/blink/renderer/platform/fonts/font_data.h" ++ ++namespace blink { ++ ++FontData::~FontData() = default; ++ ++} // namespace blink +--- a/third_party/blink/renderer/platform/fonts/font_data.h ++++ b/third_party/blink/renderer/platform/fonts/font_data.h +@@ -27,24 +27,23 @@ + #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_FONT_DATA_H_ + + #include "base/memory/scoped_refptr.h" +-#include "third_party/blink/renderer/platform/heap/garbage_collected.h" + #include "third_party/blink/renderer/platform/platform_export.h" + #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" + #include "third_party/blink/renderer/platform/wtf/forward.h" + #include "third_party/blink/renderer/platform/wtf/text/wtf_uchar.h" ++#include "third_party/blink/renderer/platform/wtf/thread_safe_ref_counted.h" + + namespace blink { + + class SimpleFontData; + +-class PLATFORM_EXPORT FontData : public GarbageCollected { ++class PLATFORM_EXPORT FontData : public RefCounted { + public: + FontData() = default; + FontData(const FontData&) = delete; + FontData& operator=(const FontData&) = delete; +- virtual ~FontData() = default; + +- virtual void Trace(Visitor*) const {} ++ virtual ~FontData(); + + virtual const SimpleFontData* FontDataForCharacter(UChar32) const = 0; + virtual bool IsCustomFont() const = 0; +--- a/third_party/blink/renderer/platform/fonts/font_data_cache.cc ++++ b/third_party/blink/renderer/platform/fonts/font_data_cache.cc +@@ -36,8 +36,23 @@ + + namespace blink { + +-const SimpleFontData* FontDataCache::Get(const FontPlatformData* platform_data, +- bool subpixel_ascent_descent) { ++#if !BUILDFLAG(IS_ANDROID) ++const unsigned kCMaxInactiveFontData = 250; ++const unsigned kCTargetInactiveFontData = 200; ++#else ++const unsigned kCMaxInactiveFontData = 225; ++const unsigned kCTargetInactiveFontData = 200; ++#endif ++ ++// static ++std::unique_ptr FontDataCache::Create() { ++ return std::make_unique(); ++} ++ ++scoped_refptr FontDataCache::Get( ++ const FontPlatformData* platform_data, ++ ShouldRetain should_retain, ++ bool subpixel_ascent_descent) { + if (!platform_data) + return nullptr; + +@@ -50,12 +65,98 @@ const SimpleFontData* FontDataCache::Get + return nullptr; + } + +- auto add_result = cache_.insert(platform_data, nullptr); +- if (add_result.is_new_entry) { +- add_result.stored_value->value = MakeGarbageCollected( +- platform_data, nullptr, subpixel_ascent_descent); ++ Cache::iterator result = cache_.find(platform_data); ++ if (result == cache_.end()) { ++ std::pair, unsigned> new_value( ++ SimpleFontData::Create(*platform_data, nullptr, ++ subpixel_ascent_descent), ++ should_retain == kRetain ? 1 : 0); ++ // The new SimpleFontData takes a copy of the incoming FontPlatformData ++ // object. The incoming key may be temporary. So, for cache storage, take ++ // the address of the newly created FontPlatformData that is copied an owned ++ // by SimpleFontData. ++ cache_.Set(&new_value.first->PlatformData(), new_value); ++ if (should_retain == kDoNotRetain) ++ inactive_font_data_.insert(new_value.first); ++ return std::move(new_value.first); ++ } ++ ++ if (!result.Get()->value.second) { ++ DCHECK(inactive_font_data_.Contains(result.Get()->value.first)); ++ inactive_font_data_.erase(result.Get()->value.first); ++ } ++ ++ if (should_retain == kRetain) { ++ result.Get()->value.second++; ++ } else if (!result.Get()->value.second) { ++ // If shouldRetain is DoNotRetain and count is 0, we want to remove the ++ // fontData from m_inactiveFontData (above) and re-add here to update LRU ++ // position. ++ inactive_font_data_.insert(result.Get()->value.first); ++ } ++ ++ return result.Get()->value.first; ++} ++ ++bool FontDataCache::Contains(const FontPlatformData* font_platform_data) const { ++ return cache_.Contains(font_platform_data); ++} ++ ++void FontDataCache::Release(const SimpleFontData* font_data) { ++ DCHECK(!font_data->IsCustomFont()); ++ ++ Cache::iterator it = cache_.find(&(font_data->PlatformData())); ++ if (it == cache_.end()) ++ return; ++ ++ DCHECK(it->value.second); ++ if (!--it->value.second) ++ inactive_font_data_.insert(it->value.first); ++} ++ ++bool FontDataCache::Purge(PurgeSeverity purge_severity) { ++ if (purge_severity == kForcePurge) ++ return PurgeLeastRecentlyUsed(INT_MAX); ++ ++ if (inactive_font_data_.size() > kCMaxInactiveFontData) ++ return PurgeLeastRecentlyUsed(inactive_font_data_.size() - ++ kCTargetInactiveFontData); ++ ++ return false; ++} ++ ++bool FontDataCache::PurgeLeastRecentlyUsed(int count) { ++ // Guard against reentry when e.g. a deleted FontData releases its small caps ++ // FontData. ++ if (is_purging_) ++ return false; ++ ++ base::AutoReset is_purging_auto_reset(&is_purging_, true); ++ ++ Vector, 20> font_data_to_delete; ++ auto end = inactive_font_data_.end(); ++ auto it = inactive_font_data_.begin(); ++ for (int i = 0; i < count && it != end; ++it, ++i) { ++ const scoped_refptr& font_data = *it; ++ cache_.erase(&(font_data->PlatformData())); ++ // We should not delete SimpleFontData here because deletion can modify ++ // m_inactiveFontData. See http://trac.webkit.org/changeset/44011 ++ font_data_to_delete.push_back(font_data); ++ } ++ ++ if (it == end) { ++ // Removed everything ++ inactive_font_data_.clear(); ++ } else { ++ for (int i = 0; i < count; ++i) ++ inactive_font_data_.erase(inactive_font_data_.begin()); + } +- return add_result.stored_value->value; ++ ++ bool did_work = font_data_to_delete.size(); ++ ++ font_data_to_delete.clear(); ++ ++ return did_work; + } + + } // namespace blink +--- a/third_party/blink/renderer/platform/fonts/font_data_cache.h ++++ b/third_party/blink/renderer/platform/fonts/font_data_cache.h +@@ -33,10 +33,14 @@ + + #include "third_party/blink/renderer/platform/fonts/font_platform_data.h" + #include "third_party/blink/renderer/platform/fonts/simple_font_data.h" +-#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h" ++#include "third_party/blink/renderer/platform/wtf/hash_map.h" ++#include "third_party/blink/renderer/platform/wtf/linked_hash_set.h" + + namespace blink { + ++enum ShouldRetain { kRetain, kDoNotRetain }; ++enum PurgeSeverity { kPurgeIfNeeded, kForcePurge }; ++ + struct FontDataCacheKeyHashTraits : GenericHashTraits { + STATIC_ONLY(FontDataCacheKeyHashTraits); + static unsigned GetHash(const FontPlatformData* platform_data) { +@@ -51,24 +55,36 @@ struct FontDataCacheKeyHashTraits : Gene + }; + + class FontDataCache final { +- DISALLOW_NEW(); ++ USING_FAST_MALLOC(FontDataCache); + + public: ++ static std::unique_ptr Create(); ++ + FontDataCache() = default; + FontDataCache(const FontDataCache&) = delete; + FontDataCache& operator=(const FontDataCache&) = delete; + +- void Trace(Visitor* visitor) const { visitor->Trace(cache_); } +- +- const SimpleFontData* Get(const FontPlatformData*, +- bool subpixel_ascent_descent = false); +- void Clear() { cache_.clear(); } ++ scoped_refptr Get(const FontPlatformData*, ++ ShouldRetain = kRetain, ++ bool subpixel_ascent_descent = false); ++ bool Contains(const FontPlatformData*) const; ++ void Release(const SimpleFontData*); ++ ++ // Purges items in FontDataCache according to provided severity. ++ // Returns true if any removal of cache items actually occurred. ++ bool Purge(PurgeSeverity); + + private: +- HeapHashMap, +- WeakMember, +- FontDataCacheKeyHashTraits> +- cache_; ++ bool PurgeLeastRecentlyUsed(int count); ++ ++ typedef HashMap, unsigned>, ++ FontDataCacheKeyHashTraits> ++ Cache; ++ ++ Cache cache_; ++ LinkedHashSet> inactive_font_data_; ++ bool is_purging_ = false; + }; + + } // namespace blink +--- a/third_party/blink/renderer/platform/fonts/font_data_for_range_set.cc ++++ b/third_party/blink/renderer/platform/fonts/font_data_for_range_set.cc +@@ -13,4 +13,10 @@ FontDataForRangeSet::FontDataForRangeSet + range_set_ = other.range_set_; + } + ++FontDataForRangeSetFromCache::~FontDataForRangeSetFromCache() { ++ if (font_data_ && !font_data_->IsCustomFont()) { ++ FontCache::Get().ReleaseFontData(font_data_.get()); ++ } ++} ++ + } // namespace blink +--- a/third_party/blink/renderer/platform/fonts/font_data_for_range_set.h ++++ b/third_party/blink/renderer/platform/fonts/font_data_for_range_set.h +@@ -37,19 +37,17 @@ namespace blink { + class SimpleFontData; + + class PLATFORM_EXPORT FontDataForRangeSet +- : public GarbageCollected { ++ : public RefCounted { + public: + explicit FontDataForRangeSet( +- const SimpleFontData* font_data = nullptr, ++ scoped_refptr font_data = nullptr, + scoped_refptr range_set = nullptr) +- : font_data_(font_data), range_set_(std::move(range_set)) {} ++ : font_data_(std::move(font_data)), range_set_(std::move(range_set)) {} + + FontDataForRangeSet(const FontDataForRangeSet& other); + + virtual ~FontDataForRangeSet() = default; + +- void Trace(Visitor* visitor) const { visitor->Trace(font_data_); } +- + bool Contains(UChar32 test_char) const { + return !range_set_ || range_set_->Contains(test_char); + } +@@ -57,8 +55,8 @@ class PLATFORM_EXPORT FontDataForRangeSe + return !range_set_ || range_set_->IsEntireRange(); + } + UnicodeRangeSet* Ranges() const { return range_set_.get(); } +- bool HasFontData() const { return font_data_; } +- const SimpleFontData* FontData() const { return font_data_.Get(); } ++ bool HasFontData() const { return font_data_.get(); } ++ const SimpleFontData* FontData() const { return font_data_.get(); } + + // TODO(xiaochengh): |FontData::IsLoadingFallback()| returns true if the + // FontData is a pending custom font. We should rename it for better clarity. +@@ -71,10 +69,20 @@ class PLATFORM_EXPORT FontDataForRangeSe + } + + protected: +- Member font_data_; ++ scoped_refptr font_data_; + scoped_refptr range_set_; + }; + ++class PLATFORM_EXPORT FontDataForRangeSetFromCache ++ : public FontDataForRangeSet { ++ public: ++ explicit FontDataForRangeSetFromCache( ++ scoped_refptr font_data, ++ scoped_refptr range_set = nullptr) ++ : FontDataForRangeSet(std::move(font_data), std::move(range_set)) {} ++ ~FontDataForRangeSetFromCache() override; ++}; ++ + } // namespace blink + + #endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_FONT_DATA_FOR_RANGE_SET_H_ +--- a/third_party/blink/renderer/platform/fonts/font_fallback_iterator.cc ++++ b/third_party/blink/renderer/platform/fonts/font_fallback_iterator.cc +@@ -60,8 +60,8 @@ void FontFallbackIterator::WillUseRange( + selector->WillUseRange(font_description_, family, range_set); + } + +-FontDataForRangeSet* FontFallbackIterator::UniqueOrNext( +- FontDataForRangeSet* candidate, ++scoped_refptr FontFallbackIterator::UniqueOrNext( ++ scoped_refptr candidate, + const Vector& hint_list) { + if (!candidate->HasFontData()) + return Next(hint_list); +@@ -104,18 +104,18 @@ bool FontFallbackIterator::NeedsHintList + return font_data->IsSegmented(); + } + +-FontDataForRangeSet* FontFallbackIterator::Next( ++scoped_refptr FontFallbackIterator::Next( + const Vector& hint_list) { + if (fallback_stage_ == kOutOfLuck) +- return MakeGarbageCollected(); ++ return base::AdoptRef(new FontDataForRangeSet()); + + if (fallback_stage_ == kFallbackPriorityFonts) { + // Only try one fallback priority font, + // then proceed to regular system fallback. + fallback_stage_ = kSystemFonts; +- FontDataForRangeSet* fallback_priority_font_range = +- MakeGarbageCollected( +- FallbackPriorityFont(hint_list[0])); ++ scoped_refptr fallback_priority_font_range = ++ base::AdoptRef( ++ new FontDataForRangeSet(FallbackPriorityFont(hint_list[0]))); + if (fallback_priority_font_range->HasFontData()) + return UniqueOrNext(std::move(fallback_priority_font_range), hint_list); + return Next(hint_list); +@@ -123,11 +123,11 @@ FontDataForRangeSet* FontFallbackIterato + + if (fallback_stage_ == kSystemFonts) { + // We've reached pref + system fallback. +- const SimpleFontData* system_font = UniqueSystemFontForHintList(hint_list); ++ scoped_refptr system_font = UniqueSystemFontForHintList(hint_list); + if (system_font) { + // Fallback fonts are not retained in the FontDataCache. +- return UniqueOrNext( +- MakeGarbageCollected(system_font), hint_list); ++ return UniqueOrNext(base::AdoptRef(new FontDataForRangeSet(system_font)), ++ hint_list); + } + + // If we don't have options from the system fallback anymore or had +@@ -137,16 +137,18 @@ FontDataForRangeSet* FontFallbackIterato + // LastResort font, not just Times or Arial. + FontCache& font_cache = FontCache::Get(); + fallback_stage_ = kFirstCandidateForNotdefGlyph; +- const SimpleFontData* last_resort = +- font_cache.GetLastResortFallbackFont(font_description_); ++ scoped_refptr last_resort = ++ font_cache.GetLastResortFallbackFont(font_description_).get(); + + if (FontSelector* font_selector = font_fallback_list_->GetFontSelector()) { +- font_selector->ReportLastResortFallbackFontLookup(font_description_, +- last_resort); ++ font_selector->ReportLastResortFallbackFontLookup( ++ font_description_, ++ last_resort.get()); + } + +- return UniqueOrNext(MakeGarbageCollected(last_resort), +- hint_list); ++ return UniqueOrNext( ++ base::AdoptRef(new FontDataForRangeSetFromCache(last_resort)), ++ hint_list); + } + + if (fallback_stage_ == kFirstCandidateForNotdefGlyph) { +@@ -177,13 +179,13 @@ FontDataForRangeSet* FontFallbackIterato + // Skip forward to the next font family for the next call to next(). + current_font_data_index_++; + if (!font_data->IsLoading()) { +- SimpleFontData* non_segmented = ++ scoped_refptr non_segmented = + const_cast(To(font_data)); + // The fontData object that we have here is tracked in m_fontList of + // FontFallbackList and gets released in the font cache when the + // FontFallbackList is destroyed. + return UniqueOrNext( +- MakeGarbageCollected(non_segmented), hint_list); ++ base::AdoptRef(new FontDataForRangeSet(non_segmented)), hint_list); + } + return Next(hint_list); + } +@@ -197,7 +199,7 @@ FontDataForRangeSet* FontFallbackIterato + } + + DCHECK_LT(segmented_face_index_, segmented->NumFaces()); +- FontDataForRangeSet* current_segmented_face = ++ scoped_refptr current_segmented_face = + segmented->FaceAt(segmented_face_index_); + segmented_face_index_++; + +@@ -208,7 +210,7 @@ FontDataForRangeSet* FontFallbackIterato + current_font_data_index_++; + } + +- if (RangeSetContributesForHint(hint_list, current_segmented_face)) { ++ if (RangeSetContributesForHint(hint_list, current_segmented_face.get())) { + const SimpleFontData* current_segmented_face_font_data = + current_segmented_face->FontData(); + if (const CustomFontData* current_segmented_face_custom_font_data = +@@ -222,15 +224,17 @@ FontDataForRangeSet* FontFallbackIterato + return Next(hint_list); + } + +-const SimpleFontData* FontFallbackIterator::FallbackPriorityFont(UChar32 hint) { +- const SimpleFontData* font_data = FontCache::Get().FallbackFontForCharacter( +- font_description_, hint, +- font_fallback_list_->PrimarySimpleFontData(font_description_), +- font_fallback_priority_); ++scoped_refptr FontFallbackIterator::FallbackPriorityFont( ++ UChar32 hint) { ++ scoped_refptr font_data = ++ FontCache::Get().FallbackFontForCharacter( ++ font_description_, hint, ++ font_fallback_list_->PrimarySimpleFontData(font_description_), ++ font_fallback_priority_); + + if (FontSelector* font_selector = font_fallback_list_->GetFontSelector()) { + font_selector->ReportFontLookupByFallbackCharacter( +- hint, font_fallback_priority_, font_description_, font_data); ++ hint, font_fallback_priority_, font_description_, font_data.get()); + } + return font_data; + } +@@ -255,7 +259,7 @@ static inline unsigned ChooseHintIndex(c + return 0; + } + +-const SimpleFontData* FontFallbackIterator::UniqueSystemFontForHintList( ++scoped_refptr FontFallbackIterator::UniqueSystemFontForHintList( + const Vector& hint_list) { + // When we're asked for a fallback for the same characters again, we give up + // because the shaper must have previously tried shaping with the font +@@ -270,13 +274,13 @@ const SimpleFontData* FontFallbackIterat + return nullptr; + previously_asked_for_hint_.insert(hint); + +- const SimpleFontData* font_data = font_cache.FallbackFontForCharacter( ++ scoped_refptr font_data = font_cache.FallbackFontForCharacter( + font_description_, hint, + font_fallback_list_->PrimarySimpleFontData(font_description_)); + + if (FontSelector* font_selector = font_fallback_list_->GetFontSelector()) { + font_selector->ReportFontLookupByFallbackCharacter( +- hint, FontFallbackPriority::kText, font_description_, font_data); ++ hint, FontFallbackPriority::kText, font_description_, font_data.get()); + } + return font_data; + } +--- a/third_party/blink/renderer/platform/fonts/font_fallback_iterator.h ++++ b/third_party/blink/renderer/platform/fonts/font_fallback_iterator.h +@@ -5,13 +5,14 @@ + #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_FONT_FALLBACK_ITERATOR_H_ + #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_FONT_FALLBACK_ITERATOR_H_ + ++#include "base/memory/scoped_refptr.h" + #include "third_party/blink/renderer/platform/fonts/font_data_for_range_set.h" + #include "third_party/blink/renderer/platform/fonts/font_fallback_priority.h" +-#include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" + #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" + #include "third_party/blink/renderer/platform/wtf/hash_set.h" + #include "third_party/blink/renderer/platform/wtf/ref_counted.h" + #include "third_party/blink/renderer/platform/wtf/text/wtf_uchar.h" ++#include "third_party/blink/renderer/platform/wtf/vector.h" + + namespace blink { + +@@ -48,7 +48,7 @@ + // Some system fallback APIs (Windows, Android) require a character, or a + // portion of the string to be passed. On Mac and Linux, we get a list of + // fonts without passing in characters. +- FontDataForRangeSet* Next(const Vector& hint_list); ++ scoped_refptr Next(const Vector& hint_list); + + void Reset(); + +@@ -50,11 +51,12 @@ class FontFallbackIterator { + bool AlreadyLoadingRangeForHintChar(UChar32 hint_char); + void WillUseRange(const AtomicString& family, const FontDataForRangeSet&); + +- FontDataForRangeSet* UniqueOrNext(FontDataForRangeSet* candidate, +- const Vector& hint_list); ++ scoped_refptr UniqueOrNext( ++ scoped_refptr candidate, ++ const Vector& hint_list); + +- const SimpleFontData* FallbackPriorityFont(UChar32 hint); +- const SimpleFontData* UniqueSystemFontForHintList( ++ scoped_refptr FallbackPriorityFont(UChar32 hint); ++ scoped_refptr UniqueSystemFontForHintList( + const Vector& hint_list); + + const FontDescription& font_description_; +@@ -82,8 +84,8 @@ class FontFallbackIterator { + // candidate to be used for rendering the .notdef glyph, and set HasNext() to + // false. + HashSet unique_font_data_for_range_sets_returned_; +- FontDataForRangeSet* first_candidate_ = nullptr; +- HeapVector> tracked_loading_range_sets_; ++ scoped_refptr first_candidate_; ++ Vector> tracked_loading_range_sets_; + FontFallbackPriority font_fallback_priority_; + }; + +--- a/third_party/blink/renderer/platform/fonts/font_fallback_list.cc ++++ b/third_party/blink/renderer/platform/fonts/font_fallback_list.cc +@@ -52,9 +52,17 @@ FontFallbackList::FontFallbackList(FontS + is_invalid_(false), + nullify_primary_font_data_for_test_(false) {} + ++FontFallbackList::~FontFallbackList() { ++ unsigned num_fonts = font_list_.size(); ++ for (unsigned i = 0; i < num_fonts; ++i) { ++ if (!font_list_[i]->IsCustomFont()) { ++ DCHECK(!font_list_[i]->IsSegmented()); ++ FontCache::Get().ReleaseFontData(To(font_list_[i].get())); ++ } ++ } ++} ++ + void FontFallbackList::Trace(Visitor* visitor) const { +- visitor->Trace(font_list_); +- visitor->Trace(cached_primary_simple_font_data_); + visitor->Trace(font_selector_); + visitor->Trace(ng_shape_cache_); + visitor->Trace(shape_cache_); +@@ -98,8 +106,8 @@ const SimpleFontData* FontFallbackList:: + return font_data->FontDataForCharacter(kSpaceCharacter); + + FontCache& font_cache = FontCache::Get(); +- const SimpleFontData* last_resort_fallback = +- font_cache.GetLastResortFallbackFont(font_description); ++ SimpleFontData* last_resort_fallback = ++ font_cache.GetLastResortFallbackFont(font_description).get(); + DCHECK(last_resort_fallback); + return last_resort_fallback; + } +@@ -137,7 +145,7 @@ const SimpleFontData* FontFallbackList:: + } + } + +-const FontData* FontFallbackList::GetFontData( ++scoped_refptr FontFallbackList::GetFontData( + const FontDescription& font_description) { + const FontFamily* curr_family = &font_description.Family(); + for (int i = 0; curr_family && i < family_index_; i++) +@@ -148,7 +156,7 @@ const FontData* FontFallbackList::GetFon + if (!font_selector_) { + // Don't query system fonts for empty font family name. + if (!curr_family->FamilyName().empty()) { +- if (auto* result = FontCache::Get().GetFontData( ++ if (auto result = FontCache::Get().GetFontData( + font_description, curr_family->FamilyName())) { + return result; + } +@@ -156,7 +164,7 @@ const FontData* FontFallbackList::GetFon + continue; + } + +- const FontData* result = ++ scoped_refptr result = + font_selector_->GetFontData(font_description, *curr_family); + // Don't query system fonts for empty font family name. + if (!result && !curr_family->FamilyName().empty()) { +@@ -164,7 +172,7 @@ const FontData* FontFallbackList::GetFon + curr_family->FamilyName()); + font_selector_->ReportFontLookupByUniqueOrFamilyName( + curr_family->FamilyName(), font_description, +- DynamicTo(result)); ++ DynamicTo(result.get())); + } + if (result) { + font_selector_->ReportSuccessfulFontFamilyMatch( +@@ -181,18 +189,18 @@ const FontData* FontFallbackList::GetFon + FontFamily font_family; + font_family.SetFamily(font_family_names::kWebkitStandard, + FontFamily::Type::kGenericFamily); +- if (const FontData* data = ++ if (scoped_refptr data = + font_selector_->GetFontData(font_description, font_family)) { + return data; + } + } + + // Still no result. Hand back our last resort fallback font. +- auto* last_resort = ++ auto last_resort = + FontCache::Get().GetLastResortFallbackFont(font_description); + if (font_selector_) { + font_selector_->ReportLastResortFallbackFontLookup(font_description, +- last_resort); ++ last_resort.get()); + } + return last_resort; + } +@@ -202,7 +210,7 @@ const FontData* FontFallbackList::FontDa + unsigned realized_font_index) { + // This fallback font is already in our list. + if (realized_font_index < font_list_.size()) +- return font_list_[realized_font_index].Get(); ++ return font_list_[realized_font_index].get(); + + // Make sure we're not passing in some crazy value here. + DCHECK_EQ(realized_font_index, font_list_.size()); +@@ -216,7 +224,7 @@ const FontData* FontFallbackList::FontDa + // the same spot in the list twice. GetFontData will adjust our + // |family_index_| as it scans for the right font to make. + DCHECK_EQ(FontCache::Get().Generation(), generation_); +- const FontData* result = GetFontData(font_description); ++ scoped_refptr result = GetFontData(font_description); + if (result) { + font_list_.push_back(result); + if (result->IsLoadingFallback()) +@@ -224,7 +232,7 @@ const FontData* FontFallbackList::FontDa + if (result->IsCustomFont()) + has_custom_font_ = true; + } +- return result; ++ return result.get(); + } + + bool FontFallbackList::ComputeCanShapeWordByWord( +--- a/third_party/blink/renderer/platform/fonts/font_fallback_list.h ++++ b/third_party/blink/renderer/platform/fonts/font_fallback_list.h +@@ -49,6 +49,7 @@ class PLATFORM_EXPORT FontFallbackList + + FontFallbackList(const FontFallbackList&) = delete; + FontFallbackList& operator=(const FontFallbackList&) = delete; ++ ~FontFallbackList(); + + void Trace(Visitor*) const; + +@@ -116,7 +117,7 @@ class PLATFORM_EXPORT FontFallbackList + bool HasCustomFont() const { return has_custom_font_; } + + private: +- const FontData* GetFontData(const FontDescription&); ++ scoped_refptr GetFontData(const FontDescription&); + + const SimpleFontData* DeterminePrimarySimpleFontData(const FontDescription&); + const SimpleFontData* DeterminePrimarySimpleFontDataCore( +@@ -124,8 +125,8 @@ class PLATFORM_EXPORT FontFallbackList + + bool ComputeCanShapeWordByWord(const FontDescription&); + +- HeapVector, 1> font_list_; +- Member cached_primary_simple_font_data_ = nullptr; ++ Vector, 1> font_list_; ++ const SimpleFontData* cached_primary_simple_font_data_ = nullptr; + const Member font_selector_; + int family_index_ = 0; + const uint16_t generation_; +--- a/third_party/blink/renderer/platform/fonts/font_platform_data.cc ++++ b/third_party/blink/renderer/platform/fonts/font_platform_data.cc +@@ -158,10 +158,6 @@ FontPlatformData::FontPlatformData(sk_sp + + FontPlatformData::~FontPlatformData() = default; + +-void FontPlatformData::Trace(Visitor* visitor) const { +- visitor->Trace(harfbuzz_face_); +-} +- + #if BUILDFLAG(IS_MAC) + CTFontRef FontPlatformData::CtFont() const { + return SkTypeface_GetCTFontRef(typeface_.get()); +@@ -213,10 +209,11 @@ SkTypeface* FontPlatformData::Typeface() + + HarfBuzzFace* FontPlatformData::GetHarfBuzzFace() const { + if (!harfbuzz_face_) { +- harfbuzz_face_ = MakeGarbageCollected(this, UniqueID()); ++ harfbuzz_face_ = ++ HarfBuzzFace::Create(const_cast(this), UniqueID()); + } + +- return harfbuzz_face_.Get(); ++ return harfbuzz_face_.get(); + } + + bool FontPlatformData::HasSpaceInLigaturesOrKerning( +@@ -246,7 +243,7 @@ unsigned FontPlatformData::GetHash() con + } + + #if !BUILDFLAG(IS_MAC) +-bool FontPlatformData::FontContainsCharacter(UChar32 character) const { ++bool FontPlatformData::FontContainsCharacter(UChar32 character) { + return CreateSkFont().unicharToGlyph(character); + } + #endif +--- a/third_party/blink/renderer/platform/fonts/font_platform_data.h ++++ b/third_party/blink/renderer/platform/fonts/font_platform_data.h +@@ -39,8 +39,6 @@ + #include "third_party/blink/renderer/platform/fonts/font_orientation.h" + #include "third_party/blink/renderer/platform/fonts/resolved_font_features.h" + #include "third_party/blink/renderer/platform/fonts/small_caps_iterator.h" +-#include "third_party/blink/renderer/platform/heap/garbage_collected.h" +-#include "third_party/blink/renderer/platform/heap/member.h" + #include "third_party/blink/renderer/platform/platform_export.h" + #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" + #include "third_party/blink/renderer/platform/wtf/forward.h" +@@ -61,8 +59,9 @@ namespace blink { + class HarfBuzzFace; + class OpenTypeVerticalData; + +-class PLATFORM_EXPORT FontPlatformData +- : public GarbageCollected { ++class PLATFORM_EXPORT FontPlatformData { ++ USING_FAST_MALLOC(FontPlatformData); ++ + public: + // Used for deleted values in the font cache's hash tables. The hash table + // will create us with this structure, and it will compare other values +@@ -83,8 +82,6 @@ class PLATFORM_EXPORT FontPlatformData + FontOrientation = FontOrientation::kHorizontal); + ~FontPlatformData(); + +- void Trace(Visitor*) const; +- + #if BUILDFLAG(IS_MAC) + // Returns nullptr for FreeType backed SkTypefaces, compare + // FontCustomPlatformData, which are used for variable fonts on Mac OS +@@ -129,7 +126,7 @@ class PLATFORM_EXPORT FontPlatformData + + bool IsHashTableDeletedValue() const { return is_hash_table_deleted_value_; } + #if !BUILDFLAG(IS_MAC) +- bool FontContainsCharacter(UChar32 character) const; ++ bool FontContainsCharacter(UChar32 character); + #endif + + #if !BUILDFLAG(IS_WIN) && !BUILDFLAG(IS_MAC) +@@ -185,7 +182,7 @@ class PLATFORM_EXPORT FontPlatformData + WebFontRenderStyle style_; + #endif + +- mutable Member harfbuzz_face_; ++ mutable scoped_refptr harfbuzz_face_; + bool is_hash_table_deleted_value_ = false; + }; + +--- a/third_party/blink/renderer/platform/fonts/font_platform_data_cache.cc ++++ b/third_party/blink/renderer/platform/fonts/font_platform_data_cache.cc +@@ -38,13 +38,20 @@ + + namespace blink { + ++// static ++std::unique_ptr FontPlatformDataCache::Create() { ++ return std::make_unique(); ++} ++ + FontPlatformDataCache::FontPlatformDataCache() + : font_size_limit_(std::nextafter( + (static_cast(std::numeric_limits::max()) - 2.f) / + static_cast(blink::FontCacheKey::PrecisionMultiplier()), + 0.f)) {} + +-const FontPlatformData* FontPlatformDataCache::GetOrCreateFontPlatformData( ++FontPlatformDataCache::~FontPlatformDataCache() = default; ++ ++FontPlatformData* FontPlatformDataCache::GetOrCreateFontPlatformData( + FontCache* font_cache, + const FontDescription& font_description, + const FontFaceCreationParams& creation_params, +@@ -60,13 +67,15 @@ const FontPlatformData* FontPlatformData + + auto it = map_.find(key); + if (it != map_.end()) { +- return it->value.Get(); ++ return it->value.get(); + } + +- if (const FontPlatformData* result = font_cache->CreateFontPlatformData( +- font_description, creation_params, size, alternate_font_name)) { +- map_.insert(key, result); +- return result; ++ if (std::unique_ptr result = ++ font_cache->CreateFontPlatformData(font_description, creation_params, ++ size, alternate_font_name)) { ++ FontPlatformData* result_ptr = result.get(); ++ map_.insert(key, std::move(result)); ++ return result_ptr; + } + + if (alternate_font_name != AlternateFontName::kAllowAlternate || +@@ -82,16 +91,35 @@ const FontPlatformData* FontPlatformData + return nullptr; + + FontFaceCreationParams create_by_alternate_family(alternate_name); +- if (const FontPlatformData* result = GetOrCreateFontPlatformData( ++ if (FontPlatformData* result = GetOrCreateFontPlatformData( + font_cache, font_description, create_by_alternate_family, + AlternateFontName::kNoAlternate)) { + // Cache the platform_data under the old name. + // "accessibility/font-changed.html" reaches here. +- map_.insert(key, result); ++ map_.insert(key, std::make_unique(*result)); + return result; + } + + return nullptr; + } + ++size_t FontPlatformDataCache::ByteSize() const { ++ return map_.size() * sizeof(std::unique_ptr); ++} ++ ++void FontPlatformDataCache::Clear() { ++ map_.clear(); ++} ++ ++void FontPlatformDataCache::Purge(const FontDataCache& font_data_cache) { ++ Vector keys_to_remove; ++ keys_to_remove.ReserveInitialCapacity(map_.size()); ++ for (auto& entry : map_) { ++ if (entry.value && !font_data_cache.Contains(entry.value.get())) { ++ keys_to_remove.push_back(entry.key); ++ } ++ } ++ map_.RemoveAll(keys_to_remove); ++} ++ + } // namespace blink +--- a/third_party/blink/renderer/platform/fonts/font_platform_data_cache.h ++++ b/third_party/blink/renderer/platform/fonts/font_platform_data_cache.h +@@ -31,13 +31,13 @@ + #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_FONT_PLATFORM_DATA_CACHE_H_ + + #include "third_party/blink/renderer/platform/fonts/font_cache_key.h" +-#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_map.h" +-#include "third_party/blink/renderer/platform/heap/garbage_collected.h" ++#include "third_party/blink/renderer/platform/wtf/hash_map.h" + + namespace blink { + + enum class AlternateFontName; + class FontCache; ++class FontDataCache; + class FontDescription; + class FontFaceCreationParams; + class FontPlatformData; +@@ -45,23 +45,30 @@ class FontPlatformData; + // `FontPlatformDataCache` is the shared cache mapping from `FontDescription` + // to `FontPlatformData`. + class FontPlatformDataCache final { +- DISALLOW_NEW(); +- + public: ++ static std::unique_ptr Create(); ++ + FontPlatformDataCache(); ++ ~FontPlatformDataCache(); ++ ++ FontPlatformDataCache(const FontPlatformDataCache&) = delete; ++ FontPlatformDataCache(FontPlatformDataCache&&) = delete; + +- void Trace(Visitor* visitor) const { visitor->Trace(map_); } ++ FontPlatformDataCache operator=(const FontPlatformDataCache&) = delete; ++ FontPlatformDataCache operator=(FontPlatformDataCache&&) = delete; + +- const FontPlatformData* GetOrCreateFontPlatformData( ++ FontPlatformData* GetOrCreateFontPlatformData( + FontCache* font_cache, + const FontDescription& font_description, + const FontFaceCreationParams& creation_params, + AlternateFontName alternate_font_name); + +- void Clear() { map_.clear(); } ++ size_t ByteSize() const; ++ void Clear(); ++ void Purge(const FontDataCache& font_data_cache); + + private: +- HeapHashMap> map_; ++ HashMap> map_; + + // A maximum float value to which we limit incoming font sizes. This is the + // smallest float so that multiplying it by +--- a/third_party/blink/renderer/platform/fonts/font_selector.h ++++ b/third_party/blink/renderer/platform/fonts/font_selector.h +@@ -53,8 +53,8 @@ class UseCounter; + class PLATFORM_EXPORT FontSelector : public FontCacheClient { + public: + ~FontSelector() override = default; +- virtual const FontData* GetFontData(const FontDescription&, +- const FontFamily&) = 0; ++ virtual scoped_refptr GetFontData(const FontDescription&, ++ const FontFamily&) = 0; + + // TODO(crbug.com/542629): The String variant of this method should be + // replaced with a better approach, now that we only have complex text. +@@ -92,7 +92,7 @@ class PLATFORM_EXPORT FontSelector : pub + virtual void ReportFontLookupByUniqueOrFamilyName( + const AtomicString& name, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) = 0; ++ scoped_refptr resulting_font_data) = 0; + + // Called whenever a page attempts to find a local font based on a name. This + // only includes lookups where the name is allowed to match PostScript names +@@ -100,7 +100,7 @@ class PLATFORM_EXPORT FontSelector : pub + virtual void ReportFontLookupByUniqueNameOnly( + const AtomicString& name, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data, ++ scoped_refptr resulting_font_data, + bool is_loading_fallback = false) = 0; + + // Called whenever a page attempts to find a local font based on a fallback +@@ -109,12 +109,12 @@ class PLATFORM_EXPORT FontSelector : pub + UChar32 fallback_character, + FontFallbackPriority fallback_priority, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) = 0; ++ scoped_refptr resulting_font_data) = 0; + + // Called whenever a page attempts to find a last-resort font. + virtual void ReportLastResortFallbackFontLookup( + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) = 0; ++ scoped_refptr resulting_font_data) = 0; + + virtual void ReportNotDefGlyph() const = 0; + +--- a/third_party/blink/renderer/platform/fonts/fuchsia/font_cache_fuchsia.cc ++++ b/third_party/blink/renderer/platform/fonts/fuchsia/font_cache_fuchsia.cc +@@ -45,7 +45,7 @@ void FontCache::SetSystemFontFamily(cons + MutableSystemFontFamily() = family_name; + } + +-const SimpleFontData* FontCache::PlatformFallbackFontForCharacter( ++scoped_refptr FontCache::PlatformFallbackFontForCharacter( + const FontDescription& font_description, + UChar32 character, + const SimpleFontData* font_data_to_substitute, +@@ -67,12 +67,12 @@ const SimpleFontData* FontCache::Platfor + !typeface->isItalic() && + font_description.SyntheticItalicAllowed(); + +- const auto* font_data = MakeGarbageCollected( ++ auto font_data = std::make_unique( + std::move(typeface), std::string(), font_description.EffectiveFontSize(), + synthetic_bold, synthetic_italic, font_description.TextRendering(), + ResolvedFontFeatures(), font_description.Orientation()); + +- return FontDataFromFontPlatformData(font_data); ++ return FontDataFromFontPlatformData(font_data.get(), kDoNotRetain); + } + + } // namespace blink +--- a/third_party/blink/renderer/platform/fonts/linux/font_cache_linux.cc ++++ b/third_party/blink/renderer/platform/fonts/linux/font_cache_linux.cc +@@ -62,7 +62,7 @@ bool FontCache::GetFontForCharacter(UCha + } + } + +-const SimpleFontData* FontCache::PlatformFallbackFontForCharacter( ++scoped_refptr FontCache::PlatformFallbackFontForCharacter( + const FontDescription& font_description, + UChar32 c, + const SimpleFontData*, +@@ -77,9 +77,11 @@ const SimpleFontData* FontCache::Platfor + AtomicString family_name = GetFamilyNameForCharacter( + font_manager_.get(), c, font_description, nullptr, fallback_priority); + if (family_name.empty()) +- return GetLastResortFallbackFont(font_description); +- return FontDataFromFontPlatformData(GetFontPlatformData( +- font_description, FontFaceCreationParams(family_name))); ++ return GetLastResortFallbackFont(font_description, kDoNotRetain); ++ return FontDataFromFontPlatformData( ++ GetFontPlatformData(font_description, ++ FontFaceCreationParams(family_name)), ++ kDoNotRetain); + } + + if (fallback_priority == FontFallbackPriority::kEmojiEmoji) { +@@ -94,7 +96,7 @@ const SimpleFontData* FontCache::Platfor + if (fallback_priority != FontFallbackPriority::kEmojiEmoji && + (font_description.Style() == kItalicSlopeValue || + font_description.Weight() >= kBoldThreshold)) { +- const SimpleFontData* font_data = ++ scoped_refptr font_data = + FallbackOnStandardFontStyle(font_description, c); + if (font_data) + return font_data; +@@ -137,16 +139,16 @@ const SimpleFontData* FontCache::Platfor + description.SetStyle(kNormalSlopeValue); + } + +- const FontPlatformData* substitute_platform_data = ++ FontPlatformData* substitute_platform_data = + GetFontPlatformData(description, creation_params); + if (!substitute_platform_data) + return nullptr; + +- FontPlatformData* platform_data = +- MakeGarbageCollected(*substitute_platform_data); ++ std::unique_ptr platform_data( ++ new FontPlatformData(*substitute_platform_data)); + platform_data->SetSyntheticBold(should_set_synthetic_bold); + platform_data->SetSyntheticItalic(should_set_synthetic_italic); +- return FontDataFromFontPlatformData(platform_data); ++ return FontDataFromFontPlatformData(platform_data.get(), kDoNotRetain); + } + + } // namespace blink +--- a/third_party/blink/renderer/platform/fonts/segmented_font_data.h ++++ b/third_party/blink/renderer/platform/fonts/segmented_font_data.h +@@ -28,7 +28,6 @@ + + #include "third_party/blink/renderer/platform/fonts/font_data.h" + #include "third_party/blink/renderer/platform/fonts/font_data_for_range_set.h" +-#include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" + #include "third_party/blink/renderer/platform/platform_export.h" + #include "third_party/blink/renderer/platform/wtf/casting.h" + +@@ -38,21 +37,20 @@ class SimpleFontData; + + class PLATFORM_EXPORT SegmentedFontData : public FontData { + public: +- SegmentedFontData() = default; +- +- void Trace(Visitor* visitor) const override { +- visitor->Trace(faces_); +- FontData::Trace(visitor); ++ static scoped_refptr Create() { ++ return base::AdoptRef(new SegmentedFontData); + } + +- void AppendFace(FontDataForRangeSet* font_data_for_range_set) { ++ void AppendFace(scoped_refptr font_data_for_range_set) { + faces_.push_back(std::move(font_data_for_range_set)); + } + unsigned NumFaces() const { return faces_.size(); } +- FontDataForRangeSet* FaceAt(unsigned i) const { return faces_[i].Get(); } ++ scoped_refptr FaceAt(unsigned i) const { return faces_[i]; } + bool ContainsCharacter(UChar32) const; + + private: ++ SegmentedFontData() = default; ++ + const SimpleFontData* FontDataForCharacter(UChar32) const override; + + bool IsCustomFont() const override; +@@ -61,7 +59,7 @@ class PLATFORM_EXPORT SegmentedFontData + bool IsSegmented() const override; + bool ShouldSkipDrawing() const override; + +- HeapVector, 1> faces_; ++ Vector, 1> faces_; + }; + + template <> +--- a/third_party/blink/renderer/platform/fonts/shaping/caching_word_shaper.cc ++++ b/third_party/blink/renderer/platform/fonts/shaping/caching_word_shaper.cc +@@ -127,7 +127,7 @@ Vector CachingWordShaper::Indivi + total_width); + } + +-HeapVector CachingWordShaper::GetRunFontData( ++Vector CachingWordShaper::GetRunFontData( + const TextRun& run) const { + ShapeResultBuffer buffer; + ShapeResultsForRun(GetShapeCache(), &font_, run, &buffer); +--- a/third_party/blink/renderer/platform/fonts/shaping/caching_word_shaper.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/caching_word_shaper.h +@@ -26,6 +26,7 @@ + #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_SHAPING_CACHING_WORD_SHAPER_H_ + #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_SHAPING_CACHING_WORD_SHAPER_H_ + ++#include "base/memory/scoped_refptr.h" + #include "third_party/blink/renderer/platform/fonts/shaping/shape_result_buffer.h" + #include "third_party/blink/renderer/platform/text/text_run.h" + #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" +@@ -59,7 +60,7 @@ class PLATFORM_EXPORT CachingWordShaper + CharacterRange GetCharacterRange(const TextRun&, unsigned from, unsigned to); + Vector IndividualCharacterAdvances(const TextRun&); + +- HeapVector GetRunFontData(const TextRun&) const; ++ Vector GetRunFontData(const TextRun&) const; + + GlyphData EmphasisMarkGlyphData(const TextRun&) const; + +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.cc +@@ -62,8 +62,7 @@ + + namespace blink { + +-HarfBuzzFace::HarfBuzzFace(const FontPlatformData* platform_data, +- uint64_t unique_id) ++HarfBuzzFace::HarfBuzzFace(FontPlatformData* platform_data, uint64_t unique_id) + : platform_data_(platform_data), unique_id_(unique_id) { + HbFontCacheEntry* const cache_entry = + FontGlobalContext::GetHarfBuzzFontCache().RefOrNew(unique_id_, +@@ -76,10 +76,6 @@ + FontGlobalContext::GetHarfBuzzFontCache().Remove(unique_id_); + } + +-void HarfBuzzFace::Trace(Visitor* visitor) const { +- visitor->Trace(platform_data_); +-} +- + bool HarfBuzzFace::ignore_variation_selectors_ = false; + + static hb_bool_t HarfBuzzGetGlyph(hb_font_t* hb_font, +@@ -426,8 +421,7 @@ static hb_blob_t* HarfBuzzSkiaGetTable(h + } + + // TODO(yosin): We should move |CreateFace()| to "harfbuzz_font_cache.cc". +-static hb::unique_ptr CreateFace( +- const FontPlatformData* platform_data) { ++static hb::unique_ptr CreateFace(FontPlatformData* platform_data) { + hb::unique_ptr face; + + sk_sp typeface = sk_ref_sp(platform_data->Typeface()); +@@ -475,9 +469,8 @@ static scoped_refptr C + return cache_entry; + } + +-HbFontCacheEntry* HarfBuzzFontCache::RefOrNew( +- uint64_t unique_id, +- const FontPlatformData* platform_data) { ++HbFontCacheEntry* HarfBuzzFontCache::RefOrNew(uint64_t unique_id, ++ FontPlatformData* platform_data) { + const auto& result = font_map_.insert(unique_id, nullptr); + if (result.is_new_entry) { + hb::unique_ptr face = CreateFace(platform_data); +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_face.h +@@ -34,11 +34,10 @@ + #include "third_party/blink/renderer/platform/fonts/glyph.h" + #include "third_party/blink/renderer/platform/fonts/typesetting_features.h" + #include "third_party/blink/renderer/platform/fonts/unicode_range_set.h" +-#include "third_party/blink/renderer/platform/heap/garbage_collected.h" +-#include "third_party/blink/renderer/platform/heap/member.h" + #include "third_party/blink/renderer/platform/platform_export.h" + #include "third_party/blink/renderer/platform/runtime_enabled_features.h" + #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" ++#include "third_party/blink/renderer/platform/wtf/ref_counted.h" + #include "third_party/blink/renderer/platform/wtf/text/character_names.h" + + #include +@@ -53,15 +52,19 @@ + // |HarfBuzzFace| is a thread specific data associated to |FontPlatformData|, + // hold by |HarfBuzzFontCache|. + class PLATFORM_EXPORT HarfBuzzFace final +- : public GarbageCollected { ++ : public RefCounted { ++ USING_FAST_MALLOC(HarfBuzzFace); ++ + public: +- HarfBuzzFace(const FontPlatformData* platform_data, uint64_t); ++ static scoped_refptr Create(FontPlatformData* platform_data, ++ uint64_t unique_id) { ++ return base::AdoptRef(new HarfBuzzFace(platform_data, unique_id)); ++ } ++ + HarfBuzzFace(const HarfBuzzFace&) = delete; + HarfBuzzFace& operator=(const HarfBuzzFace&) = delete; + ~HarfBuzzFace(); + +- void Trace(Visitor*) const; +- + enum VerticalLayoutCallbacks { kPrepareForVerticalLayout, kNoVerticalLayout }; + + // In order to support the restricting effect of unicode-range optionally a +@@ -102,10 +105,11 @@ + } + + private: ++ HarfBuzzFace(FontPlatformData* platform_data, uint64_t); + + void PrepareHarfBuzzFontData(); + +- Member platform_data_; ++ FontPlatformData* const platform_data_; + const uint64_t unique_id_; + // TODO(crbug.com/1489080): When briefly given MiraclePtr protection, + // these members were both found dangling. +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_font_cache.h +@@ -49,7 +49,7 @@ class HarfBuzzFontCache final { + ~HarfBuzzFontCache(); + + HbFontCacheEntry* RefOrNew(uint64_t unique_id, +- const FontPlatformData* platform_data); ++ FontPlatformData* platform_data); + void Remove(uint64_t unique_id); + + private: +--- a/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.cc ++++ b/third_party/blink/renderer/platform/fonts/shaping/harfbuzz_shaper.cc +@@ -798,7 +798,7 @@ + fallback_chars_hint.ReserveInitialCapacity(range_data->end - + range_data->start); + } +- FontDataForRangeSet* current_font_data_for_range_set = nullptr; ++ scoped_refptr current_font_data_for_range_set = nullptr; + FallbackFontStage fallback_stage = kIntermediate; + while (!range_data->reshape_queue.empty()) { + ReshapeQueueItem current_queue_item = range_data->reshape_queue.TakeFirst(); +@@ -867,7 +867,7 @@ + if (needs_caps_handling) { + case_map_intend = caps_support.NeedsCaseChange(small_caps_behavior); + if (caps_support.NeedsSyntheticFont(small_caps_behavior)) { +- adjusted_font = font_data->SmallCapsFontData(font_description); ++ adjusted_font = font_data->SmallCapsFontData(font_description).get(); + } + } + +--- a/third_party/blink/renderer/platform/fonts/shaping/shape_result.cc ++++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result.cc +@@ -79,10 +79,9 @@ ASSERT_SIZE(ShapeResult::RunInfo, SameSi + + struct SameSizeAsShapeResult { + float width; +- UntracedMember deprecated_ink_bounds_; +- Vector runs_; +- Vector character_position_; +- UntracedMember primary_font_; ++ UntracedMember member; ++ Vector vectors[2]; ++ void *pointer; + unsigned start_index_; + unsigned num_characters_; + unsigned bitfields : 32; +@@ -396,7 +395,7 @@ void ShapeResult::RunInfo::CharacterInde + } + } + +-ShapeResult::ShapeResult(const SimpleFontData* font_data, ++ShapeResult::ShapeResult(scoped_refptr font_data, + unsigned start_index, + unsigned num_characters, + TextDirection direction) +@@ -436,7 +435,6 @@ void ShapeResult::Trace(Visitor* visitor + visitor->Trace(deprecated_ink_bounds_); + visitor->Trace(runs_); + visitor->Trace(character_position_); +- visitor->Trace(primary_font_); + } + + size_t ShapeResult::ByteSize() const { +@@ -736,10 +734,10 @@ bool ShapeResult::HasFallbackFonts(const + return false; + } + +-void ShapeResult::GetRunFontData(HeapVector* font_data) const { ++void ShapeResult::GetRunFontData(Vector* font_data) const { + for (const auto& run : runs_) { + font_data->push_back( +- RunFontData({run->font_data_.Get(), run->glyph_data_.size()})); ++ RunFontData({run->font_data_.get(), run->glyph_data_.size()})); + } + } + +@@ -754,7 +752,7 @@ float ShapeResult::ForEachGlyphImpl(floa + for (const auto& glyph_data : run.glyph_data_) { + glyph_callback(context, run.start_index_ + glyph_data.character_index, + glyph_data.glyph, *glyph_offsets, total_advance, +- is_horizontal, run.canvas_rotation_, run.font_data_.Get()); ++ is_horizontal, run.canvas_rotation_, run.font_data_.get()); + total_advance += glyph_data.advance; + ++glyph_offsets; + } +@@ -789,7 +787,7 @@ float ShapeResult::ForEachGlyphImpl(floa + auto total_advance = initial_advance; + unsigned run_start = run.start_index_ + index_offset; + bool is_horizontal = HB_DIRECTION_IS_HORIZONTAL(run.direction_); +- const SimpleFontData* font_data = run.font_data_.Get(); ++ const SimpleFontData* font_data = run.font_data_.get(); + + if (run.IsLtr()) { // Left-to-right + for (const auto& glyph_data : run.glyph_data_) { +@@ -1679,7 +1677,7 @@ unsigned ShapeResult::CopyRangeInternal( + ShapeResult* ShapeResult::SubRange(unsigned start_offset, + unsigned end_offset) const { + ShapeResult* sub_range = +- MakeGarbageCollected(primary_font_.Get(), 0, 0, Direction()); ++ MakeGarbageCollected(primary_font_.get(), 0, 0, Direction()); + CopyRange(start_offset, end_offset, sub_range); + return sub_range; + } +--- a/third_party/blink/renderer/platform/fonts/shaping/shape_result.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result.h +@@ -139,7 +139,7 @@ typedef void (*GraphemeClusterCallback)( + + class PLATFORM_EXPORT ShapeResult : public GarbageCollected { + public: +- ShapeResult(const SimpleFontData*, ++ ShapeResult(scoped_refptr, + unsigned start_index, + unsigned num_characters, + TextDirection); +@@ -152,7 +152,7 @@ class PLATFORM_EXPORT ShapeResult : publ + void Trace(Visitor*) const; + + static ShapeResult* CreateEmpty(const ShapeResult& other) { +- return MakeGarbageCollected(other.primary_font_.Get(), 0, 0, ++ return MakeGarbageCollected(other.primary_font_, 0, 0, + other.Direction()); + } + static const ShapeResult* CreateForTabulationCharacters( +@@ -184,7 +184,7 @@ class PLATFORM_EXPORT ShapeResult : publ + LayoutUnit SnappedWidth() const { return LayoutUnit::FromFloatCeil(width_); } + unsigned NumCharacters() const { return num_characters_; } + unsigned NumGlyphs() const { return num_glyphs_; } +- const SimpleFontData* PrimaryFont() const { return primary_font_.Get(); } ++ const SimpleFontData* PrimaryFont() const { return primary_font_.get(); } + bool HasFallbackFonts(const SimpleFontData* primary_font) const; + + // TODO(eae): Remove start_x and return value once ShapeResultBuffer has been +@@ -350,12 +350,10 @@ class PLATFORM_EXPORT ShapeResult : publ + + // Computes the list of fonts along with the number of glyphs for each font. + struct RunFontData { +- DISALLOW_NEW(); +- void Trace(Visitor* visitor) const { visitor->Trace(font_data_); } +- Member font_data_; ++ SimpleFontData* font_data_; + wtf_size_t glyph_count_; + }; +- void GetRunFontData(HeapVector* font_data) const; ++ void GetRunFontData(Vector* font_data) const; + + // Iterates over, and calls the specified callback function, for all the + // glyphs. Also tracks (and returns) a seeded total advance. +@@ -510,7 +510,7 @@ + // index to x-position and O(log n) time, using binary search, from + // x-position to character index. + mutable HeapVector character_position_; +- Member primary_font_; ++ scoped_refptr primary_font_; + + unsigned start_index_ = 0; + unsigned num_characters_ = 0; +@@ -570,6 +568,5 @@ PLATFORM_EXPORT std::ostream& operator<< + } // namespace blink + + WTF_ALLOW_CLEAR_UNUSED_SLOTS_WITH_MEM_FUNCTIONS(blink::ShapeResult::ShapeRange) +-WTF_ALLOW_CLEAR_UNUSED_SLOTS_WITH_MEM_FUNCTIONS(blink::ShapeResult::RunFontData) + + #endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_SHAPING_SHAPE_RESULT_H_ +--- a/third_party/blink/renderer/platform/fonts/shaping/shape_result_buffer.cc ++++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result_buffer.cc +@@ -249,8 +249,8 @@ int ShapeResultBuffer::OffsetForPosition + return total_offset; + } + +-HeapVector ShapeResultBuffer::GetRunFontData() const { +- HeapVector font_data; ++Vector ShapeResultBuffer::GetRunFontData() const { ++ Vector font_data; + for (const auto& result : results_) + result->GetRunFontData(&font_data); + return font_data; +@@ -264,9 +264,10 @@ GlyphData ShapeResultBuffer::EmphasisMar + if (run->glyph_data_.IsEmpty()) + continue; + +- return GlyphData(run->glyph_data_[0].glyph, +- run->font_data_->EmphasisMarkFontData(font_description), +- run->CanvasRotation()); ++ return GlyphData( ++ run->glyph_data_[0].glyph, ++ run->font_data_->EmphasisMarkFontData(font_description).get(), ++ run->CanvasRotation()); + } + } + +--- a/third_party/blink/renderer/platform/fonts/shaping/shape_result_buffer.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result_buffer.h +@@ -5,6 +5,7 @@ + #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_SHAPING_SHAPE_RESULT_BUFFER_H_ + #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_FONTS_SHAPING_SHAPE_RESULT_BUFFER_H_ + ++#include "base/memory/scoped_refptr.h" + #include "third_party/blink/renderer/platform/fonts/shaping/shape_result.h" + #include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" + #include "third_party/blink/renderer/platform/platform_export.h" +@@ -47,7 +48,7 @@ class PLATFORM_EXPORT ShapeResultBuffer + TextDirection, + float total_width) const; + +- HeapVector GetRunFontData() const; ++ Vector GetRunFontData() const; + + GlyphData EmphasisMarkGlyphData(const FontDescription&) const; + +--- a/third_party/blink/renderer/platform/fonts/shaping/shape_result_inline_headers.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result_inline_headers.h +@@ -79,7 +79,7 @@ struct ShapeResult::RunInfo final + direction_(other.direction_), + canvas_rotation_(other.canvas_rotation_) {} + +- void Trace(Visitor* visitor) const { visitor->Trace(font_data_); } ++ void Trace(Visitor*) const {} + + unsigned NumGlyphs() const { return glyph_data_.size(); } + bool IsLtr() const { return HB_DIRECTION_IS_FORWARD(direction_); } +@@ -130,7 +130,7 @@ struct ShapeResult::RunInfo final + return nullptr; + + auto* run = MakeGarbageCollected( +- font_data_.Get(), direction_, canvas_rotation_, script_, ++ font_data_.get(), direction_, canvas_rotation_, script_, + start_index_ + start, number_of_glyphs, number_of_characters); + + run->glyph_data_.CopyFromRange(glyphs); +@@ -154,7 +154,7 @@ struct ShapeResult::RunInfo final + return nullptr; + DCHECK_LT(start_index_, other.start_index_); + auto* run = MakeGarbageCollected( +- font_data_.Get(), direction_, canvas_rotation_, script_, start_index_, ++ font_data_.get(), direction_, canvas_rotation_, script_, start_index_, + glyph_data_.size() + other.glyph_data_.size(), + num_characters_ + other.num_characters_); + // Note: We populate |graphemes_| on demand, e.g. hit testing. +@@ -374,7 +374,7 @@ struct ShapeResult::RunInfo final + } + + GlyphDataCollection glyph_data_; +- Member font_data_; ++ scoped_refptr font_data_; + + // graphemes_[i] is the number of graphemes up to (and including) the ith + // character in the run. +--- a/third_party/blink/renderer/platform/fonts/shaping/shape_result_test_info.cc ++++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result_test_info.cc +@@ -54,7 +54,7 @@ float ShapeResultTestInfo::AdvanceForTes + + SimpleFontData* ShapeResultTestInfo::FontDataForTesting( + unsigned run_index) const { +- return runs_[run_index]->font_data_.Get(); ++ return runs_[run_index]->font_data_.get(); + } + + Vector ShapeResultTestInfo::CharacterIndexesForTesting() const { +--- a/third_party/blink/renderer/platform/fonts/shaping/shape_result_view.cc ++++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result_view.cc +@@ -28,9 +28,7 @@ ShapeResultView::RunInfoPart::RunInfoPar + start_index_(start_index), + offset_(offset), + num_characters_(num_characters), +- width_(width) { +- static_assert(std::is_trivially_destructible::value, ""); +-} ++ width_(width) {} + + void ShapeResultView::RunInfoPart::Trace(Visitor* visitor) const { + visitor->Trace(run_); +@@ -74,10 +72,7 @@ unsigned ShapeResultView::CharacterIndex + // |InitData| provides values of const member variables of |ShapeResultView| + // for constructor. + struct ShapeResultView::InitData { +- STACK_ALLOCATED(); +- +- public: +- const SimpleFontData* primary_font = nullptr; ++ scoped_refptr primary_font; + unsigned start_index = 0; + unsigned char_index_offset = 0; + TextDirection direction = TextDirection::kLtr; +@@ -188,7 +183,7 @@ ShapeResult* ShapeResultView::CreateShap + new_result->runs_.ReserveInitialCapacity(parts_.size()); + for (const auto& part : RunsOrParts()) { + auto* new_run = MakeGarbageCollected( +- part.run_->font_data_.Get(), part.run_->direction_, ++ part.run_->font_data_.get(), part.run_->direction_, + part.run_->canvas_rotation_, part.run_->script_, part.start_index_, + part.NumGlyphs(), part.num_characters_); + new_run->glyph_data_.CopyFromRange(part.range_); +@@ -364,21 +359,21 @@ unsigned ShapeResultView::PreviousSafeTo + } + + void ShapeResultView::GetRunFontData( +- HeapVector* font_data) const { ++ Vector* font_data) const { + for (const auto& part : RunsOrParts()) { + font_data->push_back(ShapeResult::RunFontData( +- {part.run_->font_data_.Get(), ++ {part.run_->font_data_.get(), + static_cast(part.end() - part.begin())})); + } + } + + void ShapeResultView::FallbackFonts( +- HeapHashSet>* fallback) const { ++ HashSet* fallback) const { + DCHECK(fallback); + DCHECK(primary_font_); + for (const auto& part : RunsOrParts()) { + if (part.run_->font_data_ && part.run_->font_data_ != primary_font_) { +- fallback->insert(part.run_->font_data_.Get()); ++ fallback->insert(part.run_->font_data_.get()); + } + } + } +@@ -392,7 +387,7 @@ float ShapeResultView::ForEachGlyphImpl( + const auto& run = part.run_; + auto total_advance = initial_advance; + bool is_horizontal = HB_DIRECTION_IS_HORIZONTAL(run->direction_); +- const SimpleFontData* font_data = run->font_data_.Get(); ++ const SimpleFontData* font_data = run->font_data_.get(); + const unsigned character_index_offset_for_glyph_data = + CharacterIndexOffsetForGlyphData(part); + for (const auto& glyph_data : part) { +@@ -435,7 +430,7 @@ float ShapeResultView::ForEachGlyphImpl( + auto total_advance = initial_advance; + const auto& run = part.run_; + bool is_horizontal = HB_DIRECTION_IS_HORIZONTAL(run->direction_); +- const SimpleFontData* font_data = run->font_data_.Get(); ++ const SimpleFontData* font_data = run->font_data_.get(); + const unsigned character_index_offset_for_glyph_data = + CharacterIndexOffsetForGlyphData(part); + if (run->IsLtr()) { // Left-to-right +--- a/third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h ++++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h +@@ -10,7 +10,6 @@ + #include "third_party/blink/renderer/platform/fonts/shaping/shape_result.h" + #include "third_party/blink/renderer/platform/fonts/simple_font_data.h" + #include "third_party/blink/renderer/platform/geometry/layout_unit.h" +-#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_set.h" + #include "third_party/blink/renderer/platform/platform_export.h" + #include "third_party/blink/renderer/platform/text/text_direction.h" + #include "third_party/blink/renderer/platform/wtf/forward.h" +@@ -111,10 +110,7 @@ class PLATFORM_EXPORT ShapeResultView fi + ShapeResultView& operator=(const ShapeResultView&) = delete; + ~ShapeResultView() = default; + +- void Trace(Visitor* visitor) const { +- visitor->Trace(parts_); +- visitor->Trace(primary_font_); +- } ++ void Trace(Visitor* visitor) const { visitor->Trace(parts_); } + + ShapeResult* CreateShapeResult() const; + +@@ -130,7 +126,7 @@ class PLATFORM_EXPORT ShapeResultView fi + bool IsLtr() const { return blink::IsLtr(Direction()); } + bool IsRtl() const { return blink::IsRtl(Direction()); } + bool HasVerticalOffsets() const { return has_vertical_offsets_; } +- void FallbackFonts(HeapHashSet>* fallback) const; ++ void FallbackFonts(HashSet* fallback) const; + + unsigned PreviousSafeToBreakOffset(unsigned index) const; + +@@ -155,8 +151,10 @@ class PLATFORM_EXPORT ShapeResultView fi + // bounds. + gfx::RectF ComputeInkBounds() const; + +- const SimpleFontData* PrimaryFont() const { return primary_font_.Get(); } +- void GetRunFontData(HeapVector*) const; ++ scoped_refptr PrimaryFont() const { ++ return primary_font_; ++ } ++ void GetRunFontData(Vector*) const; + + void ExpandRangeToIncludePartialGlyphs(unsigned* from, unsigned* to) const; + +@@ -288,8 +286,7 @@ class PLATFORM_EXPORT ShapeResultView fi + + unsigned StartIndexOffsetForRun() const { return char_index_offset_; } + +- HeapVector parts_; +- Member const primary_font_; ++ scoped_refptr const primary_font_; + + const unsigned start_index_; + +@@ -311,6 +308,8 @@ class PLATFORM_EXPORT ShapeResultView fi + // with ShapeResult::SubRange + const unsigned char_index_offset_; + ++ HeapVector parts_; ++ + private: + friend class ShapeResult; + +--- a/third_party/blink/renderer/platform/fonts/simple_font_data.cc ++++ b/third_party/blink/renderer/platform/fonts/simple_font_data.cc +@@ -76,14 +76,14 @@ constexpr int32_t kFontObjectsMemoryCons + constexpr int32_t kFontObjectsMemoryConsumption = 2128; + #endif + +-SimpleFontData::SimpleFontData(const FontPlatformData* platform_data, +- const CustomFontData* custom_data, ++SimpleFontData::SimpleFontData(const FontPlatformData& platform_data, ++ scoped_refptr custom_data, + bool subpixel_ascent_descent, + const FontMetricsOverride& metrics_override) + : platform_data_(platform_data), +- font_(platform_data->size() ? platform_data->CreateSkFont() ++ font_(platform_data_.size() ? platform_data.CreateSkFont() + : skia::DefaultFont()), +- custom_font_data_(custom_data) { ++ custom_font_data_(std::move(custom_data)) { + // Every time new SimpleFontData instance is created, Skia will ask + // FreeType to get the metrics for glyphs by invoking + // af_face_globals_get_metrics. There FT will allocate style_metrics_size +@@ -111,7 +111,7 @@ SimpleFontData::~SimpleFontData() { + + void SimpleFontData::PlatformInit(bool subpixel_ascent_descent, + const FontMetricsOverride& metrics_override) { +- if (!platform_data_->size()) { ++ if (!platform_data_.size()) { + font_metrics_.Reset(); + avg_char_width_ = 0; + max_char_width_ = 0; +@@ -126,7 +126,7 @@ void SimpleFontData::PlatformInit(bool s + float descent; + + FontMetrics::AscentDescentWithHacks( +- ascent, descent, *platform_data_, font_, subpixel_ascent_descent, ++ ascent, descent, platform_data_, font_, subpixel_ascent_descent, + metrics_override.ascent_override, metrics_override.descent_override); + + font_metrics_.SetAscent(ascent); +@@ -164,7 +164,7 @@ void SimpleFontData::PlatformInit(bool s + + float line_gap; + if (metrics_override.line_gap_override) { +- line_gap = *metrics_override.line_gap_override * platform_data_->size(); ++ line_gap = *metrics_override.line_gap_override * platform_data_.size(); + } else { + line_gap = SkScalarToFloat(metrics.fLeading); + } +@@ -261,39 +261,45 @@ bool SimpleFontData::IsSegmented() const + return false; + } + +-SimpleFontData* SimpleFontData::SmallCapsFontData( ++scoped_refptr SimpleFontData::SmallCapsFontData( + const FontDescription& font_description) const { +- if (!small_caps_) { +- small_caps_ = ++ if (!derived_font_data_) ++ derived_font_data_ = std::make_unique(); ++ if (!derived_font_data_->small_caps) { ++ derived_font_data_->small_caps = + CreateScaledFontData(font_description, kSmallCapsFontSizeMultiplier); + } +- return small_caps_; ++ ++ return derived_font_data_->small_caps; + } + +-SimpleFontData* SimpleFontData::EmphasisMarkFontData( ++scoped_refptr SimpleFontData::EmphasisMarkFontData( + const FontDescription& font_description) const { +- if (!emphasis_mark_) { +- emphasis_mark_ = ++ if (!derived_font_data_) ++ derived_font_data_ = std::make_unique(); ++ if (!derived_font_data_->emphasis_mark) { ++ derived_font_data_->emphasis_mark = + CreateScaledFontData(font_description, kEmphasisMarkFontSizeMultiplier); + } +- return emphasis_mark_; ++ ++ return derived_font_data_->emphasis_mark; + } + +-SimpleFontData* SimpleFontData::CreateScaledFontData( ++scoped_refptr SimpleFontData::CreateScaledFontData( + const FontDescription& font_description, + float scale_factor) const { + const float scaled_size = + lroundf(font_description.ComputedSize() * scale_factor); +- return MakeGarbageCollected( +- MakeGarbageCollected(*platform_data_, scaled_size), +- IsCustomFont() ? MakeGarbageCollected() : nullptr); ++ return SimpleFontData::Create( ++ FontPlatformData(platform_data_, scaled_size), ++ IsCustomFont() ? CustomFontData::Create() : nullptr); + } + +-SimpleFontData* SimpleFontData::MetricsOverriddenFontData( ++scoped_refptr SimpleFontData::MetricsOverriddenFontData( + const FontMetricsOverride& metrics_override) const { +- return MakeGarbageCollected( +- platform_data_, custom_font_data_, false /* subpixel_ascent_descent */, +- metrics_override); ++ return base::AdoptRef(new SimpleFontData(platform_data_, custom_font_data_, ++ false /* subpixel_ascent_descent */, ++ metrics_override)); + } + + // Internal leadings can be distributed to ascent and descent. +@@ -346,7 +352,7 @@ static std::pair TypoA + + void SimpleFontData::ComputeNormalizedTypoAscentAndDescent() const { + // Compute em height metrics from OS/2 sTypoAscender and sTypoDescender. +- SkTypeface* typeface = platform_data_->Typeface(); ++ SkTypeface* typeface = platform_data_.Typeface(); + auto [typo_ascender, typo_descender] = TypoAscenderAndDescender(typeface); + if (typo_ascender > 0 && + TrySetNormalizedTypoAscentAndDescent(typo_ascender, typo_descender)) { +@@ -433,7 +439,7 @@ const std::optional& SimpleFontDa + } + + // Compute vertical advance if the orientation is `kVerticalUpright`. +- const HarfBuzzFace* hb_face = platform_data_->GetHarfBuzzFace(); ++ const HarfBuzzFace* hb_face = platform_data_.GetHarfBuzzFace(); + const OpenTypeVerticalData& vertical_data = hb_face->VerticalData(); + ideographic_inline_size_ = vertical_data.AdvanceHeight(cjk_water_glyph); + }); +@@ -461,9 +467,8 @@ const HanKerning::FontData& SimpleFontDa + } + + gfx::RectF SimpleFontData::PlatformBoundsForGlyph(Glyph glyph) const { +- if (!platform_data_->size()) { ++ if (!platform_data_.size()) + return gfx::RectF(); +- } + + static_assert(sizeof(glyph) == 2, "Glyph id should not be truncated."); + +@@ -476,18 +481,16 @@ void SimpleFontData::BoundsForGlyphs(con + Vector* bounds) const { + DCHECK_EQ(glyphs.size(), bounds->size()); + +- if (!platform_data_->size()) { ++ if (!platform_data_.size()) + return; +- } + + DCHECK_EQ(bounds->size(), glyphs.size()); + SkFontGetBoundsForGlyphs(font_, glyphs, bounds->data()); + } + + float SimpleFontData::WidthForGlyph(Glyph glyph) const { +- if (!platform_data_->size()) { ++ if (!platform_data_.size()) + return 0; +- } + + static_assert(sizeof(glyph) == 2, "Glyph id should not be truncated."); + +--- a/third_party/blink/renderer/platform/fonts/simple_font_data.h ++++ b/third_party/blink/renderer/platform/fonts/simple_font_data.h +@@ -40,7 +40,6 @@ + #include "third_party/blink/renderer/platform/fonts/glyph.h" + #include "third_party/blink/renderer/platform/fonts/shaping/han_kerning.h" + #include "third_party/blink/renderer/platform/fonts/typesetting_features.h" +-#include "third_party/blink/renderer/platform/heap/member.h" + #include "third_party/blink/renderer/platform/platform_export.h" + #include "third_party/blink/renderer/platform/wtf/casting.h" + #include "third_party/blink/renderer/platform/wtf/text/string_hash.h" +@@ -75,18 +74,12 @@ class FontDescription; + class PLATFORM_EXPORT SimpleFontData final : public FontData { + public: + // Used to create platform fonts. +- SimpleFontData( +- const FontPlatformData*, +- const CustomFontData* custom_data = nullptr, +- bool subpixel_ascent_descent = false, +- const FontMetricsOverride& metrics_override = FontMetricsOverride()); +- +- void Trace(Visitor* visitor) const override { +- visitor->Trace(platform_data_); +- visitor->Trace(small_caps_); +- visitor->Trace(emphasis_mark_); +- visitor->Trace(custom_font_data_); +- FontData::Trace(visitor); ++ static scoped_refptr Create( ++ const FontPlatformData& platform_data, ++ scoped_refptr custom_data = nullptr, ++ bool subpixel_ascent_descent = false) { ++ return base::AdoptRef(new SimpleFontData( ++ platform_data, std::move(custom_data), subpixel_ascent_descent)); + } + + SimpleFontData(const SimpleFontData&) = delete; +@@ -95,11 +88,13 @@ class PLATFORM_EXPORT SimpleFontData fin + SimpleFontData& operator=(const SimpleFontData&) = delete; + SimpleFontData& operator=(const SimpleFontData&&) = delete; + +- const FontPlatformData& PlatformData() const { return *platform_data_; } ++ const FontPlatformData& PlatformData() const { return platform_data_; } + +- SimpleFontData* SmallCapsFontData(const FontDescription&) const; +- SimpleFontData* EmphasisMarkFontData(const FontDescription&) const; +- SimpleFontData* MetricsOverriddenFontData(const FontMetricsOverride&) const; ++ scoped_refptr SmallCapsFontData(const FontDescription&) const; ++ scoped_refptr EmphasisMarkFontData( ++ const FontDescription&) const; ++ scoped_refptr MetricsOverriddenFontData( ++ const FontMetricsOverride&) const; + + FontMetrics& GetFontMetrics() { return font_metrics_; } + const FontMetrics& GetFontMetrics() const { return font_metrics_; } +@@ -154,7 +149,7 @@ class PLATFORM_EXPORT SimpleFontData fin + + Glyph GlyphForCharacter(UChar32) const; + +- bool IsCustomFont() const override { return custom_font_data_; } ++ bool IsCustomFont() const override { return custom_font_data_.get(); } + bool IsLoading() const override { + return custom_font_data_ ? custom_font_data_->IsLoading() : false; + } +@@ -169,16 +164,20 @@ class PLATFORM_EXPORT SimpleFontData fin + return custom_font_data_ && custom_font_data_->ShouldSkipDrawing(); + } + +- const CustomFontData* GetCustomFontData() const { +- return custom_font_data_.Get(); +- } ++ CustomFontData* GetCustomFontData() const { return custom_font_data_.get(); } + + private: ++ SimpleFontData( ++ const FontPlatformData&, ++ scoped_refptr custom_data, ++ bool subpixel_ascent_descent = false, ++ const FontMetricsOverride& metrics_override = FontMetricsOverride()); ++ + void PlatformInit(bool subpixel_ascent_descent, const FontMetricsOverride&); + void PlatformGlyphInit(); + +- SimpleFontData* CreateScaledFontData(const FontDescription&, +- float scale_factor) const; ++ scoped_refptr CreateScaledFontData(const FontDescription&, ++ float scale_factor) const; + + void ComputeNormalizedTypoAscentAndDescent() const; + bool TrySetNormalizedTypoAscentAndDescent(float ascent, float descent) const; +@@ -187,17 +186,30 @@ class PLATFORM_EXPORT SimpleFontData fin + float max_char_width_ = -1; + float avg_char_width_ = -1; + +- Member platform_data_; ++ const FontPlatformData platform_data_; + const SkFont font_; + + Glyph space_glyph_ = 0; + float space_width_ = 0; + Glyph zero_glyph_ = 0; + +- mutable Member small_caps_; +- mutable Member emphasis_mark_; ++ struct DerivedFontData final { ++ USING_FAST_MALLOC(DerivedFontData); ++ ++ public: ++ DerivedFontData() = default; ++ DerivedFontData(const DerivedFontData&) = delete; ++ DerivedFontData(DerivedFontData&&) = delete; ++ DerivedFontData& operator=(const DerivedFontData&) = delete; ++ DerivedFontData& operator=(DerivedFontData&&) = delete; ++ ++ scoped_refptr small_caps; ++ scoped_refptr emphasis_mark; ++ }; ++ ++ mutable std::unique_ptr derived_font_data_; + +- Member custom_font_data_; ++ const scoped_refptr custom_font_data_; + + mutable std::once_flag ideographic_inline_size_once_; + mutable std::once_flag ideographic_advance_width_once_; +--- a/third_party/blink/renderer/platform/fonts/skia/font_cache_skia.cc ++++ b/third_party/blink/renderer/platform/fonts/skia/font_cache_skia.cc +@@ -94,7 +94,7 @@ AtomicString FontCache::GetFamilyNameFor + + void FontCache::PlatformInit() {} + +-const SimpleFontData* FontCache::FallbackOnStandardFontStyle( ++scoped_refptr FontCache::FallbackOnStandardFontStyle( + const FontDescription& font_description, + UChar32 character) { + FontDescription substitute_description(font_description); +@@ -103,26 +103,27 @@ const SimpleFontData* FontCache::Fallbac + + FontFaceCreationParams creation_params( + substitute_description.Family().FamilyName()); +- const FontPlatformData* substitute_platform_data = ++ FontPlatformData* substitute_platform_data = + GetFontPlatformData(substitute_description, creation_params); + if (substitute_platform_data && + substitute_platform_data->FontContainsCharacter(character)) { +- FontPlatformData* platform_data = +- MakeGarbageCollected(*substitute_platform_data); +- platform_data->SetSyntheticBold(font_description.Weight() >= +- kBoldThreshold && +- font_description.SyntheticBoldAllowed()); +- platform_data->SetSyntheticItalic( +- font_description.Style() == kItalicSlopeValue && +- font_description.SyntheticItalicAllowed()); +- return FontDataFromFontPlatformData(platform_data); ++ FontPlatformData platform_data = ++ FontPlatformData(*substitute_platform_data); ++ platform_data.SetSyntheticBold(font_description.Weight() >= ++ kBoldThreshold && ++ font_description.SyntheticBoldAllowed()); ++ platform_data.SetSyntheticItalic(font_description.Style() == ++ kItalicSlopeValue && ++ font_description.SyntheticItalicAllowed()); ++ return FontDataFromFontPlatformData(&platform_data, kDoNotRetain); + } + + return nullptr; + } + +-const SimpleFontData* FontCache::GetLastResortFallbackFont( +- const FontDescription& description) { ++scoped_refptr FontCache::GetLastResortFallbackFont( ++ const FontDescription& description, ++ ShouldRetain should_retain) { + const FontFaceCreationParams fallback_creation_params( + GetFallbackFontFamily(description)); + const FontPlatformData* font_platform_data = GetFontPlatformData( +@@ -195,7 +196,7 @@ const SimpleFontData* FontCache::GetLast + #endif + + DCHECK(font_platform_data); +- return FontDataFromFontPlatformData(font_platform_data); ++ return FontDataFromFontPlatformData(font_platform_data, should_retain); + } + + sk_sp FontCache::CreateTypeface( +@@ -238,7 +239,7 @@ sk_sp FontCache::CreateTypef + } + + #if !BUILDFLAG(IS_WIN) +-const FontPlatformData* FontCache::CreateFontPlatformData( ++std::unique_ptr FontCache::CreateFontPlatformData( + const FontDescription& font_description, + const FontFaceCreationParams& creation_params, + float font_size, +@@ -293,10 +294,11 @@ const FontPlatformData* FontCache::Creat + ->GetResolvedFontFeatures() + : ResolvedFontFeatures(); + +- FontPlatformData* font_platform_data = MakeGarbageCollected( +- typeface, name, font_size, synthetic_bold, synthetic_italic, +- font_description.TextRendering(), resolved_font_features, +- font_description.Orientation()); ++ std::unique_ptr font_platform_data = ++ std::make_unique( ++ typeface, name, font_size, synthetic_bold, synthetic_italic, ++ font_description.TextRendering(), resolved_font_features, ++ font_description.Orientation()); + + font_platform_data->SetAvoidEmbeddedBitmaps( + BitmapGlyphsBlockList::ShouldAvoidEmbeddedBitmapsForTypeface(*typeface)); +--- a/third_party/blink/renderer/platform/testing/font_test_helpers.cc ++++ b/third_party/blink/renderer/platform/testing/font_test_helpers.cc +@@ -43,26 +43,23 @@ class TestFontSelector : public FontSele + } + ~TestFontSelector() override = default; + +- FontData* GetFontData(const FontDescription& font_description, +- const FontFamily&) override { ++ scoped_refptr GetFontData(const FontDescription& font_description, ++ const FontFamily&) override { + FontSelectionCapabilities normal_capabilities( + {kNormalWidthValue, kNormalWidthValue}, + {kNormalSlopeValue, kNormalSlopeValue}, + {kNormalWeightValue, kNormalWeightValue}); +- const FontPlatformData* platform_data = +- custom_platform_data_->GetFontPlatformData( +- font_description.EffectiveFontSize(), +- font_description.AdjustedSpecifiedSize(), +- font_description.IsSyntheticBold() && +- font_description.SyntheticBoldAllowed(), +- font_description.IsSyntheticItalic() && +- font_description.SyntheticItalicAllowed(), +- font_description.GetFontSelectionRequest(), normal_capabilities, +- font_description.FontOpticalSizing(), +- font_description.TextRendering(), {}, +- font_description.Orientation()); +- return MakeGarbageCollected( +- platform_data, MakeGarbageCollected()); ++ FontPlatformData platform_data = custom_platform_data_->GetFontPlatformData( ++ font_description.EffectiveFontSize(), ++ font_description.AdjustedSpecifiedSize(), ++ font_description.IsSyntheticBold() && ++ font_description.SyntheticBoldAllowed(), ++ font_description.IsSyntheticItalic() && ++ font_description.SyntheticItalicAllowed(), ++ font_description.GetFontSelectionRequest(), normal_capabilities, ++ font_description.FontOpticalSizing(), font_description.TextRendering(), ++ {}, font_description.Orientation()); ++ return SimpleFontData::Create(platform_data, CustomFontData::Create()); + } + + void WillUseFontData(const FontDescription&, +@@ -83,20 +80,20 @@ class TestFontSelector : public FontSele + void ReportFontLookupByUniqueOrFamilyName( + const AtomicString& name, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) override {} ++ scoped_refptr resulting_font_data) override {} + void ReportFontLookupByUniqueNameOnly( + const AtomicString& name, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data, ++ scoped_refptr resulting_font_data, + bool is_loading_fallback = false) override {} + void ReportFontLookupByFallbackCharacter( + UChar32 hint, + FontFallbackPriority fallback_priority, + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) override {} ++ scoped_refptr resulting_font_data) override {} + void ReportLastResortFallbackFontLookup( + const FontDescription& font_description, +- const SimpleFontData* resulting_font_data) override {} ++ scoped_refptr resulting_font_data) override {} + void ReportNotDefGlyph() const override {} + void ReportEmojiSegmentGlyphCoverage(unsigned, unsigned) override {} + ExecutionContext* GetExecutionContext() const override { return nullptr; } +--- a/tools/privacy_budget/font_indexer/font_indexer.cc ++++ b/tools/privacy_budget/font_indexer/font_indexer.cc +@@ -116,7 +116,7 @@ void FontIndexer::FontListHasLoaded(base + bool FontIndexer::DoesFontHaveDigest(WTF::AtomicString name, + blink::FontDescription font_description, + int64_t digest) { +- const blink::SimpleFontData* font_data = ++ scoped_refptr font_data = + font_cache_->GetFontData(font_description, name); + DCHECK(font_data); + return blink::FontGlobalContext::Get() +@@ -170,7 +170,7 @@ void FontIndexer::PrintAllFontsWithName( + // exists and for later comparison. + int64_t default_font_digest; + { +- const blink::SimpleFontData* font_data = ++ scoped_refptr font_data = + font_cache_->GetFontData(blink::FontDescription(), name); + default_font_digest = + font_data ? blink::FontGlobalContext::Get() +@@ -231,7 +231,7 @@ void FontIndexer::PrintAllFontsWithName( + for (auto slope_pair : slopes) { + font_description.SetStyle(slope_pair.first); + +- if (const blink::SimpleFontData* font_data = ++ if (scoped_refptr font_data = + font_cache_->GetFontData(font_description, name)) { + uint64_t typeface_digest = + blink::FontGlobalContext::Get() diff --git a/chromium-125-debian-bad-font-gc3.patch b/chromium-125-debian-bad-font-gc3.patch new file mode 100644 index 0000000000000000000000000000000000000000..600a4001c9aa341137a13ed5f44602ff84c6b593 --- /dev/null +++ b/chromium-125-debian-bad-font-gc3.patch @@ -0,0 +1,38 @@ +Revert the following commit (to support bad-font-gc2.patch): + +commit d4806d20fda56e9bac259fddf10b7439ce749add +Author: Hao Liu +Date: Mon Mar 18 22:56:31 2024 +0000 + + Cleanup leftover non-used custom_font_data methods + + This is to clean up non-used custom_font_data methods. Their usage has + been deleted in a previous CL. + https://chromium-review.googlesource.com/c/chromium/src/+/5262982/29/third_party/blink/renderer/core/css/css_font_face_source.cc#b95 + + Change-Id: I90c3ae794a6caf71526c81a56795e95c23cc3fb5 + Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5368244 + Reviewed-by: Ian Kilpatrick + Commit-Queue: Ian Kilpatrick + Cr-Commit-Position: refs/heads/main@{#1274525} + +--- a/third_party/blink/renderer/core/css/css_custom_font_data.h ++++ b/third_party/blink/renderer/core/css/css_custom_font_data.h +@@ -55,6 +55,7 @@ class CSSCustomFontData final : public C + + bool IsLoading() const override { return is_loading_; } + bool IsLoadingFallback() const override { return true; } ++ void ClearFontFaceSource() override { font_face_source_ = nullptr; } + + bool IsPendingDataUrl() const override { + return font_face_source_ && font_face_source_->IsPendingDataUrl(); +--- a/third_party/blink/renderer/platform/fonts/custom_font_data.h ++++ b/third_party/blink/renderer/platform/fonts/custom_font_data.h +@@ -46,6 +46,7 @@ class PLATFORM_EXPORT CustomFontData : p + virtual bool IsLoading() const { return false; } + virtual bool IsLoadingFallback() const { return false; } + virtual bool ShouldSkipDrawing() const { return false; } ++ virtual void ClearFontFaceSource() {} + virtual bool IsPendingDataUrl() const { return false; } + + protected: diff --git a/chromium-125-disable-FFmpegAllowLists.patch b/chromium-125-disable-FFmpegAllowLists.patch new file mode 100644 index 0000000000000000000000000000000000000000..72761b7f723d4dd7da96b18989a9d2c77470ef78 --- /dev/null +++ b/chromium-125-disable-FFmpegAllowLists.patch @@ -0,0 +1,12 @@ +diff -up chromium-122.0.6261.29/media/base/media_switches.cc.disable-FFmpegAllowLists chromium-122.0.6261.29/media/base/media_switches.cc +--- chromium-122.0.6261.29/media/base/media_switches.cc.disable-FFmpegAllowLists 2024-02-12 15:56:50.703196471 +0100 ++++ chromium-122.0.6261.29/media/base/media_switches.cc 2024-02-12 17:08:42.266076401 +0100 +@@ -1753,7 +1753,7 @@ + // Enables FFmpeg allow lists for supported codecs / containers. + BASE_FEATURE(kFFmpegAllowLists, + "FFmpegAllowLists", +- base::FEATURE_ENABLED_BY_DEFAULT); ++ base::FEATURE_DISABLED_BY_DEFAULT); + + #if BUILDFLAG(IS_WIN) + // Enables audio offload when supported by endpoints. diff --git a/chromium-125-emplace-struct.patch b/chromium-125-emplace-struct.patch new file mode 100644 index 0000000000000000000000000000000000000000..e1881700846ae847813bf6a8ee37af902b522e82 --- /dev/null +++ b/chromium-125-emplace-struct.patch @@ -0,0 +1,68 @@ +diff --git a/shared_image_backing.h b/shared_image_backing.h.new +index 97ebd0b..fc6179c 100644 +--- a/gpu/command_buffer/service/shared_image/shared_image_backing.h ++++ b/gpu/command_buffer/service/shared_image/shared_image_backing.h +@@ -338,7 +338,7 @@ class GPU_GLES2_EXPORT SharedImageBacking { + private: + class ScopedWriteUMA { + public: +- ScopedWriteUMA() = default; ++ ScopedWriteUMA() : content_consumed_(false) {} + + ScopedWriteUMA(const ScopedWriteUMA&) = delete; + ScopedWriteUMA& operator=(const ScopedWriteUMA&) = delete; +@@ -352,7 +352,7 @@ class GPU_GLES2_EXPORT SharedImageBacking { + void SetConsumed() { content_consumed_ = true; } + + private: +- bool content_consumed_ = false; ++ bool content_consumed_; + }; + + const Mailbox mailbox_; +diff --git a/history_item.h b/history_item.h.new +index 15fea48..ba59305 100644 +--- a/third_party/blink/renderer/core/loader/history_item.h ++++ b/third_party/blink/renderer/core/loader/history_item.h +@@ -77,13 +77,13 @@ class CORE_EXPORT HistoryItem final : public GarbageCollected { + DISALLOW_NEW(); + + public: +- ViewState() = default; ++ ViewState() : page_scale_factor_(0) {} + ViewState(const ViewState&) = default; + ViewState& operator=(const ViewState&) = default; + + ScrollOffset visual_viewport_scroll_offset_; + ScrollOffset scroll_offset_; +- float page_scale_factor_ = 0; ++ float page_scale_factor_; + ScrollAnchorData scroll_anchor_data_; + }; + +diff --git a/third_party/blink/public/common/interest_group/auction_config.h b/third_party/blink/public/common/interest_group/auction_config.h.new +index 5eb6378..4187556 100644 +--- a/third_party/blink/public/common/interest_group/auction_config.h ++++ b/third_party/blink/public/common/interest_group/auction_config.h +@@ -243,9 +243,11 @@ struct BLINK_COMMON_EXPORT AuctionConfig { + + // Povides whether debug mode is enabled and, if it is, any debug key. + struct BLINK_COMMON_EXPORT AuctionReportBuyerDebugModeConfig { +- bool is_enabled = false; ++ bool is_enabled; + std::optional debug_key; + ++ AuctionReportBuyerDebugModeConfig() : is_enabled(false) {} ++ + friend BLINK_COMMON_EXPORT bool operator==( + const AuctionReportBuyerDebugModeConfig&, + const AuctionReportBuyerDebugModeConfig&); +@@ -447,7 +449,7 @@ struct BLINK_COMMON_EXPORT AuctionConfig { + // Origin for the Coordinator to be used for Private Aggregation. + std::optional aggregation_coordinator_origin; + +- static_assert(__LINE__ == 455, R"( ++ static_assert(__LINE__ == 457, R"( + If modifying AuctionConfig fields, please make sure to also modify: + + * third_party/blink/public/mojom/interest_group/interest_group_types.mojom diff --git a/chromium-125-ffmpeg-5.x-reordered_opaque.patch b/chromium-125-ffmpeg-5.x-reordered_opaque.patch new file mode 100644 index 0000000000000000000000000000000000000000..9aff864890f7817c7d5758abb2feabbc26c65b5e --- /dev/null +++ b/chromium-125-ffmpeg-5.x-reordered_opaque.patch @@ -0,0 +1,105 @@ +commit 62274859104bd828373ae406aa9309e610449ac5 +Author: Ted Meyer +Date: Fri Mar 22 19:56:55 2024 +0000 + + Replace deprecated use of AVCodecContext::reordered_opaque + + We can use the AV_CODEC_FLAG_COPY_OPAQUE flag on the codec context + now to trigger timestamp propagation. + + Bug: 330573128 + Change-Id: I6bc57241a35ab5283742aad8d42acb4dc5e85858 + Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5384308 + Commit-Queue: Ted (Chromium) Meyer + Reviewed-by: Dan Sanders + Cr-Commit-Position: refs/heads/main@{#1277051} + +diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc +index bd75477feeabb..8a658a58caac5 100644 +--- a/media/filters/ffmpeg_video_decoder.cc ++++ b/media/filters/ffmpeg_video_decoder.cc +@@ -134,7 +134,7 @@ bool FFmpegVideoDecoder::IsCodecSupported(VideoCodec codec) { + } + + FFmpegVideoDecoder::FFmpegVideoDecoder(MediaLog* media_log) +- : media_log_(media_log) { ++ : media_log_(media_log), timestamp_map_(128) { + DVLOG(1) << __func__; + DETACH_FROM_SEQUENCE(sequence_checker_); + } +@@ -363,8 +363,10 @@ bool FFmpegVideoDecoder::FFmpegDecode(const DecoderBuffer& buffer) { + DCHECK(packet->data); + DCHECK_GT(packet->size, 0); + +- // Let FFmpeg handle presentation timestamp reordering. +- codec_context_->reordered_opaque = buffer.timestamp().InMicroseconds(); ++ const int64_t timestamp = buffer.timestamp().InMicroseconds(); ++ const TimestampId timestamp_id = timestamp_id_generator_.GenerateNextId(); ++ timestamp_map_.Put(std::make_pair(timestamp_id, timestamp)); ++ packet->opaque = reinterpret_cast(timestamp_id.GetUnsafeValue()); + } + FFmpegDecodingLoop::DecodeStatus decode_status = decoding_loop_->DecodePacket( + packet, base::BindRepeating(&FFmpegVideoDecoder::OnNewFrame, +@@ -423,7 +425,12 @@ bool FFmpegVideoDecoder::OnNewFrame(AVFrame* frame) { + } + gfx::Size natural_size = aspect_ratio.GetNaturalSize(visible_rect); + +- const auto pts = base::Microseconds(frame->reordered_opaque); ++ const auto ts_id = TimestampId(reinterpret_cast(frame->opaque)); ++ const auto ts_lookup = timestamp_map_.Get(ts_id); ++ if (ts_lookup == timestamp_map_.end()) { ++ return false; ++ } ++ const auto pts = base::Microseconds(std::get<1>(*ts_lookup)); + auto video_frame = VideoFrame::WrapExternalDataWithLayout( + opaque->layout, visible_rect, natural_size, opaque->data, opaque->size, + pts); +@@ -498,8 +505,10 @@ bool FFmpegVideoDecoder::ConfigureDecoder(const VideoDecoderConfig& config, + codec_context_->thread_count = GetFFmpegVideoDecoderThreadCount(config); + codec_context_->thread_type = + FF_THREAD_SLICE | (low_delay ? 0 : FF_THREAD_FRAME); ++ + codec_context_->opaque = this; + codec_context_->get_buffer2 = GetVideoBufferImpl; ++ codec_context_->flags |= AV_CODEC_FLAG_COPY_OPAQUE; + + if (base::FeatureList::IsEnabled(kFFmpegAllowLists)) { + // Note: FFmpeg will try to free this string, so we must duplicate it. +diff --git a/media/filters/ffmpeg_video_decoder.h b/media/filters/ffmpeg_video_decoder.h +index d02cb89c3ddf7..0a2de1c623fff 100644 +--- a/media/filters/ffmpeg_video_decoder.h ++++ b/media/filters/ffmpeg_video_decoder.h +@@ -7,10 +7,12 @@ + + #include + ++#include "base/containers/lru_cache.h" + #include "base/functional/callback.h" + #include "base/memory/raw_ptr.h" + #include "base/memory/scoped_refptr.h" + #include "base/sequence_checker.h" ++#include "base/types/id_type.h" + #include "media/base/frame_buffer_pool.h" + #include "media/base/supported_video_decoder_config.h" + #include "media/base/video_decoder.h" +@@ -87,6 +89,20 @@ class MEDIA_EXPORT FFmpegVideoDecoder : public VideoDecoder { + // FFmpeg structures owned by this object. + std::unique_ptr codec_context_; + ++ // The gist here is that timestamps need to be 64 bits to store microsecond ++ // precision. A 32 bit integer would overflow at ~35 minutes at this level of ++ // precision. We can't cast the timestamp to the void ptr object used by the ++ // opaque field in ffmpeg then, because it would lose data on a 32 bit build. ++ // However, we don't actually have 2^31 timestamped frames in a single ++ // playback, so it's fine to use the 32 bit value as a key in a map which ++ // contains the actual timestamps. Additionally, we've in the past set 128 ++ // outstanding frames for re-ordering as a limit for cross-thread decoding ++ // tasks, so we'll do that here too with the LRU cache. ++ using TimestampId = base::IdType; ++ ++ TimestampId::Generator timestamp_id_generator_; ++ base::LRUCache timestamp_map_; ++ + VideoDecoderConfig config_; + + scoped_refptr frame_pool_; diff --git a/chromium-125-lens-include.patch b/chromium-125-lens-include.patch new file mode 100644 index 0000000000000000000000000000000000000000..70372e3a7c9160b88bb9b3dba718a281b99915cd --- /dev/null +++ b/chromium-125-lens-include.patch @@ -0,0 +1,25 @@ +commit 251c365ea2c268a475f91c9913fabba6b41e2b6b +Author: Jose Dapena Paz +Date: Tue Apr 23 08:04:27 2024 +0000 + + IWYU: missing include for usage of std::optional in lens_overlay_url_builder.h + + Bug: 41455655 + Change-Id: I5ef0752f0cea84b64b5b5fde84d5203d9a5bccbb + Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5475524 + Reviewed-by: Colin Blundell + Commit-Queue: José Dapena Paz + Cr-Commit-Position: refs/heads/main@{#1291135} + +diff --git a/chrome/browser/lens/lens_overlay/lens_overlay_url_builder.h b/chrome/browser/lens/lens_overlay/lens_overlay_url_builder.h +index 00ffff4902114..1be9c645e5fea 100644 +--- a/chrome/browser/lens/lens_overlay/lens_overlay_url_builder.h ++++ b/chrome/browser/lens/lens_overlay/lens_overlay_url_builder.h +@@ -5,6 +5,7 @@ + #ifndef CHROME_BROWSER_LENS_LENS_OVERLAY_LENS_OVERLAY_URL_BUILDER_H_ + #define CHROME_BROWSER_LENS_LENS_OVERLAY_LENS_OVERLAY_URL_BUILDER_H_ + ++#include + #include + + #include "third_party/lens_server_proto/lens_overlay_cluster_info.pb.h" diff --git a/chromium-125-lp155-typename.patch b/chromium-125-lp155-typename.patch new file mode 100644 index 0000000000000000000000000000000000000000..9c10a00cab62a7050eae7985081785c843299df2 --- /dev/null +++ b/chromium-125-lp155-typename.patch @@ -0,0 +1,376 @@ + +fixed error: missing 'typename' prior to dependent type name + +Index: chromium-123.0.6312.46/base/containers/map_util.h +=================================================================== +--- chromium-123.0.6312.46.orig/base/containers/map_util.h ++++ chromium-123.0.6312.46/base/containers/map_util.h +@@ -42,7 +42,7 @@ constexpr internal::MappedType* Fin + template >::element_type> ++ typename std::pointer_traits>::element_type> + constexpr const MappedElementType* FindPtrOrNull(const Map& map, + const Key& key) { + auto it = map.find(key); +@@ -60,7 +60,7 @@ + template >::element_type> ++ typename std::pointer_traits>::element_type> + constexpr MappedElementType* FindPtrOrNull(Map& map, const Key& key) { + auto it = map.find(key); + return it != map.end() ? base::to_address(it->second) : nullptr; +Index: chromium-123.0.6312.46/base/functional/bind_internal.h +=================================================================== +--- chromium-123.0.6312.46.orig/base/functional/bind_internal.h ++++ chromium-123.0.6312.46/base/functional/bind_internal.h +@@ -1497,11 +1497,11 @@ template + struct ParamCanBeBound { + private: +- using UnwrappedParam = BindArgument::template ForwardedAs< ++ using UnwrappedParam = typename BindArgument::template ForwardedAs< + Unwrapped>::template ToParamWithType; +- using ParamStorage = BindArgument::template ToParamWithType< ++ using ParamStorage = typename BindArgument::template ToParamWithType< + Param>::template StoredAs; +- using BoundStorage = ++ using BoundStorage = typename + BindArgument::template BoundAs::template StoredAs; + + template +-SortedItems::const_iterator GetLastIter(const SortedItems& cache) { ++typename SortedItems::const_iterator GetLastIter(const SortedItems& cache) { + CHECK(!cache.empty()); + auto it = cache.end(); + return std::prev(it); +@@ -1090,9 +1090,9 @@ bool DownloadBubbleUpdateService::CacheM + } + + template +-SortedItems::iterator ++typename SortedItems::iterator + DownloadBubbleUpdateService::CacheManager::RemoveItemFromCacheByIter( +- SortedItems::iterator iter, ++ typename SortedItems::iterator iter, + SortedItems& cache, + IterMap& iter_map) { + CHECK(iter != cache.end()); +Index: chromium-123.0.6312.46/components/optimization_guide/core/model_execution/model_execution_util.h +=================================================================== +--- chromium-123.0.6312.46.orig/components/optimization_guide/core/model_execution/model_execution_util.h ++++ chromium-123.0.6312.46/components/optimization_guide/core/model_execution/model_execution_util.h +@@ -25,7 +25,7 @@ void SetExecutionRequestTemplate( + + // Request is set by the feature and should always be typed. + auto typed_request = +- static_cast(request_metadata); ++ static_cast(request_metadata); + *(logging_data->mutable_request_data()) = typed_request; + } + +Index: chromium-123.0.6312.46/components/optimization_guide/core/model_quality/model_quality_log_entry.h +=================================================================== +--- chromium-123.0.6312.46.orig/components/optimization_guide/core/model_quality/model_quality_log_entry.h ++++ chromium-123.0.6312.46/components/optimization_guide/core/model_quality/model_quality_log_entry.h +@@ -29,7 +29,7 @@ class ModelQualityLogEntry { + } + + template +- FeatureType::Quality* quality_data() { ++ typename FeatureType::Quality* quality_data() { + return FeatureType::GetLoggingData(*log_ai_data_request_) + ->mutable_quality_data(); + } +Index: chromium-123.0.6312.46/components/optimization_guide/core/tflite_model_executor.h +=================================================================== +--- chromium-123.0.6312.46.orig/components/optimization_guide/core/tflite_model_executor.h ++++ chromium-123.0.6312.46/components/optimization_guide/core/tflite_model_executor.h +@@ -242,7 +242,7 @@ class TFLiteModelExecutor : public Model + void SendForBatchExecution( + BatchExecutionCallback callback_on_complete, + base::TimeTicks start_time, +- ModelExecutor::ConstRefInputVector inputs) ++ typename ModelExecutor::ConstRefInputVector inputs) + override { + DCHECK(execution_task_runner_->RunsTasksInCurrentSequence()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +@@ -264,7 +264,7 @@ class TFLiteModelExecutor : public Model + // Starts the synchronous execution of the model. Returns model outputs. + // Model needs to be loaded. Synchronous calls do not load or unload model. + std::vector> SendForBatchExecutionSync( +- ModelExecutor::ConstRefInputVector inputs) ++ typename ModelExecutor::ConstRefInputVector inputs) + override { + DCHECK(execution_task_runner_->RunsTasksInCurrentSequence()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +@@ -422,7 +422,7 @@ class TFLiteModelExecutor : public Model + // executes it on the model execution thread. + void LoadModelFileAndBatchExecute( + BatchExecutionCallback callback_on_complete, +- ModelExecutor::ConstRefInputVector inputs) { ++ typename ModelExecutor::ConstRefInputVector inputs) { + DCHECK(execution_task_runner_->RunsTasksInCurrentSequence()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + +@@ -439,7 +439,7 @@ class TFLiteModelExecutor : public Model + + // Batch executes the loaded model for inputs. + void BatchExecuteLoadedModel( +- ModelExecutor::ConstRefInputVector inputs, ++ typename ModelExecutor::ConstRefInputVector inputs, + std::vector>* outputs) { + DCHECK(execution_task_runner_->RunsTasksInCurrentSequence()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +@@ -499,7 +499,7 @@ class TFLiteModelExecutor : public Model + // Unloads the model if needed. + void BatchExecuteLoadedModelAndRunCallback( + BatchExecutionCallback callback_on_complete, +- ModelExecutor::ConstRefInputVector inputs, ++ typename ModelExecutor::ConstRefInputVector inputs, + ExecutionStatus execution_status) { + DCHECK(execution_task_runner_->RunsTasksInCurrentSequence()); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +Index: chromium-123.0.6312.46/mojo/public/cpp/bindings/array_traits.h +=================================================================== +--- chromium-123.0.6312.46.orig/mojo/public/cpp/bindings/array_traits.h ++++ chromium-123.0.6312.46/mojo/public/cpp/bindings/array_traits.h +@@ -90,7 +90,7 @@ template + { c[i] } -> std::same_as; + } + struct ArrayTraits { +- using Element = Container::value_type; ++ using Element = typename Container::value_type; + + // vector-like containers have no built-in null. + static bool IsNull(const Container& c) { return false; } +Index: chromium-123.0.6312.46/third_party/blink/renderer/bindings/core/v8/async_iterable.h +=================================================================== +--- chromium-123.0.6312.46.orig/third_party/blink/renderer/bindings/core/v8/async_iterable.h ++++ chromium-123.0.6312.46/third_party/blink/renderer/bindings/core/v8/async_iterable.h +@@ -245,7 +245,7 @@ + private: + virtual IterationSource* CreateIterationSource( + ScriptState* script_state, +- IterationSource::Kind kind, ++ typename IterationSource::Kind kind, + InitArgs... args, + ExceptionState& exception_state) = 0; + }; +@@ -291,7 +291,7 @@ + private: + virtual IterationSource* CreateIterationSource( + ScriptState* script_state, +- IterationSource::Kind kind, ++ typename IterationSource::Kind kind, + InitArgs... args, + ExceptionState& exception_state) = 0; + }; +Index: chromium-123.0.6312.46/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc +=================================================================== +--- chromium-123.0.6312.46.orig/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc ++++ chromium-123.0.6312.46/third_party/blink/renderer/core/html/parser/html_document_parser_fastpath.cc +@@ -210,7 +210,7 @@ class HTMLFastPathParser { + using Span = base::span; + using USpan = base::span; + // 32 matches that used by HTMLToken::Attribute. +- typedef std::conditional, ++ typedef typename std::conditional, + UCharLiteralBuffer<32>, + LCharLiteralBuffer<32>>::type LiteralBufferType; + static_assert(std::is_same_v || std::is_same_v); +Index: chromium-123.0.6312.46/base/functional/function_ref.h +=================================================================== +--- chromium-123.0.6312.46.orig/base/functional/function_ref.h ++++ chromium-123.0.6312.46/base/functional/function_ref.h +@@ -64,7 +64,7 @@ class FunctionRef; + template + class FunctionRef { + template ::RunType> ++ typename RunType = typename internal::FunctorTraits::RunType> + static constexpr bool kCompatibleFunctor = + std::convertible_to, R> && + std::same_as, internal::TypeList>; +Index: chromium-123.0.6312.46/base/containers/heap_array.h +=================================================================== +--- chromium-123.0.6312.46.orig/base/containers/heap_array.h ++++ chromium-123.0.6312.46/base/containers/heap_array.h +@@ -32,8 +32,8 @@ + static_assert(!std::is_reference_v, + "HeapArray cannot hold reference types"); + +- using iterator = base::span::iterator; +- using const_iterator = base::span::iterator; ++ using iterator = typename base::span::iterator; ++ using const_iterator = typename base::span::iterator; + // We don't put this default value in the template parameter list to allow the + // static_assert on is_reference_v to give a nicer error message. + using deleter_type = std:: +Index: chromium-123.0.6312.46/mojo/public/cpp/bindings/type_converter.h +=================================================================== +--- chromium-123.0.6312.46.orig/mojo/public/cpp/bindings/type_converter.h ++++ chromium-123.0.6312.46/mojo/public/cpp/bindings/type_converter.h +@@ -127,7 +127,7 @@ using VecValueType = typename Vec::value + + template + using VecPtrLikeUnderlyingValueType = +- std::pointer_traits>::element_type; ++ typename std::pointer_traits>::element_type; + + } // namespace internal + +Index: chromium-123.0.6312.46/third_party/blink/renderer/platform/wtf/hash_table.h +=================================================================== +--- chromium-123.0.6312.46.orig/third_party/blink/renderer/platform/wtf/hash_table.h ++++ chromium-123.0.6312.46/third_party/blink/renderer/platform/wtf/hash_table.h +@@ -2004,7 +2004,7 @@ struct HashTableConstIteratorAdapter { + static_assert(!IsTraceable::value); + + using iterator_category = std::bidirectional_iterator_tag; +- using value_type = HashTableType::ValueType; ++ using value_type = typename HashTableType::ValueType; + using difference_type = ptrdiff_t; + using pointer = value_type*; + using reference = value_type&; +@@ -2056,7 +2056,7 @@ struct HashTableConstIteratorAdapter< + + public: + using iterator_category = std::bidirectional_iterator_tag; +- using value_type = HashTableType::ValueType; ++ using value_type = typename HashTableType::ValueType; + using difference_type = ptrdiff_t; + using pointer = value_type*; + using reference = value_type&; +@@ -2110,7 +2110,7 @@ struct HashTableIteratorAdapter { + static_assert(!IsTraceable::value); + + using iterator_category = std::bidirectional_iterator_tag; +- using value_type = HashTableType::ValueType; ++ using value_type = typename HashTableType::ValueType; + using difference_type = ptrdiff_t; + using pointer = value_type*; + using reference = value_type&; +@@ -2158,7 +2158,7 @@ struct HashTableIteratorAdapter< + + public: + using iterator_category = std::bidirectional_iterator_tag; +- using value_type = HashTableType::ValueType; ++ using value_type = typename HashTableType::ValueType; + using difference_type = ptrdiff_t; + using pointer = value_type*; + using reference = value_type&; +Index: chromium-123.0.6312.46/base/types/fixed_array.h +=================================================================== +--- chromium-123.0.6312.46.orig/base/types/fixed_array.h ++++ chromium-123.0.6312.46/base/types/fixed_array.h +@@ -27,8 +27,8 @@ template { + public: + using absl::FixedArray::FixedArray; +- explicit FixedArray(absl::FixedArray::size_type n, +- const absl::FixedArray::allocator_type& a = ++ explicit FixedArray(typename absl::FixedArray::size_type n, ++ const typename absl::FixedArray::allocator_type& a = + typename absl::FixedArray::allocator_type()) + : FixedArray(n, T(), a) {} + }; +Index: chromium-123.0.6312.46/chrome/browser/web_applications/commands/internal/command_internal.h +=================================================================== +--- chromium-123.0.6312.46.orig/chrome/browser/web_applications/commands/internal/command_internal.h ++++ chromium-123.0.6312.46/chrome/browser/web_applications/commands/internal/command_internal.h +@@ -121,7 +121,7 @@ class CommandBase { + template + class CommandWithLock : public CommandBase { + public: +- using LockDescription = LockType::LockDescription; ++ using LockDescription = typename LockType::LockDescription; + explicit CommandWithLock(const std::string& name, + LockDescription initial_lock_request); + +Index: chromium-123.0.6312.46/chrome/browser/web_applications/commands/web_app_command.h +=================================================================== +--- chromium-123.0.6312.46.orig/chrome/browser/web_applications/commands/web_app_command.h ++++ chromium-123.0.6312.46/chrome/browser/web_applications/commands/web_app_command.h +@@ -106,7 +106,7 @@ class WebAppLockManager; + template + class WebAppCommand : public internal::CommandWithLock { + public: +- using LockDescription = LockType::LockDescription; ++ using LockDescription = typename LockType::LockDescription; + using CallbackType = base::OnceCallback; + using ShutdownArgumentsTuple = std::tuple...>; + +Index: chromium-123.0.6312.46/chrome/browser/web_applications/web_app_command_scheduler.h +=================================================================== +--- chromium-123.0.6312.46.orig/chrome/browser/web_applications/web_app_command_scheduler.h ++++ chromium-123.0.6312.46/chrome/browser/web_applications/web_app_command_scheduler.h +@@ -363,7 +363,7 @@ class WebAppCommandScheduler { + // command system. + template + void ScheduleCallback(const std::string& operation_name, +- LockType::LockDescription lock_description, ++ typename LockType::LockDescription lock_description, + CallbackCommand callback, + base::OnceClosure on_complete, + const base::Location& location = FROM_HERE) { +@@ -381,7 +381,7 @@ class WebAppCommandScheduler { + typename CallbackReturnValue = std::decay_t> + void ScheduleCallbackWithResult( + const std::string& operation_name, +- LockType::LockDescription lock_description, ++ typename LockType::LockDescription lock_description, + CallbackCommand callback, + base::OnceCallback on_complete, + CallbackReturnValue arg_for_shutdown, +Index: chromium-123.0.6312.46/components/supervised_user/core/browser/proto_fetcher.h +=================================================================== +--- chromium-123.0.6312.46.orig/components/supervised_user/core/browser/proto_fetcher.h ++++ chromium-123.0.6312.46/components/supervised_user/core/browser/proto_fetcher.h +@@ -424,7 +424,7 @@ class RetryingFetcherImpl final : public + RetryingFetcherImpl(const RetryingFetcherImpl&) = delete; + RetryingFetcherImpl& operator=(const RetryingFetcherImpl&) = delete; + +- void Start(ProtoFetcher::Callback callback) override { ++ void Start(typename ProtoFetcher::Callback callback) override { + callback_ = std::move(callback); + Retry(); + } +@@ -469,7 +469,7 @@ class RetryingFetcherImpl final : public + } + + // Client callback. +- TypedProtoFetcher::Callback callback_; ++ typename TypedProtoFetcher::Callback callback_; + + // Retry controls. + base::OneShotTimer timer_; +@@ -490,7 +490,7 @@ class ParallelFetchManager { + // Deferred fetcher is required because it should be started after it is + // stored internally. + using Fetcher = ProtoFetcher; +- using KeyType = base::IDMap>::KeyType; ++ using KeyType = typename base::IDMap>::KeyType; + + public: + // Provides fresh instances of a deferred fetcher for each fetch. +@@ -506,7 +506,7 @@ class ParallelFetchManager { + + // Starts the fetch. Underlying fetcher is stored internally, and will be + // cleaned up after finish or when this manager is destroyed. +- void Fetch(const Request& request, Fetcher::Callback callback) { ++ void Fetch(const Request& request, typename Fetcher::Callback callback) { + CHECK(callback) << "Use base::DoNothing() instead of empty callback."; + KeyType key = requests_in_flight_.Add(MakeFetcher(request)); + requests_in_flight_.Lookup(key)->Start( diff --git a/chromium-125-missing-header-files.patch b/chromium-125-missing-header-files.patch new file mode 100644 index 0000000000000000000000000000000000000000..4a60ac956ce463d70a896a562bc659d92419a0ec --- /dev/null +++ b/chromium-125-missing-header-files.patch @@ -0,0 +1,246 @@ +Index: chromium-123.0.6312.46/base/check_op.h +=================================================================== +--- chromium-123.0.6312.46.orig/base/check_op.h ++++ chromium-123.0.6312.46/base/check_op.h +@@ -5,6 +5,7 @@ + #ifndef BASE_CHECK_OP_H_ + #define BASE_CHECK_OP_H_ + ++#include + #include + #include + #include +Index: chromium-123.0.6312.46/base/containers/flat_map.h +=================================================================== +--- chromium-123.0.6312.46.orig/base/containers/flat_map.h ++++ chromium-123.0.6312.46/base/containers/flat_map.h +@@ -5,6 +5,7 @@ + #ifndef BASE_CONTAINERS_FLAT_MAP_H_ + #define BASE_CONTAINERS_FLAT_MAP_H_ + ++#include + #include + #include + #include +Index: chromium-123.0.6312.46/chrome/browser/webauthn/authenticator_request_dialog_model.h +=================================================================== +--- chromium-123.0.6312.46.orig/chrome/browser/webauthn/authenticator_request_dialog_model.h ++++ chromium-123.0.6312.46/chrome/browser/webauthn/authenticator_request_dialog_model.h +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + + #include "base/containers/span.h" + #include "base/functional/callback_forward.h" +Index: chromium-123.0.6312.46/components/feature_engagement/internal/never_event_storage_validator.h +=================================================================== +--- chromium-123.0.6312.46.orig/components/feature_engagement/internal/never_event_storage_validator.h ++++ chromium-123.0.6312.46/components/feature_engagement/internal/never_event_storage_validator.h +@@ -5,6 +5,7 @@ + #ifndef COMPONENTS_FEATURE_ENGAGEMENT_INTERNAL_NEVER_EVENT_STORAGE_VALIDATOR_H_ + #define COMPONENTS_FEATURE_ENGAGEMENT_INTERNAL_NEVER_EVENT_STORAGE_VALIDATOR_H_ + ++#include + #include + + #include "components/feature_engagement/internal/event_storage_validator.h" +Index: chromium-123.0.6312.46/gin/time_clamper.h +=================================================================== +--- chromium-123.0.6312.46.orig/gin/time_clamper.h ++++ chromium-123.0.6312.46/gin/time_clamper.h +@@ -6,6 +6,7 @@ + #define GIN_TIME_CLAMPER_H_ + + #include ++#include + + #include "base/rand_util.h" + #include "base/time/time.h" +Index: chromium-123.0.6312.46/net/base/net_export.h +=================================================================== +--- chromium-123.0.6312.46.orig/net/base/net_export.h ++++ chromium-123.0.6312.46/net/base/net_export.h +@@ -5,6 +5,8 @@ + #ifndef NET_BASE_NET_EXPORT_H_ + #define NET_BASE_NET_EXPORT_H_ + ++#include ++ + // Defines NET_EXPORT so that functionality implemented by the net module can + // be exported to consumers, and NET_EXPORT_PRIVATE that allows unit tests to + // access features not intended to be used directly by real consumers. +Index: chromium-123.0.6312.46/third_party/abseil-cpp/absl/strings/string_view.h +=================================================================== +--- chromium-123.0.6312.46.orig/third_party/abseil-cpp/absl/strings/string_view.h ++++ chromium-123.0.6312.46/third_party/abseil-cpp/absl/strings/string_view.h +@@ -27,6 +27,7 @@ + #ifndef ABSL_STRINGS_STRING_VIEW_H_ + #define ABSL_STRINGS_STRING_VIEW_H_ + ++#include + #include + #include + #include +Index: chromium-123.0.6312.46/third_party/dawn/src/tint/lang/spirv/reader/ast_parser/namer.h +=================================================================== +--- chromium-123.0.6312.46.orig/third_party/dawn/src/tint/lang/spirv/reader/ast_parser/namer.h ++++ chromium-123.0.6312.46/third_party/dawn/src/tint/lang/spirv/reader/ast_parser/namer.h +@@ -28,6 +28,7 @@ + #ifndef SRC_TINT_LANG_SPIRV_READER_AST_PARSER_NAMER_H_ + #define SRC_TINT_LANG_SPIRV_READER_AST_PARSER_NAMER_H_ + ++#include + #include + #include + #include +Index: chromium-123.0.6312.46/third_party/material_color_utilities/src/cpp/palettes/tones.cc +=================================================================== +--- chromium-123.0.6312.46.orig/third_party/material_color_utilities/src/cpp/palettes/tones.cc ++++ chromium-123.0.6312.46/third_party/material_color_utilities/src/cpp/palettes/tones.cc +@@ -14,6 +14,7 @@ + * limitations under the License. + */ + ++#include + #include "cpp/palettes/tones.h" + + #include +Index: chromium-123.0.6312.46/third_party/ruy/src/ruy/profiler/instrumentation.h +=================================================================== +--- chromium-123.0.6312.46.orig/third_party/ruy/src/ruy/profiler/instrumentation.h ++++ chromium-123.0.6312.46/third_party/ruy/src/ruy/profiler/instrumentation.h +@@ -17,6 +17,7 @@ + #define RUY_RUY_PROFILER_INSTRUMENTATION_H_ + + #ifdef RUY_PROFILER ++#include + #include + #include + #include +Index: chromium-123.0.6312.46/third_party/swiftshader/third_party/llvm-10.0/llvm/lib/Support/Unix/Signals.inc +=================================================================== +--- chromium-123.0.6312.46.orig/third_party/swiftshader/third_party/llvm-10.0/llvm/lib/Support/Unix/Signals.inc ++++ chromium-123.0.6312.46/third_party/swiftshader/third_party/llvm-10.0/llvm/lib/Support/Unix/Signals.inc +@@ -45,6 +45,7 @@ + #include "llvm/Support/SaveAndRestore.h" + #include "llvm/Support/raw_ostream.h" + #include ++#include + #include + #include + #ifdef HAVE_BACKTRACE +Index: chromium-123.0.6312.46/third_party/tflite/src/tensorflow/lite/kernels/internal/spectrogram.h +=================================================================== +--- chromium-123.0.6312.46.orig/third_party/tflite/src/tensorflow/lite/kernels/internal/spectrogram.h ++++ chromium-123.0.6312.46/third_party/tflite/src/tensorflow/lite/kernels/internal/spectrogram.h +@@ -31,6 +31,7 @@ limitations under the License. + #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_SPECTROGRAM_H_ + #define TENSORFLOW_LITE_KERNELS_INTERNAL_SPECTROGRAM_H_ + ++#include + #include + #include + #include +Index: chromium-123.0.6312.46/third_party/vulkan-deps/vulkan-validation-layers/src/layers/external/vma/vk_mem_alloc.h +=================================================================== +--- chromium-123.0.6312.46.orig/third_party/vulkan-deps/vulkan-validation-layers/src/layers/external/vma/vk_mem_alloc.h ++++ chromium-123.0.6312.46/third_party/vulkan-deps/vulkan-validation-layers/src/layers/external/vma/vk_mem_alloc.h +@@ -2884,6 +2884,7 @@ static void vma_aligned_free(void* VMA_N + + // Define this macro to 1 to enable functions: vmaBuildStatsString, vmaFreeStatsString. + #if VMA_STATS_STRING_ENABLED ++#include + static inline void VmaUint32ToStr(char* VMA_NOT_NULL outStr, size_t strLen, uint32_t num) + { + snprintf(outStr, strLen, "%u", static_cast(num)); +Index: chromium-123.0.6312.46/third_party/webrtc/audio/utility/channel_mixer.cc +=================================================================== +--- chromium-123.0.6312.46.orig/third_party/webrtc/audio/utility/channel_mixer.cc ++++ chromium-123.0.6312.46/third_party/webrtc/audio/utility/channel_mixer.cc +@@ -8,6 +8,8 @@ + * be found in the AUTHORS file in the root of the source tree. + */ + ++#include ++ + #include "audio/utility/channel_mixer.h" + + #include "audio/utility/channel_mixing_matrix.h" +Index: chromium-123.0.6312.46/third_party/webrtc/modules/include/module_common_types_public.h +=================================================================== +--- chromium-123.0.6312.46.orig/third_party/webrtc/modules/include/module_common_types_public.h ++++ chromium-123.0.6312.46/third_party/webrtc/modules/include/module_common_types_public.h +@@ -11,6 +11,7 @@ + #ifndef MODULES_INCLUDE_MODULE_COMMON_TYPES_PUBLIC_H_ + #define MODULES_INCLUDE_MODULE_COMMON_TYPES_PUBLIC_H_ + ++#include + #include + + #include "absl/types/optional.h" +Index: chromium-123.0.6312.46/ui/gfx/linux/drm_util_linux.h +=================================================================== +--- chromium-123.0.6312.46.orig/ui/gfx/linux/drm_util_linux.h ++++ chromium-123.0.6312.46/ui/gfx/linux/drm_util_linux.h +@@ -9,6 +9,8 @@ + + #include "ui/gfx/buffer_types.h" + ++#include ++ + namespace ui { + + int GetFourCCFormatFromBufferFormat(gfx::BufferFormat format); +Index: chromium-123.0.6312.46/third_party/blink/renderer/platform/peerconnection/resolution_monitor.cc +=================================================================== +--- chromium-123.0.6312.46.orig/third_party/blink/renderer/platform/peerconnection/resolution_monitor.cc ++++ chromium-123.0.6312.46/third_party/blink/renderer/platform/peerconnection/resolution_monitor.cc +@@ -6,6 +6,8 @@ + + #include + ++#include ++ + #include "base/containers/span.h" + #include "base/logging.h" + #include "base/memory/ptr_util.h" +Index: chromium-123.0.6312.46/components/search_engines/util.h +=================================================================== +--- chromium-123.0.6312.46.orig/components/search_engines/util.h ++++ chromium-123.0.6312.46/components/search_engines/util.h +@@ -8,6 +8,7 @@ + // This file contains utility functions for search engine functionality. + + #include ++#include + #include + #include + #include +Index: chromium-123.0.6312.46/content/common/service_worker/race_network_request_write_buffer_manager.h +=================================================================== +--- chromium-123.0.6312.46.orig/content/common/service_worker/race_network_request_write_buffer_manager.h ++++ chromium-123.0.6312.46/content/common/service_worker/race_network_request_write_buffer_manager.h +@@ -7,6 +7,8 @@ + + #include + ++#include ++ + #include "base/containers/span.h" + #include "content/common/content_export.h" + #include "mojo/public/cpp/system/data_pipe.h" +Index: chromium-123.0.6312.46/third_party/blink/renderer/core/layout/hit_test_request.h +=================================================================== +--- chromium-123.0.6312.46.orig/third_party/blink/renderer/core/layout/hit_test_request.h ++++ chromium-123.0.6312.46/third_party/blink/renderer/core/layout/hit_test_request.h +@@ -25,6 +25,8 @@ + + #include + ++#include ++ + #include "base/functional/callback.h" + #include "third_party/blink/renderer/platform/heap/garbage_collected.h" + #include "third_party/blink/renderer/platform/heap/member.h" diff --git a/chromium-125-mojo-bindings-include.patch b/chromium-125-mojo-bindings-include.patch new file mode 100644 index 0000000000000000000000000000000000000000..36f6cc2255ec8ac1b7f7c81dd2e64fed60651907 --- /dev/null +++ b/chromium-125-mojo-bindings-include.patch @@ -0,0 +1,25 @@ +commit 39735a1167272326da5ff85e0096b52ca7f47d6c +Author: Jose Dapena Paz +Date: Tue Apr 16 14:36:36 2024 +0000 + + IWYU: missing include for std::optional usage in bindings_internal.h + + Bug: 41455655 + Change-Id: Id3e3ade6c8cc89a526462ea9ff6c8bc1dc93a375 + Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5456954 + Reviewed-by: Ken Rockot + Commit-Queue: Ken Rockot + Cr-Commit-Position: refs/heads/main@{#1288018} + +diff --git a/mojo/public/cpp/bindings/lib/bindings_internal.h b/mojo/public/cpp/bindings/lib/bindings_internal.h +index 759ceaf7e641d..9f4202b6481b1 100644 +--- a/mojo/public/cpp/bindings/lib/bindings_internal.h ++++ b/mojo/public/cpp/bindings/lib/bindings_internal.h +@@ -8,6 +8,7 @@ + #include + + #include ++#include + #include + #include + diff --git a/chromium-125-ninja.patch b/chromium-125-ninja.patch new file mode 100644 index 0000000000000000000000000000000000000000..1f16ac1ecbde89b9064bdb38e448ed68c3cc6a2d --- /dev/null +++ b/chromium-125-ninja.patch @@ -0,0 +1,27 @@ +commit a976cb05b4024b7a6452d1541378d718cdfe33e6 +Author: Takuto Ikuta +Date: Thu Apr 25 07:25:32 2024 +0000 + + [devtools] fix a missing build dependency to a generated file + + Bug: 336911498 + Change-Id: I6e6d3afaf33ace53a68271b70165b8c3ab596340 + Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5487538 + Auto-Submit: Takuto Ikuta + Commit-Queue: Takuto Ikuta + Reviewed-by: Danil Somsikov + Commit-Queue: Danil Somsikov + Cr-Commit-Position: refs/heads/main@{#1292300} + +diff --git a/chrome/browser/devtools/BUILD.gn b/chrome/browser/devtools/BUILD.gn +index f0c07cad8cfb4..053199e462f55 100644 +--- a/chrome/browser/devtools/BUILD.gn ++++ b/chrome/browser/devtools/BUILD.gn +@@ -117,6 +117,7 @@ static_library("devtools") { + "//chrome/browser/autofill:autofill", + "//components/autofill/content/browser:browser", + "//components/autofill/core/browser:browser", ++ "//components/enterprise/buildflags", + "//components/paint_preview/buildflags:buildflags", + "//components/variations/service:service", + "//components/webapps/common:common", diff --git a/chromium-125-no-vector-consts.patch b/chromium-125-no-vector-consts.patch new file mode 100644 index 0000000000000000000000000000000000000000..aaca8b92bef199f4b9f078bfbea477a8f37d12d9 --- /dev/null +++ b/chromium-125-no-vector-consts.patch @@ -0,0 +1,259 @@ +commit 0bed9a54baa5058e711a1f051a766f67e1842ec5 +Author: Jose Dapena Paz +Date: Tue Apr 16 10:59:08 2024 +0000 + + Remove more instances of std::vector + + Bug: 323708866 + Change-Id: I50ef671f18f0d152ecccbf0f345f84db005c06d7 + Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5440252 + Reviewed-by: Yuzhu Shen + Reviewed-by: Vasilii Sukhanov + Commit-Queue: José Dapena Paz + Reviewed-by: Matthew Jones + Cr-Commit-Position: refs/heads/main@{#1287935} + +diff --git a/chrome/browser/sync/test/integration/product_specifications_helper.cc b/chrome/browser/sync/test/integration/product_specifications_helper.cc +index d664b952801f8..3ed308b4b7ad8 100644 +--- a/chrome/browser/sync/test/integration/product_specifications_helper.cc ++++ b/chrome/browser/sync/test/integration/product_specifications_helper.cc +@@ -41,9 +41,9 @@ bool ProductSpecificationsChecker::IsExitConditionSatisfied(std::ostream* os) { + bool ProductSpecificationsChecker::IsSpecificsAvailableAndEqual() { + for (const ProductSpecificationsSet& product_specifications_set : + service_->GetAllProductSpecifications()) { +- std::vector specifics_urls; ++ std::vector specifics_urls; + for (sync_pb::ComparisonData data : compare_specifics_->data()) { +- specifics_urls.push_back(GURL(data.url())); ++ specifics_urls.emplace_back(data.url()); + } + if (product_specifications_set.uuid().AsLowercaseString() == + compare_specifics_->uuid() && +diff --git a/components/commerce/core/product_specifications/product_specifications_service.cc b/components/commerce/core/product_specifications/product_specifications_service.cc +index eaa362dd46ea0..171ea09f0a6b3 100644 +--- a/components/commerce/core/product_specifications/product_specifications_service.cc ++++ b/components/commerce/core/product_specifications/product_specifications_service.cc +@@ -24,11 +24,11 @@ ProductSpecificationsService::GetSyncControllerDelegate() { + return bridge_->change_processor()->GetControllerDelegate(); + } + +-const std::vector ++const std::vector + ProductSpecificationsService::GetAllProductSpecifications() { +- std::vector product_specifications; ++ std::vector product_specifications; + for (auto& entry : bridge_->entries()) { +- std::vector urls; ++ std::vector urls; + for (auto& data : entry.second.data()) { + urls.emplace_back(data.url()); + } +@@ -43,7 +43,7 @@ ProductSpecificationsService::GetAllProductSpecifications() { + const std::optional + ProductSpecificationsService::AddProductSpecificationsSet( + const std::string& name, +- const std::vector& urls) { ++ const std::vector& urls) { + // TODO(crbug.com/332545064) add for a product specification set being added. + std::optional specifics = + bridge_->AddProductSpecifications(name, urls); +diff --git a/components/commerce/core/product_specifications/product_specifications_service.h b/components/commerce/core/product_specifications/product_specifications_service.h +index 4afe013a0869f..0f84ae04fd228 100644 +--- a/components/commerce/core/product_specifications/product_specifications_service.h ++++ b/components/commerce/core/product_specifications/product_specifications_service.h +@@ -26,14 +26,13 @@ class ProductSpecificationsService : public KeyedService { + base::WeakPtr + GetSyncControllerDelegate(); + +- const std::vector +- GetAllProductSpecifications(); ++ const std::vector GetAllProductSpecifications(); + + // Add new product specifications set called |name| with product pages + // corresponding to |urls|. + const std::optional + AddProductSpecificationsSet(const std::string& name, +- const std::vector& urls); ++ const std::vector& urls); + + // Deletes product specification set corresponding to identifier |uuid|. + void DeleteProductSpecificationsSet(const std::string& uuid); +diff --git a/components/commerce/core/product_specifications/product_specifications_service_unittest.cc b/components/commerce/core/product_specifications/product_specifications_service_unittest.cc +index 6e0072a5318e8..4087d7f19424a 100644 +--- a/components/commerce/core/product_specifications/product_specifications_service_unittest.cc ++++ b/components/commerce/core/product_specifications/product_specifications_service_unittest.cc +@@ -82,9 +82,9 @@ void AddTestSpecifics(commerce::ProductSpecificationsSyncBridge* bridge) { + } + + MATCHER_P(HasAllProductSpecs, compare_specifics, "") { +- std::vector specifics_urls; ++ std::vector specifics_urls; + for (const sync_pb::ComparisonData& data : compare_specifics.data()) { +- specifics_urls.push_back(GURL(data.url())); ++ specifics_urls.emplace_back(data.url()); + } + return arg.uuid().AsLowercaseString() == compare_specifics.uuid() && + arg.creation_time() == +@@ -217,7 +217,7 @@ class ProductSpecificationsServiceTest : public testing::Test { + specifics.update_time_unix_epoch_micros()), + specifications.update_time()); + EXPECT_EQ(specifics.name(), specifications.name()); +- std::vector urls; ++ std::vector urls; + for (const sync_pb::ComparisonData& data : specifics.data()) { + urls.emplace_back(data.url()); + } +@@ -243,7 +243,7 @@ TEST_F(ProductSpecificationsServiceTest, TestGetProductSpecifications) { + for (const sync_pb::CompareSpecifics& specifics : kCompareSpecifics) { + bridge()->AddCompareSpecifics(specifics); + } +- const std::vector specifications = ++ const std::vector specifications = + service()->GetAllProductSpecifications(); + EXPECT_EQ(2u, specifications.size()); + for (uint64_t i = 0; i < specifications.size(); i++) { +@@ -252,8 +252,8 @@ TEST_F(ProductSpecificationsServiceTest, TestGetProductSpecifications) { + } + + TEST_F(ProductSpecificationsServiceTest, TestAddProductSpecificationsSuccess) { +- std::vector expected_product_urls{GURL(kProductOneUrl), +- GURL(kProductTwoUrl)}; ++ std::vector expected_product_urls{GURL(kProductOneUrl), ++ GURL(kProductTwoUrl)}; + EXPECT_CALL(*observer(), + OnProductSpecificationsSetAdded(HasProductSpecsNameUrl( + kProductSpecsName, expected_product_urls))) +diff --git a/components/commerce/core/product_specifications/product_specifications_set.cc b/components/commerce/core/product_specifications/product_specifications_set.cc +index 7005b6c5b3448..408bfde664f2a 100644 +--- a/components/commerce/core/product_specifications/product_specifications_set.cc ++++ b/components/commerce/core/product_specifications/product_specifications_set.cc +@@ -12,7 +12,7 @@ ProductSpecificationsSet::ProductSpecificationsSet( + const std::string& uuid, + const int64_t creation_time_usec_since_epoch, + const int64_t update_time_usec_since_epoch, +- const std::vector& urls, ++ const std::vector& urls, + const std::string& name) + : uuid_(base::Uuid::ParseLowercase(uuid)), + creation_time_(base::Time::FromMillisecondsSinceUnixEpoch( +@@ -34,9 +34,9 @@ ProductSpecificationsSet::~ProductSpecificationsSet() = default; + + ProductSpecificationsSet ProductSpecificationsSet::FromProto( + const sync_pb::CompareSpecifics& specifics) { +- std::vector urls; ++ std::vector urls; + for (const sync_pb::ComparisonData& data : specifics.data()) { +- urls.push_back(GURL(data.url())); ++ urls.emplace_back(data.url()); + } + return ProductSpecificationsSet( + specifics.uuid(), specifics.creation_time_unix_epoch_micros(), +diff --git a/components/commerce/core/product_specifications/product_specifications_set.h b/components/commerce/core/product_specifications/product_specifications_set.h +index d761fabafb702..18e3aa113120b 100644 +--- a/components/commerce/core/product_specifications/product_specifications_set.h ++++ b/components/commerce/core/product_specifications/product_specifications_set.h +@@ -43,7 +43,7 @@ class ProductSpecificationsSet { + ProductSpecificationsSet(const std::string& uuid, + const int64_t creation_time_usec_since_epoch, + const int64_t update_time_usec_since_epoch, +- const std::vector& urls, ++ const std::vector& urls, + const std::string& name); + + ProductSpecificationsSet(const ProductSpecificationsSet&); +@@ -61,7 +61,7 @@ class ProductSpecificationsSet { + const base::Time& update_time() const { return update_time_; } + + // Product urls for each item in the set +- const std::vector& urls() const { return urls_; } ++ const std::vector& urls() const { return urls_; } + + // Name of the set + const std::string& name() const { return name_; } +@@ -76,7 +76,7 @@ class ProductSpecificationsSet { + const base::Uuid uuid_; + const base::Time creation_time_; + const base::Time update_time_; +- const std::vector urls_; ++ const std::vector urls_; + const std::string name_; + }; + +diff --git a/components/commerce/core/product_specifications/product_specifications_sync_bridge.cc b/components/commerce/core/product_specifications/product_specifications_sync_bridge.cc +index 09c3fc5f5cede..40e1c4690aa49 100644 +--- a/components/commerce/core/product_specifications/product_specifications_sync_bridge.cc ++++ b/components/commerce/core/product_specifications/product_specifications_sync_bridge.cc +@@ -131,7 +131,7 @@ void ProductSpecificationsSyncBridge::GetAllDataForDebugging( + const std::optional + ProductSpecificationsSyncBridge::AddProductSpecifications( + const std::string& name, +- const std::vector& urls) { ++ const std::vector& urls) { + if (!change_processor()->IsTrackingMetadata()) { + return std::nullopt; + } +diff --git a/components/commerce/core/product_specifications/product_specifications_sync_bridge.h b/components/commerce/core/product_specifications/product_specifications_sync_bridge.h +index 0988e7b91ea97..aa7b7a6ba24eb 100644 +--- a/components/commerce/core/product_specifications/product_specifications_sync_bridge.h ++++ b/components/commerce/core/product_specifications/product_specifications_sync_bridge.h +@@ -64,7 +64,7 @@ class ProductSpecificationsSyncBridge : public syncer::ModelTypeSyncBridge { + + virtual const std::optional + AddProductSpecifications(const std::string& name, +- const std::vector& urls); ++ const std::vector& urls); + + void DeleteProductSpecificationsSet(const std::string& uuid); + +diff --git a/components/commerce/core/product_specifications/product_specifications_sync_bridge_unittest.cc b/components/commerce/core/product_specifications/product_specifications_sync_bridge_unittest.cc +index 3525177044541..7d0409dfe715d 100644 +--- a/components/commerce/core/product_specifications/product_specifications_sync_bridge_unittest.cc ++++ b/components/commerce/core/product_specifications/product_specifications_sync_bridge_unittest.cc +@@ -178,7 +178,7 @@ class ProductSpecificationsSyncBridgeTest : public testing::Test { + + std::optional AddProductSpecifications( + const std::string& name, +- const std::vector urls) { ++ const std::vector urls) { + return bridge().AddProductSpecifications(name, urls); + } + +diff --git a/components/commerce/core/shopping_service.cc b/components/commerce/core/shopping_service.cc +index 236a8befae286..ae17aea1053d0 100644 +--- a/components/commerce/core/shopping_service.cc ++++ b/components/commerce/core/shopping_service.cc +@@ -1734,7 +1734,7 @@ void ShoppingService::GetProductIdentifierForUrl( + std::move(callback))); + } + +-const std::vector ++const std::vector + ShoppingService::GetAllProductSpecificationSets() { + return product_specifications_service_->GetAllProductSpecifications(); + } +diff --git a/components/commerce/core/shopping_service.h b/components/commerce/core/shopping_service.h +index 304e33d7c5260..5b6d9d2321281 100644 +--- a/components/commerce/core/shopping_service.h ++++ b/components/commerce/core/shopping_service.h +@@ -624,7 +624,7 @@ class ShoppingService : public KeyedService, + UrlProductIdentifierTupleCallback callback); + + // Return all ProductSpecificationsSets from ProductSpecificationsService. +- virtual const std::vector ++ virtual const std::vector + GetAllProductSpecificationSets(); + + // Updates the bookmark model used for sync (and shopping) if needed. Invoked +diff --git a/mojo/public/cpp/base/proto_wrapper.cc b/mojo/public/cpp/base/proto_wrapper.cc +index ad5b76632d76e..c5fa9f48a1a46 100644 +--- a/mojo/public/cpp/base/proto_wrapper.cc ++++ b/mojo/public/cpp/base/proto_wrapper.cc +@@ -57,7 +57,7 @@ bool ProtoWrapper::DeserializeToMessage( + // Make an in-process copy here as protobuf is not designed to + // safely parse data that might be changing underneath it. + auto as_span = base::make_span(bytes_->data(), bytes_->size()); +- const std::vector copy(as_span.begin(), as_span.end()); ++ const std::vector copy(as_span.begin(), as_span.end()); + return message.ParseFromArray(copy.data(), copy.size()); + } + } diff --git a/chromium-119-no_matching_constructor.patch b/chromium-125-no_matching_constructor.patch similarity index 47% rename from chromium-119-no_matching_constructor.patch rename to chromium-125-no_matching_constructor.patch index a16c979c37f1cf33d31468a8b364462c1cf8312d..d3469d8feafba8b8b6352d513d065588f3eaeaf8 100644 --- a/chromium-119-no_matching_constructor.patch +++ b/chromium-125-no_matching_constructor.patch @@ -1,7 +1,41 @@ -diff -up chromium-119.0.6045.59/base/trace_event/trace_log.cc.no_matching_constructor chromium-119.0.6045.59/base/trace_event/trace_log.cc ---- chromium-119.0.6045.59/base/trace_event/trace_log.cc.no_matching_constructor 2023-10-26 18:16:51.000000000 +0200 -+++ chromium-119.0.6045.59/base/trace_event/trace_log.cc 2023-10-30 16:51:02.270151487 +0100 -@@ -2191,8 +2191,8 @@ void TraceLog::SetTraceBufferForTesting( +Index: chromium-123.0.6312.46/base/metrics/persistent_histogram_allocator.cc +=================================================================== +--- chromium-123.0.6312.46.orig/base/metrics/persistent_histogram_allocator.cc ++++ chromium-123.0.6312.46/base/metrics/persistent_histogram_allocator.cc +@@ -220,13 +220,13 @@ PersistentSparseHistogramDataManager::Lo + // The sample-record could be for any sparse histogram. Add the reference + // to the appropriate collection for later use. + if (found_id == match_id) { +- found_records.emplace_back(ref, value); ++ found_records.emplace_back() = {ref, value}; + found = true; + } else { + std::vector* samples = + GetSampleMapRecordsWhileLocked(found_id); + CHECK(samples); +- samples->emplace_back(ref, value); ++ samples->emplace_back() = {ref, value}; + } + } + +Index: chromium-123.0.6312.46/base/nix/mime_util_xdg.cc +=================================================================== +--- chromium-123.0.6312.46.orig/base/nix/mime_util_xdg.cc ++++ chromium-123.0.6312.46/base/nix/mime_util_xdg.cc +@@ -56,7 +56,7 @@ void LoadAllMimeCacheFiles(MimeTypeMap& + for (const auto& path : GetXDGDataSearchLocations(env.get())) { + FilePath mime_cache = path.Append("mime/mime.cache"); + if (GetFileInfo(mime_cache, &info) && ParseMimeTypes(mime_cache, map)) { +- files.emplace_back(mime_cache, info.last_modified); ++ files.emplace_back() = {mime_cache, info.last_modified}; + } + } + } +Index: chromium-123.0.6312.46/base/trace_event/trace_log.cc +=================================================================== +--- chromium-123.0.6312.46.orig/base/trace_event/trace_log.cc ++++ chromium-123.0.6312.46/base/trace_event/trace_log.cc +@@ -2198,8 +2198,8 @@ void TraceLog::SetTraceBufferForTesting( #if BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY) void TraceLog::OnSetup(const perfetto::DataSourceBase::SetupArgs& args) { AutoLock lock(track_event_lock_); @@ -12,10 +46,11 @@ diff -up chromium-119.0.6045.59/base/trace_event/trace_log.cc.no_matching_constr } void TraceLog::OnStart(const perfetto::DataSourceBase::StartArgs&) { -diff -up chromium-119.0.6045.59/chrome/browser/content_settings/one_time_permission_provider.cc.no_matching_constructor chromium-119.0.6045.59/chrome/browser/content_settings/one_time_permission_provider.cc ---- chromium-119.0.6045.59/chrome/browser/content_settings/one_time_permission_provider.cc.no_matching_constructor 2023-10-26 18:16:57.000000000 +0200 -+++ chromium-119.0.6045.59/chrome/browser/content_settings/one_time_permission_provider.cc 2023-10-30 16:51:02.269151462 +0100 -@@ -226,8 +226,8 @@ void OneTimePermissionProvider::OnSuspen +Index: chromium-123.0.6312.46/chrome/browser/content_settings/one_time_permission_provider.cc +=================================================================== +--- chromium-123.0.6312.46.orig/chrome/browser/content_settings/one_time_permission_provider.cc ++++ chromium-123.0.6312.46/chrome/browser/content_settings/one_time_permission_provider.cc +@@ -252,8 +252,8 @@ void OneTimePermissionProvider::OnSuspen while (rule_iterator && rule_iterator->HasNext()) { auto rule = rule_iterator->Next(); @@ -26,7 +61,7 @@ diff -up chromium-119.0.6045.59/chrome/browser/content_settings/one_time_permiss permissions::PermissionUmaUtil::RecordOneTimePermissionEvent( setting_type, permissions::OneTimePermissionEvent::EXPIRED_ON_SUSPEND); -@@ -329,8 +329,8 @@ void OneTimePermissionProvider::DeleteEn +@@ -355,8 +355,8 @@ void OneTimePermissionProvider::DeleteEn auto rule = rule_iterator->Next(); if (rule->primary_pattern.Matches(origin_gurl) && rule->secondary_pattern.Matches(origin_gurl)) { @@ -37,9 +72,10 @@ diff -up chromium-119.0.6045.59/chrome/browser/content_settings/one_time_permiss permissions::PermissionUmaUtil::RecordOneTimePermissionEvent( content_setting_type, trigger_event); } -diff -up chromium-119.0.6045.59/chrome/browser/enterprise/profile_management/profile_management_navigation_throttle.cc.no_matching_constructor chromium-119.0.6045.59/chrome/browser/enterprise/profile_management/profile_management_navigation_throttle.cc ---- chromium-119.0.6045.59/chrome/browser/enterprise/profile_management/profile_management_navigation_throttle.cc.no_matching_constructor 2023-10-26 18:16:57.000000000 +0200 -+++ chromium-119.0.6045.59/chrome/browser/enterprise/profile_management/profile_management_navigation_throttle.cc 2023-10-30 16:51:02.267151412 +0100 +Index: chromium-123.0.6312.46/chrome/browser/enterprise/profile_management/profile_management_navigation_throttle.cc +=================================================================== +--- chromium-123.0.6312.46.orig/chrome/browser/enterprise/profile_management/profile_management_navigation_throttle.cc ++++ chromium-123.0.6312.46/chrome/browser/enterprise/profile_management/profile_management_navigation_throttle.cc @@ -67,8 +67,8 @@ base::flat_mapinsert(std::make_pair( @@ -51,9 +87,25 @@ diff -up chromium-119.0.6045.59/chrome/browser/enterprise/profile_management/pro // Extract domains and attributes from the command line switch. const base::CommandLine& command_line = -diff -up chromium-119.0.6045.59/chrome/browser/ui/omnibox/chrome_omnibox_client.cc.no_matching_constructor chromium-119.0.6045.59/chrome/browser/ui/omnibox/chrome_omnibox_client.cc ---- chromium-119.0.6045.59/chrome/browser/ui/omnibox/chrome_omnibox_client.cc.no_matching_constructor 2023-10-26 18:17:00.000000000 +0200 -+++ chromium-119.0.6045.59/chrome/browser/ui/omnibox/chrome_omnibox_client.cc 2023-10-30 16:51:02.262151288 +0100 +Index: chromium-123.0.6312.46/chrome/browser/ui/autofill/autofill_context_menu_manager.cc +=================================================================== +--- chromium-123.0.6312.46.orig/chrome/browser/ui/autofill/autofill_context_menu_manager.cc ++++ chromium-123.0.6312.46/chrome/browser/ui/autofill/autofill_context_menu_manager.cc +@@ -277,8 +277,8 @@ void AutofillContextMenuManager::Execute + AutofillManager& manager) { + auto& driver = static_cast(manager.driver()); + driver.browser_events().RendererShouldTriggerSuggestions( +- FieldGlobalId(driver.GetFrameToken(), +- FieldRendererId(params_.field_renderer_id)), ++ FieldGlobalId{driver.GetFrameToken(), ++ FieldRendererId(params_.field_renderer_id)}, + AutofillSuggestionTriggerSource::kManualFallbackPayments); + LogManualFallbackContextMenuEntryAccepted( + static_cast(manager), +Index: chromium-123.0.6312.46/chrome/browser/ui/omnibox/chrome_omnibox_client.cc +=================================================================== +--- chromium-123.0.6312.46.orig/chrome/browser/ui/omnibox/chrome_omnibox_client.cc ++++ chromium-123.0.6312.46/chrome/browser/ui/omnibox/chrome_omnibox_client.cc @@ -474,10 +474,10 @@ void ChromeOmniboxClient::OnAutocomplete alternative_nav_match); @@ -62,14 +114,134 @@ diff -up chromium-119.0.6045.59/chrome/browser/ui/omnibox/chrome_omnibox_client. + location_bar_->set_navigation_params(LocationBar::NavigationParams{ destination_url, disposition, transition, match_selection_timestamp, destination_url_entered_without_scheme, -- destination_url_entered_with_http_scheme)); -+ destination_url_entered_with_http_scheme}); +- destination_url_entered_with_http_scheme, match.extra_headers)); ++ destination_url_entered_with_http_scheme, match.extra_headers}); if (browser_) { auto navigation = chrome::OpenCurrentURL(browser_); -diff -up chromium-119.0.6045.59/chrome/test/chromedriver/capabilities.cc.no_matching_constructor chromium-119.0.6045.59/chrome/test/chromedriver/capabilities.cc ---- chromium-119.0.6045.59/chrome/test/chromedriver/capabilities.cc.no_matching_constructor 2023-10-26 18:17:01.000000000 +0200 -+++ chromium-119.0.6045.59/chrome/test/chromedriver/capabilities.cc 2023-10-30 16:51:02.268151437 +0100 +Index: chromium-123.0.6312.46/chrome/browser/ui/views/permissions/embedded_permission_prompt_ask_view.cc +=================================================================== +--- chromium-123.0.6312.46.orig/chrome/browser/ui/views/permissions/embedded_permission_prompt_ask_view.cc ++++ chromium-123.0.6312.46/chrome/browser/ui/views/permissions/embedded_permission_prompt_ask_view.cc +@@ -60,12 +60,12 @@ std::vector buttons; + if (base::FeatureList::IsEnabled(permissions::features::kOneTimePermission)) { +- buttons.emplace_back( ++ buttons.emplace_back() = { + l10n_util::GetStringUTF16(IDS_PERMISSION_ALLOW_THIS_TIME), +- ButtonType::kAllowThisTime, ui::ButtonStyle::kTonal); ++ ButtonType::kAllowThisTime, ui::ButtonStyle::kTonal}; + } +- buttons.emplace_back(l10n_util::GetStringUTF16(IDS_PERMISSION_ALLOW), +- ButtonType::kAllow, ui::ButtonStyle::kTonal, kAllowId); ++ buttons.emplace_back() = {l10n_util::GetStringUTF16(IDS_PERMISSION_ALLOW), ++ ButtonType::kAllow, ui::ButtonStyle::kTonal, kAllowId}; + return buttons; + } + +Index: chromium-123.0.6312.46/chrome/browser/ui/views/permissions/embedded_permission_prompt_base_view.h +=================================================================== +--- chromium-123.0.6312.46.orig/chrome/browser/ui/views/permissions/embedded_permission_prompt_base_view.h ++++ chromium-123.0.6312.46/chrome/browser/ui/views/permissions/embedded_permission_prompt_base_view.h +@@ -87,6 +87,7 @@ class EmbeddedPermissionPromptBaseView : + struct RequestLineConfiguration { + const raw_ptr icon; + std::u16string message; ++ RequestLineConfiguration(auto i, auto m) : icon(i), message(m) { } + }; + + struct ButtonConfiguration { +Index: chromium-123.0.6312.46/chrome/browser/ui/views/permissions/embedded_permission_prompt_policy_view.cc +=================================================================== +--- chromium-123.0.6312.46.orig/chrome/browser/ui/views/permissions/embedded_permission_prompt_policy_view.cc ++++ chromium-123.0.6312.46/chrome/browser/ui/views/permissions/embedded_permission_prompt_policy_view.cc +@@ -64,8 +64,8 @@ EmbeddedPermissionPromptPolicyView::GetR + std::vector + EmbeddedPermissionPromptPolicyView::GetButtonsConfiguration() const { + std::vector buttons; +- buttons.emplace_back(l10n_util::GetStringUTF16(IDS_EMBEDDED_PROMPT_OK_LABEL), +- ButtonType::kPolicyOK, ui::ButtonStyle::kTonal); ++ buttons.emplace_back() = {l10n_util::GetStringUTF16(IDS_EMBEDDED_PROMPT_OK_LABEL), ++ ButtonType::kPolicyOK, ui::ButtonStyle::kTonal}; + return buttons; + } + +Index: chromium-123.0.6312.46/chrome/browser/ui/views/permissions/embedded_permission_prompt_previously_denied_view.cc +=================================================================== +--- chromium-123.0.6312.46.orig/chrome/browser/ui/views/permissions/embedded_permission_prompt_previously_denied_view.cc ++++ chromium-123.0.6312.46/chrome/browser/ui/views/permissions/embedded_permission_prompt_previously_denied_view.cc +@@ -79,17 +79,17 @@ EmbeddedPermissionPromptPreviouslyDenied + std::vector + EmbeddedPermissionPromptPreviouslyDeniedView::GetButtonsConfiguration() const { + std::vector buttons; +- buttons.emplace_back( ++ buttons.emplace_back() = { + l10n_util::GetStringUTF16(IDS_EMBEDDED_PROMPT_CONTINUE_NOT_ALLOWING), +- ButtonType::kContinueNotAllowing, ui::ButtonStyle::kTonal); ++ ButtonType::kContinueNotAllowing, ui::ButtonStyle::kTonal}; + + if (base::FeatureList::IsEnabled(permissions::features::kOneTimePermission)) { +- buttons.emplace_back( ++ buttons.emplace_back() = { + l10n_util::GetStringUTF16(IDS_PERMISSION_ALLOW_THIS_TIME), +- ButtonType::kAllowThisTime, ui::ButtonStyle::kTonal, kAllowThisTimeId); ++ ButtonType::kAllowThisTime, ui::ButtonStyle::kTonal, kAllowThisTimeId}; + } else { +- buttons.emplace_back(l10n_util::GetStringUTF16(IDS_PERMISSION_ALLOW), +- ButtonType::kAllow, ui::ButtonStyle::kTonal); ++ buttons.emplace_back() = {l10n_util::GetStringUTF16(IDS_PERMISSION_ALLOW), ++ ButtonType::kAllow, ui::ButtonStyle::kTonal}; + } + return buttons; + } +Index: chromium-123.0.6312.46/chrome/browser/ui/views/permissions/embedded_permission_prompt_previously_granted_view.cc +=================================================================== +--- chromium-123.0.6312.46.orig/chrome/browser/ui/views/permissions/embedded_permission_prompt_previously_granted_view.cc ++++ chromium-123.0.6312.46/chrome/browser/ui/views/permissions/embedded_permission_prompt_previously_granted_view.cc +@@ -74,12 +74,12 @@ EmbeddedPermissionPromptPreviouslyGrante + std::vector + EmbeddedPermissionPromptPreviouslyGrantedView::GetButtonsConfiguration() const { + std::vector buttons; +- buttons.emplace_back( ++ buttons.emplace_back() = { + l10n_util::GetStringUTF16(IDS_EMBEDDED_PROMPT_CONTINUE_ALLOWING), +- ButtonType::kContinueAllowing, ui::ButtonStyle::kTonal); ++ ButtonType::kContinueAllowing, ui::ButtonStyle::kTonal}; + +- buttons.emplace_back( ++ buttons.emplace_back() = { + l10n_util::GetStringUTF16(IDS_EMBEDDED_PROMPT_STOP_ALLOWING), +- ButtonType::kStopAllowing, ui::ButtonStyle::kTonal, kStopAllowingId); ++ ButtonType::kStopAllowing, ui::ButtonStyle::kTonal, kStopAllowingId}; + return buttons; + } +Index: chromium-123.0.6312.46/chrome/browser/ui/web_applications/sub_apps_service_impl.cc +=================================================================== +--- chromium-123.0.6312.46.orig/chrome/browser/ui/web_applications/sub_apps_service_impl.cc ++++ chromium-123.0.6312.46/chrome/browser/ui/web_applications/sub_apps_service_impl.cc +@@ -107,7 +107,7 @@ AddOptionsFromMojo( + ConvertPathToUrl(sub_app->manifest_id_path, origin)); + ASSIGN_OR_RETURN(GURL install_url, + ConvertPathToUrl(sub_app->install_url_path, origin)); +- sub_apps.emplace_back(std::move(manifest_id), std::move(install_url)); ++ sub_apps.emplace_back() = {std::move(manifest_id), std::move(install_url)}; + } + return sub_apps; + } +@@ -439,7 +439,7 @@ void SubAppsServiceImpl::ScheduleSubAppI + base::BindOnce( + [](webapps::ManifestId manifest_id, const webapps::AppId& app_id, + webapps::InstallResultCode result_code) { +- return SubAppInstallResult(manifest_id, app_id, result_code); ++ return SubAppInstallResult{manifest_id, app_id, result_code}; + }, + manifest_id) + .Then(concurrent.CreateCallback()), +Index: chromium-123.0.6312.46/chrome/test/chromedriver/capabilities.cc +=================================================================== +--- chromium-123.0.6312.46.orig/chrome/test/chromedriver/capabilities.cc ++++ chromium-123.0.6312.46/chrome/test/chromedriver/capabilities.cc @@ -346,7 +346,7 @@ Status ParseMobileEmulation(const base:: "'version' field of type string"); } @@ -88,25 +260,136 @@ diff -up chromium-119.0.6045.59/chrome/test/chromedriver/capabilities.cc.no_matc } client_hints.full_version_list = std::move(full_version_list); -diff -up chromium-119.0.6045.59/components/autofill/core/browser/contact_info_sync_util.cc.no_matching_constructor chromium-119.0.6045.59/components/autofill/core/browser/contact_info_sync_util.cc ---- chromium-119.0.6045.59/components/autofill/core/browser/contact_info_sync_util.cc.no_matching_constructor 2023-10-30 16:51:02.273151562 +0100 -+++ chromium-119.0.6045.59/components/autofill/core/browser/contact_info_sync_util.cc 2023-10-30 17:41:12.685887538 +0100 -@@ -195,9 +195,9 @@ class ContactInfoProfileSetter { - CHECK(observations.empty()); - for (const sync_pb::ContactInfoSpecifics::Observation& proto_observation : - metadata.observations()) { -- observations.emplace_back(proto_observation.type(), -+ observations.emplace_back() = {static_cast(proto_observation.type()), - ProfileTokenQuality::FormSignatureHash( -- proto_observation.form_hash())); -+ proto_observation.form_hash())}; - } - } +Index: chromium-123.0.6312.46/components/password_manager/core/browser/password_manager.cc +=================================================================== +--- chromium-123.0.6312.46.orig/components/password_manager/core/browser/password_manager.cc ++++ chromium-123.0.6312.46/components/password_manager/core/browser/password_manager.cc +@@ -673,7 +673,7 @@ void PasswordManager::OnUserModifiedNonP + it->second.last_change = base::Time::Now(); + } else { + possible_usernames_.Put( +- PossibleUsernameFieldIdentifier(driver_id, renderer_id), ++ PossibleUsernameFieldIdentifier{driver_id, renderer_id}, + PossibleUsernameData(GetSignonRealm(driver->GetLastCommittedURL()), + renderer_id, value, base::Time::Now(), driver_id, + autocomplete_attribute_has_username, +Index: chromium-123.0.6312.46/components/performance_manager/worker_watcher.cc +=================================================================== +--- chromium-123.0.6312.46.orig/components/performance_manager/worker_watcher.cc ++++ chromium-123.0.6312.46/components/performance_manager/worker_watcher.cc +@@ -239,7 +239,7 @@ void WorkerWatcher::OnWorkerCreated( + DCHECK(insertion_result.second); + + absl::visit( +- base::Overloaded( ++ base::Overloaded{ + [&, + this](const content::GlobalRenderFrameHostId& render_frame_host_id) { + AddFrameClientConnection(insertion_result.first->second.get(), +@@ -248,7 +248,7 @@ void WorkerWatcher::OnWorkerCreated( + [&, this](blink::DedicatedWorkerToken dedicated_worker_token) { + ConnectDedicatedWorkerClient(insertion_result.first->second.get(), + dedicated_worker_token); +- }), ++ }}, + creator); + } + +@@ -265,7 +265,7 @@ void WorkerWatcher::OnBeforeWorkerDestro + // First disconnect the creator's node from this worker node. + + absl::visit( +- base::Overloaded( ++ base::Overloaded{ + [&, + this](const content::GlobalRenderFrameHostId& render_frame_host_id) { + RemoveFrameClientConnection(worker_node.get(), +@@ -274,7 +274,7 @@ void WorkerWatcher::OnBeforeWorkerDestro + [&, this](blink::DedicatedWorkerToken dedicated_worker_token) { + DisconnectDedicatedWorkerClient(worker_node.get(), + dedicated_worker_token); +- }), ++ }}, + creator); + + // Disconnect all child workers before destroying the node. +@@ -446,7 +446,7 @@ void WorkerWatcher::OnControlleeAdded( + const std::string& client_uuid, + const content::ServiceWorkerClientInfo& client_info) { + absl::visit( +- base::Overloaded( ++ base::Overloaded{ + [&, this](content::GlobalRenderFrameHostId render_frame_host_id) { + // For window clients, it is necessary to wait until the navigation + // has committed to a RenderFrameHost. +@@ -484,7 +484,7 @@ void WorkerWatcher::OnControlleeAdded( + ConnectSharedWorkerClient(service_worker_node, + shared_worker_token); + } +- }), ++ }}, + client_info); + } + +@@ -524,7 +524,7 @@ void WorkerWatcher::OnControlleeRemoved( + return; + + absl::visit( +- base::Overloaded( ++ base::Overloaded{ + [&, this](content::GlobalRenderFrameHostId render_frame_host_id) { + RemoveFrameClientConnection(worker_node, render_frame_host_id); + }, +@@ -534,7 +534,7 @@ void WorkerWatcher::OnControlleeRemoved( + }, + [&, this](blink::SharedWorkerToken shared_worker_token) { + DisconnectSharedWorkerClient(worker_node, shared_worker_token); +- }), ++ }}, + client); + } + +@@ -810,7 +810,7 @@ void WorkerWatcher::ConnectAllServiceWor + + for (const auto& kv : it->second) { + absl::visit( +- base::Overloaded( ++ base::Overloaded{ + [&, this](content::GlobalRenderFrameHostId render_frame_host_id) { + AddFrameClientConnection(service_worker_node, + render_frame_host_id); +@@ -822,7 +822,7 @@ void WorkerWatcher::ConnectAllServiceWor + [&, this](blink::SharedWorkerToken shared_worker_token) { + ConnectSharedWorkerClient(service_worker_node, + shared_worker_token); +- }), ++ }}, + kv.second); } -diff -up chromium-119.0.6045.59/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc.no_matching_constructor chromium-119.0.6045.59/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc ---- chromium-119.0.6045.59/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc.no_matching_constructor 2023-10-26 18:17:12.000000000 +0200 -+++ chromium-119.0.6045.59/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc 2023-10-30 16:51:02.260151238 +0100 -@@ -1530,7 +1530,7 @@ void SkiaOutputSurfaceImplOnGpu::CopyOut + } +@@ -837,7 +837,7 @@ void WorkerWatcher::DisconnectAllService + + for (const auto& kv : it->second) { + absl::visit( +- base::Overloaded( ++ base::Overloaded{ + [&, this]( + const content::GlobalRenderFrameHostId& render_frame_host_id) { + RemoveFrameClientConnection(service_worker_node, +@@ -851,7 +851,7 @@ void WorkerWatcher::DisconnectAllService + [&, this](const blink::SharedWorkerToken& shared_worker_token) { + DisconnectSharedWorkerClient(service_worker_node, + shared_worker_token); +- }), ++ }}, + kv.second); + } + } +Index: chromium-123.0.6312.46/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc +=================================================================== +--- chromium-123.0.6312.46.orig/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc ++++ chromium-123.0.6312.46/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc +@@ -1701,7 +1701,7 @@ void SkiaOutputSurfaceImplOnGpu::CopyOut // Issue readbacks from the surfaces: for (size_t i = 0; i < CopyOutputResult::kNV12MaxPlanes; ++i) { @@ -115,10 +398,11 @@ diff -up chromium-119.0.6045.59/components/viz/service/display_embedder/skia_out SkImageInfo dst_info = SkImageInfo::Make( size, (i == 0) ? kAlpha_8_SkColorType : kR8G8_unorm_SkColorType, kUnpremul_SkAlphaType); -diff -up chromium-119.0.6045.59/content/browser/download/save_package.cc.no_matching_constructor chromium-119.0.6045.59/content/browser/download/save_package.cc ---- chromium-119.0.6045.59/content/browser/download/save_package.cc.no_matching_constructor 2023-10-26 18:17:12.000000000 +0200 -+++ chromium-119.0.6045.59/content/browser/download/save_package.cc 2023-10-30 16:51:02.271151512 +0100 -@@ -769,8 +769,8 @@ void SavePackage::Finish() { +Index: chromium-123.0.6312.46/content/browser/download/save_package.cc +=================================================================== +--- chromium-123.0.6312.46.orig/content/browser/download/save_package.cc ++++ chromium-123.0.6312.46/content/browser/download/save_package.cc +@@ -803,8 +803,8 @@ void SavePackage::Finish() { if (download_) { std::vector files; for (auto& item : saved_success_items_) { @@ -129,55 +413,181 @@ diff -up chromium-119.0.6045.59/content/browser/download/save_package.cc.no_matc } download::DownloadSaveItemData::AttachItemData(download_, std::move(files)); } -diff -up chromium-119.0.6045.59/content/browser/renderer_host/render_frame_host_impl.cc.no_matching_constructor chromium-119.0.6045.59/content/browser/renderer_host/render_frame_host_impl.cc ---- chromium-119.0.6045.59/content/browser/renderer_host/render_frame_host_impl.cc.no_matching_constructor 2023-10-26 18:17:12.000000000 +0200 -+++ chromium-119.0.6045.59/content/browser/renderer_host/render_frame_host_impl.cc 2023-10-30 17:38:09.351389984 +0100 -@@ -8567,7 +8567,7 @@ void RenderFrameHostImpl::SendFencedFram +Index: chromium-123.0.6312.46/content/browser/first_party_sets/first_party_set_parser.cc +=================================================================== +--- chromium-123.0.6312.46.orig/content/browser/first_party_sets/first_party_set_parser.cc ++++ chromium-123.0.6312.46/content/browser/first_party_sets/first_party_set_parser.cc +@@ -773,7 +773,7 @@ FirstPartySetParser::ParseSetsFromEnterp + context.GetPolicySetsFromList( + policy.FindList(kFirstPartySetPolicyAdditionsField), + PolicySetType::kAddition)); +- return ParsedPolicySetLists(std::move(replacements), std::move(additions)); ++ return ParsedPolicySetLists{std::move(replacements), std::move(additions)}; + }(); + + context.PostProcessSetLists(set_lists); +Index: chromium-123.0.6312.46/content/browser/interest_group/header_direct_from_seller_signals.h +=================================================================== +--- chromium-123.0.6312.46.orig/content/browser/interest_group/header_direct_from_seller_signals.h ++++ chromium-123.0.6312.46/content/browser/interest_group/header_direct_from_seller_signals.h +@@ -133,6 +133,7 @@ class CONTENT_EXPORT HeaderDirectFromSel + + // The Ad-Auction-Signals response served by `origin`. + std::string response_json; ++ UnprocessedResponse(auto u, auto s) : origin(u), response_json(s) { } + }; + + // Information from ParseAndFind() calls used by ParseAndFindCompleted. +Index: chromium-123.0.6312.46/content/browser/interest_group/interest_group_storage.cc +=================================================================== +--- chromium-123.0.6312.46.orig/content/browser/interest_group/interest_group_storage.cc ++++ chromium-123.0.6312.46/content/browser/interest_group/interest_group_storage.cc +@@ -3284,9 +3284,9 @@ std::optional DoGet + return std::nullopt; + } + +- return DebugReportCooldown(cooldown_debugging_only_report.ColumnTime(0), ++ return DebugReportCooldown{cooldown_debugging_only_report.ColumnTime(0), + static_cast( +- cooldown_debugging_only_report.ColumnInt(1))); ++ cooldown_debugging_only_report.ColumnInt(1))}; + } + + void DoGetDebugReportCooldowns( +@@ -3406,10 +3406,10 @@ DoGetKAnonymityData(sql::Database& db, + + std::vector k_anon_data; + while (interest_group_kanon_query.Step()) { +- k_anon_data.emplace_back( ++ k_anon_data.emplace_back() = { + /*key=*/interest_group_kanon_query.ColumnString(0), + /*is_k_anonymous=*/interest_group_kanon_query.ColumnBool(1), +- /*last_updated=*/interest_group_kanon_query.ColumnTime(2)); ++ /*last_updated=*/interest_group_kanon_query.ColumnTime(2)}; + } + if (!interest_group_kanon_query.Succeeded()) { + return std::nullopt; +Index: chromium-123.0.6312.46/content/browser/renderer_host/render_frame_host_impl.cc +=================================================================== +--- chromium-123.0.6312.46.orig/content/browser/renderer_host/render_frame_host_impl.cc ++++ chromium-123.0.6312.46/content/browser/renderer_host/render_frame_host_impl.cc +@@ -8796,7 +8796,7 @@ for (const blink::FencedFrame::ReportingDestination& destination : destinations) { SendFencedFrameReportingBeaconInternal( -- DestinationEnumEvent(event_type, event_data), destination, -+ DestinationEnumEvent{event_type, event_data}, destination, - /*from_renderer=*/true, attribution_reporting_runtime_features, - GetFrameTreeNodeId()); +- DestinationEnumEvent(event_type, event_data, cross_origin_exposed), ++ DestinationEnumEvent{event_type, event_data, cross_origin_exposed}, + destination); } -@@ -8603,7 +8603,7 @@ void RenderFrameHostImpl::SendFencedFram + } +@@ -8827,7 +8827,7 @@ } SendFencedFrameReportingBeaconInternal( -- DestinationURLEvent(destination_url), -+ DestinationURLEvent{destination_url}, - blink::FencedFrame::ReportingDestination::kBuyer, - /*from_renderer=*/true, attribution_reporting_runtime_features, - GetFrameTreeNodeId()); -@@ -8703,8 +8703,8 @@ void RenderFrameHostImpl::MaybeSendFence +- DestinationURLEvent(destination_url, cross_origin_exposed), ++ DestinationURLEvent{destination_url, cross_origin_exposed}, + blink::FencedFrame::ReportingDestination::kBuyer); + } + +@@ -8851,7 +8851,7 @@ void RenderFrameHostImpl::MaybeSendFence data = info->data; } initiator_rfh->SendFencedFrameReportingBeaconInternal( -- DestinationEnumEvent(blink::kFencedFrameTopNavigationBeaconType, -- data), -+ DestinationEnumEvent{blink::kFencedFrameTopNavigationBeaconType, -+ data}, - destination, - /*from_renderer=*/false, attribution_reporting_features, - GetFrameTreeNodeId(), navigation_request.GetNavigationId()); -@@ -8717,8 +8717,8 @@ void RenderFrameHostImpl::MaybeSendFence +- AutomaticBeaconEvent(event_type, data), destination, ++ AutomaticBeaconEvent{event_type, data}, destination, + navigation_request.GetNavigationId()); + } + } else { +@@ -8862,7 +8862,7 @@ void RenderFrameHostImpl::MaybeSendFence for (blink::FencedFrame::ReportingDestination destination : info->destinations) { initiator_rfh->SendFencedFrameReportingBeaconInternal( -- DestinationEnumEvent(blink::kFencedFrameTopNavigationBeaconType, -- info->data), -+ DestinationEnumEvent{blink::kFencedFrameTopNavigationBeaconType, -+ info->data}, - destination, - /*from_renderer=*/false, info->attribution_reporting_runtime_features, - GetFrameTreeNodeId(), navigation_request.GetNavigationId()); -diff -up chromium-119.0.6045.59/third_party/blink/renderer/platform/fonts/font_palette.h.no_matching_constructor chromium-119.0.6045.59/third_party/blink/renderer/platform/fonts/font_palette.h ---- chromium-119.0.6045.59/third_party/blink/renderer/platform/fonts/font_palette.h.no_matching_constructor 2023-10-26 18:17:24.000000000 +0200 -+++ chromium-119.0.6045.59/third_party/blink/renderer/platform/fonts/font_palette.h 2023-10-30 16:51:02.262151288 +0100 +- AutomaticBeaconEvent(event_type, info->data), destination, ++ AutomaticBeaconEvent{event_type, info->data}, destination, + navigation_request.GetNavigationId()); + } + } +Index: chromium-123.0.6312.46/content/browser/service_worker/service_worker_container_host.cc +=================================================================== +--- chromium-123.0.6312.46.orig/content/browser/service_worker/service_worker_container_host.cc ++++ chromium-123.0.6312.46/content/browser/service_worker/service_worker_container_host.cc +@@ -881,7 +881,7 @@ ServiceWorkerContainerHost::GetClientTyp + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(client_info_); + return absl::visit( +- base::Overloaded( ++ base::Overloaded{ + [](GlobalRenderFrameHostId render_frame_host_id) { + return blink::mojom::ServiceWorkerClientType::kWindow; + }, +@@ -890,7 +890,7 @@ ServiceWorkerContainerHost::GetClientTyp + }, + [](blink::SharedWorkerToken shared_worker_token) { + return blink::mojom::ServiceWorkerClientType::kSharedWorker; +- }), ++ }}, + *client_info_); + } + +Index: chromium-123.0.6312.46/content/browser/service_worker/service_worker_main_resource_loader_interceptor.cc +=================================================================== +--- chromium-123.0.6312.46.orig/content/browser/service_worker/service_worker_main_resource_loader_interceptor.cc ++++ chromium-123.0.6312.46/content/browser/service_worker/service_worker_main_resource_loader_interceptor.cc +@@ -361,10 +361,10 @@ ServiceWorkerMainResourceLoaderIntercept + } + auto* storage_partition = process->GetStoragePartition(); + +- return absl::visit(base::Overloaded([&, this](auto token) { ++ return absl::visit(base::Overloaded{[&, this](auto token) { + return GetStorageKeyFromWorkerHost(storage_partition, + token, origin); +- }), ++ }}, + *worker_token_); + } + +Index: chromium-123.0.6312.46/content/browser/worker_host/dedicated_worker_host.cc +=================================================================== +--- chromium-123.0.6312.46.orig/content/browser/worker_host/dedicated_worker_host.cc ++++ chromium-123.0.6312.46/content/browser/worker_host/dedicated_worker_host.cc +@@ -255,7 +255,7 @@ void DedicatedWorkerHost::StartScriptLoa + RenderFrameHostImpl* creator_render_frame_host = nullptr; + DedicatedWorkerHost* creator_worker = nullptr; + +- absl::visit(base::Overloaded( ++ absl::visit(base::Overloaded{ + [&](const GlobalRenderFrameHostId& render_frame_host_id) { + creator_render_frame_host = + RenderFrameHostImpl::FromID(render_frame_host_id); +@@ -263,7 +263,7 @@ void DedicatedWorkerHost::StartScriptLoa + [&](blink::DedicatedWorkerToken dedicated_worker_token) { + creator_worker = service_->GetDedicatedWorkerHostFromToken( + dedicated_worker_token); +- }), ++ }}, + creator_); + + if (!creator_render_frame_host && !creator_worker) { +Index: chromium-123.0.6312.46/net/dns/host_resolver_cache.cc +=================================================================== +--- chromium-123.0.6312.46.orig/net/dns/host_resolver_cache.cc ++++ chromium-123.0.6312.46/net/dns/host_resolver_cache.cc +@@ -368,7 +368,7 @@ void HostResolverCache::Set( + + std::string domain_name = result->domain_name(); + entries_.emplace( +- Key(std::move(domain_name), network_anonymization_key), ++ Key{std::move(domain_name), network_anonymization_key}, + Entry(std::move(result), source, secure, staleness_generation)); + + if (entries_.size() > max_entries_) { +Index: chromium-123.0.6312.46/third_party/blink/renderer/platform/fonts/font_palette.h +=================================================================== +--- chromium-123.0.6312.46.orig/third_party/blink/renderer/platform/fonts/font_palette.h ++++ chromium-123.0.6312.46/third_party/blink/renderer/platform/fonts/font_palette.h @@ -96,7 +96,7 @@ class PLATFORM_EXPORT FontPalette : publ Color::ColorSpace color_interpolation_space, - absl::optional hue_interpolation_method) { + std::optional hue_interpolation_method) { return base::AdoptRef(new FontPalette( - start, end, NonNormalizedPercentages(start_percentage, end_percentage), + start, end, NonNormalizedPercentages{start_percentage, end_percentage}, @@ -193,125 +603,37 @@ diff -up chromium-119.0.6045.59/third_party/blink/renderer/platform/fonts/font_p } double GetAlphaMultiplier() const { -diff -up chromium-119.0.6045.59/third_party/blink/renderer/platform/fonts/palette_interpolation.cc.no_matching_constructor chromium-119.0.6045.59/third_party/blink/renderer/platform/fonts/palette_interpolation.cc ---- chromium-119.0.6045.59/third_party/blink/renderer/platform/fonts/palette_interpolation.cc.no_matching_constructor 2023-10-26 18:17:24.000000000 +0200 -+++ chromium-119.0.6045.59/third_party/blink/renderer/platform/fonts/palette_interpolation.cc 2023-10-30 16:51:02.261151263 +0100 +Index: chromium-123.0.6312.46/third_party/blink/renderer/platform/fonts/palette_interpolation.cc +=================================================================== +--- chromium-123.0.6312.46.orig/third_party/blink/renderer/platform/fonts/palette_interpolation.cc ++++ chromium-123.0.6312.46/third_party/blink/renderer/platform/fonts/palette_interpolation.cc @@ -31,7 +31,7 @@ Vector color_interpolation_space, hue_interpolation_method, start_color, end_color, percentage, alpha_multiplier); - FontPalette::FontPaletteOverride result_color_record(i, result_color); -+ FontPalette::FontPaletteOverride result_color_record{static_cast(i), result_color}; ++ FontPalette::FontPaletteOverride result_color_record{static_cast(i), result_color}; result_color_records.push_back(result_color_record); } return result_color_records; -diff -up chromium-119.0.6045.59/ui/gtk/gtk_ui.cc.no_matching_constructor chromium-119.0.6045.59/ui/gtk/gtk_ui.cc ---- chromium-119.0.6045.59/ui/gtk/gtk_ui.cc.no_matching_constructor 2023-10-26 18:18:14.000000000 +0200 -+++ chromium-119.0.6045.59/ui/gtk/gtk_ui.cc 2023-10-30 16:51:02.272151537 +0100 -@@ -993,11 +993,11 @@ ui::DisplayConfig GtkUi::GetDisplayConfi - GdkRectangle geometry; - gdk_monitor_get_geometry(monitor, &geometry); - int monitor_scale = std::max(1, gdk_monitor_get_scale_factor(monitor)); -- config.display_geometries.emplace_back( -+ config.display_geometries.emplace_back() = { - gfx::Rect(monitor_scale * geometry.x, monitor_scale * geometry.y, - monitor_scale * geometry.width, - monitor_scale * geometry.height), -- monitor_scale * font_scale); -+ static_cast(monitor_scale * font_scale)}; - } - return config; - } -diff -up chromium-119.0.6045.59/base/metrics/persistent_histogram_allocator.cc.me chromium-119.0.6045.59/base/metrics/persistent_histogram_allocator.cc ---- chromium-119.0.6045.59/base/metrics/persistent_histogram_allocator.cc.me 2023-10-31 18:14:49.275728099 +0100 -+++ chromium-119.0.6045.59/base/metrics/persistent_histogram_allocator.cc 2023-10-31 18:19:54.599223239 +0100 -@@ -221,13 +221,13 @@ PersistentSparseHistogramDataManager::Lo - // The sample-record could be for any sparse histogram. Add the reference - // to the appropriate collection for later use. - if (found_id == match_id) { -- found_records.emplace_back(ref, value); -+ found_records.emplace_back() = {ref, value}; - found = true; +Index: chromium-123.0.6312.46/third_party/pdfium/core/fpdfapi/render/cpdf_renderstatus.cpp +=================================================================== +--- chromium-123.0.6312.46.orig/third_party/pdfium/core/fpdfapi/render/cpdf_renderstatus.cpp ++++ chromium-123.0.6312.46/third_party/pdfium/core/fpdfapi/render/cpdf_renderstatus.cpp +@@ -507,7 +507,7 @@ void CPDF_RenderStatus::ProcessClipPath( } else { - std::vector* samples = - GetSampleMapRecordsWhileLocked(found_id); - CHECK(samples); -- samples->emplace_back(ref, value); -+ samples->emplace_back() = {ref, value}; + m_pDevice->SetClip_PathFill( + *pPath, &mtObj2Device, +- CFX_FillRenderOptions(ClipPath.GetClipType(i))); ++ CFX_FillRenderOptions{ClipPath.GetClipType(i)}); } } -diff -up chromium-119.0.6045.59/net/dns/host_resolver_cache.cc.me chromium-119.0.6045.59/net/dns/host_resolver_cache.cc ---- chromium-119.0.6045.59/net/dns/host_resolver_cache.cc.me 2023-10-31 20:48:19.153868338 +0100 -+++ chromium-119.0.6045.59/net/dns/host_resolver_cache.cc 2023-10-31 20:51:37.634526549 +0100 -@@ -368,7 +368,7 @@ void HostResolverCache::Set( - - std::string domain_name = result->domain_name(); - entries_.emplace( -- Key(std::move(domain_name), network_anonymization_key), -+ Key{std::move(domain_name), network_anonymization_key}, - Entry(std::move(result), source, secure, staleness_generation)); - - if (entries_.size() > max_entries_) { -diff -up chromium-119.0.6045.59/components/autofill/core/browser/webdata/autofill_table.cc.me chromium-119.0.6045.59/components/autofill/core/browser/webdata/autofill_table.cc ---- chromium-119.0.6045.59/components/autofill/core/browser/webdata/autofill_table.cc.me 2023-10-31 22:32:58.995997897 +0100 -+++ chromium-119.0.6045.59/components/autofill/core/browser/webdata/autofill_table.cc 2023-10-31 22:33:28.290520601 +0100 -@@ -1733,10 +1733,10 @@ std::unique_ptr Autofil - } - - base::span observations_data = s.ColumnBlob(3); -- field_type_values.emplace_back( -+ field_type_values.emplace_back() = { - type, s.ColumnString16(1), s.ColumnInt(2), - std::vector(observations_data.begin(), -- observations_data.end())); -+ observations_data.end())}; - - if (type == ADDRESS_HOME_COUNTRY) { - country_code = base::UTF16ToUTF8(s.ColumnString16(1)); -diff -up chromium-119.0.6045.59/components/password_manager/core/browser/password_manager.cc.than chromium-119.0.6045.59/components/password_manager/core/browser/password_manager.cc ---- chromium-119.0.6045.59/components/password_manager/core/browser/password_manager.cc.than 2023-10-31 22:41:22.850233005 +0100 -+++ chromium-119.0.6045.59/components/password_manager/core/browser/password_manager.cc 2023-10-31 22:42:37.276931933 +0100 -@@ -625,7 +625,7 @@ void PasswordManager::OnUserModifiedNonP - // |driver| might be empty on iOS or in tests. - int driver_id = driver ? driver->GetId() : 0; - possible_usernames_.Put( -- PossibleUsernameFieldIdentifier(driver_id, renderer_id), -+ PossibleUsernameFieldIdentifier{driver_id, renderer_id}, - PossibleUsernameData(GetSignonRealm(driver->GetLastCommittedURL()), - renderer_id, value, base::Time::Now(), driver_id, - autocomplete_attribute_has_username, is_likely_otp)); -diff -up chromium-119.0.6045.59/content/browser/interest_group/interest_group_storage.cc.than chromium-119.0.6045.59/content/browser/interest_group/interest_group_storage.cc ---- chromium-119.0.6045.59/content/browser/interest_group/interest_group_storage.cc.than 2023-10-31 23:31:08.438267908 +0100 -+++ chromium-119.0.6045.59/content/browser/interest_group/interest_group_storage.cc 2023-10-31 23:32:08.979358711 +0100 -@@ -2854,10 +2854,10 @@ DoGetKAnonymityData(sql::Database& db, - - std::vector k_anon_data; - while (interest_group_kanon_query.Step()) { -- k_anon_data.emplace_back( -+ k_anon_data.emplace_back() = { - /*key=*/interest_group_kanon_query.ColumnString(0), - /*is_k_anonymous=*/interest_group_kanon_query.ColumnBool(1), -- /*last_updated=*/interest_group_kanon_query.ColumnTime(2)); -+ /*last_updated=*/interest_group_kanon_query.ColumnTime(2)}; - } - if (!interest_group_kanon_query.Succeeded()) { - return absl::nullopt; -diff -up chromium-119.0.6045.59/content/browser/webid/federated_auth_request_impl.cc.than chromium-119.0.6045.59/content/browser/webid/federated_auth_request_impl.cc ---- chromium-119.0.6045.59/content/browser/webid/federated_auth_request_impl.cc.than 2023-11-01 11:19:42.745395797 +0100 -+++ chromium-119.0.6045.59/content/browser/webid/federated_auth_request_impl.cc 2023-11-01 11:22:16.670920679 +0100 -@@ -1881,7 +1881,7 @@ void FederatedAuthRequestImpl::ShowError - base::BindOnce(&FederatedAuthRequestImpl::CompleteRequestWithError, - weak_ptr_factory_.GetWeakPtr())); - absl::optional token_error = -- error ? absl::make_optional(error->code, error->url) -+ error ? absl::make_optional({error->code, error->url}) - : absl::nullopt; - - // TODO(crbug.com/1485710): Refactor IdentityCredentialTokenError ---- chromium-119.0.6045.59/ui/base/wayland/color_manager_util.h.no_matching_constructor 2023-10-26 18:18:14.000000000 +0200 -+++ chromium-119.0.6045.59/ui/base/wayland/color_manager_util.h 2023-11-01 17:29:54.269820415 +0100 -@@ -52,53 +52,53 @@ +Index: chromium-123.0.6312.46/ui/base/wayland/color_manager_util.h +=================================================================== +--- chromium-123.0.6312.46.orig/ui/base/wayland/color_manager_util.h ++++ chromium-123.0.6312.46/ui/base/wayland/color_manager_util.h +@@ -52,53 +52,53 @@ constexpr auto kChromaticityMap = base:: zcr_color_manager_v1_chromaticity_names, PrimaryVersion>( {{ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_BT601_525_LINE, @@ -391,7 +713,7 @@ diff -up chromium-119.0.6045.59/content/browser/webid/federated_auth_request_imp // A map from the zcr_color_manager_v1 eotf_names enum values // representing well-known EOTFs, to their equivalent TransferIDs. -@@ -107,68 +107,68 @@ +@@ -107,68 +107,68 @@ constexpr auto kEotfMap = base::MakeFixe zcr_color_manager_v1_eotf_names, TransferVersion>({ {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_LINEAR, @@ -498,7 +820,7 @@ diff -up chromium-119.0.6045.59/content/browser/webid/federated_auth_request_imp }); // A map from the SDR zcr_color_manager_v1 eotf_names enum values -@@ -177,18 +177,18 @@ +@@ -177,18 +177,18 @@ constexpr auto kEotfMap = base::MakeFixe constexpr auto kTransferMap = base::MakeFixedFlatMap({ {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_LINEAR, @@ -524,7 +846,7 @@ diff -up chromium-119.0.6045.59/content/browser/webid/federated_auth_request_imp }); // A map from the HDR zcr_color_manager_v1 eotf_names enum values -@@ -197,70 +197,70 @@ +@@ -197,70 +197,70 @@ constexpr auto kTransferMap = constexpr auto kHDRTransferMap = base::MakeFixedFlatMap( {{ZCR_COLOR_MANAGER_V1_EOTF_NAMES_LINEAR, @@ -628,76 +950,192 @@ diff -up chromium-119.0.6045.59/content/browser/webid/federated_auth_request_imp zcr_color_manager_v1_chromaticity_names ToColorManagerChromaticity( gfx::ColorSpace::PrimaryID primaryID, -@@ -283,4 +283,4 @@ +@@ -283,4 +283,4 @@ zcr_color_manager_v1_eotf_names ToColorM } // namespace ui::wayland -#endif // UI_BASE_WAYLAND_COLOR_MANAGER_UTIL_H_ -\ Kein Zeilenumbruch am Dateiende. +\ No newline at end of file +#endif // UI_BASE_WAYLAND_COLOR_MANAGER_UTIL_H_ -diff -up chromium-119.0.6045.59/chrome/browser/ui/views/permissions/embedded_permission_prompt_previously_granted_view.cc.me chromium-119.0.6045.59/chrome/browser/ui/views/permissions/embedded_permission_prompt_previously_granted_view.cc ---- chromium-119.0.6045.59/chrome/browser/ui/views/permissions/embedded_permission_prompt_previously_granted_view.cc.me 2023-11-01 20:46:15.997861278 +0100 -+++ chromium-119.0.6045.59/chrome/browser/ui/views/permissions/embedded_permission_prompt_previously_granted_view.cc 2023-11-01 20:49:33.603371680 +0100 -@@ -58,13 +58,13 @@ EmbeddedPermissionPromptPreviouslyGrante - std::vector - EmbeddedPermissionPromptPreviouslyGrantedView::GetButtonsConfiguration() { - std::vector buttons; -- buttons.emplace_back( -+ buttons.emplace_back() = { - l10n_util::GetStringUTF16(IDS_EMBEDDED_PROMPT_CONTINUE_ALLOWING), -- ButtonType::kContinueAllowing, ui::ButtonStyle::kTonal); -+ ButtonType::kContinueAllowing, ui::ButtonStyle::kTonal}; - -- buttons.emplace_back( -+ buttons.emplace_back() = { - l10n_util::GetStringUTF16(IDS_EMBEDDED_PROMPT_STOP_ALLOWING), -- ButtonType::kStopAllowing, ui::ButtonStyle::kTonal); -+ ButtonType::kStopAllowing, ui::ButtonStyle::kTonal}; - return buttons; +Index: chromium-123.0.6312.46/ui/gtk/gtk_ui.cc +=================================================================== +--- chromium-123.0.6312.46.orig/ui/gtk/gtk_ui.cc ++++ chromium-123.0.6312.46/ui/gtk/gtk_ui.cc +@@ -1001,11 +1001,11 @@ display::DisplayConfig GtkUi::GetDisplay + GdkRectangle geometry; + gdk_monitor_get_geometry(monitor, &geometry); + int monitor_scale = std::max(1, gdk_monitor_get_scale_factor(monitor)); +- config.display_geometries.emplace_back( ++ config.display_geometries.emplace_back() = { + gfx::Rect(monitor_scale * geometry.x, monitor_scale * geometry.y, + monitor_scale * geometry.width, + monitor_scale * geometry.height), +- monitor_scale * font_scale); ++ static_cast(monitor_scale * font_scale)}; + } + return config; } - -diff -up chromium-119.0.6045.59/chrome/browser/ui/views/permissions/embedded_permission_prompt_ask_view.cc.than chromium-119.0.6045.59/chrome/browser/ui/views/permissions/embedded_permission_prompt_ask_view.cc ---- chromium-119.0.6045.59/chrome/browser/ui/views/permissions/embedded_permission_prompt_ask_view.cc.than 2023-11-01 20:52:29.005464494 +0100 -+++ chromium-119.0.6045.59/chrome/browser/ui/views/permissions/embedded_permission_prompt_ask_view.cc 2023-11-01 21:14:12.741859604 +0100 -@@ -56,12 +56,12 @@ std::vector buttons; - if (base::FeatureList::IsEnabled(permissions::features::kOneTimePermission)) { -- buttons.emplace_back( -+ buttons.emplace_back() = { - l10n_util::GetStringUTF16(IDS_PERMISSION_ALLOW_THIS_TIME), -- ButtonType::kAllowThisTime, ui::ButtonStyle::kTonal); -+ ButtonType::kAllowThisTime, ui::ButtonStyle::kTonal}; +Index: chromium-123.0.6312.46/components/memory_pressure/unnecessary_discard_monitor.cc +=================================================================== +--- chromium-123.0.6312.46.orig/components/memory_pressure/unnecessary_discard_monitor.cc ++++ chromium-123.0.6312.46/components/memory_pressure/unnecessary_discard_monitor.cc +@@ -92,8 +92,8 @@ void UnnecessaryDiscardMonitor::OnDiscar + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (current_reclaim_event_) { + // Cache this kill event along with the time it took place. +- current_reclaim_event_kills_.emplace_back(memory_freed_kb, +- discard_complete_time); ++ current_reclaim_event_kills_.emplace_back() = {memory_freed_kb, ++ discard_complete_time}; } -- buttons.emplace_back(l10n_util::GetStringUTF16(IDS_PERMISSION_ALLOW), -- ButtonType::kAllow, ui::ButtonStyle::kTonal); -+ buttons.emplace_back() = {l10n_util::GetStringUTF16(IDS_PERMISSION_ALLOW), -+ ButtonType::kAllow, ui::ButtonStyle::kTonal}; - return buttons; } -diff -up chromium-119.0.6045.59/chrome/browser/ui/views/permissions/embedded_permission_prompt_base_view.h.me chromium-119.0.6045.59/chrome/browser/ui/views/permissions/embedded_permission_prompt_base_view.h ---- chromium-119.0.6045.59/chrome/browser/ui/views/permissions/embedded_permission_prompt_base_view.h.me 2023-11-01 21:22:02.222646903 +0100 -+++ chromium-119.0.6045.59/chrome/browser/ui/views/permissions/embedded_permission_prompt_base_view.h 2023-11-01 21:19:58.769619393 +0100 -@@ -72,6 +72,7 @@ class EmbeddedPermissionPromptBaseView : - struct RequestLineConfiguration { - const raw_ptr icon; - std::u16string message; -+ RequestLineConfiguration(auto i, auto m) : icon(i), message(m) { } - }; +Index: chromium-123.0.6312.46/components/autofill/core/browser/webdata/addresses/address_autofill_table.cc +=================================================================== +--- chromium-123.0.6312.46.orig/components/autofill/core/browser/webdata/addresses/address_autofill_table.cc ++++ chromium-123.0.6312.46/components/autofill/core/browser/webdata/addresses/address_autofill_table.cc +@@ -635,10 +635,10 @@ std::unique_ptr Address + } - struct ButtonConfiguration { -diff -up chromium-119.0.6045.59/chrome/browser/ui/views/permissions/embedded_permission_prompt_policy_view.cc.than chromium-119.0.6045.59/chrome/browser/ui/views/permissions/embedded_permission_prompt_policy_view.cc ---- chromium-119.0.6045.59/chrome/browser/ui/views/permissions/embedded_permission_prompt_policy_view.cc.than 2023-11-01 21:25:31.118626473 +0100 -+++ chromium-119.0.6045.59/chrome/browser/ui/views/permissions/embedded_permission_prompt_policy_view.cc 2023-11-01 21:30:06.383340274 +0100 -@@ -48,8 +48,8 @@ EmbeddedPermissionPromptPolicyView::GetR - std::vector - EmbeddedPermissionPromptPolicyView::GetButtonsConfiguration() { - std::vector buttons; -- buttons.emplace_back(l10n_util::GetStringUTF16(IDS_EMBEDDED_PROMPT_OK_LABEL), -- ButtonType::kPolicyOK, ui::ButtonStyle::kTonal); -+ buttons.emplace_back() = {l10n_util::GetStringUTF16(IDS_EMBEDDED_PROMPT_OK_LABEL), -+ ButtonType::kPolicyOK, ui::ButtonStyle::kTonal}; - return buttons; + base::span observations_data = s.ColumnBlob(3); +- field_type_values.emplace_back( ++ field_type_values.emplace_back() = { + type, s.ColumnString16(1), s.ColumnInt(2), + std::vector(observations_data.begin(), +- observations_data.end())); ++ observations_data.end())}; + + if (type == ADDRESS_HOME_COUNTRY) { + country_code = base::UTF16ToUTF8(s.ColumnString16(1)); +Index: chromium-123.0.6312.46/components/autofill/core/browser/webdata/addresses/contact_info_sync_util.cc +=================================================================== +--- chromium-123.0.6312.46.orig/components/autofill/core/browser/webdata/addresses/contact_info_sync_util.cc ++++ chromium-123.0.6312.46/components/autofill/core/browser/webdata/addresses/contact_info_sync_util.cc +@@ -169,9 +169,9 @@ class ContactInfoProfileSetter { + CHECK(observations.empty()); + for (const sync_pb::ContactInfoSpecifics::Observation& proto_observation : + metadata.observations()) { +- observations.emplace_back(proto_observation.type(), ++ observations.emplace_back() = {static_cast>(proto_observation.type()), + ProfileTokenQuality::FormSignatureHash( +- proto_observation.form_hash())); ++ proto_observation.form_hash())}; + } + } + } +Index: chromium-123.0.6312.46/content/browser/fenced_frame/fenced_frame_config.cc +=================================================================== +--- chromium-123.0.6312.46.orig/content/browser/fenced_frame/fenced_frame_config.cc ++++ chromium-123.0.6312.46/content/browser/fenced_frame/fenced_frame_config.cc +@@ -402,7 +402,7 @@ void FencedFrameProperties::UpdateParent + feature, allow_list.AllowedOrigins(), allow_list.SelfIfMatches(), + allow_list.MatchesAll(), allow_list.MatchesOpaqueSrc()); + } +- parent_permissions_info_.emplace(parsed_policies, parent_origin); ++ parent_permissions_info_.emplace() = {parsed_policies, parent_origin}; } + } // namespace content +Index: chromium-123.0.6312.46/chrome/browser/ui/safety_hub/menu_notification_service.h +=================================================================== +--- chromium-123.0.6312.46.orig/chrome/browser/ui/safety_hub/menu_notification_service.h ++++ chromium-123.0.6312.46/chrome/browser/ui/safety_hub/menu_notification_service.h +@@ -24,6 +24,7 @@ struct MenuNotificationEntry { + int command = 0; + std::u16string label; + safety_hub::SafetyHubModuleType module; ++ MenuNotificationEntry(auto c, auto l, auto m) : command(c), label(l), module(m) { } + }; + + namespace { +Index: chromium-123.0.6312.46/chrome/browser/ui/views/tabs/tab_style_views.cc +=================================================================== +--- chromium-123.0.6312.46.orig/chrome/browser/ui/views/tabs/tab_style_views.cc ++++ chromium-123.0.6312.46/chrome/browser/ui/views/tabs/tab_style_views.cc +@@ -1214,10 +1214,10 @@ SkPath ChromeRefresh2023TabStyleViews::G + + // Radii are clockwise from top left. + const SkVector radii[4] = { +- SkVector(top_content_corner_radius, top_content_corner_radius), +- SkVector(top_content_corner_radius, top_content_corner_radius), +- SkVector(bottom_content_corner_radius, bottom_content_corner_radius), +- SkVector(bottom_content_corner_radius, bottom_content_corner_radius)}; ++ SkVector{top_content_corner_radius, top_content_corner_radius}, ++ SkVector{top_content_corner_radius, top_content_corner_radius}, ++ SkVector{bottom_content_corner_radius, bottom_content_corner_radius}, ++ SkVector{bottom_content_corner_radius, bottom_content_corner_radius}}; + SkRRect rrect; + rrect.setRectRadii(SkRect::MakeLTRB(left, top, right, bottom), radii); + SkPath path; +Index: chromium-123.0.6312.46/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc +=================================================================== +--- chromium-123.0.6312.46.orig/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc ++++ chromium-123.0.6312.46/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc +@@ -386,7 +386,7 @@ bool ShouldBlockAccessToPath(const base: + DCHECK(block.path); + blocked_path = base::FilePath(block.path); + } +- rules.emplace_back(blocked_path, block.type); ++ rules.emplace_back() = {blocked_path, block.type}; + } + + base::FilePath nearest_ancestor; +@@ -1578,11 +1578,11 @@ void ChromeFileSystemAccessPermissionCon + // profile's directory, assuming the profile dir is a child of the user data + // dir. + std::vector extra_rules; +- extra_rules.emplace_back(profile_->GetPath().DirName(), kBlockAllChildren); ++ extra_rules.emplace_back() = {profile_->GetPath().DirName(), kBlockAllChildren}; + if (g_browser_process->profile_manager()) { +- extra_rules.emplace_back( ++ extra_rules.emplace_back() = { + g_browser_process->profile_manager()->user_data_dir(), +- kBlockAllChildren); ++ kBlockAllChildren}; + } + + base::ThreadPool::PostTaskAndReplyWithResult( +Index: chromium-123.0.6312.46/chrome/browser/performance_manager/mechanisms/page_discarder.cc +=================================================================== +--- chromium-123.0.6312.46.orig/chrome/browser/performance_manager/mechanisms/page_discarder.cc ++++ chromium-123.0.6312.46/chrome/browser/performance_manager/mechanisms/page_discarder.cc +@@ -53,7 +53,7 @@ std::vector + if (lifecycle_unit->DiscardTab( + discard_reason, + /*memory_footprint_estimate=*/proxy.second)) { +- discard_events.emplace_back(base::TimeTicks::Now(), proxy.second); ++ discard_events.emplace_back() = {base::TimeTicks::Now(), proxy.second}; + } + } + return discard_events; +Index: chromium-123.0.6312.46/extensions/browser/service_worker/service_worker_task_queue.h +=================================================================== +--- chromium-123.0.6312.46.orig/extensions/browser/service_worker/service_worker_task_queue.h ++++ chromium-123.0.6312.46/extensions/browser/service_worker/service_worker_task_queue.h +@@ -204,6 +204,7 @@ class ServiceWorkerTaskQueue : public Ke + raw_ptr browser_context; + base::UnguessableToken token; + ++ SequencedContextId(auto e, auto b, auto t) : extension_id(e), browser_context(b), token(t) { } + bool operator<(const SequencedContextId& rhs) const { + return std::tie(extension_id, browser_context, token) < + std::tie(rhs.extension_id, rhs.browser_context, rhs.token); +Index: chromium-123.0.6312.46/chrome/browser/renderer_context_menu/render_view_context_menu.cc +=================================================================== +--- chromium-123.0.6312.46.orig/chrome/browser/renderer_context_menu/render_view_context_menu.cc ++++ chromium-123.0.6312.46/chrome/browser/renderer_context_menu/render_view_context_menu.cc +@@ -4043,10 +4043,10 @@ + autofill::LocalFrameToken frame_token = driver->GetFrameToken(); + client->GetManager().OpenCompose( + *driver, +- autofill::FormGlobalId( +- frame_token, autofill::FormRendererId(params_.form_renderer_id)), +- autofill::FieldGlobalId( +- frame_token, autofill::FieldRendererId(params_.field_renderer_id)), ++ autofill::FormGlobalId{ ++ frame_token, autofill::FormRendererId(params_.form_renderer_id)}, ++ autofill::FieldGlobalId{ ++ frame_token, autofill::FieldRendererId(params_.field_renderer_id)}, + compose::ComposeManagerImpl::UiEntryPoint::kContextMenu); + GetBrowser()->window()->NotifyPromoFeatureUsed( + compose::features::kEnableCompose); diff --git a/chromium-125-tabstrip-include.patch b/chromium-125-tabstrip-include.patch new file mode 100644 index 0000000000000000000000000000000000000000..44c7ea157c10d3643c633a6e7eaf27480b3e2139 --- /dev/null +++ b/chromium-125-tabstrip-include.patch @@ -0,0 +1,26 @@ +commit 2958f58a84ebaacce716929f1cc4ba4a8076daee +Author: Ivan Murashov +Date: Wed May 15 19:30:45 2024 +0000 + + IWYU: Add missing include for std::variant usage in tab_strip_model.h + + Bug: 41455655 + Change-Id: I1b028ee1340f0697f147b5d0bfef3c916e1a5729 + Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5537958 + Reviewed-by: Vasilii Sukhanov + Reviewed-by: Dana Fried + Commit-Queue: Ivan Murashov + Cr-Commit-Position: refs/heads/main@{#1301505} + +diff --git a/chrome/browser/ui/tabs/tab_strip_model.h b/chrome/browser/ui/tabs/tab_strip_model.h +index 735c379a8cd1d..6711d565101ab 100644 +--- a/chrome/browser/ui/tabs/tab_strip_model.h ++++ b/chrome/browser/ui/tabs/tab_strip_model.h +@@ -12,6 +12,7 @@ + #include + #include + #include ++#include + #include + + #include "base/containers/span.h" diff --git a/chromium-125-vulkan-include.patch b/chromium-125-vulkan-include.patch new file mode 100644 index 0000000000000000000000000000000000000000..1ab6e239abda4e0ae46d930b66a8d2ae04c5e429 --- /dev/null +++ b/chromium-125-vulkan-include.patch @@ -0,0 +1,16 @@ +commit bbd4b7752f0a9e5f486fa55c9f2b80071ef99d01 +Author: lauren n. liberda +Date: Thu Apr 25 04:24:47 2024 +0200 + + iwyu: missing #include for std::unique_ptr + +--- a/third_party/vulkan-deps/vulkan-utility-libraries/src/include/vulkan/utility/vk_small_containers.hpp ++++ b/third_party/vulkan-deps/vulkan-utility-libraries/src/include/vulkan/utility/vk_small_containers.hpp +@@ -9,6 +9,7 @@ + #pragma once + + #include ++#include + #include + #include + diff --git a/chromium-119.0.6045.159.tar.xz b/chromium-125.0.6422.141.tar.xz similarity index 100% rename from chromium-119.0.6045.159.tar.xz rename to chromium-125.0.6422.141.tar.xz diff --git a/chromium-70.0.3538.67-sandbox-pie.patch b/chromium-70.0.3538.67-sandbox-pie.patch deleted file mode 100644 index 0f104e923ea9d90666c15da7aece3272bec403b6..0000000000000000000000000000000000000000 --- a/chromium-70.0.3538.67-sandbox-pie.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -up chromium-70.0.3538.67/sandbox/linux/BUILD.gn.sandboxpie chromium-70.0.3538.67/sandbox/linux/BUILD.gn ---- chromium-70.0.3538.67/sandbox/linux/BUILD.gn.sandboxpie 2018-10-18 12:14:05.766939769 -0400 -+++ chromium-70.0.3538.67/sandbox/linux/BUILD.gn 2018-10-18 12:16:37.820027182 -0400 -@@ -315,10 +315,16 @@ if (is_linux) { - # For ULLONG_MAX - "-std=gnu99", - -+ "-fPIE", -+ - # These files have a suspicious comparison. - # TODO fix this and re-enable this warning. - "-Wno-sign-compare", - ] -+ -+ ldflags = [ -+ "-pie", -+ ] - } - } - diff --git a/chromium-77.0.3865.75-no-zlib-mangle.patch b/chromium-77.0.3865.75-no-zlib-mangle.patch deleted file mode 100644 index c32d22649bfd8e3b71bc1f51ee1661174eeb7780..0000000000000000000000000000000000000000 --- a/chromium-77.0.3865.75-no-zlib-mangle.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -up chromium-77.0.3865.75/third_party/zlib/zconf.h.nozmangle chromium-77.0.3865.75/third_party/zlib/zconf.h ---- chromium-77.0.3865.75/third_party/zlib/zconf.h.nozmangle 2019-09-12 09:36:37.924086850 +0200 -+++ chromium-77.0.3865.75/third_party/zlib/zconf.h 2019-09-12 09:53:01.623958551 +0200 -@@ -9,18 +9,6 @@ - #define ZCONF_H - - /* -- * This library is also built as a part of AOSP, which does not need to include -- * chromeconf.h. This config does not want chromeconf.h, so it can set this -- * macro to opt out. While this works today, there's no guarantee that building -- * zlib outside of Chromium keeps working in the future. -- */ --#if !defined(CHROMIUM_ZLIB_NO_CHROMECONF) --/* This include does prefixing as below, but with an updated set of names. Also -- * sets up export macros in component builds. */ --#include "chromeconf.h" --#endif -- --/* - * If you *really* need a unique prefix for all types and library functions, - * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. - * Even better than compiling with -DZ_PREFIX would be to use configure to set diff --git a/chromium-81.0.4044.92-unbundle-zlib.patch b/chromium-81.0.4044.92-unbundle-zlib.patch deleted file mode 100644 index ff4e3b1e82c8d40dbb6284406bb1f4f9bd0084d7..0000000000000000000000000000000000000000 --- a/chromium-81.0.4044.92-unbundle-zlib.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up chromium-81.0.4044.92/third_party/perfetto/gn/BUILD.gn.unbundle-zlib chromium-81.0.4044.92/third_party/perfetto/gn/BUILD.gn ---- chromium-81.0.4044.92/third_party/perfetto/gn/BUILD.gn.unbundle-zlib 2020-04-13 12:25:09.001172601 -0400 -+++ chromium-81.0.4044.92/third_party/perfetto/gn/BUILD.gn 2020-04-13 12:25:23.688921586 -0400 -@@ -294,7 +294,7 @@ if (enable_perfetto_zlib) { - public_configs = [ "//buildtools:zlib_config" ] - public_deps = [ "//buildtools:zlib" ] - } else { -- public_configs = [ "//third_party/zlib:zlib_config" ] -+ public_configs = [ "//third_party/zlib:system_zlib" ] - public_deps = [ "//third_party/zlib" ] - } - } diff --git a/chromium-91.0.4472.77-java-only-allowed-in-android-builds.patch b/chromium-91-java-only-allowed-in-android-builds.patch similarity index 50% rename from chromium-91.0.4472.77-java-only-allowed-in-android-builds.patch rename to chromium-91-java-only-allowed-in-android-builds.patch index a4748d9af7aa22ed08331d338259a0107123d5b4..58d93690e0cde1b611c1f4c034efb4c4c05586eb 100644 --- a/chromium-91.0.4472.77-java-only-allowed-in-android-builds.patch +++ b/chromium-91-java-only-allowed-in-android-builds.patch @@ -1,6 +1,9 @@ -diff -up chromium-91.0.4472.77/third_party/closure_compiler/compiler.py.java-allowed chromium-91.0.4472.77/third_party/closure_compiler/compiler.py ---- chromium-91.0.4472.77/third_party/closure_compiler/compiler.py.java-allowed 2021-06-02 17:14:48.445064647 +0000 -+++ chromium-91.0.4472.77/third_party/closure_compiler/compiler.py 2021-06-02 17:15:12.994836949 +0000 +References: https://bugs.chromium.org/p/chromium/issues/detail?id=1192875 + +Index: chromium-91.0.4472.57/third_party/closure_compiler/compiler.py +=================================================================== +--- chromium-91.0.4472.57.orig/third_party/closure_compiler/compiler.py ++++ chromium-91.0.4472.57/third_party/closure_compiler/compiler.py @@ -13,8 +13,7 @@ import subprocess diff --git a/chromium-93-ffmpeg-4.4.patch b/chromium-93-ffmpeg-4.4.patch new file mode 100644 index 0000000000000000000000000000000000000000..9755ca8bfe50336e0b3b7110b4674a490f61aa7b --- /dev/null +++ b/chromium-93-ffmpeg-4.4.patch @@ -0,0 +1,67 @@ +From: 52c3e9c0f140a8742034e107fb0f371c0d73bf1d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Sun, 12 Sep 2021 04:20:11 +0200 +Subject: [PATCH] chromium-93: fix building with system-ffmpeg +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The version of ffmpeg bundled in Chromium changed ABI a little, which +affected the code in that the type of the last parameter of +av_packet_get_side_data() is now size_t instead of int. + +This causes Chromium to fail to build with system-ffmpeg if the system +ffmpeg's version does not yet have this ABI change. + +Fix the code to be able to compile with older ffmpeg as well. + +Signed-off-by: Marek Behún +--- + media/filters/audio_decoder_unittest.cc | 4 ++++ + media/filters/ffmpeg_demuxer.cc | 16 ++++++++++++++++ + 2 files changed, 20 insertions(+) + +Index: chromium-119.0.6045.21/media/filters/audio_decoder_unittest.cc +=================================================================== +--- chromium-119.0.6045.21.orig/media/filters/audio_decoder_unittest.cc ++++ chromium-119.0.6045.21/media/filters/audio_decoder_unittest.cc +@@ -108,7 +108,11 @@ void SetDiscardPadding(AVPacket* packet, + } + + // If the timestamp is positive, try to use FFmpeg's discard data. ++#if LIBAVUTIL_VERSION_MAJOR < 57 ++ int skip_samples_size = 0; ++#else + size_t skip_samples_size = 0; ++#endif + const uint32_t* skip_samples_ptr = + reinterpret_cast(av_packet_get_side_data( + packet, AV_PKT_DATA_SKIP_SAMPLES, &skip_samples_size)); +Index: chromium-119.0.6045.21/media/filters/ffmpeg_demuxer.cc +=================================================================== +--- chromium-119.0.6045.21.orig/media/filters/ffmpeg_demuxer.cc ++++ chromium-119.0.6045.21/media/filters/ffmpeg_demuxer.cc +@@ -390,7 +390,11 @@ void FFmpegDemuxerStream::EnqueuePacket( + + scoped_refptr buffer; + ++#if LIBAVUTIL_VERSION_MAJOR < 57 ++ int side_data_size = 0; ++#else + size_t side_data_size = 0; ++#endif + uint8_t* side_data = av_packet_get_side_data( + packet.get(), AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, &side_data_size); + +@@ -453,7 +457,11 @@ void FFmpegDemuxerStream::EnqueuePacket( + packet->size - data_offset); + } + ++#if LIBAVUTIL_VERSION_MAJOR < 57 ++ int skip_samples_size = 0; ++#else + size_t skip_samples_size = 0; ++#endif + const uint32_t* skip_samples_ptr = + reinterpret_cast(av_packet_get_side_data( + packet.get(), AV_PKT_DATA_SKIP_SAMPLES, &skip_samples_size)); diff --git a/chromium-93.0.4577.63-py3-bootstrap.patch b/chromium-93.0.4577.63-py3-bootstrap.patch deleted file mode 100644 index 899495f4b475607656a1b8f1ee2e6444b457f3b7..0000000000000000000000000000000000000000 --- a/chromium-93.0.4577.63-py3-bootstrap.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up chromium-93.0.4577.63/tools/gn/bootstrap/bootstrap.py.py3 chromium-93.0.4577.63/tools/gn/bootstrap/bootstrap.py ---- chromium-93.0.4577.63/tools/gn/bootstrap/bootstrap.py.py3 2021-08-31 21:40:34.000000000 -0400 -+++ chromium-93.0.4577.63/tools/gn/bootstrap/bootstrap.py 2021-09-02 08:26:04.415846917 -0400 -@@ -130,7 +130,7 @@ def main(argv): - if not options.debug: - gn_gen_args += ' is_debug=false' - subprocess.check_call([ -- gn_path, 'gen', out_dir, -+ gn_path, 'gen', out_dir, ' --script-executable=/usr/bin/python3', - '--args=%s' % gn_gen_args, "--root=" + SRC_ROOT - ]) - diff --git a/chromium-94-ffmpeg-roll.patch b/chromium-94-ffmpeg-roll.patch new file mode 100644 index 0000000000000000000000000000000000000000..dae1adde0bc6652e1afadc56cb65c2c271a8ea68 --- /dev/null +++ b/chromium-94-ffmpeg-roll.patch @@ -0,0 +1,12 @@ +diff --git a/build/linux/unbundle/ffmpeg.gn b/build/linux/unbundle/ffmpeg.gn +index 16e20744706..6a079b32221 100644 +--- a/build/linux/unbundle/ffmpeg.gn ++++ b/build/linux/unbundle/ffmpeg.gn +@@ -12,6 +12,7 @@ pkg_config("system_ffmpeg") { + "libavformat", + "libavutil", + ] ++ defines = [ "av_stream_get_first_dts(stream)=stream->first_dts" ] + } + + buildflag_header("ffmpeg_features") { diff --git a/chromium-98.0.4758.102-remoting-no-tests.patch b/chromium-98.0.4758.102-remoting-no-tests.patch deleted file mode 100644 index a8c4dbd8c91c44d74423ff0700ecabb502979014..0000000000000000000000000000000000000000 --- a/chromium-98.0.4758.102-remoting-no-tests.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -up chromium-98.0.4758.102/remoting/BUILD.gn.remoting-no-tests chromium-98.0.4758.102/remoting/BUILD.gn ---- chromium-98.0.4758.102/remoting/BUILD.gn.remoting-no-tests 2022-02-28 19:15:23.835872267 +0000 -+++ chromium-98.0.4758.102/remoting/BUILD.gn 2022-03-01 17:55:50.625536957 +0000 -@@ -8,7 +8,7 @@ import("//remoting/build/config/remoting - group("remoting_all") { - testonly = true - -- deps = [ ":remoting_unittests" ] -+ deps = [ ] - - if (is_win) { - deps += [ -@@ -37,7 +37,6 @@ group("remoting_all") { - - if (enable_remoting_host) { - deps += [ -- ":remoting_perftests", - "//remoting/host", - ] - diff --git a/chromium-browser.desktop b/chromium-browser.desktop deleted file mode 100644 index 23d3257b471f1909c100bb6b37422415f8e7cb2b..0000000000000000000000000000000000000000 --- a/chromium-browser.desktop +++ /dev/null @@ -1,356 +0,0 @@ -[Desktop Entry] -Version=1.0 -Name=Chromium Web Browser -Name[ast]=Restolador web Chromium -Name[ca]=Navegador web Chromium -Name[de]=Chromium-Webbrowser -Name[es]=Navegador web Chromium -Name[fr]=Navigateur Web Chromium -Name[gl]=Navegador web Chromium -Name[he]=דפדפן האינטרנט Chromium -Name[hr]=Chromium web preglednik -Name[hu]=Chromium webböngésző -Name[id]=Peramban Web Chromium -Name[it]=Browser web Chromium -Name[ja]=Chromium ウェブ・ブラウザ -Name[ko]=Chromium 웹 브라우저 -Name[pt_BR]=Chromium Navegador da Internet -Name[ru]=Веб-браузер Chromium -Name[sl]=Chromium spletni brskalnik -Name[sv]=Webbläsaren Chromium -Name[ug]=Chromium توركۆرگۈ -Name[zh_CN]=Chromium 网页浏览器 -Name[zh_HK]=Chromium 網頁瀏覽器 -Name[zh_TW]=Chromium 網頁瀏覽器 -Comment=Access the Internet -Comment[ar]=الدخول إلى الإنترنت -Comment[ast]=Accesu a Internet -Comment[bg]=Достъп до интернет -Comment[bn]=ইন্টারনেটটি অ্যাক্সেস করুন -Comment[ca]=Accediu a Internet -Comment[cs]=Přístup k internetu -Comment[da]=Få adgang til internettet -Comment[de]=Internetzugriff -Comment[el]=Πρόσβαση στο Διαδίκτυο -Comment[en_GB]=Access the Internet -Comment[es]=Acceda a Internet -Comment[et]=Pääs Internetti -Comment[fi]=Käytä internetiä -Comment[fil]=I-access ang Internet -Comment[fr]=Explorer le Web -Comment[gl]=Acceda a Internet -Comment[gu]=ઇંટરનેટ ઍક્સેસ કરો -Comment[he]=גישה לאינטרנט -Comment[hi]=इंटरनेट तक पहुंच स्थापित करें -Comment[hr]=Pristupite Internetu -Comment[hu]=Az internet elérése -Comment[id]=Akses Internet -Comment[it]=Accesso a Internet -Comment[ja]=インターネットにアクセス -Comment[kn]=ಇಂಟರ್ನೆಟ್ ಅನ್ನು ಪ್ರವೇಶಿಸಿs -Comment[ko]=인터넷에 연결합니다 -Comment[lt]=Interneto prieiga -Comment[lv]=Piekļūt internetam -Comment[ml]=ഇന്റര്‍‌നെറ്റ് ആക്‌സസ് ചെയ്യുക -Comment[mr]=इंटरनेटमध्ये प्रवेश करा -Comment[nb]=Gå til Internett -Comment[nl]=Verbinding maken met internet -Comment[or]=ଇଣ୍ଟର୍ନେଟ୍ ପ୍ରବେଶ କରନ୍ତୁ -Comment[pl]=Skorzystaj z internetu -Comment[pt]=Aceder à Internet -Comment[pt_BR]=Acessar a internet -Comment[ro]=Accesaţi Internetul -Comment[ru]=Доступ в Интернет -Comment[sk]=Prístup do siete Internet -Comment[sl]=Dostop do interneta -Comment[sr]=Приступите Интернету -Comment[sv]=Surfa på Internet -Comment[ta]=இணையத்தை அணுகுதல் -Comment[te]=ఇంటర్నెట్‌ను ఆక్సెస్ చెయ్యండి -Comment[th]=เข้าถึงอินเทอร์เน็ต -Comment[tr]=İnternet'e erişin -Comment[ug]=ئىنتېرنېتنى زىيارەت قىلىش -Comment[uk]=Доступ до Інтернету -Comment[vi]=Truy cập Internet -Comment[zh_CN]=访问互联网 -Comment[zh_HK]=連線到網際網路 -Comment[zh_TW]=連線到網際網路 -GenericName=Web Browser -GenericName[ar]=متصفح الشبكة -GenericName[ast]=Restolador web -GenericName[bg]=Уеб браузър -GenericName[bn]=ওয়েব ব্রাউজার -GenericName[ca]=Navegador web -GenericName[cs]=WWW prohlížeč -GenericName[da]=Browser -GenericName[de]=Web-Browser -GenericName[el]=Περιηγητής ιστού -GenericName[en_GB]=Web Browser -GenericName[es]=Navegador web -GenericName[et]=Veebibrauser -GenericName[fi]=WWW-selain -GenericName[fil]=Web Browser -GenericName[fr]=Navigateur Web -GenericName[gl]=Navegador web -GenericName[gu]=વેબ બ્રાઉઝર -GenericName[he]=דפדפן אינטרנט -GenericName[hi]=वेब ब्राउज़र -GenericName[hr]=Web preglednik -GenericName[hu]=Webböngésző -GenericName[id]=Peramban Web -GenericName[it]=Browser web -GenericName[ja]=ウェブ・ブラウザ -GenericName[kn]=ಜಾಲ ವೀಕ್ಷಕ -GenericName[ko]=웹 브라우저 -GenericName[lt]=Žiniatinklio naršyklė -GenericName[lv]=Tīmekļa pārlūks -GenericName[ml]=വെബ് ബ്രൌസര്‍ -GenericName[mr]=वेब ब्राऊजर -GenericName[nb]=Nettleser -GenericName[nl]=Webbrowser -GenericName[or]=ଓ୍ବେବ ବ୍ରାଉଜର -GenericName[pl]=Przeglądarka WWW -GenericName[pt]=Navegador Web -GenericName[pt_BR]=Navegador da Internet -GenericName[ro]=Navigator de Internet -GenericName[ru]=Веб-браузер -GenericName[sk]=WWW prehliadač -GenericName[sl]=Spletni brskalnik -GenericName[sr]=Интернет прегледник -GenericName[sv]=Webbläsare -GenericName[ta]=இணைய உலாவி -GenericName[te]=మహాతల అన్వేషి -GenericName[th]=เว็บเบราว์เซอร์ -GenericName[tr]=Web Tarayıcı -GenericName[ug]=توركۆرگۈ -GenericName[uk]=Навігатор Тенет -GenericName[vi]=Bộ duyệt Web -GenericName[zh_CN]=网页浏览器 -GenericName[zh_HK]=網頁瀏覽器 -GenericName[zh_TW]=網頁瀏覽器 -Exec=/usr/bin/chromium-browser %U -Terminal=false -X-MultipleArgs=false -Type=Application -Icon=chromium-browser -Categories=Network;WebBrowser; -MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https; -StartupWMClass=Chromium-browser -Keywords=web;browser;internet; -Actions=new-window;new-private-window; - -[Desktop Action new-window] -Name=Open a New Window -Name[ach]=Dirica manyen -Name[af]=Nuwe venster -Name[an]=Nueva finestra -Name[ar]=نافذة جديدة -Name[as]=নতুন উইন্ডো -Name[ast]=Ventana nueva -Name[az]=Yeni Pəncərə -Name[be]=Новае акно -Name[bg]=Нов прозорец -Name[bn-BD]=নতুন উইন্ডো (N) -Name[bn-IN]=নতুন উইন্ডো -Name[br]=Prenestr nevez -Name[brx]=गोदान उइन्ड'(N) -Name[bs]=Novi prozor -Name[ca]=Finestra nova -Name[cak]=K'ak'a' tzuwäch -Name[cs]=Nové okno -Name[cy]=Ffenestr Newydd -Name[da]=Nyt vindue -Name[de]=Neues Fenster -Name[dsb]=Nowe wokno -Name[el]=Νέο παράθυρο -Name[en-GB]=New Window -Name[en-US]=New Window -Name[en-ZA]=New Window -Name[eo]=Nova fenestro -Name[es-AR]=Nueva ventana -Name[es-CL]=Nueva ventana -Name[es-ES]=Nueva ventana -Name[es-MX]=Nueva ventana -Name[et]=Uus aken -Name[eu]=Leiho berria -Name[fa]=پنجره جدید‌ -Name[ff]=Henorde Hesere -Name[fi]=Uusi ikkuna -Name[fr]=Nouvelle fenêtre -Name[fy-NL]=Nij finster -Name[ga-IE]=Fuinneog Nua -Name[gd]=Uinneag ùr -Name[gl]=Nova xanela -Name[gn]=Ovetã pyahu -Name[gu-IN]=નવી વિન્ડો -Name[he]=חלון חדש -Name[hi-IN]=नया विंडो -Name[hr]=Novi prozor -Name[hsb]=Nowe wokno -Name[hu]=Új ablak -Name[hy-AM]=Նոր Պատուհան -Name[id]=Jendela Baru -Name[is]=Nýr gluggi -Name[it]=Nuova finestra -Name[ja]=新しいウィンドウ -Name[ja-JP-mac]=新規ウインドウ -Name[ka]=ახალი ფანჯარა -Name[kk]=Жаңа терезе -Name[km]=បង្អួច​​​ថ្មី -Name[kn]=ಹೊಸ ಕಿಟಕಿ -Name[ko]=새 창 -Name[kok]=नवें जनेल -Name[ks]=نئئ وِنڈو -Name[lij]=Neuvo barcon -Name[lo]=ຫນ້າຕ່າງໃຫມ່ -Name[lt]=Naujas langas -Name[ltg]=Jauns lūgs -Name[lv]=Jauns logs -Name[mai]=नव विंडो -Name[mk]=Нов прозорец -Name[ml]=പുതിയ ജാലകം -Name[mr]=नवीन पटल -Name[ms]=Tetingkap Baru -Name[my]=ဝင်းဒိုးအသစ် -Name[nb-NO]=Nytt vindu -Name[ne-NP]=नयाँ सञ्झ्याल -Name[nl]=Nieuw venster -Name[nn-NO]=Nytt vindauge -Name[or]=ନୂତନ ୱିଣ୍ଡୋ -Name[pa-IN]=ਨਵੀਂ ਵਿੰਡੋ -Name[pl]=Nowe okno -Name[pt-BR]=Nova janela -Name[pt-PT]=Nova janela -Name[rm]=Nova fanestra -Name[ro]=Fereastră nouă -Name[ru]=Новое окно -Name[sat]=नावा विंडो (N) -Name[si]=නව කවුළුවක් -Name[sk]=Nové okno -Name[sl]=Novo okno -Name[son]=Zanfun taaga -Name[sq]=Dritare e Re -Name[sr]=Нови прозор -Name[sv-SE]=Nytt fönster -Name[ta]=புதிய சாளரம் -Name[te]=కొత్త విండో -Name[th]=หน้าต่างใหม่ -Name[tr]=Yeni pencere -Name[tsz]=Eraatarakua jimpani -Name[uk]=Нове вікно -Name[ur]=نیا دریچہ -Name[uz]=Yangi oyna -Name[vi]=Cửa sổ mới -Name[wo]=Palanteer bu bees -Name[xh]=Ifestile entsha -Name[zh-CN]=新建窗口 -Name[zh-TW]=開新視窗 -Exec=chromium-browser %U - -[Desktop Action new-private-window] -Name=Open a New Private Window -Name[ach]=Dirica manyen me mung -Name[af]=Nuwe privaatvenster -Name[an]=Nueva finestra privada -Name[ar]=نافذة خاصة جديدة -Name[as]=নতুন ব্যক্তিগত উইন্ডো -Name[ast]=Ventana privada nueva -Name[az]=Yeni Məxfi Pəncərə -Name[be]=Новае акно адасаблення -Name[bg]=Нов прозорец за поверително сърфиране -Name[bn-BD]=নতুন ব্যক্তিগত উইন্ডো -Name[bn-IN]=নতুন ব্যক্তিগত উইন্ডো -Name[br]=Prenestr merdeiñ prevez nevez -Name[brx]=गोदान प्राइभेट उइन्ड' -Name[bs]=Novi privatni prozor -Name[ca]=Finestra privada nova -Name[cak]=K'ak'a' ichinan tzuwäch -Name[cs]=Nové anonymní okno -Name[cy]=Ffenestr Breifat Newydd -Name[da]=Nyt privat vindue -Name[de]=Neues privates Fenster -Name[dsb]=Nowe priwatne wokno -Name[el]=Νέο παράθυρο ιδιωτικής περιήγησης -Name[en-GB]=New Private Window -Name[en-US]=New Private Window -Name[en-ZA]=New Private Window -Name[eo]=Nova privata fenestro -Name[es-AR]=Nueva ventana privada -Name[es-CL]=Nueva ventana privada -Name[es-ES]=Nueva ventana privada -Name[es-MX]=Nueva ventana privada -Name[et]=Uus privaatne aken -Name[eu]=Leiho pribatu berria -Name[fa]=پنجره ناشناس جدید -Name[ff]=Henorde Suturo Hesere -Name[fi]=Uusi yksityinen ikkuna -Name[fr]=Nouvelle fenêtre de navigation privée -Name[fy-NL]=Nij priveefinster -Name[ga-IE]=Fuinneog Nua Phríobháideach -Name[gd]=Uinneag phrìobhaideach ùr -Name[gl]=Nova xanela privada -Name[gn]=Ovetã ñemi pyahu -Name[gu-IN]=નવી ખાનગી વિન્ડો -Name[he]=חלון פרטי חדש -Name[hi-IN]=नयी निजी विंडो -Name[hr]=Novi privatni prozor -Name[hsb]=Nowe priwatne wokno -Name[hu]=Új privát ablak -Name[hy-AM]=Սկսել Գաղտնի դիտարկում -Name[id]=Jendela Mode Pribadi Baru -Name[is]=Nýr huliðsgluggi -Name[it]=Nuova finestra anonima -Name[ja]=新しいプライベートウィンドウ -Name[ja-JP-mac]=新規プライベートウインドウ -Name[ka]=ახალი პირადი ფანჯარა -Name[kk]=Жаңа жекелік терезе -Name[km]=បង្អួច​ឯកជន​ថ្មី -Name[kn]=ಹೊಸ ಖಾಸಗಿ ಕಿಟಕಿ -Name[ko]=새 사생활 보호 모드 -Name[kok]=नवो खाजगी विंडो -Name[ks]=نْو پرایوٹ وینڈو& -Name[lij]=Neuvo barcon privou -Name[lo]=ເປີດຫນ້າຕ່າງສວນຕົວຂື້ນມາໃຫມ່ -Name[lt]=Naujas privataus naršymo langas -Name[ltg]=Jauns privatais lūgs -Name[lv]=Jauns privātais logs -Name[mai]=नया निज विंडो (W) -Name[mk]=Нов приватен прозорец -Name[ml]=പുതിയ സ്വകാര്യ ജാലകം -Name[mr]=नवीन वैयक्तिक पटल -Name[ms]=Tetingkap Persendirian Baharu -Name[my]=New Private Window -Name[nb-NO]=Nytt privat vindu -Name[ne-NP]=नयाँ निजी सञ्झ्याल -Name[nl]=Nieuw privévenster -Name[nn-NO]=Nytt privat vindauge -Name[or]=ନୂତନ ବ୍ୟକ୍ତିଗତ ୱିଣ୍ଡୋ -Name[pa-IN]=ਨਵੀਂ ਪ੍ਰਾਈਵੇਟ ਵਿੰਡੋ -Name[pl]=Nowe okno prywatne -Name[pt-BR]=Nova janela privativa -Name[pt-PT]=Nova janela privada -Name[rm]=Nova fanestra privata -Name[ro]=Fereastră privată nouă -Name[ru]=Новое приватное окно -Name[sat]=नावा निजेराक् विंडो (W ) -Name[si]=නව පුද්ගලික කවුළුව (W) -Name[sk]=Nové okno v režime Súkromné prehliadanie -Name[sl]=Novo zasebno okno -Name[son]=Sutura zanfun taaga -Name[sq]=Dritare e Re Private -Name[sr]=Нови приватан прозор -Name[sv-SE]=Nytt privat fönster -Name[ta]=புதிய தனிப்பட்ட சாளரம் -Name[te]=కొత్త ఆంతరంగిక విండో -Name[th]=หน้าต่างส่วนตัวใหม่ -Name[tr]=Yeni gizli pencere -Name[tsz]=Juchiiti eraatarakua jimpani -Name[uk]=Приватне вікно -Name[ur]=نیا نجی دریچہ -Name[uz]=Yangi maxfiy oyna -Name[vi]=Cửa sổ riêng tư mới -Name[wo]=Panlanteeru biir bu bees -Name[xh]=Ifestile yangasese entsha -Name[zh-CN]=新建隐私浏览窗口 -Name[zh-TW]=新增隱私視窗 -Exec=chromium-browser --incognito %U diff --git a/chromium-browser.sh b/chromium-browser.sh deleted file mode 100755 index 492a4968c3c9f229bb3e9dd4e7041a2a0edc9a59..0000000000000000000000000000000000000000 --- a/chromium-browser.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2011 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# Let the wrapped binary know that it has been run through the wrapper. -export CHROME_WRAPPER="`readlink -f "$0"`" - -HERE="`dirname "$CHROME_WRAPPER"`" - -# We include some xdg utilities next to the binary, and we want to prefer them -# over the system versions when we know the system versions are very old. We -# detect whether the system xdg utilities are sufficiently new to be likely to -# work for us by looking for xdg-settings. If we find it, we leave $PATH alone, -# so that the system xdg utilities (including any distro patches) will be used. -if ! which xdg-settings &> /dev/null; then - # Old xdg utilities. Prepend $HERE to $PATH to use ours instead. - export PATH="$HERE:$PATH" -else - # Use system xdg utilities. But first create mimeapps.list if it doesn't - # exist; some systems have bugs in xdg-mime that make it fail without it. - xdg_app_dir="${XDG_DATA_HOME:-$HOME/.local/share/applications}" - mkdir -p "$xdg_app_dir" - [ -f "$xdg_app_dir/mimeapps.list" ] || touch "$xdg_app_dir/mimeapps.list" -fi - -# Always use our versions of ffmpeg libs. -# This also makes RPMs find the compatibly-named library symlinks. -if [[ -n "$LD_LIBRARY_PATH" ]]; then - LD_LIBRARY_PATH="$HERE:$HERE/lib:$LD_LIBRARY_PATH" -else - LD_LIBRARY_PATH="$HERE:$HERE/lib" -fi -export LD_LIBRARY_PATH - -export CHROME_VERSION_EXTRA="Built from source for @@BUILD_TARGET@@" - -# We don't want bug-buddy intercepting our crashes. http://crbug.com/24120 -export GNOME_DISABLE_CRASH_DIALOG=SET_BY_GOOGLE_CHROME - -# Allow users to override command-line options and prefer user defined -# CHROMIUM_USER_FLAGS from env over system wide CHROMIUM_FLAGS -[[ -f /etc/chromium/chromium.conf ]] && . /etc/chromium/chromium.conf -CHROMIUM_FLAGS=${CHROMIUM_USER_FLAGS:-$CHROMIUM_FLAGS} - -CHROMIUM_DISTRO_FLAGS=" --enable-plugins \ - --enable-extensions \ - --enable-user-scripts \ - --enable-printing \ - --enable-gpu-rasterization \ - --enable-sync \ - --auto-ssl-client-auth @@EXTRA_FLAGS@@" - -# Sanitize std{in,out,err} because they'll be shared with untrusted child -# processes (http://crbug.com/376567). -exec < /dev/null -exec > >(exec cat) -exec 2> >(exec cat >&2) - -exec -a "$0" "$HERE/@@CHROMIUM_BROWSER_CHANNEL@@" $CHROMIUM_FLAGS $CHROMIUM_DISTRO_FLAGS "$@" diff --git a/chromium-browser.xml b/chromium-browser.xml deleted file mode 100644 index 159e05cc4a2107d33a22889a9b5c2e372705cc00..0000000000000000000000000000000000000000 --- a/chromium-browser.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - Chromium - chromium-browser - /usr/bin/chromium-browser %s - chromium-browser - false - false - - - - diff --git a/chromium-disable-GlobalMediaControlsCastStartStop.patch b/chromium-disable-GlobalMediaControlsCastStartStop.patch new file mode 100644 index 0000000000000000000000000000000000000000..16c0cec58a20ad7131c0437201652a1a8e0b70e4 --- /dev/null +++ b/chromium-disable-GlobalMediaControlsCastStartStop.patch @@ -0,0 +1,13 @@ +Index: chromium-123.0.6312.46/chrome/browser/media/router/media_router_feature.cc +=================================================================== +--- chromium-123.0.6312.46.orig/chrome/browser/media/router/media_router_feature.cc ++++ chromium-123.0.6312.46/chrome/browser/media/router/media_router_feature.cc +@@ -59,7 +59,7 @@ BASE_FEATURE(kFallbackToAudioTabMirrorin + #if BUILDFLAG(IS_CHROMEOS) + base::FEATURE_DISABLED_BY_DEFAULT); + #else +- base::FEATURE_ENABLED_BY_DEFAULT); ++ base::FEATURE_DISABLED_BY_DEFAULT); + #endif // BUILDFLAG(IS_CHROMEOS) + + BASE_FEATURE(kCastMirroringPlayoutDelay, diff --git a/chromium-disable-font-tests.patch b/chromium-disable-font-tests.patch deleted file mode 100644 index ae38a8a1151a1e22c37b261b4c2ce4a9ae0f6cd6..0000000000000000000000000000000000000000 --- a/chromium-disable-font-tests.patch +++ /dev/null @@ -1,26 +0,0 @@ -description: disable building font tests -author: Michael Gilbert - ---- a/skia/BUILD.gn -+++ b/skia/BUILD.gn -@@ -860,7 +860,7 @@ group("test_fonts_resources") { - if (is_apple) { - deps += [ ":test_fonts_bundle_data" ] - data_deps += [ ":test_fonts_bundle_data" ] -- } else { -+ } else if (false) { - deps += [ "//third_party/test_fonts" ] - data_deps += [ "//third_party/test_fonts" ] - } ---- a/third_party/test_fonts/fontconfig/BUILD.gn -+++ b/third_party/test_fonts/fontconfig/BUILD.gn -@@ -8,9 +8,7 @@ if (is_linux || is_chromeos) { - group("test_support") { - testonly = true - public_deps = [ ":fontconfig_util_linux" ] -- data_deps = [ "//third_party/test_fonts" ] - if (current_toolchain == host_toolchain) { -- data_deps += [ ":do_generate_fontconfig_caches" ] - } - } - diff --git a/chromium-disable-parallel-gold.patch b/chromium-disable-parallel-gold.patch new file mode 100644 index 0000000000000000000000000000000000000000..d25912d2a46032d65b90f2be243322c549461b1f --- /dev/null +++ b/chromium-disable-parallel-gold.patch @@ -0,0 +1,13 @@ +diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn +index 01d97a360..a9a721403 100644 +--- a/build/config/compiler/BUILD.gn ++++ b/build/config/compiler/BUILD.gn +@@ -415,8 +415,6 @@ config("compiler") { + # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36 + # Only apply this to the target linker, since the host + # linker might not be gold, but isn't used much anyway. +- "-Wl,--threads", +- "-Wl,--thread-count=4", + ] + } + diff --git a/chromium-icu72-2.patch b/chromium-icu72-2.patch deleted file mode 100644 index d79bf183bdf53e49471e563706452f56a54f9411..0000000000000000000000000000000000000000 --- a/chromium-icu72-2.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 103e1ff08c00590be56c98aa5647e92c7fa78631 Mon Sep 17 00:00:00 2001 -From: Mustafa Emre Acer -Date: Fri, 18 Nov 2022 22:52:00 +0000 -Subject: [PATCH] IDN Spoof Checks: Disallow ZWJ and ZWNJ in ICU versions below - 72 - -ICU 72 updates to Unicode 15 which changes the zero width joiner (ZWJ) -and zero width non-joiner (ZWNJ) characters from -Identifier_Status=Allowed to Identifier_Status=Restricted. These -characters are therefore no longer allowed by default in ICU 72. - -crbug/694157 recently implemented Non-Transitional IDNA 2008 behind a -flag. ZWJ and ZWNJ are disallowed in Transitional Mode but allowed in -Non-Transitional Mode, so the test cases with the Non-Transitional Mode -enabled fail in ICU 72. - -This CL removes ZWJ and ZWNJ from the allowed identifiers set for -ICU versions below 72. This effectively disables these characters even -in Non-Transitional Mode. - -This is a temporary fix. Once ICU 72 is rolled out, we should check if -we can use UIDNA_CHECK_CONTEXTJ and explicitly add ZWJ and ZWNJ to -the allowed sets again. - -Bug: 1386204, 694157 -Change-Id: I606c43b9d94fea0f2331e5aed530f633bb94517c -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4038542 -Reviewed-by: Frank Tang -Commit-Queue: Mustafa Emre Acer -Cr-Commit-Position: refs/heads/main@{#1073605} ---- - .../spoof_checks/idn_spoof_checker.cc | 9 ++++++ - .../idn_spoof_checker_unittest.cc | 28 +++++++++++-------- - 2 files changed, 25 insertions(+), 12 deletions(-) - -Index: chromium-110.0.5481.38/components/url_formatter/spoof_checks/idn_spoof_checker.cc -=================================================================== ---- chromium-110.0.5481.38.orig/components/url_formatter/spoof_checks/idn_spoof_checker.cc -+++ chromium-110.0.5481.38/components/url_formatter/spoof_checks/idn_spoof_checker.cc -@@ -722,6 +722,15 @@ void IDNSpoofChecker::SetAllowedUnicodeS - allowed_set.remove(0x200Du); // Zero Width Joiner - #endif - -+#if U_ICU_VERSION_MAJOR_NUM < 72 -+ // Unicode 15 changes ZWJ and ZWNJ from allowed to restricted. Restrict them -+ // in lower versions too. This only relevant in Non-Transitional Mode as -+ // Transitional Mode maps these characters out. -+ // TODO(crbug.com/1386204): Remove these after ICU 72 is rolled out. -+ allowed_set.remove(0x200Cu); // Zero Width Non-Joiner -+ allowed_set.remove(0x200Du); // Zero Width Joiner -+#endif -+ - uspoof_setAllowedUnicodeSet(checker_, &allowed_set, status); - } - diff --git a/chromium-libusb_interrupt_event_handler.patch b/chromium-libusb_interrupt_event_handler.patch new file mode 100644 index 0000000000000000000000000000000000000000..0def4a36147ebd3ebc3f9a3adb3c1793366dfc65 --- /dev/null +++ b/chromium-libusb_interrupt_event_handler.patch @@ -0,0 +1,15 @@ +diff -up chromium-48.0.2564.116/services/device/usb/usb_context.cc.modern-libusbx chromium-48.0.2564.116/device/usb/usb_context.cc +--- chromium-48.0.2564.116/services/device/usb/usb_context.cc.modern-libusbx 2016-02-24 10:21:10.534996028 -0500 ++++ chromium-48.0.2564.116/services/device/usb/usb_context.cc 2016-02-24 10:22:28.270499864 -0500 +@@ -57,7 +57,11 @@ void UsbContext::UsbEventHandler::Run() + + void UsbContext::UsbEventHandler::Stop() { + base::subtle::Release_Store(&running_, 0); ++#ifdef LIBUSB_API_VERSION >= 0x01000105 ++ libusb_interrupt_event_handler(context_); ++#else + libusb_interrupt_handle_event(context_); ++#endif + } + + UsbContext::UsbContext(PlatformUsbContext context) : context_(context) { diff --git a/chromium-115-initial_prefs-etc-path.patch b/chromium-master-prefs-path.patch similarity index 39% rename from chromium-115-initial_prefs-etc-path.patch rename to chromium-master-prefs-path.patch index b666b0c6c61fb740ec5a390385e341f9adf0fb83..f9e6b07c168e940c77bbf17323556e9dadfcd998 100644 --- a/chromium-115-initial_prefs-etc-path.patch +++ b/chromium-master-prefs-path.patch @@ -1,16 +1,16 @@ -diff -up chromium-115.0.5790.32/chrome/browser/first_run/first_run_internal_linux.cc.me chromium-115.0.5790.32/chrome/browser/first_run/first_run_internal_linux.cc ---- chromium-115.0.5790.32/chrome/browser/first_run/first_run_internal_linux.cc.me 2023-06-17 19:43:08.481952671 +0200 -+++ chromium-115.0.5790.32/chrome/browser/first_run/first_run_internal_linux.cc 2023-06-17 19:44:26.165349772 +0200 -@@ -20,10 +20,8 @@ bool IsOrganicFirstRun() { - +Index: chromium-115.0.5790.32/chrome/browser/first_run/first_run_internal_linux.cc +=================================================================== +--- chromium-115.0.5790.32.orig/chrome/browser/first_run/first_run_internal_linux.cc ++++ chromium-115.0.5790.32/chrome/browser/first_run/first_run_internal_linux.cc +@@ -21,10 +21,7 @@ bool IsOrganicFirstRun() { base::FilePath InitialPrefsPath() { // The standard location of the initial prefs is next to the chrome binary. -- base::FilePath dir_exe; + base::FilePath dir_exe; - if (!base::PathService::Get(base::DIR_EXE, &dir_exe)) { - return base::FilePath(); - } -+ // ...but we patch it to use /etc/chromium -+ base::FilePath dir_exe = base::FilePath("/etc/chromium"); - +- ++ dir_exe = base::FilePath("/etc/chromium"); return installer::InitialPreferences::Path(dir_exe); } + diff --git a/chromium-119-norar.patch b/chromium-norar.patch similarity index 32% rename from chromium-119-norar.patch rename to chromium-norar.patch index 51b715501fd48f971969d961cf297af12ba863a7..1b25f5d777c95561eb037c0231ea5ca00280a86a 100644 --- a/chromium-119-norar.patch +++ b/chromium-norar.patch @@ -1,7 +1,7 @@ -diff -up chromium-119.0.6045.105/chrome/browser/safe_browsing/download_protection/file_analyzer.cc.nounrar chromium-119.0.6045.105/chrome/browser/safe_browsing/download_protection/file_analyzer.cc ---- chromium-119.0.6045.105/chrome/browser/safe_browsing/download_protection/file_analyzer.cc.nounrar 2023-11-01 19:10:13.000000000 +0100 -+++ chromium-119.0.6045.105/chrome/browser/safe_browsing/download_protection/file_analyzer.cc 2023-11-06 17:16:55.630255973 +0100 -@@ -77,8 +77,6 @@ void FileAnalyzer::Start(const base::Fil +diff -up chromium-122.0.6261.29/chrome/browser/safe_browsing/download_protection/file_analyzer.cc.nounrar chromium-122.0.6261.29/chrome/browser/safe_browsing/download_protection/file_analyzer.cc +--- chromium-122.0.6261.29/chrome/browser/safe_browsing/download_protection/file_analyzer.cc.nounrar 2024-02-07 19:49:25.000000000 +0100 ++++ chromium-122.0.6261.29/chrome/browser/safe_browsing/download_protection/file_analyzer.cc 2024-02-11 18:55:29.964450604 +0100 +@@ -79,8 +79,6 @@ void FileAnalyzer::Start(const base::Fil if (inspection_type == DownloadFileType::ZIP) { StartExtractZipFeatures(); @@ -10,9 +10,9 @@ diff -up chromium-119.0.6045.105/chrome/browser/safe_browsing/download_protectio #if BUILDFLAG(IS_MAC) } else if (inspection_type == DownloadFileType::DMG) { StartExtractDmgFeatures(); -diff -up chromium-119.0.6045.105/chrome/common/safe_browsing/BUILD.gn.nounrar chromium-119.0.6045.105/chrome/common/safe_browsing/BUILD.gn ---- chromium-119.0.6045.105/chrome/common/safe_browsing/BUILD.gn.nounrar 2023-11-01 19:10:16.000000000 +0100 -+++ chromium-119.0.6045.105/chrome/common/safe_browsing/BUILD.gn 2023-11-06 17:16:55.630255973 +0100 +diff -up chromium-122.0.6261.29/chrome/common/safe_browsing/BUILD.gn.nounrar chromium-122.0.6261.29/chrome/common/safe_browsing/BUILD.gn +--- chromium-122.0.6261.29/chrome/common/safe_browsing/BUILD.gn.nounrar 2024-02-07 19:49:27.000000000 +0100 ++++ chromium-122.0.6261.29/chrome/common/safe_browsing/BUILD.gn 2024-02-11 18:55:29.965450629 +0100 @@ -143,7 +143,6 @@ source_set("safe_browsing") { "//components/safe_browsing/content/common:file_type_policies", "//components/safe_browsing/core/common", @@ -21,11 +21,11 @@ diff -up chromium-119.0.6045.105/chrome/common/safe_browsing/BUILD.gn.nounrar ch ] public_deps = [ -diff -up chromium-119.0.6045.105/chrome/services/file_util/safe_archive_analyzer.cc.nounrar chromium-119.0.6045.105/chrome/services/file_util/safe_archive_analyzer.cc ---- chromium-119.0.6045.105/chrome/services/file_util/safe_archive_analyzer.cc.nounrar 2023-11-06 18:07:30.549291823 +0100 -+++ chromium-119.0.6045.105/chrome/services/file_util/safe_archive_analyzer.cc 2023-11-06 18:08:00.510076945 +0100 +diff -up chromium-122.0.6261.29/chrome/services/file_util/safe_archive_analyzer.cc.nounrar chromium-122.0.6261.29/chrome/services/file_util/safe_archive_analyzer.cc +--- chromium-122.0.6261.29/chrome/services/file_util/safe_archive_analyzer.cc.nounrar 2024-02-07 19:49:27.000000000 +0100 ++++ chromium-122.0.6261.29/chrome/services/file_util/safe_archive_analyzer.cc 2024-02-11 23:49:25.061324007 +0100 @@ -74,6 +74,7 @@ void SafeArchiveAnalyzer::AnalyzeRarFile - const absl::optional& password, + const std::optional& password, mojo::PendingRemote temp_file_getter, AnalyzeRarFileCallback callback) { +#if 0 @@ -42,10 +42,10 @@ diff -up chromium-119.0.6045.105/chrome/services/file_util/safe_archive_analyzer } void SafeArchiveAnalyzer::AnalyzeSevenZipFile( -diff -up chromium-119.0.6045.105/chrome/services/file_util/safe_archive_analyzer.h.nounrar chromium-119.0.6045.105/chrome/services/file_util/safe_archive_analyzer.h ---- chromium-119.0.6045.105/chrome/services/file_util/safe_archive_analyzer.h.nounrar 2023-11-01 19:10:16.000000000 +0100 -+++ chromium-119.0.6045.105/chrome/services/file_util/safe_archive_analyzer.h 2023-11-06 17:16:55.630255973 +0100 -@@ -7,7 +7,6 @@ +diff -up chromium-122.0.6261.29/chrome/services/file_util/safe_archive_analyzer.h.nounrar chromium-122.0.6261.29/chrome/services/file_util/safe_archive_analyzer.h +--- chromium-122.0.6261.29/chrome/services/file_util/safe_archive_analyzer.h.nounrar 2024-02-07 19:49:27.000000000 +0100 ++++ chromium-122.0.6261.29/chrome/services/file_util/safe_archive_analyzer.h 2024-02-11 18:55:29.966450653 +0100 +@@ -9,7 +9,6 @@ #include "chrome/common/safe_browsing/archive_analyzer_results.h" #include "chrome/services/file_util/public/mojom/safe_archive_analyzer.mojom.h" @@ -53,7 +53,7 @@ diff -up chromium-119.0.6045.105/chrome/services/file_util/safe_archive_analyzer #include "chrome/utility/safe_browsing/seven_zip_analyzer.h" #include "chrome/utility/safe_browsing/zip_analyzer.h" #include "mojo/public/cpp/bindings/remote.h" -@@ -66,7 +65,6 @@ class SafeArchiveAnalyzer : public chrom +@@ -67,7 +66,6 @@ class SafeArchiveAnalyzer : public chrom void Timeout(); safe_browsing::ZipAnalyzer zip_analyzer_; @@ -61,3 +61,47 @@ diff -up chromium-119.0.6045.105/chrome/services/file_util/safe_archive_analyzer safe_browsing::SevenZipAnalyzer seven_zip_analyzer_; #if BUILDFLAG(IS_MAC) safe_browsing::dmg::DMGAnalyzer dmg_analyzer_; +Index: chromium-118.0.5993.18/chrome/utility/safe_browsing/BUILD.gn +=================================================================== +--- chromium-118.0.5993.18.orig/chrome/utility/safe_browsing/BUILD.gn ++++ chromium-118.0.5993.18/chrome/utility/safe_browsing/BUILD.gn +@@ -31,8 +31,6 @@ source_set("safe_browsing") { + sources = [ + "archive_analyzer.cc", + "archive_analyzer.h", +- "rar_analyzer.cc", +- "rar_analyzer.h", + "seven_zip_analyzer.cc", + "seven_zip_analyzer.h", + "zip_analyzer.cc", +@@ -55,7 +53,6 @@ source_set("safe_browsing") { + "//components/safe_browsing/content/common:file_type_policies", + "//components/safe_browsing/core/common", + "//third_party/lzma_sdk/google:seven_zip_reader", +- "//third_party/unrar:unrar", + "//third_party/zlib", + ] + +Index: chromium-118.0.5993.18/chrome/utility/safe_browsing/archive_analyzer.cc +=================================================================== +--- chromium-118.0.5993.18.orig/chrome/utility/safe_browsing/archive_analyzer.cc ++++ chromium-118.0.5993.18/chrome/utility/safe_browsing/archive_analyzer.cc +@@ -8,7 +8,6 @@ + #include "build/build_config.h" + #include "build/buildflag.h" + #include "chrome/common/safe_browsing/archive_analyzer_results.h" +-#include "chrome/utility/safe_browsing/rar_analyzer.h" + #include "chrome/utility/safe_browsing/seven_zip_analyzer.h" + #include "chrome/utility/safe_browsing/zip_analyzer.h" + #include "components/safe_browsing/content/common/proto/download_file_types.pb.h" +@@ -23,9 +22,7 @@ namespace safe_browsing { + // static + std::unique_ptr ArchiveAnalyzer::CreateForArchiveType( + DownloadFileType_InspectionType file_type) { +- if (file_type == DownloadFileType::RAR) { +- return std::make_unique(); +- } else if (file_type == DownloadFileType::ZIP) { ++ if (file_type == DownloadFileType::ZIP) { + return std::make_unique(); + } else if (file_type == DownloadFileType::SEVEN_ZIP) { + return std::make_unique(); diff --git a/chromium-107-proprietary-codecs.patch b/chromium-prop-codecs.patch similarity index 63% rename from chromium-107-proprietary-codecs.patch rename to chromium-prop-codecs.patch index 94b95b6e2ac9d76becac848ffbef29286f846181..09e2119810c94eba3733d16b787b0f2d09e54a1a 100644 --- a/chromium-107-proprietary-codecs.patch +++ b/chromium-prop-codecs.patch @@ -1,6 +1,7 @@ -diff -up chromium-107.0.5304.121/media/BUILD.gn.me chromium-107.0.5304.121/media/BUILD.gn ---- chromium-107.0.5304.121/media/BUILD.gn.me 2022-12-17 12:35:44.546779129 +0100 -+++ chromium-107.0.5304.121/media/BUILD.gn 2022-12-17 12:35:59.296047028 +0100 +Index: chromium-106.0.5249.91/media/BUILD.gn +=================================================================== +--- chromium-106.0.5249.91.orig/media/BUILD.gn ++++ chromium-106.0.5249.91/media/BUILD.gn @@ -64,12 +64,6 @@ buildflag_header("media_buildflags") { } } diff --git a/chromium-symbolic.svg b/chromium-symbolic.svg new file mode 100644 index 0000000000000000000000000000000000000000..1b47e0075829e5a6ec4311f86a51d29af72e70ab --- /dev/null +++ b/chromium-symbolic.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chromium.conf b/chromium.conf deleted file mode 100644 index b30a512e47894c53f06bb8c5dc2927da4b7b0da5..0000000000000000000000000000000000000000 --- a/chromium.conf +++ /dev/null @@ -1,3 +0,0 @@ -# system wide chromium flags -CHROMIUM_FLAGS="" -CHROMIUM_FLAGS+=" --enable-features=VaapiVideoEncoder,VaapiVideoDecodeLinuxGL" diff --git a/chromium.spec b/chromium.spec index abc3d6f92b90e602627ce5feabaa79191588d9b5..751c2a0e81e7490ea51bc1fc955a0b0aad2c55d1 100644 --- a/chromium.spec +++ b/chromium.spec @@ -1,653 +1,308 @@ -%define _lto_cflags %{nil} -# enable | disable system build flags -# official builds have less debugging and go faster... but we have to shut some things off. -%global official_build 1 -%global enable_thin_lto 0 -# enable | disable bootstrap -# If this is 1, we enable bootstrap -%global bootstrap 0 -%global esbuild 1 -%global esbuild_version 0.19.11 - - -# set default numjobs for the koji build -%global numjobs %{_smp_build_ncpus} - -# Fancy build status, so we at least know, where we are.. -# %1 where -# %2 what -%global build_target() \ - export NINJA_STATUS="[%2:%f/%t] " ; \ - ninja -v -j %{numjobs} -C '%1' '%2' -# enable | disable headless client build -%global build_headless 1 -# enable|disable chrome-remote-desktop build -%global build_remoting 0 -%global system_nodejs 1 - -# enable | disable system brotli -# disable system brotli due to old system brotli -%global bundlebrotli 1 -# Chromium's fork of ICU is now something we can't unbundle. -# This is left here to ease the change if that ever switches. -%global bundleicu 1 -%global bundlere2 1 - -# The libxml_utils code depends on the specific bundled libxml checkout -# which is not compatible with the current code in the -# 2017-06-08. -%global bundlelibxml 0 -# openEuler's Python 2 stack is being removed, we use the bundled Python libraries -# This can be revisited once we upgrade to Python 3 -%global bundlepylibs 0 -%global bundlezlib 1 -%global use_qt 1 -# enable gtk3 by default -%global gtk3 1 - -%global bundleopus 1 -%global bundlelibusbx 1 -%global bundleharfbuzz 1 -%global bundlelibwebp 1 -%global bundlelibpng 1 -%global bundlelibjpeg 1 -%global bundlefreetype 1 -%global bundlelibdrm 1 -%global bundlefontconfig 1 -%global bundleffmpegfree 0 -%global bundlelibaom 1 -%global bundlevpx 1 -%global bundlezstd 0 - -%global use_vaapi 1 -%global use_v4l2_codec 0 -%global disable_bti 0 -%global enable_swiftshader 0 -# enable v4l2 and disable vaapi for aarch64 platform -%ifarch aarch64 -%global use_vaapi 0 -%global use_v4l2_codec 1 -%global optflags %(echo %{optflags} | sed 's/-mbranch-protection=standard /-mbranch-protection=pac-ret /') -# Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=2239523 -# Disable BTI until this is fixed upstream. -%global disable_bti 1 -%endif - -%ifarch riscv64 -%global use_vaapi 0 -%global bundlevpx 0 -%endif - -%global python312 0 -# Seems like we might need this sometimes -# Practically, no. But it's here in case we do. -%global use_gold 0 -%global build_clear_key_cdm 0 -# Disabled because of Google, starting with Chromium 88. -%global userestrictedapikeys 0 -# openEuer does not currently provide an official Google API key. -%global useapikey 0 - -# Leave this alone, please. -%global builddir out/Release -%global headlessbuilddir out/Headless -%global remotingbuilddir out/Remoting - -# enable|disable debuginfo -%global enable_debug 0 -%if ! %{enable_debug} -%global debug_package %{nil} -%global debug_level 0 -%else -%global debug_level 1 -# workaround for the error empty file debugsource -%undefine _debugsource_packages -%endif - -# %%{nil} for Stable; -beta for Beta; -dev for Devel -# dash in -beta and -dev is intentional ! -%global chromium_channel %{nil} -%global chromium_menu_name Chromium -%global chromium_browser_channel chromium-browser%{chromium_channel} -%global chromium_path %{_libdir}/chromium-browser%{chromium_channel} -%global crd_path %{_libdir}/chrome-remote-desktop - -%global __provides_exclude_from ^(%{chromium_path}/.*\\.so|%{chromium_path}/.*\\.so.*)$ -%global __requires_exclude ^(%{chromium_path}/.*\\.so|%{chromium_path}/.*\\.so.*)$ - -# enable clang by default -%global clang 1 -# set correct toolchain -%if %{clang} -%global toolchain clang -%else -%global toolchain gcc -%endif - +# No API key! +%global api_key %nil +%define outputdir out +%define __provides_exclude ^lib.*\\.so.*$ -### Google API keys (see http://www.chromium.org/developers/how-tos/api-keys) -# Currently we do not provide API key unless somebody need this -%if %{useapikey} -%global api_key %nil -%else -%global api_key %nil -%endif -%global default_client_id %nil -%global default_client_secret %nil -%global chromoting_client_id %nil +%bcond_without clang +%bcond_with lto +%bcond_with gtk4 +%bcond_without qt +%ifarch x86_64 +%bcond_without swiftshader +%endif +%bcond_with system_harfbuzz +%bcond_with system_freetype +%bcond_with arm_bti +%bcond_with system_icu +%bcond_without pipewire +%bcond_without system_ffmpeg +%bcond_with system_zlib +%bcond_with system_vpx +%bcond_with system_avif +%bcond_with system_re2 +%bcond_with system_webp +%bcond_with system_zstd + +# Enable esbuild +%global esbuild 1 +# When will gn fix this? +# https://bugs.chromium.org/p/gn/issues/detail?id=360 +%global bootstrap 0 -Name: chromium%{chromium_channel} -Version: 119.0.6045.159 +Name: chromium +Version: 125.0.6422.141 Release: 1 Summary: A WebKit (Blink) powered web browser. Url: http://www.chromium.org/Home -License: BSD-3-Clause AND LGPL-2.1-or-later AND Apache-2.0 AND IJG AND MIT AND GPL-2.0-or-later AND ISC AND OpenSSL AND (MPL-1.1 OR GPL-2.0-only OR LGPL-2.0-only) - -### Chromium Patches ### -Patch0: chromium-70.0.3538.67-sandbox-pie.patch -# Use /etc/chromium for initial_prefs -Patch1: chromium-115-initial_prefs-etc-path.patch -# system libusb -Patch2: chromium-119-system-libusb.patch -# Do not mangle zlib -Patch5: chromium-77.0.3865.75-no-zlib-mangle.patch -# Do not use unrar code, it is non-free -Patch6: chromium-119-norar.patch -# Try to load widevine from other places -Patch8: chromium-117-widevine-other-locations.patch -# Tell bootstrap.py to always use the version of Python we specify -Patch11: chromium-93.0.4577.63-py3-bootstrap.patch -# debian patch, disable font-test -Patch20: chromium-disable-font-tests.patch -# https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/files/chromium-unbundle-zlib.patch -Patch52: chromium-81.0.4044.92-unbundle-zlib.patch -# Fix headers to look for system paths when we are using system minizip -Patch61: chromium-119-system-minizip-header-fix.patch -# Fix issue where closure_compiler thinks java is only allowed in android builds -# https://bugs.chromium.org/p/chromium/issues/detail?id=1192875 -Patch65: chromium-91.0.4472.77-java-only-allowed-in-android-builds.patch -# Update rjsmin to 1.2.0 -Patch69: chromium-103.0.5060.53-update-rjsmin-to-1.2.0.patch -# Update six to 1.16.0 -Patch70: chromium-105.0.5195.52-python-six-1.16.0.patch -# Disable tests on remoting build -Patch82: chromium-98.0.4758.102-remoting-no-tests.patch -# patch for using system brotli -Patch89: chromium-116-system-brotli.patch -# disable GlobalMediaControlsCastStartStop to avoid crash -# when using the address bar media player button -Patch90: chromium-119-disable-GlobalMediaControlsCastStartStop.patch -# patch for using system opus -Patch91: chromium-108-system-opus.patch - -# need for old ffmpeg 5.x -Patch114: chromium-107-ffmpeg-5.x-duration.patch -# disable the check -Patch115: chromium-107-proprietary-codecs.patch -# drop av_stream_get_first_dts from internal ffmpeg -Patch116: chromium-119-ffmpeg-first_dts.patch -# fix tab crash with SIGTRAP error when using system ffmpeg -Patch117: chromium-118-sigtrap_system_ffmpeg.patch -# https://bugs.chromium.org/p/chromium/issues/detail?id=1325301 -# https://www.mail-archive.com/ffmpeg-devel@ffmpeg.org/msg121495.html - -# revert AV1 VAAPI video encode due to old libva on el9 -Patch130: chromium-119-revert-av1enc-el9.patch -# file conflict with old kernel on el8/el9 -Patch140: chromium-118-dma_buf_export_sync_file-conflict.patch - -Patch200: chromium-117-system-zstd.patch -# fixes for old clang version -# compiler build errors, no matching constructor for initialization -Patch300: chromium-119-no_matching_constructor.patch -Patch301: chromium-115-compiler-SkColor4f.patch -# workaround for clang bug, https://github.com/llvm/llvm-project/issues/57826 -Patch302: chromium-118-workaround_clang_bug-structured_binding.patch -# missing typename -Patch303: chromium-117-typename.patch -# error: invalid operands to binary expression -Patch304: chromium-117-string-convert.patch -# error: constexpr constructor's 3rd parameter type 'std::string' (aka 'basic_string') is not a literal type -Patch305: chromium-119-constexpr.patch -Patch306: chromium-119-assert.patch -# not supported in old glibc < 2.30, error: fatal error: 'sys/ifunc.h' file not found -Patch307: chromium-118-arm64-memory_tagging.patch -# missing include header files -Patch310: chromium-119-missing-header-files.patch -# clang warnings -Patch311: chromium-115-clang-warnings.patch -# imp module is removed in python-3.12 -Patch312: chromium-118-python-3.12-deprecated.patch -# build error -Patch351: chromium-117-mnemonic-error.patch -# Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=2239523 -# https://bugs.chromium.org/p/chromium/issues/detail?id=1145581#c60 -# Disable BTI until this is fixed upstream. -Patch352: chromium-117-workaround_for_crash_on_BTI_capable_system.patch -# upstream patches -Patch400: chromium-119-dont-redefine-ATSPI-version-macros.patch -# fix build error, nullptr_t without namespace std:: -Patch401: chromium-119-nullptr_t-without-namespace-std.patch -# workaround for buggy Nvidia drivers fail to return FDs for planes -# of a BO which had already an imported BO destroyed before. -Patch402: chromium-119-nvidia-use-separate-bo-to-verify-modifier.patch -# hide UseChromeOSDirectVideoDecoder flag on VA-API devices to avoid crashes -Patch403: chromium-119-hide-UseChromeOSDirectVideoDecoder-flag-on-VA-API-devices.patch - -Patch404: fix-headers-ldflags.patch - -Patch500: chromium-icu72-2.patch - -# RISC-V Support -Patch1001: riscv-base.patch -Patch1002: riscv-build.patch -Patch1003: riscv-sandbox.patch -Patch1004: riscv-angle.patch -Patch1005: riscv-dav1d.patch -Patch1006: riscv-swiftshader.patch - +License: BSD-3-Clause AND LGPL-2.1-or-later # Use chromium-latest.py to generate clean tarball from released build tarballs, found here: # https://commondatastorage.googleapis.com/chromium-browser-official/chromium-%%{version}.tar.xz Source0: chromium-%{version}.tar.xz -Source2: chromium.conf -Source3: chromium-browser.sh -Source4: %{chromium_browser_channel}.desktop -Source5: chromium-browser.xml -Source6: chrome-remote-desktop@.service -Source7: master_preferences +Source1: master_preferences +Source2: chrome-wrapper +Source3: chromium-symbolic.svg +Source4: INSTALL.sh # esbuild binary %if 0%{?esbuild} -Source101: https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-%{esbuild_version}.tgz -Source102: https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-%{esbuild_version}.tgz -Source103: https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-%{esbuild_version}.tgz +Source101: esbuild.tar.gz %endif - -%if %{clang} -BuildRequires: clang -BuildRequires: clang-tools-extra -BuildRequires: llvm -BuildRequires: lld -%else -BuildRequires: gcc-c++ -BuildRequires: gcc -BuildRequires: binutils -%endif - -BuildRequires: libicu-devel -# build with system ffmpeg-free -%if ! %{bundleffmpegfree} -BuildRequires: pkgconfig(libavcodec) -BuildRequires: pkgconfig(libavfilter) -BuildRequires: pkgconfig(libavformat) -BuildRequires: pkgconfig(libavutil) -BuildRequires: ffmpeg-devel -%endif - -# build with system libaom -%if ! %{bundlelibaom} -BuildRequires: libaom-devel -%endif - -BuildRequires: alsa-lib-devel -BuildRequires: atk-devel -BuildRequires: bison -BuildRequires: cups-devel -BuildRequires: dbus-devel -BuildRequires: desktop-file-utils -BuildRequires: expat-devel -BuildRequires: flex -BuildRequires: fontconfig-devel -BuildRequires: glib2-devel -BuildRequires: glibc-devel -BuildRequires: gperf -BuildRequires: snappy-devel -BuildRequires: pkgconfig(dri) -BuildRequires: pkgconfig(epoxy) - -%if %{use_qt} -BuildRequires: pkgconfig(Qt5Core) -BuildRequires: pkgconfig(Qt5Widgets) -%endif - -%if ! %{bundleharfbuzz} -BuildRequires: harfbuzz-devel >= 2.4.0 -%endif - -BuildRequires: libatomic -BuildRequires: libcap-devel -BuildRequires: libcurl-devel - -%if ! %{bundlelibdrm} -BuildRequires: libdrm-devel -%endif - -BuildRequires: libgcrypt-devel -BuildRequires: libudev-devel -BuildRequires: libuuid-devel -BuildRequires: libusb-devel -BuildRequires: libutempter-devel -BuildRequires: libXdamage-devel -BuildRequires: libXtst-devel -BuildRequires: xcb-proto -BuildRequires: mesa-libgbm-devel - -%if ! %{bundlezlib} -BuildRequires: pkgconfig(zlib) minizip-ng-devel -%endif - -%if %{system_nodejs} -BuildRequires: nodejs -%endif - -%if ! %{bootstrap} -BuildRequires: gn -%endif - -BuildRequires: nss-devel >= 3.26 -BuildRequires: pciutils-devel -BuildRequires: pulseaudio-libs-devel - -# For screen sharing on Wayland -BuildRequires: pkgconfig(libpipewire-0.3) -# for /usr/bin/appstream-util -BuildRequires: libappstream-glib - -%if %{bootstrap} -# gn needs these -BuildRequires: libstdc++-static +Patch0: chromium-libusb_interrupt_event_handler.patch +Patch2: chromium-master-prefs-path.patch +Patch3: fix_building_widevinecdm_with_chromium.patch +Patch6: gcc-enable-lto.patch +# Do not use unrar code, it is non-free +Patch7: chromium-norar.patch +Patch9: system-libdrm.patch +Patch10: chromium-disable-parallel-gold.patch +# other distro patchset +Patch15: chromium-125-compiler.patch +Patch40: chromium-91-java-only-allowed-in-android-builds.patch +Patch62: chromium-93-ffmpeg-4.4.patch +#Patch68: chromium-94-ffmpeg-roll.patch +Patch98: chromium-102-regex_pattern-array.patch +Patch202: chromium-prop-codecs.patch +Patch203: chromium-106-ffmpeg-duration.patch +Patch205: chromium-disable-GlobalMediaControlsCastStartStop.patch +Patch224: chromium-115-compiler-SkColor4f.patch +Patch240: chromium-117-string-convert.patch +Patch244: chromium-117-system-zstd.patch +Patch248: chromium-119-assert.patch +Patch250: chromium-120-emplace.patch +Patch254: chromium-125-emplace-struct.patch +Patch256: chromium-120-make_unique-struct.patch +Patch258: chromium-121-nullptr_t-without-namespace-std.patch +Patch261: chromium-121-rust-clang_lib.patch +Patch311: chromium-125-disable-FFmpegAllowLists.patch +Patch316: chromium-125-missing-header-files.patch +Patch317: chromium-125-no_matching_constructor.patch +Patch322: chromium-125-lp155-typename.patch +Patch324: chromium-122-workaround_clang_bug-structured_binding.patch +Patch326: chromium-123-stats-collector.patch +# error: no matching constructor for initialization of 'XMLDocumentParserScope' +# Please enable this patch if you build on openEuler version smaller than 24.03 +#Patch336: chromium-124-system-libxml.patch +Patch337: chromium-123-missing-QtGui.patch +Patch340: chromium-125-appservice-include.patch +Patch341: chromium-125-lens-include.patch +Patch342: chromium-125-mojo-bindings-include.patch +Patch343: chromium-125-no-vector-consts.patch +Patch345: chromium-125-vulkan-include.patch +Patch346: chromium-125-tabstrip-include.patch +Patch347: chromium-125-ninja.patch +Patch350: chromium-125-debian-bad-font-gc0000.patch +Patch351: chromium-125-debian-bad-font-gc000.patch +Patch352: chromium-125-debian-bad-font-gc00.patch +Patch353: chromium-125-debian-bad-font-gc0.patch +Patch354: chromium-125-debian-bad-font-gc11.patch +Patch355: chromium-125-debian-bad-font-gc1.patch +Patch356: chromium-125-debian-bad-font-gc2.patch +Patch357: chromium-125-debian-bad-font-gc3.patch + +# error: unknown type name 'size_t' +Patch358: chromium-124-size_t.patch +# webui_contents_wrapper.h:189:9: error: static assertion expression is not an integral constant expression +Patch359: chromium-125-assert.patch + +# Disable swiftshader on aarch64 +# ld.lld: error: undefined symbol: llvm::MCSymbolizer::~MCSymbolizer() +# >>> referenced by AArch64ExternalSymbolizer.cpp +# >>> obj/third_party/swiftshader/third_party/llvm-16.0/swiftshader_llvm_aarch64/AArch64ExternalSymbolizer.o:(llvm::AArch64ExternalSymbolizer::~AArch64ExternalSymbolizer()) +# >>> referenced by AArch64ExternalSymbolizer.cpp +# >>> obj/third_party/swiftshader/third_party/llvm-16.0/swiftshader_llvm_aarch64/AArch64ExternalSymbolizer.o:(vtable for llvm::AArch64ExternalSymbolizer) +# +# ld.lld: error: undefined symbol: llvm::MCExternalSymbolizer::tryAddingPcLoadReferenceComment(llvm::raw_ostream&, long, unsigned long) +# >>> referenced by AArch64ExternalSymbolizer.cpp +# >>> obj/third_party/swiftshader/third_party/llvm-16.0/swiftshader_llvm_aarch64/AArch64ExternalSymbolizer.o:(vtable for llvm::AArch64ExternalSymbolizer) +%ifarch aarch64 +Patch360: swiftshader.patch +Patch361: swiftshader-2.patch %endif -# Tries to use system libs whenever it can. -BuildRequires: bzip2-devel -BuildRequires: dbus-glib-devel -# For eu-strip +# RISC-V Support +Patch1000: riscv-build.patch +Patch1001: riscv-sandbox.patch +Patch1002: riscv-dav1d.patch +Patch1003: riscv-swiftshader.patch +Patch1005: riscv-cpuinfo.patch + +BuildRequires: SDL-devel +BuildRequires: bison +BuildRequires: cups-devel +BuildRequires: desktop-file-utils BuildRequires: elfutils -BuildRequires: elfutils-libelf-devel -BuildRequires: flac-devel -BuildRequires: pkgconfig(libexif) - +BuildRequires: flex +BuildRequires: git +%if ! %{bootstrap} +BuildRequires: gn +%else +BuildRequires: libstdc++-static +%endif +BuildRequires: gperf +BuildRequires: hicolor-icon-theme +BuildRequires: golang +# Java used during build +BuildRequires: java-17-openjdk-headless +BuildRequires: libcap-devel +BuildRequires: libgcrypt-devel +BuildRequires: gsm-devel +BuildRequires: libjpeg-turbo-devel +BuildRequires: libpng-devel +BuildRequires: nasm +BuildRequires: ncurses-devel +BuildRequires: ninja-build >= 1.7.2 +BuildRequires: nodejs >= 8.0 +BuildRequires: pam-devel +BuildRequires: pkgconfig +BuildRequires: python3 +BuildRequires: python3-setuptools +BuildRequires: python3-six +BuildRequires: snappy-devel +BuildRequires: util-linux +BuildRequires: perl(Switch) +BuildRequires: pkgconfig(alsa) +BuildRequires: pkgconfig(bzip2) +BuildRequires: pkgconfig(cairo) >= 1.6 +BuildRequires: pkgconfig(dbus-1) +BuildRequires: pkgconfig(dri) +BuildRequires: pkgconfig(expat) BuildRequires: pkgconfig(flac++) +BuildRequires: pkgconfig(gbm) +BuildRequires: pkgconfig(glib-2.0) +BuildRequires: pkgconfig(hunspell) +BuildRequires: pkgconfig(imlib2) +BuildRequires: pkgconfig(jack) +BuildRequires: pkgconfig(kadm-client) +BuildRequires: pkgconfig(kdb) +BuildRequires: pkgconfig(krb5) +BuildRequires: pkgconfig(libcrypto) +BuildRequires: pkgconfig(libcurl) +BuildRequires: pkgconfig(libdrm) +BuildRequires: pkgconfig(libelf) +BuildRequires: pkgconfig(libevdev) +BuildRequires: pkgconfig(libevent) +BuildRequires: pkgconfig(libexif) +BuildRequires: pkgconfig(libffi) +BuildRequires: pkgconfig(libpci) +BuildRequires: pkgconfig(libpulse) +BuildRequires: pkgconfig(libssl) +BuildRequires: pkgconfig(libudev) +BuildRequires: pkgconfig(libusb-1.0) +BuildRequires: pkgconfig(libva) +%if %{with system_webp} +BuildRequires: pkgconfig(libwebp) >= 0.4.0 +%endif +%if %{with system_zstd} +BuildRequires: pkgconfig(libzstd) +%endif +BuildRequires: pkgconfig(libxml-2.0) >= 2.9.5 +BuildRequires: pkgconfig(libxslt) +BuildRequires: pkgconfig(minizip) +BuildRequires: pkgconfig(nspr) >= 4.9.5 +BuildRequires: pkgconfig(nss) >= 3.26 +BuildRequires: pkgconfig(ogg) +BuildRequires: pkgconfig(openssl) +BuildRequires: pkgconfig(opus) >= 1.3.1 +BuildRequires: pkgconfig(python3) BuildRequires: pkgconfig(slang) -BuildRequires: pkgconfig(theora) BuildRequires: pkgconfig(sqlite3) - -%if ! %{bundlefreetype} -BuildRequires: freetype-devel -%endif -BuildRequires: git -BuildRequires: hwdata -BuildRequires: kernel-headers -BuildRequires: libevent-devel -BuildRequires: libffi-devel -BuildRequires: fdupes - -%if ! %{bundlelibjpeg} -BuildRequires: libjpeg-devel -%endif - -%if ! %{bundlelibpng} -BuildRequires: libpng-devel -%endif - -BuildRequires: libudev-devel -%if ! %{bundlelibusbx} -Requires: libusbx >= 1.0.21-0.1.git448584a -BuildRequires: libusbx-devel >= 1.0.21-0.1.git448584a -%endif -%if %{use_vaapi} -BuildRequires: libva-devel -%endif - -%if ! %{bundlelibwebp} -BuildRequires: libwebp-devel -%endif - -%if ! %{bundlezstd} -BuildRequires: pkgconfig(libzstd) -%endif - -BuildRequires: libxslt-devel -BuildRequires: libxshmfence-devel - -BuildRequires: mesa-libGL-devel - -%if ! %{bundleopus} -BuildRequires: opus-devel -%endif - -BuildRequires: perl(Switch) -BuildRequires: python3 -BuildRequires: pkgconfig(gtk+-3.0) -BuildRequires: python3-devel -BuildRequires: python3-zipp -BuildRequires: python3-simplejson -BuildRequires: python3-importlib-metadata -BuildRequires: python3-six - -%if ! %{bundlepylibs} -BuildRequires: python3-beautifulsoup4 -BuildRequires: python3-html5lib -BuildRequires: python3-markupsafe -BuildRequires: python3-ply -BuildRequires: python3-jinja2 -%endif - -%if ! %{bundlere2} -Requires: re2 >= 20160401 -BuildRequires: re2-devel >= 20160401 -%endif - -%if ! %{bundlebrotli} -BuildRequires: brotli-devel -%endif - -BuildRequires: speech-dispatcher-devel -BuildRequires: yasm -BuildRequires: zlib-devel - -# remote desktop needs this -BuildRequires: pam-devel -BuildRequires: systemd - -# using the built from source version on aarch64 -BuildRequires: ninja-build - -# Yes, java is needed as well.. -%if %{build_headless} -BuildRequires: java-17-openjdk-headless -%endif - -BuildRequires: libevdev-devel - -BuildRequires: procps-ng - -# There is a hardcoded check for nss 3.26 in the chromium code (crypto/nss_util.cc) -Requires: nss%{_isa} >= 3.26 -Requires: nss-mdns%{_isa} - -# GTK modules it expects to find for some reason. -%if %{gtk3} -Requires: libcanberra-gtk3%{_isa} +BuildRequires: pkgconfig(theora) >= 1.1 +BuildRequires: pkgconfig(vdpau) +BuildRequires: pkgconfig(vorbis) +BuildRequires: pkgconfig(wayland-client) +BuildRequires: pkgconfig(wayland-cursor) +BuildRequires: pkgconfig(wayland-scanner) +BuildRequires: pkgconfig(wayland-server) +BuildRequires: pkgconfig(x11) +BuildRequires: pkgconfig(xcb-dri3) +BuildRequires: pkgconfig(xcb-proto) +BuildRequires: pkgconfig(xcomposite) +BuildRequires: pkgconfig(xcursor) +BuildRequires: pkgconfig(xdamage) +BuildRequires: pkgconfig(xext) +BuildRequires: pkgconfig(xfixes) +BuildRequires: pkgconfig(xi) +BuildRequires: pkgconfig(xkbcommon) >= 1.0.0 +BuildRequires: pkgconfig(xrandr) +BuildRequires: pkgconfig(xrender) +BuildRequires: pkgconfig(xscrnsaver) +BuildRequires: pkgconfig(xshmfence) +BuildRequires: pkgconfig(xt) +BuildRequires: pkgconfig(xtst) +BuildRequires: cargo +BuildRequires: rust +Requires: xdg-utils +Recommends: google-noto-emoji-fonts + +Conflicts: chromium-browser +Provides: %{name}-suid-helper = %{version} +Provides: chromium-browser = %{version} +Obsoletes: %{name}-suid-helper < %{version} +Obsoletes: chromium-browser < %{version} + +ExclusiveArch: x86_64 aarch64 riscv64 + +%if %{with pipewire} +BuildRequires: pkgconfig(libpipewire-0.3) +BuildRequires: pkgconfig(libspa-0.2) +%endif +%if %{with system_harfbuzz} +BuildRequires: pkgconfig(harfbuzz) > 2.3.0 +%endif +%if %{with system_icu} +BuildRequires: pkgconfig(icu-i18n) >= 67.0 +%endif +%if %{with system_vpx} +BuildRequires: pkgconfig(vpx) +%endif +%if %{with system_freetype} +BuildRequires: pkgconfig(freetype2) +%endif +%if %{with system_zlib} +BuildRequires: pkgconfig(zlib) +%endif +%if %{with gtk4} +BuildRequires: pkgconfig(atk-bridge-2.0) +BuildRequires: pkgconfig(gtk4) %else -Requires: libcanberra-gtk2%{_isa} -%endif - -# This enables support for u2f tokens -Requires: u2f-hidraw-policy - -Requires: chromium-common%{_isa} = %{version}-%{release} - -ExclusiveArch: x86_64 aarch64 riscv64 - -# Bundled bits (I'm sure I've missed some) -Provides: bundled(angle) = 2422 -Provides: bundled(bintrees) = 1.0.1 -# This is a fork of openssl. -Provides: bundled(boringssl) - -%if %{bundlebrotli} -Provides: bundled(brotli) = 222564a95d9ab58865a096b8d9f7324ea5f2e03e -%endif - -Provides: bundled(bspatch) -Provides: bundled(cacheinvalidation) = 20150720 -Provides: bundled(colorama) = 799604a104 -Provides: bundled(crashpad) -Provides: bundled(dmg_fp) -Provides: bundled(expat) = 2.2.0 -Provides: bundled(fdmlibm) = 5.3 - -# Don't get too excited. MPEG and other legally problematic stuff is stripped out. -%if %{bundleffmpegfree} -Provides: bundled(ffmpeg) = 6.0 -%endif - -%if %{bundlelibaom} -Provides: bundled(libaom) -%endif - -Provides: bundled(fips181) = 2.2.3 - -%if %{bundlefontconfig} -Provides: bundled(fontconfig) = 2.12.6 -%endif - -%if %{bundlefreetype} -Provides: bundled(freetype) = 2.11.0git -%endif - -Provides: bundled(gperftools) = svn144 - -%if %{bundleharfbuzz} -Provides: bundled(harfbuzz) = 2.4.0 -%endif - -Provides: bundled(hunspell) = 1.6.0 -Provides: bundled(iccjpeg) - -%if %{bundleicu} -Provides: bundled(icu) +BuildRequires: pkgconfig(gtk+-3.0) %endif - -Provides: bundled(kitchensink) = 1 -Provides: bundled(leveldb) = 1.20 -Provides: bundled(libaddressinput) = 0 - -%if %{bundlelibdrm} -Provides: bundled(libdrm) = 2.4.85 +%if %{with qt} +BuildRequires: pkgconfig(Qt5Core) +BuildRequires: pkgconfig(Qt5Widgets) %endif - -Provides: bundled(libevent) = 1.4.15 -Provides: bundled(libjingle) = 9564 - -%if %{bundlelibjpeg} -Provides: bundled(libjpeg-turbo) = 1.4.90 +%if %{with system_ffmpeg} +BuildRequires: pkgconfig(libavcodec) +BuildRequires: pkgconfig(libavfilter) +BuildRequires: pkgconfig(libavformat) >= 58 +BuildRequires: pkgconfig(libavutil) %endif - -Provides: bundled(libphonenumber) = a4da30df63a097d67e3c429ead6790ad91d36cf4 - -%if %{bundlelibpng} -Provides: bundled(libpng) = 1.6.22 +%if %{with system_avif} +#BuildRequires: pkgconfig(libavif) +#BuildRequires: pkgconfig(libyuv) %endif - -Provides: bundled(libsrtp) = 2cbd85085037dc7bf2eda48d4cf62e2829056e2d - -%if %{bundlelibusbx} -Provides: bundled(libusbx) = 1.0.17 +%if %{with system_re2} +BuildRequires: pkgconfig(re2) >= 11 %endif - -Provides: bundled(libvpx) = 1.6.0 - -%if %{bundlelibwebp} -Provides: bundled(libwebp) = 0.6.0 +%if %{with clang} +BuildRequires: clang llvm lld +BuildRequires: libstdc++-devel libstdc++-static +BuildRequires: compiler-rt %endif - -%if %{bundlelibxml} -# Well, it's actually newer than 2.9.4 and has code in it that has been reverted upstream... but eh. -Provides: bundled(libxml) = 2.9.4 +%if %{without clang} +BuildRequires: gcc +BuildRequires: gcc-c++ %endif -Provides: bundled(libXNVCtrl) = 302.17 -Provides: bundled(libyuv) = 1651 -Provides: bundled(lzma) = 15.14 -Provides: bundled(libudis86) = 1.7.1 -Provides: bundled(mesa) = 9.0.3 -Provides: bundled(NSBezierPath) = 1.0 -Provides: bundled(mozc) - -%if %{bundleopus} -Provides: bundled(opus) = 1.1.3 -%endif - -Provides: bundled(ots) = 8d70cffebbfa58f67a5c3ed0e9bc84dccdbc5bc0 -Provides: bundled(protobuf) = 3.0.0.beta.3 -Provides: bundled(qcms) = 4 - -%if %{bundlere2} -Provides: bundled(re2) -%endif - -Provides: bundled(sfntly) = 04740d2600193b14aa3ef24cd9fbb3d5996b9f77 -Provides: bundled(skia) -Provides: bundled(SMHasher) = 0 -Provides: bundled(snappy) = 1.1.4-head -Provides: bundled(speech-dispatcher) = 0.7.1 -Provides: bundled(sqlite) = 3.17patched -Provides: bundled(superfasthash) = 0 -Provides: bundled(talloc) = 2.0.1 -Provides: bundled(usrsctp) = 0 -Provides: bundled(v8) = 5.9.211.31 -Provides: bundled(webrtc) = 90usrsctp -Provides: bundled(woff2) = 445f541996fe8376f3976d35692fd2b9a6eedf2d -Provides: bundled(xdg-mime) -Provides: bundled(xdg-user-dirs) -%if %{bundlezlib} -Provides: bundled(zlib) -%endif - -# For selinux scriptlet -Requires(post): /usr/sbin/semanage -Requires(post): /usr/sbin/restorecon - %description Chromium is an open-source web browser, powered by WebKit (Blink). -%package common -Summary: Files needed for both the headless_shell and full Chromium - -# -common doesn't have chrome-remote-desktop bits -# but we need to clean it up if it gets disabled again -# NOTE: Check obsoletes version to be sure it matches -%if ! %{build_remoting} -Provides: chrome-remote-desktop = %{version}-%{release} -Obsoletes: chrome-remote-desktop <= 81.0.4044.138 -%endif - -%description common -%{summary}. - -%if %{build_remoting} -%package -n chrome-remote-desktop -Requires(pre): shadow-utils -Requires(post): systemd -Requires(preun): systemd -Requires(postun): systemd -Requires: xorg-x11-server-Xvfb -Requires: python3-psutil -Requires: chromium-common%{_isa} = %{version}-%{release} -Summary: Remote desktop support for google-chrome & chromium - -%description -n chrome-remote-desktop -Remote desktop support for google-chrome & chromium. -%endif - %package -n chromedriver -Summary: WebDriver for Google Chrome/Chromium -Requires: chromium-common%{_isa} = %{version}-%{release} +Summary: WebDriver for Google Chrome/Chromium +Requires: %{name} = %{version} %description -n chromedriver WebDriver is an open source tool for automated testing of webapps across many @@ -656,149 +311,35 @@ JavaScript execution, and more. ChromeDriver is a standalone server which implements WebDriver's wire protocol for Chromium. It is being developed by members of the Chromium and WebDriver teams. -%package headless -Summary: A minimal headless shell built from Chromium -Requires: chromium-common%{_isa} = %{version}-%{release} - -%description headless -A minimal headless client built from Chromium. headless_shell is built -without support for alsa, cups, dbus, gconf, gio, kerberos, pulseaudio, or -udev. - %prep # download source0 cd %{_sourcedir} rm -f %{SOURCE0} -wget https://user-repo.openeuler.openatom.cn/lfs-tar/chromium/chromium-%{version}.tar.xz +wget -q https://user-repo.openeuler.openatom.cn/lfs-tar/chromium/chromium-%{version}.tar.xz cd - #%{__cat} %{SOURCE101} %{SOURCE102} %{SOURCE103} %{SOURCE104} %{SOURCE105} > %{SOURCE0} %setup -q -n chromium-%{version} -### Chromium Patches ### -%patch -P0 -p1 -b .sandboxpie -%patch -P1 -p1 -b .etc -%patch -P2 -p1 -b .system-libusb -%patch -P5 -p1 -b .nozlibmangle -%patch -P6 -p1 -b .nounrar -%patch -P8 -p1 -b .widevine-other-locations -%patch -P11 -p1 -b .py3 -%patch -P20 -p1 -b .disable-font-test -%if ! %{bundlezlib} -%patch -P52 -p1 -b .unbundle-zlib -%patch -P61 -p1 -b .system-minizip -%endif -%patch -P65 -p1 -b .java-only-allowed -%patch -P69 -p1 -b .update-rjsmin-to-1.2.0 -%patch -P70 -p1 -b .update-six-to-1.16.0 -%patch -P82 -p1 -b .remoting-no-tests -%if ! %{bundlebrotli} -%patch -P89 -p1 -b .system-brotli -%endif -%patch -P90 -p1 -b .disable-GlobalMediaControlsCastStartStop -%if ! %{bundleopus} -%patch -P91 -p1 -b .system-opus -%endif -%if ! %{bundleffmpegfree} -%patch -P114 -p1 -b .ffmpeg-5.x-duration -%patch -P116 -p1 -b .first_dts -%patch -P115 -p1 -b .prop-codecs -%patch -P117 -p1 -b .sigtrap_system_ffmpeg -%endif -%patch -P140 -p1 -b .dma_buf_export_sync_file-conflict -%patch -P130 -p1 -b .revert-av1enc - -%if ! %{bundlezstd} -%patch -P200 -p1 -b .system-zstd -%endif - -%if %{clang} -%patch -P300 -p1 -b .no_matching_constructor -%patch -P301 -p1 -b .workaround_clang-SkColor4f -%patch -P302 -p1 -b .workaround_clang_bug-structured_binding -%patch -P303 -p1 -b .typename -%patch -P304 -p1 -b .string-convert -%patch -P305 -p1 -b .constexpr -%patch -P306 -p1 -b .assert -%endif - -%ifarch aarch64 -%patch -P307 -p1 -b .memory_tagging -%endif - -%patch -P310 -p1 -b .missing-header-files -%patch -P311 -p1 -b .clang-warnings - -%if 0%{?python312} -%patch -P312 -p1 -b .python-3.12-deprecated -%endif - -%patch -P351 -p1 -b .mnemonic-error - -%if %{disable_bti} -%patch -P352 -p1 -b .workaround_for_crash_on_BTI_capable_system -%endif - -%patch -P400 -p1 -R -b .revert-dont-redefine-ATSPI-version-macros -%patch -P401 -p1 -b .nullptr_t-without-namespace-std -%patch -P402 -p1 -b .nvidia-use-separate-bo-to-verify-modifiers -%patch -P403 -p1 -b .UseChromeOSDirectVideoDecoder-flag-on-VA-API-devices -%patch -P404 -p1 -b .fix-headers-ldflags - -%patch -P500 -p1 -b .icu72-2 - -# riscv patch - -%patch -P1001 -p1 -b .riscv-base -%patch -P1002 -p1 -b .riscv-build -%patch -P1003 -p1 -b .riscv-sandbox -%patch -P1004 -p1 -b .riscv-angle -%patch -P1005 -p1 -b .riscv-dav1d -%patch -P1006 -p1 -b .riscv-swiftshader +%autopatch -p1 # Change shebang in all relevant files in this directory and all subdirectories # See `man find` for how the `-exec command {} +` syntax works find -type f \( -iname "*.py" \) -exec sed -i '1s=^#! */usr/bin/\(python\|env python\)[23]\?=#!%{__python3}=' {} + -%if %{bundlelibusbx} -# no hackity hack hack -%else -# hackity hack hack -rm -rf third_party/libusb/src/libusb/libusb.h -# we _shouldn't need to do this, but it looks like we do. -cp -a %{_includedir}/libusb-1.0/libusb.h third_party/libusb/src/libusb/libusb.h -%endif - # Hard code extra version sed -i 's/getenv("CHROME_VERSION_EXTRA")/"openEuler Project"/' chrome/common/channel_info_posix.cc -# Fix hardcoded path in remoting code -sed -i 's|/opt/google/chrome-remote-desktop|%{crd_path}|g' remoting/host/setup/daemon_controller_delegate_linux.cc - -# change moc to moc-qt5 for -sed -i 's|moc|moc-qt5|g' ui/qt/moc_wrapper.py - - -# Get rid of the bundled esbuild - - %build -%if ! %{esbuild} - ln -sf %{_bindir}/esbuild third_party/devtools-frontend/src/third_party/esbuild/esbuild -%else - %ifarch x86_64 - tar -zxf %{SOURCE101} --directory %{_tmppath} - %endif - %ifarch aarch64 - tar -zxf %{SOURCE102} --directory %{_tmppath} - %endif - %ifarch riscv64 - tar -zxf %{SOURCE103} --directory %{_tmppath} - %endif - mv %{_tmppath}/package/bin/esbuild third_party/devtools-frontend/src/third_party/esbuild/esbuild -%endif - +rm third_party/devtools-frontend/src/third_party/esbuild/esbuild +tar -xf %{SOURCE101} +pushd esbuild +gflags="-mod=vendor -gcflags=all='-N -l'" +GO_FLAGS="${gflags}" make +cp -a esbuild ../third_party/devtools-frontend/src/third_party/esbuild/esbuild +popd + #correct path for nodejs binary mkdir -p third_party/node/linux/node-linux-x64/bin ln -s %{_bindir}/node third_party/node/linux/node-linux-x64/bin/node @@ -808,6 +349,13 @@ rm -rf buildtools/third_party/eu-strip/bin/eu-strip # Replace it with a symlink to copy ln -s %{_bindir}/eu-strip buildtools/third_party/eu-strip/bin/eu-strip +# need for error: the option `Z` is only accepted on the nightly compiler +export RUSTC_BOOTSTRAP=1 + +# set rustc version +rustc_version="$(rustc --version | cut -d' ' -f2)" + +export RUSTFLAGS # python3 mkdir -p $HOME/bin @@ -815,6 +363,319 @@ export PYTHON=python3 ln -sfn %{_bindir}/$PYTHON $HOME/bin/python export PATH="$HOME/bin/:$PATH" +# use alternative wrapper +rm chrome/installer/linux/common/wrapper +cp %{SOURCE2} chrome/installer/linux/common/wrapper + +# set clang version +#global clang_maj_ver %%(clang --version | sed -n 's/clang version //p' | cut -d. -f1) +#if %{?clang_maj_ver} >= 17 +# This is for >= 24.03 LTS, return example: 17 +clang_version="$(clang --version | sed -n 's/clang version //p' | cut -d. -f1)" +#else +# This is for < 24.03 LTS, return example: 17.0.6 +#clang_version="$(clang --version | awk '/clang version/{print $3}')" +#endif +clang_base_path="$(clang --version | grep InstalledDir | cut -d' ' -f2 | sed 's#/bin##')" + +# Remove bundled libs +keeplibs=( + base/third_party/cityhash + base/third_party/double_conversion + base/third_party/dynamic_annotations + base/third_party/icu + base/third_party/nspr + base/third_party/superfasthash + base/third_party/symbolize + base/third_party/valgrind + base/third_party/xdg_user_dirs + buildtools/third_party/eu-strip + buildtools/third_party/libc++ + buildtools/third_party/libc++abi + buildtools/third_party/libunwind + chrome/third_party/mozilla_security_manager + courgette/third_party + net/third_party/mozilla_security_manager + net/third_party/nss + net/third_party/quic + net/third_party/uri_template + third_party/abseil-cpp + third_party/angle + third_party/angle/src/common/third_party/xxhash + third_party/angle/src/third_party/ceval + third_party/angle/src/third_party/libXNVCtrl + third_party/angle/src/third_party/volk + third_party/anonymous_tokens + third_party/apple_apsl + third_party/axe-core + third_party/bidimapper + third_party/blink + third_party/boringssl + third_party/boringssl/src/third_party/fiat + third_party/breakpad + third_party/breakpad/breakpad/src/third_party/curl + third_party/brotli + third_party/catapult + third_party/catapult/common/py_vulcanize/third_party/rcssmin + third_party/catapult/common/py_vulcanize/third_party/rjsmin + third_party/catapult/third_party/beautifulsoup4 + third_party/catapult/third_party/html5lib-1.1/ + third_party/catapult/third_party/html5lib-python + third_party/catapult/third_party/polymer + third_party/catapult/third_party/six + third_party/catapult/tracing/third_party/d3 + third_party/catapult/tracing/third_party/gl-matrix + third_party/catapult/tracing/third_party/jpeg-js + third_party/catapult/tracing/third_party/jszip + third_party/catapult/tracing/third_party/mannwhitneyu + third_party/catapult/tracing/third_party/oboe + third_party/catapult/tracing/third_party/pako + third_party/ced + third_party/cld_3 + third_party/closure_compiler + third_party/content_analysis_sdk + third_party/cpuinfo + third_party/crashpad + third_party/crashpad/crashpad/third_party/lss + third_party/crashpad/crashpad/third_party/zlib + third_party/crc32c + third_party/cros_system_api + third_party/d3 + third_party/dav1d + third_party/dawn + third_party/dawn/third_party + third_party/depot_tools + third_party/devscripts + third_party/devtools-frontend + third_party/devtools-frontend/src/front_end/third_party + third_party/devtools-frontend/src/front_end/third_party/acorn + third_party/devtools-frontend/src/front_end/third_party/axe-core + third_party/devtools-frontend/src/front_end/third_party/chromium + third_party/devtools-frontend/src/front_end/third_party/codemirror + third_party/devtools-frontend/src/front_end/third_party/diff + third_party/devtools-frontend/src/front_end/third_party/i18n + third_party/devtools-frontend/src/front_end/third_party/intl-messageformat + third_party/devtools-frontend/src/front_end/third_party/lighthouse + third_party/devtools-frontend/src/front_end/third_party/lodash-isequal + third_party/devtools-frontend/src/front_end/third_party/marked + third_party/devtools-frontend/src/front_end/third_party/puppeteer + third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/esm/third_party/mitt + third_party/devtools-frontend/src/front_end/third_party/puppeteer/package/lib/esm/third_party/rxjs + third_party/devtools-frontend/src/front_end/third_party/wasmparser + third_party/devtools-frontend/src/third_party + third_party/distributed_point_functions + third_party/dom_distiller_js + third_party/eigen3 + third_party/emoji-segmenter + third_party/farmhash + third_party/fdlibm + third_party/fft2d + third_party/flatbuffers + third_party/fp16 + third_party/fusejs/dist + third_party/fxdiv + third_party/gemmlowp + third_party/google_input_tools + third_party/google_input_tools/third_party/closure_library + third_party/google_input_tools/third_party/closure_library/third_party/closure + third_party/googletest + third_party/highway + third_party/hunspell + third_party/iccjpeg + third_party/inspector_protocol + third_party/ipcz + third_party/jinja2 + third_party/jsoncpp + third_party/jstemplate + third_party/khronos + third_party/lens_server_proto + third_party/leveldatabase + third_party/libaddressinput + third_party/libaom + third_party/libaom/source/libaom/third_party/fastfeat + third_party/libaom/source/libaom/third_party/SVT-AV1 + third_party/libaom/source/libaom/third_party/vector + third_party/libaom/source/libaom/third_party/x86inc + third_party/libgav1 + third_party/libjingle + third_party/libphonenumber + third_party/libsecret + third_party/libsrtp + third_party/libsync + third_party/libudev + third_party/liburlpattern + third_party/libva_protected_content + third_party/libwebm + third_party/libx11/src + third_party/libxcb-keysyms/keysyms + third_party/libxml/chromium + third_party/libzip + third_party/lit + third_party/lottie + third_party/lss + third_party/lzma_sdk + third_party/mako + third_party/maldoca + third_party/maldoca/src/third_party + third_party/markupsafe + third_party/material_color_utilities + third_party/mesa + third_party/metrics_proto + third_party/minigbm + third_party/modp_b64 + third_party/nasm + third_party/nearby + third_party/node + third_party/omnibox_proto + third_party/one_euro_filter + third_party/openscreen + third_party/openscreen/src/third_party/tinycbor/src/src + third_party/ots + third_party/pdfium + third_party/pdfium/third_party/agg23 + third_party/pdfium/third_party/bigint + third_party/pdfium/third_party/freetype + third_party/pdfium/third_party/lcms + third_party/pdfium/third_party/libopenjpeg + third_party/pdfium/third_party/libtiff + third_party/perfetto + third_party/perfetto/protos/third_party/chromium + third_party/pffft + third_party/ply + third_party/polymer + third_party/private-join-and-compute + third_party/private_membership + third_party/protobuf + third_party/pthreadpool + third_party/puffin + third_party/pyjson5 + third_party/pyyaml + third_party/qcms + third_party/rnnoise + third_party/rust + third_party/ruy + third_party/s2cellid + third_party/securemessage + third_party/selenium-atoms + third_party/shell-encryption + third_party/simplejson + third_party/skia + third_party/skia/include/third_party/vulkan/ + third_party/skia/third_party/vulkan + third_party/smhasher + third_party/sqlite + third_party/swiftshader + third_party/swiftshader/third_party/astc-encoder + third_party/swiftshader/third_party/llvm-10.0 + third_party/swiftshader/third_party/llvm-16.0 + third_party/swiftshader/third_party/llvm-subzero + third_party/swiftshader/third_party/marl + third_party/swiftshader/third_party/SPIRV-Headers + third_party/swiftshader/third_party/SPIRV-Tools + third_party/swiftshader/third_party/subzero + third_party/tensorflow_models + third_party/tensorflow-text + third_party/tflite + third_party/tflite/src/third_party/eigen3 + third_party/tflite/src/third_party/fft2d + third_party/tflite/src/third_party/xla/third_party/tsl + third_party/tflite/src/third_party/xla/xla/tsl/util + third_party/ukey2 + third_party/utf + third_party/vulkan + third_party/wayland + third_party/webdriver + third_party/webgpu-cts + third_party/webrtc + third_party/webrtc/common_audio/third_party/ooura + third_party/webrtc/common_audio/third_party/spl_sqrt_floor + third_party/webrtc/modules/third_party/fft + third_party/webrtc/modules/third_party/g711 + third_party/webrtc/modules/third_party/g722 + third_party/webrtc/rtc_base/third_party/base64 + third_party/webrtc/rtc_base/third_party/sigslot + third_party/widevine + third_party/woff2 + third_party/wuffs + third_party/x11proto + third_party/xcbproto + third_party/xnnpack + third_party/zlib/google + third_party/zxcvbn-cpp + url/third_party/mozilla + v8/src/third_party/siphash + v8/src/third_party/utf8-decoder + v8/src/third_party/valgrind + v8/third_party/glibc + v8/third_party/inspector_protocol + v8/third_party/v8/builtins + v8/third_party/v8/codegen +) + +%if ! %{with system_harfbuzz} +keeplibs+=( third_party/harfbuzz-ng ) +%endif +%if ! %{with system_freetype} +keeplibs+=( third_party/freetype ) +%endif +%if ! %{with system_icu} +keeplibs+=( third_party/icu ) +%endif +%if ! %{with system_ffmpeg} +keeplibs+=( third_party/ffmpeg ) +%endif +%if ! %{with system_zlib} +keeplibs+=( third_party/zlib ) +%endif +%if ! %{with system_vpx} +keeplibs+=( + third_party/libvpx + third_party/libvpx/source/libvpx/third_party/x86inc +) +%endif +%if !%{with system_avif} +keeplibs+=( third_party/libyuv ) +keeplibs+=( third_party/libavif ) +%endif +%if !%{with system_webp} || !%{with system_avif} +keeplibs+=( third_party/libwebp ) +%endif +keeplibs+=( + third_party/speech-dispatcher + third_party/usb_ids + third_party/xdg-utils +) +%if ! %{with system_re2} +keeplibs+=( third_party/re2 ) +%endif +%if ! %{with system_zlib} +keeplibs+=( third_party/zlib ) +%endif +keeplibs+=( third_party/lit ) +keeplibs+=( third_party/rust/chromium_crates_io ) +keeplibs+=( third_party/rust/cxx ) +%if ! %{with system_zstd} +keeplibs+=( third_party/zstd ) +%endif +build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove + +# GN sets lto on its own and we need just ldflag options, not cflags +%define _lto_cflags %{nil} +%undefine _debugsource_packages +%if %{with clang} +export CC=clang +export CXX=clang++ +export AR=llvm-ar +export NM=llvm-nm +export RANLIB=llvm-ranlib +%else +export CC=gcc +export CXX=g++ +export AR=ar +export NM=nm +export RANLIB=ranlib +%endif + # REDUCE DEBUG as it gets TOO large ARCH_FLAGS="`echo %{optflags} | sed -e 's/^-g / /g' -e 's/ -g / /g' -e 's/ -g$//g'`" export CXXFLAGS="${ARCH_FLAGS} -Wno-return-type" @@ -823,639 +684,257 @@ export CXXFLAGS="${CXXFLAGS} -Wno-pedantic -Wno-unused-result -Wno-unused-functi # ignore warnings for minor mistakes that are too common export CXXFLAGS="${CXXFLAGS} -Wno-return-type -Wno-parentheses -Wno-misleading-indentation" # ignore warnings that are not supported well until gcc 8 -export CXXFLAGS="${CXXFLAGS} -Wno-attributes" # ignore warnings due to gcc bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84055) -export CXXFLAGS="${CXXFLAGS} -Wno-ignored-attributes" +export CXXFLAGS="${CXXFLAGS} -Wno-attributes -Wno-ignored-attributes" # ingore new gcc 8 warnings that aren't yet handled upstream export CXXFLAGS="${CXXFLAGS} -Wno-address -Wno-dangling-else -D_GNU_SOURCE" +export CXXFLAGS=${CXXFLAGS/-Wp,-D_GLIBCXX_ASSERTIONS} # for wayland export CXXFLAGS="${CXXFLAGS} -I/usr/include/wayland -I/usr/include/libxkbcommon -I/usr/include/opus" - - -%if %{clang} -export CC=clang -export CXX=clang++ -export AR=llvm-ar -export NM=llvm-nm -export READELF=llvm-readelf +%if %{with clang} export LDFLAGS="${LDFLAGS} -Wl,--build-id=sha1" export CXXFLAGS="${CXXFLAGS} -Wno-unused-command-line-argument -Wno-unknown-warning-option" -%define __strip /usr/bin/llvm-strip -%if 0%{?enable_thin_lto} -# reduce the threads for linking even more due to LTO eating ton of memory -_link_threads=$(((%{jobs} - 2))) -test "$_link_threads" -le 0 && _link_threads=1 -export LDFLAGS="-flto=$_link_threads --param lto-max-streaming-parallelism=1" %endif -%else -export CC=gcc -export CXX=g++ -export AR=ar -export NM=nm -export READELF=readelf -%endif - %ifarch aarch64 -%if %{clang} -export CXXFLAGS="${CXXFLAGS} -flax-vector-conversions=all" -%else +%if %{without clang} export CXXFLAGS="${CXXFLAGS} -flax-vector-conversions -fno-omit-frame-pointer" -%endif -%endif - -# Core defines are flags that are true for both the browser and headless. -CHROMIUM_CORE_GN_DEFINES="" -# using system toolchain -CHROMIUM_CORE_GN_DEFINES+=' custom_toolchain="//build/toolchain/linux/unbundle:default"' -CHROMIUM_CORE_GN_DEFINES+=' host_toolchain="//build/toolchain/linux/unbundle:default"' -CHROMIUM_CORE_GN_DEFINES+=' is_debug=false dcheck_always_on=false dcheck_is_configurable=false' -CHROMIUM_CORE_GN_DEFINES+=' use_goma=false' -CHROMIUM_CORE_GN_DEFINES+=' enable_nacl=false' -CHROMIUM_CORE_GN_DEFINES+=' system_libdir="%{_lib}"' - -%if %{official_build} -CHROMIUM_CORE_GN_DEFINES+=' is_official_build=true is_cfi=false chrome_pgo_phase=0 use_debug_fission=true' -sed -i 's|OFFICIAL_BUILD|GOOGLE_CHROME_BUILD|g' tools/generate_shim_headers/generate_shim_headers.py -%endif - -%if %{useapikey} -CHROMIUM_CORE_GN_DEFINES+=' google_api_key="%{api_key}"' -%endif - -%if %{clang} -CHROMIUM_CORE_GN_DEFINES+=' is_clang=true' -CHROMIUM_CORE_GN_DEFINES+=' clang_base_path="%{_prefix}"' -CHROMIUM_CORE_GN_DEFINES+=' clang_use_chrome_plugins=false' -CHROMIUM_CORE_GN_DEFINES+=' use_lld=true' -%if %{enable_thin_lto} -CHROMIUM_CORE_GN_DEFINES+=" use_thin_lto=true" %else -CHROMIUM_CORE_GN_DEFINES+=" use_thin_lto=false" -%endif -%else -CHROMIUM_CORE_GN_DEFINES+=' is_clang=false' -CHROMIUM_CORE_GN_DEFINES+=' use_lld=false' -%endif - -# disable rust, it's only using for testing -CHROMIUM_CORE_GN_DEFINES+=' enable_rust=false' - -CHROMIUM_CORE_GN_DEFINES+=' use_sysroot=false disable_fieldtrial_testing_config=true rtc_enable_symbol_export=true' - -%if %{use_gold} -CHROMIUM_CORE_GN_DEFINES+=' use_gold=true' -%else -CHROMIUM_CORE_GN_DEFINES+=' use_gold=false' -%endif - -%ifarch x86_64 -CHROMIUM_CORE_GN_DEFINES+=' host_cpu="x64"' -%endif -%ifarch aarch64 -CHROMIUM_CORE_GN_DEFINES+=' host_cpu="arm64"' -%endif -%ifarch riscv64 -CHROMIUM_CORE_GN_DEFINES+=' host_cpu="riscv64"' +export CXXFLAGS="${CXXFLAGS} -flax-vector-conversions=all" %endif - -%if ! %{bundleicu} -CHROMIUM_CORE_GN_DEFINES+=' icu_use_data_file=false' -%endif -CHROMIUM_CORE_GN_DEFINES+=' target_os="linux"' -CHROMIUM_CORE_GN_DEFINES+=' current_os="linux"' -CHROMIUM_CORE_GN_DEFINES+=' treat_warnings_as_errors=false' -CHROMIUM_CORE_GN_DEFINES+=' use_custom_libcxx=false' -CHROMIUM_CORE_GN_DEFINES+=' enable_iterator_debugging=false' -CHROMIUM_CORE_GN_DEFINES+=' enable_vr=false' -CHROMIUM_CORE_GN_DEFINES+=' build_dawn_tests=false enable_perfetto_unittests=false' -CHROMIUM_CORE_GN_DEFINES+=' disable_fieldtrial_testing_config=true' -CHROMIUM_CORE_GN_DEFINES+=' symbol_level=1' -CHROMIUM_CORE_GN_DEFINES+=' blink_symbol_level=%{debug_level} v8_symbol_level=%{debug_level}' -CHROMIUM_CORE_GN_DEFINES+=' blink_enable_generated_code_formatting=false' -CHROMIUM_CORE_GN_DEFINES+=' angle_has_histograms=false' -CHROMIUM_CORE_GN_DEFINES+=' optimize_webui=false' -CHROMIUM_CORE_GN_DEFINES+=' enable_reading_list=false' -CHROMIUM_CORE_GN_DEFINES+=' fatal_linker_warnings=false' -CHROMIUM_CORE_GN_DEFINES+=' use_allocator_shim=true' -CHROMIUM_CORE_GN_DEFINES+=' use_partition_alloc=true' -CHROMIUM_CORE_GN_DEFINES+=' use_unofficial_version_number=false' - -%if ! %{bundleharfbuzz} -CHROMIUM_CORE_GN_DEFINES+=" use_system_harfbuzz=true" %endif - -%if ! %{bundlefreetype} -CHROMIUM_CORE_GN_DEFINES+=" use_system_freetype=true" +%if %{without clang} +export CXXFLAGS="${CXXFLAGS} -Wno-unused-but-set-variable -Wno-packed-not-aligned" %endif - -%if 0%{?enable_swiftshader} -CHROMIUM_CORE_GN_DEFINES+=" use_swiftshader_with_subzero=true" +export CFLAGS="${CXXFLAGS}" +%if %{without clang} +export CXXFLAGS="${CXXFLAGS} -Wno-subobject-linkage -Wno-class-memaccess" %endif - -export CHROMIUM_CORE_GN_DEFINES - -# browser gn defines -CHROMIUM_BROWSER_GN_DEFINES="" - -# if systemwide ffmpeg free is used, the proprietary codecs can be set to true to load the codecs from ffmpeg-free -# the codecs computation is passed to ffmpeg-free in this case -%if ! %{bundleffmpegfree} -CHROMIUM_BROWSER_GN_DEFINES+=' ffmpeg_branding="Chrome" proprietary_codecs=true is_component_ffmpeg=true enable_ffmpeg_video_decoders=true media_use_ffmpeg=true' -%else -CHROMIUM_BROWSER_GN_DEFINES+=' ffmpeg_branding="Chromium" proprietary_codecs=true is_component_ffmpeg=true enable_ffmpeg_video_decoders=true media_use_ffmpeg=true' -%endif -CHROMIUM_BROWSER_GN_DEFINES+=' media_use_openh264=false' -CHROMIUM_BROWSER_GN_DEFINES+=' rtc_use_h264=false' -CHROMIUM_BROWSER_GN_DEFINES+=' use_kerberos=true' - -%if %{use_qt} -CHROMIUM_BROWSER_GN_DEFINES+=' use_qt=true' -%else -CHROMIUM_BROWSER_GN_DEFINES+=' use_qt=false' -%endif - -CHROMIUM_BROWSER_GN_DEFINES+=' use_gio=true use_pulseaudio=true link_pulseaudio=true' -CHROMIUM_BROWSER_GN_DEFINES+=' enable_hangout_services_extension=true' -CHROMIUM_BROWSER_GN_DEFINES+=' use_aura=true' -CHROMIUM_BROWSER_GN_DEFINES+=' enable_widevine=true' - -%if %{use_vaapi} -CHROMIUM_BROWSER_GN_DEFINES+=' use_vaapi=true' -%else -CHROMIUM_BROWSER_GN_DEFINES+=' use_vaapi=false' -%endif - -%if %{use_v4l2_codec} -CHROMIUM_BROWSER_GN_DEFINES+=' use_v4l2_codec=true' +export CXXFLAGS="${CXXFLAGS} -Wno-invalid-offsetof -fpermissive" +%if %{with lto} && %{without clang} +# reduce the threads for linking even more due to LTO eating ton of memory +_link_threads=$(((%{jobs} - 2))) +test "$_link_threads" -le 0 && _link_threads=1 +export LDFLAGS="-flto=$_link_threads --param lto-max-streaming-parallelism=1" %endif -CHROMIUM_BROWSER_GN_DEFINES+=' rtc_use_pipewire=true rtc_link_pipewire=true' -CHROMIUM_BROWSER_GN_DEFINES+=' use_system_libffi=true' -CHROMIUM_BROWSER_GN_DEFINES+=' use_cups=true' -CHROMIUM_BROWSER_GN_DEFINES+=' use_dbus=true' -export CHROMIUM_BROWSER_GN_DEFINES - -# headless gn defines -CHROMIUM_HEADLESS_GN_DEFINES="" -CHROMIUM_HEADLESS_GN_DEFINES+=' use_ozone=true ozone_auto_platforms=false ozone_platform="headless" ozone_platform_headless=true' -CHROMIUM_HEADLESS_GN_DEFINES+=' angle_enable_vulkan=true angle_enable_swiftshader=true headless_use_embedded_resources=false' -CHROMIUM_HEADLESS_GN_DEFINES+=' headless_use_prefs=false headless_use_policy=false' -CHROMIUM_HEADLESS_GN_DEFINES+=' v8_use_external_startup_data=false enable_print_preview=false enable_remoting=false' -CHROMIUM_HEADLESS_GN_DEFINES+=' use_alsa=false use_bluez=false use_cups=false use_dbus=false use_gio=false use_kerberos=false' -CHROMIUM_HEADLESS_GN_DEFINES+=' use_libpci=false use_pulseaudio=false use_udev=false rtc_use_pipewire=false' -CHROMIUM_HEADLESS_GN_DEFINES+=' v8_enable_lazy_source_positions=false use_glib=false use_gtk=false use_pangocairo=false' -CHROMIUM_HEADLESS_GN_DEFINES+=' use_qt=false is_component_build=false enable_ffmpeg_video_decoders=false media_use_ffmpeg=false' -CHROMIUM_HEADLESS_GN_DEFINES+=' media_use_libvpx=false proprietary_codecs=false' -export CHROMIUM_HEADLESS_GN_DEFINES - -build/linux/unbundle/replace_gn_files.py --system-libraries \ - libevent \ - snappy \ -%if ! %{bundlelibaom} - libaom \ +# Set system libraries to be used +gn_system_libraries=( + flac + fontconfig + libdrm + libevent + libjpeg + libpng + libxslt + libusb + libxml + opus + snappy +) +%if %{with system_harfbuzz} +gn_system_libraries+=( harfbuzz-ng ) %endif -%if ! %{bundlezstd} - zstd \ +%if %{with system_freetype} +gn_system_libraries+=( freetype ) %endif -%if ! %{bundlebrotli} - brotli \ +%if %{with system_icu} +gn_system_libraries+=( icu ) %endif -%if ! %{bundlefontconfig} - fontconfig \ +%if %{with system_vpx} +gn_system_libraries+=( libvpx ) %endif -%if ! %{bundleffmpegfree} - ffmpeg \ +%if %{with system_ffmpeg} +gn_system_libraries+=( ffmpeg ) %endif -%if ! %{bundlefreetype} - freetype \ +%if %{with system_re2} +gn_system_libraries+=( re2 ) %endif -%if ! %{bundleharfbuzz} - harfbuzz-ng \ +%if %{with system_webp} +gn_system_libraries+=( libwebp ) %endif -%if ! %{bundleicu} - icu \ +%if %{with system_zlib} +gn_system_libraries+=( zlib ) %endif -%if ! %{bundlelibdrm} - libdrm \ +%if %{with system_zstd} +gn_system_libraries+=( zstd ) %endif -%if ! %{bundlelibjpeg} - libjpeg \ +build/linux/unbundle/replace_gn_files.py --system-libraries ${gn_system_libraries[@]} + +# Configuration for GN +# Available options: out/Release/gn args --list out/Release/ +gn_conf="" +gn_conf+=" custom_toolchain=\"//build/toolchain/linux/unbundle:default\"" +gn_conf+=" host_toolchain=\"//build/toolchain/linux/unbundle:default\"" +gn_conf+=" use_custom_libcxx=false" +%ifarch x86_64 +gn_conf+=" host_cpu=\"x64\"" %endif -%if ! %{bundlelibpng} - libpng \ +%ifarch riscv64 +gn_conf+=" host_cpu=\"riscv64\"" %endif -%if ! %{bundlelibusbx} - libusb \ +gn_conf+=" is_debug=false" +gn_conf+=" dcheck_always_on=false" +gn_conf+=" enable_nacl=false" +%if %{with swiftshader} +gn_conf+=" use_swiftshader_with_subzero=true" %endif -%if ! %{bundlelibwebp} - libwebp \ +%ifarch aarch64 +gn_conf+=" enable_swiftshader=false" +gn_conf+=" dawn_use_swiftshader=false" +%endif +gn_conf+=" is_component_ffmpeg=true" +gn_conf+=" use_cups=true" +gn_conf+=" use_aura=true" +gn_conf+=" symbol_level=1" +gn_conf+=" blink_symbol_level=0" +gn_conf+=" use_kerberos=true" +gn_conf+=" enable_vr=false" +gn_conf+=" optimize_webui=false" +gn_conf+=" enable_reading_list=false" +gn_conf+=" use_pulseaudio=true link_pulseaudio=true" +gn_conf+=" is_component_build=false" +gn_conf+=" use_sysroot=false" +gn_conf+=" fatal_linker_warnings=false" +gn_conf+=" use_allocator_shim=true" +gn_conf+=" use_partition_alloc=true" +gn_conf+=" disable_fieldtrial_testing_config=true" +gn_conf+=" use_gnome_keyring=false" +gn_conf+=" use_unofficial_version_number=false" +%ifnarch riscv64 +gn_conf+=" use_vaapi=true" +%endif +gn_conf+=" use_sysroot=false" +gn_conf+=" treat_warnings_as_errors=false" +gn_conf+=" enable_widevine=false" +gn_conf+=" use_dbus=true" +gn_conf+=" media_use_openh264=false" +gn_conf+=" rtc_use_h264=false" +gn_conf+=" use_v8_context_snapshot=true" +gn_conf+=" v8_use_external_startup_data=true" +%if %{with gtk4} +gn_conf+=" gtk_version=4" +%endif +%if %{without qt} +gn_conf+=" use_qt=false" +%else +gn_conf+=" moc_qt5_path=\"%{_libdir}/qt5/bin\"" %endif -%if ! %{bundlelibxml} - libxml \ +# See dependency logic in third_party/BUILD.gn +%if %{with system_harfbuzz} +gn_conf+=" use_system_harfbuzz=true" %endif - libxslt \ -%if ! %{bundleopus} - opus \ +%if %{with system_freetype} +gn_conf+=" use_system_freetype=true" %endif -%if ! %{bundlere2} - re2 \ +gn_conf+=" enable_hangout_services_extension=true" +gn_conf+=" enable_vulkan=true" +%if %{with pipewire} +gn_conf+=" rtc_use_pipewire=true rtc_link_pipewire=true" %endif -%if ! %{bundlezlib} - zlib \ +%if %{with clang} +gn_conf+=" is_clang=true clang_version=\"$clang_version\" clang_base_path=\"$clang_base_path\" clang_use_chrome_plugins=false" +%if %{with lto} && %{with clang} +gn_conf+=" use_thin_lto=true" %endif - flac - -# Check that there is no system 'google' module, shadowing bundled ones: -if python3 -c 'import google ; print google.__path__' 2> /dev/null ; then \ - echo "Python 3 'google' module is defined, this will shadow modules of this build"; \ - exit 1 ; \ -fi - -%if %{bootstrap} -tools/gn/bootstrap/bootstrap.py --gn-gen-args="$CHROMIUM_CORE_GN_DEFINES $CHROMIUM_BROWSER_GN_DEFINES" +gn_conf+=" use_lld=true" %else -mkdir -p %{builddir} && cp -a %{_bindir}/gn %{builddir}/ +gn_conf+=" is_clang=false" +%ifnarch riscv64 aarch64 +gn_conf+=" use_gold=true" %endif - -%{builddir}/gn --script-executable=python3 gen --args="$CHROMIUM_CORE_GN_DEFINES $CHROMIUM_BROWSER_GN_DEFINES" %{builddir} - -%if %{build_headless} -%{builddir}/gn --script-executable=python3 gen --args="$CHROMIUM_CORE_GN_DEFINES $CHROMIUM_HEADLESS_GN_DEFINES" %{headlessbuilddir} %endif - -%if %{build_remoting} -%{builddir}/gn --script-executable=python3 gen --args="$CHROMIUM_CORE_GN_DEFINES $CHROMIUM_BROWSER_GN_DEFINES" %{remotingbuilddir} +%if %{with lto} && %{without clang} +gn_conf+=" gcc_lto=true" %endif - -%if %{build_headless} -# Do headless first. -%build_target %{headlessbuilddir} headless_shell +%if %{with system_icu} +gn_conf+=" icu_use_data_file=false" %endif +gn_conf+=" rust_sysroot_absolute=\"%{_prefix}\"" +gn_conf+=" rustc_version=\"$rustc_version\"" -%build_target %{builddir} chrome -%build_target %{builddir} chrome_sandbox -%build_target %{builddir} chromedriver - -%if %{build_clear_key_cdm} -%build_target %{builddir} clear_key_cdm -%endif +# The proprietary codecs just force the chromium to say they can use it and +# offload the actual computation to the ffmpeg, otherwise the chromium +# won't be able to load the codec even if the library can handle it +gn_conf+=" proprietary_codecs=true" +gn_conf+=" ffmpeg_branding=\"Chrome\"" -%build_target %{builddir} policy_templates - -%if %{build_remoting} -# remote client -# ninja -C ../%{builddir} -vvv remoting_me2me_host remoting_start_host remoting_it2me_native_messaging_host remoting_me2me_native_messaging_host remoting_native_messaging_manifests remoting_resources -%build_target %{remotingbuilddir} remoting_all +%ifarch aarch64 +gn_conf+=" host_cpu=\"arm64\"" +%if %{with arm_bti} +gn_conf+=" arm_control_flow_integrity=\"standard\"" +%else +gn_conf+=" arm_control_flow_integrity=\"none\"" %endif - -%install -rm -rf %{buildroot} - -mkdir -p %{buildroot}%{_bindir} \ - %{buildroot}%{chromium_path}/locales \ - %{buildroot}%{_sysconfdir}/%{name} - -# install system wide chromium config -%ifnarch riscv64 -cp -a %{SOURCE2} %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf %endif -cp -a %{SOURCE3} %{buildroot}%{chromium_path}/%{chromium_browser_channel}.sh -chmod +x %{buildroot}%{chromium_path}/%{chromium_browser_channel}.sh -%if ! %{use_vaapi} -# remove vaapi flags -echo "# system wide chromium flags" > %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf -%endif +gn_conf+=" google_api_key=\"%{api_key}\"" -export BUILD_TARGET=`cat /etc/openEuler-release` -export CHROMIUM_PATH=%{chromium_path} -export CHROMIUM_BROWSER_CHANNEL=%{chromium_browser_channel} +gn_conf+=" use_system_libffi=true" -sed -i "s|@@BUILD_TARGET@@|$BUILD_TARGET|g" %{buildroot}%{chromium_path}/%{chromium_browser_channel}.sh -sed -i "s|@@CHROMIUM_PATH@@|$CHROMIUM_PATH|g" %{buildroot}%{chromium_path}/%{chromium_browser_channel}.sh -sed -i "s|@@CHROMIUM_BROWSER_CHANNEL@@|$CHROMIUM_BROWSER_CHANNEL|g" %{buildroot}%{chromium_path}/%{chromium_browser_channel}.sh -%if "%{chromium_channel}" == "%{nil}" - sed -i "s|@@EXTRA_FLAGS@@||g" %{buildroot}%{chromium_path}/%{chromium_browser_channel}.sh +%if %{bootstrap} +tools/gn/bootstrap/bootstrap.py --gn-gen-args="${gn_conf}" %else - # Enable debug outputs for beta and dev channels - export EXTRA_FLAGS="--enable-logging=stderr --v=2" - sed -i "s|@@EXTRA_FLAGS@@|$EXTRA_FLAGS|g" %{buildroot}%{chromium_path}/%{chromium_browser_channel}.sh -%endif - -ln -s ../..%{chromium_path}/%{chromium_browser_channel}.sh %{buildroot}%{_bindir}/%{chromium_browser_channel} -mkdir -p %{buildroot}%{_mandir}/man1/ - -pushd %{builddir} - cp -a chrom*.pak resources.pak icudtl.dat %{buildroot}%{chromium_path} - cp -a locales/*.pak %{buildroot}%{chromium_path}/locales/ - %ifarch x86_64 aarch64 riscv64 - cp -a libvk_swiftshader.so %{buildroot}%{chromium_path} - cp -a libvulkan.so.1 %{buildroot}%{chromium_path} - cp -a vk_swiftshader_icd.json %{buildroot}%{chromium_path} - %endif - cp -a chrome %{buildroot}%{chromium_path}/%{chromium_browser_channel} - cp -a chrome_sandbox %{buildroot}%{chromium_path}/chrome-sandbox - cp -a chrome_crashpad_handler %{buildroot}%{chromium_path}/chrome_crashpad_handler - cp -a ../../chrome/app/resources/manpage.1.in %{buildroot}%{_mandir}/man1/%{chromium_browser_channel}.1 - sed -i "s|@@PACKAGE@@|%{chromium_browser_channel}|g" %{buildroot}%{_mandir}/man1/%{chromium_browser_channel}.1 - sed -i "s|@@MENUNAME@@|%{chromium_menu_name}|g" %{buildroot}%{_mandir}/man1/%{chromium_browser_channel}.1 - - # V8 initial snapshots - # https://code.google.com/p/chromium/issues/detail?id=421063 - cp -a v8_context_snapshot.bin %{buildroot}%{chromium_path} - - # This is ANGLE, not to be confused with the similarly named files under swiftshader/ - cp -a libEGL.so libGLESv2.so %{buildroot}%{chromium_path} - - %if %{use_qt} - cp -a libqt5_shim.so %{buildroot}%{chromium_path} - %endif - - %if %{build_clear_key_cdm} - %ifarch x86_64 - cp -a ClearKeyCdm/_platform_specific/linux_x64/libclearkeycdm.so %{buildroot}%{chromium_path} - %endif - %ifarch aarch64 - cp -a ClearKeyCdm/_platform_specific/linux_arm64/libclearkeycdm.so %{buildroot}%{chromium_path} - %endif - %ifarch riscv64 - cp -a ClearKeyCdm/_platform_specific/linux_riscv64/libclearkeycdm.so %{buildroot}%{chromium_path} - %endif - %ifnarch x86_64 aarch64 riscv64 - cp -a libclearkeycdm.so %{buildroot}%{chromium_path} - %endif - %endif - - # chromedriver - cp -a chromedriver %{buildroot}%{chromium_path}/chromedriver - ln -s ../..%{chromium_path}/chromedriver %{buildroot}%{_bindir}/chromedriver - - %if %{build_remoting} - # Remote desktop bits - mkdir -p %{buildroot}%{crd_path} - %endif -popd - -%if %{build_remoting} - pushd %{remotingbuilddir} - # Hey, there is a library now. - cp -a libremoting_core.so %{buildroot}%{crd_path}/ - - # See remoting/host/installer/linux/Makefile for logic - mkdir -p %{buildroot}%{crd_path}/remoting_locales - cp -a remoting_native_messaging_host %{buildroot}%{crd_path}/native-messaging-host - cp -a remote_assistance_host %{buildroot}%{crd_path}/remote-assistance-host - cp -a remoting_locales/*.pak %{buildroot}%{crd_path}/remoting_locales/ - cp -a remoting_me2me_host %{buildroot}%{crd_path}/chrome-remote-desktop-host - cp -a remoting_start_host %{buildroot}%{crd_path}/start-host - cp -a remoting_user_session %{buildroot}%{crd_path}/user-session - chmod +s %{buildroot}%{crd_path}/user-session - - # chromium - mkdir -p %{buildroot}%{_sysconfdir}/chromium/native-messaging-hosts - # google-chrome - mkdir -p %{buildroot}%{_sysconfdir}/opt/chrome/ - cp -a remoting/* %{buildroot}%{_sysconfdir}/chromium/native-messaging-hosts/ - for i in %{buildroot}%{_sysconfdir}/chromium/native-messaging-hosts/*.json; do - sed -i 's|/opt/google/chrome-remote-desktop|%{crd_path}|g' $i - done - mkdir -p %{buildroot}%{_sysconfdir}/opt/chrome/native-messaging-hosts - pushd %{buildroot}%{_sysconfdir}/opt/chrome/native-messaging-hosts - for i in ../../../chromium/native-messaging-hosts/*; do - # rpm gets unhappy when we symlink here - cp -a $i . - done - popd - popd - - mkdir -p %{buildroot}/var/lib/chrome-remote-desktop - touch %{buildroot}/var/lib/chrome-remote-desktop/hashes - - mkdir -p %{buildroot}%{_sysconfdir}/pam.d/ - pushd %{buildroot}%{_sysconfdir}/pam.d/ - ln -s system-auth chrome-remote-desktop - popd - - cp -a remoting/host/linux/linux_me2me_host.py %{buildroot}%{crd_path}/chrome-remote-desktop - cp -a remoting/host/installer/linux/is-remoting-session %{buildroot}%{crd_path}/ - - mkdir -p %{buildroot}%{_unitdir} - cp -a %{SOURCE6} %{buildroot}%{_unitdir}/ - sed -i 's|@@CRD_PATH@@|%{crd_path}|g' %{buildroot}%{_unitdir}/chrome-remote-desktop@.service +mkdir -p %{outputdir} && cp -a %{_bindir}/gn %{outputdir}/ %endif -%if %{build_headless} - pushd %{headlessbuilddir} - cp -a headless_lib_data.pak headless_lib_strings.pak headless_shell %{buildroot}%{chromium_path} - popd -%endif +# GN does not support passing cflags: +# https://bugs.chromium.org/p/chromium/issues/detail?id=642016 +%{outputdir}/gn gen --args="${gn_conf}" %{outputdir} -# need to strip binaries explicitly when debug is disable -%if ! %{enable_debug} -pushd %{buildroot}%{chromium_path}/ -for f in *.so chrome_crashpad_handler chrome-sandbox chromium-browser headless_shell chromedriver chrome; do - [ -f $f ] && %{__strip} $f -done -popd -%endif - -# Add directories for policy management -mkdir -p %{buildroot}%{_sysconfdir}/chromium/policies/managed -mkdir -p %{buildroot}%{_sysconfdir}/chromium/policies/recommended - -cp -a out/Release/gen/chrome/app/policy/common/html/en-US/*.html . -cp -a out/Release/gen/chrome/app/policy/linux/examples/chrome.json . - -mkdir -p %{buildroot}%{_datadir}/icons/hicolor/256x256/apps -cp -a chrome/app/theme/chromium/product_logo_256.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/%{chromium_browser_channel}.png -mkdir -p %{buildroot}%{_datadir}/icons/hicolor/128x128/apps -cp -a chrome/app/theme/chromium/product_logo_128.png %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/%{chromium_browser_channel}.png -mkdir -p %{buildroot}%{_datadir}/icons/hicolor/64x64/apps -cp -a chrome/app/theme/chromium/product_logo_64.png %{buildroot}%{_datadir}/icons/hicolor/64x64/apps/%{chromium_browser_channel}.png -mkdir -p %{buildroot}%{_datadir}/icons/hicolor/48x48/apps -cp -a chrome/app/theme/chromium/product_logo_48.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/%{chromium_browser_channel}.png -mkdir -p %{buildroot}%{_datadir}/icons/hicolor/24x24/apps -cp -a chrome/app/theme/chromium/product_logo_24.png %{buildroot}%{_datadir}/icons/hicolor/24x24/apps/%{chromium_browser_channel}.png +%{!?njobs:%global njobs %{_smp_build_ncpus}} +ninja -v -j%njobs -C %{outputdir} chrome chromedriver +%install +bash %{SOURCE4} -s %{buildroot} -l %{_libdir} %{!?with_system_icu:-i true} -o %{outputdir} +# chromedriver +cp -a %{outputdir}/chromedriver.unstripped %{buildroot}%{_libdir}/chromium/chromedriver +ln -s %{_libdir}/chromium/chromedriver %{buildroot}%{_bindir}/chromedriver +# link to browser plugin path. +mkdir -p %{buildroot}%{_libdir}/browser-plugins +ln -s %{_libdir}/browser-plugins %{buildroot}%{_libdir}/chromium/plugins # Install the master_preferences file -install -m 0644 %{SOURCE7} %{buildroot}%{_sysconfdir}/%{name}/ - -mkdir -p %{buildroot}%{_datadir}/applications/ -desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE4} - -install -D -m0644 chrome/installer/linux/common/chromium-browser/chromium-browser.appdata.xml \ - ${RPM_BUILD_ROOT}%{_datadir}/metainfo/%{chromium_browser_channel}.appdata.xml -appstream-util validate-relax --nonet ${RPM_BUILD_ROOT}%{_datadir}/metainfo/%{chromium_browser_channel}.appdata.xml - -mkdir -p %{buildroot}%{_datadir}/gnome-control-center/default-apps/ -cp -a %{SOURCE5} %{buildroot}%{_datadir}/gnome-control-center/default-apps/ - - -%post -# Set SELinux labels - semanage itself will adjust the lib directory naming -# But only do it when selinux is enabled, otherwise, it gets noisy. -if selinuxenabled; then - semanage fcontext -a -t bin_t /usr/lib/%{chromium_browser_channel} &>/dev/null || : - semanage fcontext -a -t bin_t /usr/lib/%{chromium_browser_channel}/%{chromium_browser_channel}.sh &>/dev/null || : - semanage fcontext -a -t chrome_sandbox_exec_t /usr/lib/chrome-sandbox &>/dev/null || : - restorecon -R -v %{chromium_path}/%{chromium_browser_channel} &>/dev/null || : -fi - -%if %{build_remoting} -%pretrans -n chrome-remote-desktop -p -path = "/etc/opt/chrome/native-messaging-hosts" -st = posix.stat(path) -if st and st.type == "link" then - os.remove(path) -end -%endif - -%if %{build_remoting} -%pre -n chrome-remote-desktop -getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-desktop - -%post -n chrome-remote-desktop -%systemd_post chrome-remote-desktop@.service - -%preun -n chrome-remote-desktop -%systemd_preun chrome-remote-desktop@.service - -%postun -n chrome-remote-desktop -%systemd_postun_with_restart chrome-remote-desktop@.service -%endif +mkdir -p %{buildroot}%{_sysconfdir}/chromium +install -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/chromium +# Compat link +ln -s %{_bindir}/chromium-browser %{buildroot}%{_bindir}/chromium +# Policy dirs +mkdir -p %{buildroot}%{_sysconfdir}/chromium/policies +mkdir %{buildroot}%{_sysconfdir}/chromium/policies/managed +mkdir %{buildroot}%{_sysconfdir}/chromium/policies/recommended +chmod -w %{buildroot}%{_sysconfdir}/chromium/policies/managed +mkdir -p %{buildroot}%{_datadir}/chromium/extensions +mkdir -p %{buildroot}%{_sysconfdir}/chromium/native-messaging-hosts +# SVG +install -Dm 0644 %{SOURCE3} %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps/chromium-browser.svg %files -%doc chrome_policy_list.html *.json %license LICENSE -%config(noreplace) %{_sysconfdir}/%{name}/chromium.conf -%config %{_sysconfdir}/%{name}/master_preferences -%config %{_sysconfdir}/%{name}/policies/ -%if %{build_remoting} -%exclude %{_sysconfdir}/%{name}/native-messaging-hosts/* -%endif -%{_bindir}/%{chromium_browser_channel} -%{chromium_path}/*.bin -%{chromium_path}/chrome_*.pak -%{chromium_path}/chrome_crashpad_handler -%{chromium_path}/resources.pak -%{chromium_path}/%{chromium_browser_channel} -%{chromium_path}/%{chromium_browser_channel}.sh -%attr(4755, root, root) %{chromium_path}/chrome-sandbox -%if %{use_qt} -%{chromium_path}/libqt5_shim.so -%endif -%{_mandir}/man1/%{chromium_browser_channel}.* -%{_datadir}/icons/hicolor/*/apps/%{chromium_browser_channel}.png +%doc AUTHORS +%{_datadir}/chromium +%dir %{_sysconfdir}/chromium +%dir %{_sysconfdir}/chromium/policies +%dir %{_sysconfdir}/chromium/policies/managed +%dir %{_sysconfdir}/chromium/policies/recommended +%dir %{_sysconfdir}/chromium/native-messaging-hosts +%config %{_sysconfdir}/chromium/master_preferences +%{_libdir}/chromium %{_datadir}/applications/*.desktop -%{_datadir}/metainfo/*.appdata.xml -%{_datadir}/gnome-control-center/default-apps/chromium-browser.xml - -%files common -%if %{build_clear_key_cdm} -%{chromium_path}/libclearkeycdm.so -%endif -%ifarch x86_64 aarch64 riscv64 -%{chromium_path}/libvk_swiftshader.so* -%{chromium_path}/libvulkan.so* -%{chromium_path}/vk_swiftshader_icd.json -%{chromium_path}/libEGL.so* -%{chromium_path}/libGLESv2.so* -%endif -%{chromium_path}/icudtl.dat -%dir %{chromium_path}/ -%dir %{chromium_path}/locales/ -%lang(af) %{chromium_path}/locales/af.pak -%lang(am) %{chromium_path}/locales/am.pak -%lang(ar) %{chromium_path}/locales/ar.pak -%lang(bg) %{chromium_path}/locales/bg.pak -%lang(bn) %{chromium_path}/locales/bn.pak -%lang(ca) %{chromium_path}/locales/ca.pak -%lang(cs) %{chromium_path}/locales/cs.pak -%lang(da) %{chromium_path}/locales/da.pak -%lang(de) %{chromium_path}/locales/de.pak -%lang(el) %{chromium_path}/locales/el.pak -%lang(en_GB) %{chromium_path}/locales/en-GB.pak -# Chromium _ALWAYS_ needs en-US.pak as a fallback -# This means we cannot apply the lang code here. -# Otherwise, it is filtered out on install. -%{chromium_path}/locales/en-US.pak -%lang(es) %{chromium_path}/locales/es.pak -%lang(es) %{chromium_path}/locales/es-419.pak -%lang(et) %{chromium_path}/locales/et.pak -%lang(fa) %{chromium_path}/locales/fa.pak -%lang(fi) %{chromium_path}/locales/fi.pak -%lang(fil) %{chromium_path}/locales/fil.pak -%lang(fr) %{chromium_path}/locales/fr.pak -%lang(gu) %{chromium_path}/locales/gu.pak -%lang(he) %{chromium_path}/locales/he.pak -%lang(hi) %{chromium_path}/locales/hi.pak -%lang(hr) %{chromium_path}/locales/hr.pak -%lang(hu) %{chromium_path}/locales/hu.pak -%lang(id) %{chromium_path}/locales/id.pak -%lang(it) %{chromium_path}/locales/it.pak -%lang(ja) %{chromium_path}/locales/ja.pak -%lang(kn) %{chromium_path}/locales/kn.pak -%lang(ko) %{chromium_path}/locales/ko.pak -%lang(lt) %{chromium_path}/locales/lt.pak -%lang(lv) %{chromium_path}/locales/lv.pak -%lang(ml) %{chromium_path}/locales/ml.pak -%lang(mr) %{chromium_path}/locales/mr.pak -%lang(ms) %{chromium_path}/locales/ms.pak -%lang(nb) %{chromium_path}/locales/nb.pak -%lang(nl) %{chromium_path}/locales/nl.pak -%lang(pl) %{chromium_path}/locales/pl.pak -%lang(pt_BR) %{chromium_path}/locales/pt-BR.pak -%lang(pt_PT) %{chromium_path}/locales/pt-PT.pak -%lang(ro) %{chromium_path}/locales/ro.pak -%lang(ru) %{chromium_path}/locales/ru.pak -%lang(sk) %{chromium_path}/locales/sk.pak -%lang(sl) %{chromium_path}/locales/sl.pak -%lang(sr) %{chromium_path}/locales/sr.pak -%lang(sv) %{chromium_path}/locales/sv.pak -%lang(sw) %{chromium_path}/locales/sw.pak -%lang(ta) %{chromium_path}/locales/ta.pak -%lang(te) %{chromium_path}/locales/te.pak -%lang(th) %{chromium_path}/locales/th.pak -%lang(tr) %{chromium_path}/locales/tr.pak -%lang(uk) %{chromium_path}/locales/uk.pak -%lang(ur) %{chromium_path}/locales/ur.pak -%lang(vi) %{chromium_path}/locales/vi.pak -%lang(zh_CN) %{chromium_path}/locales/zh-CN.pak -%lang(zh_TW) %{chromium_path}/locales/zh-TW.pak - -%if %{build_headless} -%files headless -%{chromium_path}/headless_shell -%{chromium_path}/headless_lib_data.pak -%{chromium_path}/headless_lib_strings.pak -%endif - -%if %{build_remoting} -%files -n chrome-remote-desktop -%{crd_path}/chrome-remote-desktop -%{crd_path}/chrome-remote-desktop-host -%{crd_path}/is-remoting-session -%{crd_path}/libremoting_core.so* -%{crd_path}/native-messaging-host -%{crd_path}/remote-assistance-host -%{_sysconfdir}/pam.d/chrome-remote-desktop -%{_sysconfdir}/chromium/native-messaging-hosts/* -%{_sysconfdir}/opt/chrome/ -%{crd_path}/remoting_locales/ -%{crd_path}/start-host -%{crd_path}/user-session -%{_unitdir}/chrome-remote-desktop@.service -/var/lib/chrome-remote-desktop/ -%endif +%{_datadir}/metainfo/chromium-browser.appdata.xml +%{_datadir}/icons/hicolor +%exclude %{_libdir}/chromium/chromedriver +%{_bindir}/chromium-browser +%{_bindir}/chromium +%{_mandir}/man1/chromium-browser.1* %files -n chromedriver -%doc AUTHORS -%license LICENSE +%{_libdir}/chromium/chromedriver %{_bindir}/chromedriver -%{chromium_path}/chromedriver %changelog +* Tue Jul 02 2024 misaka0251 - 125.0.6422.141-1 +- Upgrade to version 125 + * Wed Mar 06 2024 misaka00251 - 119.0.6045.159-1 - Upgrade to version 119 diff --git a/esbuild.tar.gz b/esbuild.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..9d2965e7f76a9ba3207799c3d55fead82cc1366b Binary files /dev/null and b/esbuild.tar.gz differ diff --git a/fix-ffmpeg.patch b/ffmpeg-new-channel-layout.patch similarity index 47% rename from fix-ffmpeg.patch rename to ffmpeg-new-channel-layout.patch index eae342c4a6d8d839183e4b56609cb22fccd0314b..30f873d220f65c549a337fca7115ee5de4314a60 100644 --- a/fix-ffmpeg.patch +++ b/ffmpeg-new-channel-layout.patch @@ -1,50 +1,43 @@ -diff --git a/media/cast/test/fake_media_source.cc b/media/cast/test/fake_media_source.cc -index 94c3f6da21..80a27a315f 100644 ---- a/media/cast/test/fake_media_source.cc -+++ b/media/cast/test/fake_media_source.cc -@@ -166,8 +166,8 @@ void FakeMediaSource::SetSourceFile(const base::FilePath& video_file, - continue; - } - ChannelLayout layout = ChannelLayoutToChromeChannelLayout( -- av_codec_context->ch_layout.u.mask, -- av_codec_context->ch_layout.nb_channels); -+ av_codec_context->channel_layout, -+ av_codec_context->channels); - if (layout == CHANNEL_LAYOUT_UNSUPPORTED) { - LOG(ERROR) << "Unsupported audio channels layout."; - continue; -@@ -179,7 +179,7 @@ void FakeMediaSource::SetSourceFile(const base::FilePath& video_file, - av_audio_context_ = std::move(av_codec_context); - source_audio_params_.Reset( - AudioParameters::AUDIO_PCM_LINEAR, -- {layout, av_audio_context_->ch_layout.nb_channels}, -+ {layout, av_audio_context_->channels}, - av_audio_context_->sample_rate, - av_audio_context_->sample_rate / kAudioPacketsPerSecond); - CHECK(source_audio_params_.IsValid()); -@@ -507,9 +507,9 @@ bool FakeMediaSource::OnNewAudioFrame(AVFrame* frame) { - AVSampleFormatToSampleFormat(av_audio_context_->sample_fmt, - av_audio_context_->codec_id), - ChannelLayoutToChromeChannelLayout( -- av_audio_context_->ch_layout.u.mask, -- av_audio_context_->ch_layout.nb_channels), -- av_audio_context_->ch_layout.nb_channels, av_audio_context_->sample_rate, -+ av_audio_context_->channel_layout, -+ av_audio_context_->channels), -+ av_audio_context_->channels, av_audio_context_->sample_rate, - frames_read, &frame->data[0], - PtsToTimeDelta(frame->pts, av_audio_stream()->time_base)); - audio_algo_.EnqueueBuffer(buffer); +From 6e554a30893150793c2638e3689cf208ffc8e375 Mon Sep 17 00:00:00 2001 +From: Dale Curtis +Date: Sat, 2 Apr 2022 05:13:53 +0000 +Subject: [PATCH] Roll src/third_party/ffmpeg/ 574c39cce..32b2d1d526 (1125 + commits) + +https://chromium.googlesource.com/chromium/third_party/ffmpeg.git/+log/574c39cce323..32b2d1d526 + +Created with: + roll-dep src/third_party/ffmpeg + +Fixed: 1293918 +Cq-Include-Trybots: luci.chromium.try:mac_chromium_asan_rel_ng,linux_chromium_asan_rel_ng,linux_chromium_chromeos_asan_rel_ng +Change-Id: I41945d0f963e3d1f65940067bac22f63b68e37d2 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3565647 +Auto-Submit: Dale Curtis +Reviewed-by: Dan Sanders +Commit-Queue: Dale Curtis +Cr-Commit-Position: refs/heads/main@{#988253} +--- + .../clear_key_cdm/ffmpeg_cdm_audio_decoder.cc | 29 ++++++++++--------- + media/ffmpeg/ffmpeg_common.cc | 11 +++---- + media/filters/audio_file_reader.cc | 9 +++--- + media/filters/audio_file_reader_unittest.cc | 6 ++-- + .../filters/audio_video_metadata_extractor.cc | 11 +++++-- + .../filters/ffmpeg_aac_bitstream_converter.cc | 7 +++-- + ...ffmpeg_aac_bitstream_converter_unittest.cc | 2 +- + media/filters/ffmpeg_audio_decoder.cc | 13 +++++---- + 8 files changed, 51 insertions(+), 37 deletions(-) + diff --git a/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc b/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc -index 7fdb81bf02..2d13c03482 100644 +index e4fc3f460e2..9b1ad9f7675 100644 --- a/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc +++ b/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc @@ -74,7 +74,7 @@ void CdmAudioDecoderConfigToAVCodecContext( codec_context->sample_fmt = AV_SAMPLE_FMT_NONE; } -- codec_context->ch_layout.nb_channels = config.channel_count; -+ codec_context->channels = config.channel_count; +- codec_context->channels = config.channel_count; ++ codec_context->ch_layout.nb_channels = config.channel_count; codec_context->sample_rate = config.samples_per_second; if (config.extra_data) { @@ -52,247 +45,260 @@ index 7fdb81bf02..2d13c03482 100644 case cdm::kAudioFormatPlanarS16: case cdm::kAudioFormatPlanarF32: { const int decoded_size_per_channel = -- decoded_audio_size / av_frame.ch_layout.nb_channels; -- for (int i = 0; i < av_frame.ch_layout.nb_channels; ++i) { -+ decoded_audio_size / av_frame.channels; -+ for (int i = 0; i < av_frame.channels; ++i) { +- decoded_audio_size / av_frame.channels; +- for (int i = 0; i < av_frame.channels; ++i) { ++ decoded_audio_size / av_frame.ch_layout.nb_channels; ++ for (int i = 0; i < av_frame.ch_layout.nb_channels; ++i) { memcpy(output_buffer, av_frame.extended_data[i], decoded_size_per_channel); output_buffer += decoded_size_per_channel; -@@ -186,13 +186,13 @@ bool FFmpegCdmAudioDecoder::Initialize( +@@ -185,13 +185,14 @@ bool FFmpegCdmAudioDecoder::Initialize( + // Success! decoding_loop_ = std::make_unique(codec_context_.get()); samples_per_second_ = config.samples_per_second; - bytes_per_frame_ = -- codec_context_->ch_layout.nb_channels * config.bits_per_channel / 8; -+ codec_context_->channels * config.bits_per_channel / 8; +- bytes_per_frame_ = codec_context_->channels * config.bits_per_channel / 8; ++ bytes_per_frame_ = ++ codec_context_->ch_layout.nb_channels * config.bits_per_channel / 8; output_timestamp_helper_ = std::make_unique(config.samples_per_second); is_initialized_ = true; // Store initial values to guard against midstream configuration changes. -- channels_ = codec_context_->ch_layout.nb_channels; -+ channels_ = codec_context_->channels; +- channels_ = codec_context_->channels; ++ channels_ = codec_context_->ch_layout.nb_channels; av_sample_format_ = codec_context_->sample_fmt; return true; -@@ -292,19 +292,19 @@ cdm::Status FFmpegCdmAudioDecoder::DecodeBuffer( +@@ -291,17 +292,19 @@ cdm::Status FFmpegCdmAudioDecoder::DecodeBuffer( for (auto& frame : audio_frames) { int decoded_audio_size = 0; if (frame->sample_rate != samples_per_second_ || -- frame->ch_layout.nb_channels != channels_ || -+ frame->channels != channels_ || - frame->format != av_sample_format_) { +- frame->channels != channels_ || frame->format != av_sample_format_) { ++ frame->ch_layout.nb_channels != channels_ || ++ frame->format != av_sample_format_) { DLOG(ERROR) << "Unsupported midstream configuration change!" << " Sample Rate: " << frame->sample_rate << " vs " - << samples_per_second_ -- << ", Channels: " << frame->ch_layout.nb_channels << " vs " -+ << ", Channels: " << frame->channels << " vs " - << channels_ << ", Sample Format: " << frame->format << " vs " - << av_sample_format_; +- << samples_per_second_ << ", Channels: " << frame->channels +- << " vs " << channels_ << ", Sample Format: " << frame->format +- << " vs " << av_sample_format_; ++ << samples_per_second_ ++ << ", Channels: " << frame->ch_layout.nb_channels << " vs " ++ << channels_ << ", Sample Format: " << frame->format << " vs " ++ << av_sample_format_; return cdm::kDecodeError; } decoded_audio_size = av_samples_get_buffer_size( -- nullptr, codec_context_->ch_layout.nb_channels, frame->nb_samples, -+ nullptr, codec_context_->channels, frame->nb_samples, +- nullptr, codec_context_->channels, frame->nb_samples, ++ nullptr, codec_context_->ch_layout.nb_channels, frame->nb_samples, codec_context_->sample_fmt, 1); if (!decoded_audio_size) continue; -@@ -324,7 +324,7 @@ bool FFmpegCdmAudioDecoder::OnNewFrame( +@@ -320,9 +323,9 @@ bool FFmpegCdmAudioDecoder::OnNewFrame( + size_t* total_size, std::vector>* audio_frames, AVFrame* frame) { - *total_size += av_samples_get_buffer_size( -- nullptr, codec_context_->ch_layout.nb_channels, frame->nb_samples, -+ nullptr, codec_context_->channels, frame->nb_samples, - codec_context_->sample_fmt, 1); +- *total_size += av_samples_get_buffer_size(nullptr, codec_context_->channels, +- frame->nb_samples, +- codec_context_->sample_fmt, 1); ++ *total_size += av_samples_get_buffer_size( ++ nullptr, codec_context_->ch_layout.nb_channels, frame->nb_samples, ++ codec_context_->sample_fmt, 1); audio_frames->emplace_back(av_frame_clone(frame)); return true; + } diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc -index 910f9ad504..1526c80a40 100644 +index 87ca8969626..76f03d6608e 100644 --- a/media/ffmpeg/ffmpeg_common.cc +++ b/media/ffmpeg/ffmpeg_common.cc -@@ -336,11 +336,11 @@ bool AVCodecContextToAudioDecoderConfig(const AVCodecContext* codec_context, +@@ -345,10 +345,11 @@ bool AVCodecContextToAudioDecoderConfig(const AVCodecContext* codec_context, codec_context->sample_fmt, codec_context->codec_id); ChannelLayout channel_layout = -- codec_context->ch_layout.nb_channels > 8 -+ codec_context->channels > 8 +- codec_context->channels > 8 ++ codec_context->ch_layout.nb_channels > 8 ? CHANNEL_LAYOUT_DISCRETE - : ChannelLayoutToChromeChannelLayout( -- codec_context->ch_layout.u.mask, -- codec_context->ch_layout.nb_channels); -+ codec_context->channel_layout, -+ codec_context->channels); +- : ChannelLayoutToChromeChannelLayout(codec_context->channel_layout, +- codec_context->channels); ++ : ChannelLayoutToChromeChannelLayout( ++ codec_context->ch_layout.u.mask, ++ codec_context->ch_layout.nb_channels); + int sample_rate = codec_context->sample_rate; switch (codec) { - // For AC3/EAC3 we enable only demuxing, but not decoding, so FFmpeg does -@@ -392,7 +392,7 @@ bool AVCodecContextToAudioDecoderConfig(const AVCodecContext* codec_context, +@@ -401,7 +402,7 @@ bool AVCodecContextToAudioDecoderConfig(const AVCodecContext* codec_context, extra_data, encryption_scheme, seek_preroll, codec_context->delay); if (channel_layout == CHANNEL_LAYOUT_DISCRETE) -- config->SetChannelsForDiscrete(codec_context->ch_layout.nb_channels); -+ config->SetChannelsForDiscrete(codec_context->channels); +- config->SetChannelsForDiscrete(codec_context->channels); ++ config->SetChannelsForDiscrete(codec_context->ch_layout.nb_channels); #if BUILDFLAG(ENABLE_PLATFORM_AC3_EAC3_AUDIO) // These are bitstream formats unknown to ffmpeg, so they don't have -@@ -461,7 +461,7 @@ void AudioDecoderConfigToAVCodecContext(const AudioDecoderConfig& config, +@@ -470,7 +471,7 @@ void AudioDecoderConfigToAVCodecContext(const AudioDecoderConfig& config, // TODO(scherkus): should we set |channel_layout|? I'm not sure if FFmpeg uses // said information to decode. -- codec_context->ch_layout.nb_channels = config.channels(); -+ codec_context->channels = config.channels(); +- codec_context->channels = config.channels(); ++ codec_context->ch_layout.nb_channels = config.channels(); codec_context->sample_rate = config.samples_per_second(); if (config.extra_data().empty()) { diff --git a/media/filters/audio_file_reader.cc b/media/filters/audio_file_reader.cc -index 7be0206011..c2e46e41b1 100644 +index 5f257bdfaa6..e1be5aa9a5b 100644 --- a/media/filters/audio_file_reader.cc +++ b/media/filters/audio_file_reader.cc -@@ -114,14 +114,14 @@ bool AudioFileReader::OpenDecoder() { +@@ -113,14 +113,15 @@ bool AudioFileReader::OpenDecoder() { + // Verify the channel layout is supported by Chrome. Acts as a sanity check // against invalid files. See http://crbug.com/171962 - if (ChannelLayoutToChromeChannelLayout( -- codec_context_->ch_layout.u.mask, -- codec_context_->ch_layout.nb_channels) == -+ codec_context_->channel_layout, -+ codec_context_->channels) == +- if (ChannelLayoutToChromeChannelLayout(codec_context_->channel_layout, +- codec_context_->channels) == ++ if (ChannelLayoutToChromeChannelLayout( ++ codec_context_->ch_layout.u.mask, ++ codec_context_->ch_layout.nb_channels) == CHANNEL_LAYOUT_UNSUPPORTED) { return false; } // Store initial values to guard against midstream configuration changes. -- channels_ = codec_context_->ch_layout.nb_channels; -+ channels_ = codec_context_->channels; +- channels_ = codec_context_->channels; ++ channels_ = codec_context_->ch_layout.nb_channels; audio_codec_ = CodecIDToAudioCodec(codec_context_->codec_id); sample_rate_ = codec_context_->sample_rate; av_sample_format_ = codec_context_->sample_fmt; -@@ -224,7 +224,7 @@ bool AudioFileReader::OnNewFrame( +@@ -223,7 +224,7 @@ bool AudioFileReader::OnNewFrame( if (frames_read < 0) return false; -- const int channels = frame->ch_layout.nb_channels; -+ const int channels = frame->channels; +- const int channels = frame->channels; ++ const int channels = frame->ch_layout.nb_channels; if (frame->sample_rate != sample_rate_ || channels != channels_ || frame->format != av_sample_format_) { DLOG(ERROR) << "Unsupported midstream configuration change!" +diff --git a/media/filters/audio_file_reader_unittest.cc b/media/filters/audio_file_reader_unittest.cc +index 2aba7927a31..1f45a50cace 100644 +--- a/media/filters/audio_file_reader_unittest.cc ++++ b/media/filters/audio_file_reader_unittest.cc +@@ -121,11 +121,11 @@ class AudioFileReaderTest : public testing::Test { + EXPECT_FALSE(reader_->Open()); + } + +- void RunTestFailingDecode(const char* fn) { ++ void RunTestFailingDecode(const char* fn, int expect_read = 0) { + Initialize(fn); + EXPECT_TRUE(reader_->Open()); + std::vector> decoded_audio_packets; +- EXPECT_EQ(reader_->Read(&decoded_audio_packets), 0); ++ EXPECT_EQ(reader_->Read(&decoded_audio_packets), expect_read); + } + + void RunTestPartialDecode(const char* fn) { +@@ -219,7 +219,7 @@ TEST_F(AudioFileReaderTest, AAC_ADTS) { + } + + TEST_F(AudioFileReaderTest, MidStreamConfigChangesFail) { +- RunTestFailingDecode("midstream_config_change.mp3"); ++ RunTestFailingDecode("midstream_config_change.mp3", 0); + } + #endif + diff --git a/media/filters/ffmpeg_aac_bitstream_converter.cc b/media/filters/ffmpeg_aac_bitstream_converter.cc -index e26b6cd191..e9fe8494f7 100644 +index 6f231c85729..ca5e5fb927d 100644 --- a/media/filters/ffmpeg_aac_bitstream_converter.cc +++ b/media/filters/ffmpeg_aac_bitstream_converter.cc -@@ -196,14 +196,14 @@ bool FFmpegAACBitstreamConverter::ConvertPacket(AVPacket* packet) { +@@ -195,14 +195,15 @@ bool FFmpegAACBitstreamConverter::ConvertPacket(AVPacket* packet) { + if (!header_generated_ || codec_ != stream_codec_parameters_->codec_id || audio_profile_ != stream_codec_parameters_->profile || sample_rate_index_ != sample_rate_index || - channel_configuration_ != -- stream_codec_parameters_->ch_layout.nb_channels || -+ stream_codec_parameters_->channels || +- channel_configuration_ != stream_codec_parameters_->channels || ++ channel_configuration_ != ++ stream_codec_parameters_->ch_layout.nb_channels || frame_length_ != header_plus_packet_size) { header_generated_ = GenerateAdtsHeader(stream_codec_parameters_->codec_id, 0, // layer stream_codec_parameters_->profile, sample_rate_index, 0, // private stream -- stream_codec_parameters_->ch_layout.nb_channels, -+ stream_codec_parameters_->channels, +- stream_codec_parameters_->channels, ++ stream_codec_parameters_->ch_layout.nb_channels, 0, // originality 0, // home 0, // copyrighted_stream -@@ -215,7 +215,7 @@ bool FFmpegAACBitstreamConverter::ConvertPacket(AVPacket* packet) { +@@ -214,7 +215,7 @@ bool FFmpegAACBitstreamConverter::ConvertPacket(AVPacket* packet) { codec_ = stream_codec_parameters_->codec_id; audio_profile_ = stream_codec_parameters_->profile; sample_rate_index_ = sample_rate_index; -- channel_configuration_ = stream_codec_parameters_->ch_layout.nb_channels; -+ channel_configuration_ = stream_codec_parameters_->channels; +- channel_configuration_ = stream_codec_parameters_->channels; ++ channel_configuration_ = stream_codec_parameters_->ch_layout.nb_channels; frame_length_ = header_plus_packet_size; } diff --git a/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc b/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc -index 1897eb0983..3b46f7f6b6 100644 +index 1fd4c5ccd7d..f59bcd8fdaf 100644 --- a/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc +++ b/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc @@ -34,7 +34,7 @@ class FFmpegAACBitstreamConverterTest : public testing::Test { memset(&test_parameters_, 0, sizeof(AVCodecParameters)); test_parameters_.codec_id = AV_CODEC_ID_AAC; test_parameters_.profile = FF_PROFILE_AAC_MAIN; -- test_parameters_.ch_layout.nb_channels = 2; -+ test_parameters_.channels = 2; +- test_parameters_.channels = 2; ++ test_parameters_.ch_layout.nb_channels = 2; test_parameters_.extradata = extradata_header_; test_parameters_.extradata_size = sizeof(extradata_header_); } diff --git a/media/filters/ffmpeg_audio_decoder.cc b/media/filters/ffmpeg_audio_decoder.cc -index d564ee978a..455b009602 100644 +index 6a56c675f7d..4615fdeb3fb 100644 --- a/media/filters/ffmpeg_audio_decoder.cc +++ b/media/filters/ffmpeg_audio_decoder.cc -@@ -29,7 +29,7 @@ namespace media { +@@ -28,7 +28,7 @@ namespace media { // Return the number of channels from the data in |frame|. static inline int DetermineChannels(AVFrame* frame) { -- return frame->ch_layout.nb_channels; -+ return frame->channels; +- return frame->channels; ++ return frame->ch_layout.nb_channels; } // Called by FFmpeg's allocation routine to allocate a buffer. Uses -@@ -243,7 +243,7 @@ bool FFmpegAudioDecoder::OnNewFrame(const DecoderBuffer& buffer, +@@ -231,7 +231,7 @@ bool FFmpegAudioDecoder::OnNewFrame(const DecoderBuffer& buffer, // Translate unsupported into discrete layouts for discrete configurations; // ffmpeg does not have a labeled discrete configuration internally. ChannelLayout channel_layout = ChannelLayoutToChromeChannelLayout( -- codec_context_->ch_layout.u.mask, codec_context_->ch_layout.nb_channels); -+ codec_context_->channel_layout, codec_context_->channels); +- codec_context_->channel_layout, codec_context_->channels); ++ codec_context_->ch_layout.u.mask, codec_context_->ch_layout.nb_channels); if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED && config_.channel_layout() == CHANNEL_LAYOUT_DISCRETE) { channel_layout = CHANNEL_LAYOUT_DISCRETE; -@@ -360,11 +360,11 @@ bool FFmpegAudioDecoder::ConfigureDecoder(const AudioDecoderConfig& config) { +@@ -348,11 +348,11 @@ bool FFmpegAudioDecoder::ConfigureDecoder(const AudioDecoderConfig& config) { // Success! av_sample_format_ = codec_context_->sample_fmt; -- if (codec_context_->ch_layout.nb_channels != config.channels()) { -+ if (codec_context_->channels != config.channels()) { +- if (codec_context_->channels != config.channels()) { ++ if (codec_context_->ch_layout.nb_channels != config.channels()) { MEDIA_LOG(ERROR, media_log_) << "Audio configuration specified " << config.channels() << " channels, but FFmpeg thinks the file contains " -- << codec_context_->ch_layout.nb_channels << " channels"; -+ << codec_context_->channels << " channels"; +- << codec_context_->channels << " channels"; ++ << codec_context_->ch_layout.nb_channels << " channels"; ReleaseFFmpegResources(); state_ = DecoderState::kUninitialized; return false; -@@ -415,7 +415,7 @@ int FFmpegAudioDecoder::GetAudioBuffer(struct AVCodecContext* s, +@@ -403,7 +403,7 @@ int FFmpegAudioDecoder::GetAudioBuffer(struct AVCodecContext* s, if (frame->nb_samples <= 0) return AVERROR(EINVAL); -- if (s->ch_layout.nb_channels != channels) { -+ if (s->channels != channels) { +- if (s->channels != channels) { ++ if (s->ch_layout.nb_channels != channels) { DLOG(ERROR) << "AVCodecContext and AVFrame disagree on channel count."; return AVERROR(EINVAL); } -@@ -448,8 +448,8 @@ int FFmpegAudioDecoder::GetAudioBuffer(struct AVCodecContext* s, +@@ -436,7 +436,8 @@ int FFmpegAudioDecoder::GetAudioBuffer(struct AVCodecContext* s, ChannelLayout channel_layout = config_.channel_layout() == CHANNEL_LAYOUT_DISCRETE ? CHANNEL_LAYOUT_DISCRETE -- : ChannelLayoutToChromeChannelLayout(s->ch_layout.u.mask, -- s->ch_layout.nb_channels); -+ : ChannelLayoutToChromeChannelLayout(s->channel_layout, -+ s->channels); +- : ChannelLayoutToChromeChannelLayout(s->channel_layout, s->channels); ++ : ChannelLayoutToChromeChannelLayout(s->ch_layout.u.mask, ++ s->ch_layout.nb_channels); if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED) { DLOG(ERROR) << "Unsupported channel layout."; -diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc -index 1a30d294ab..1e327b6638 100644 ---- a/media/filters/ffmpeg_demuxer.cc -+++ b/media/filters/ffmpeg_demuxer.cc -@@ -395,7 +395,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) { - - scoped_refptr buffer; - -- size_t side_data_size = 0; -+ int side_data_size = 0; - uint8_t* side_data = av_packet_get_side_data( - packet.get(), AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, &side_data_size); - -@@ -458,7 +458,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) { - packet->size - data_offset); - } - -- size_t skip_samples_size = 0; -+ int skip_samples_size = 0; - const uint32_t* skip_samples_ptr = - reinterpret_cast(av_packet_get_side_data( - packet.get(), AV_PKT_DATA_SKIP_SAMPLES, &skip_samples_size)); diff --git a/fix-headers-ldflags.patch b/fix-headers-ldflags.patch deleted file mode 100644 index c98f034f3f5b4ffe7df718f074d08161a9f2d750..0000000000000000000000000000000000000000 --- a/fix-headers-ldflags.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 93f423aff6a293ff5212c1d870963c87c7b7823c Mon Sep 17 00:00:00 2001 -From: misaka00251 -Date: Mon, 29 Jan 2024 16:36:54 +0800 -Subject: [PATCH] Fix headers & ldflags - ---- - build/config/compiler/BUILD.gn | 2 +- - v8/src/compiler/turboshaft/utils.h | 1 + - 2 files changed, 2 insertions(+), 1 deletion(-) - -diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn -index 6d05512ae3..b04747fd19 100644 ---- a/build/config/compiler/BUILD.gn -+++ b/build/config/compiler/BUILD.gn -@@ -773,7 +773,7 @@ config("compiler") { - # toolchain has this flag. - # We only use one version of LLVM within a build so there's no need to - # upgrade debug info, which can be expensive since it runs the verifier. -- ldflags += [ "-Wl,-mllvm,-disable-auto-upgrade-debug-info" ] -+ # ldflags += [ "-Wl,-mllvm,-disable-auto-upgrade-debug-info" ] - } - } - -diff --git a/v8/src/compiler/turboshaft/utils.h b/v8/src/compiler/turboshaft/utils.h -index 232c7a6dbd..8b70a15a88 100644 ---- a/v8/src/compiler/turboshaft/utils.h -+++ b/v8/src/compiler/turboshaft/utils.h -@@ -8,6 +8,7 @@ - #include - #include - -+#include - #include "src/base/logging.h" - - namespace v8::internal::compiler::turboshaft { --- -2.39.3 (Apple Git-145) - diff --git a/fix_building_widevinecdm_with_chromium.patch b/fix_building_widevinecdm_with_chromium.patch new file mode 100644 index 0000000000000000000000000000000000000000..24f3d5e5b52a95267726858e8952ef984e888dbf --- /dev/null +++ b/fix_building_widevinecdm_with_chromium.patch @@ -0,0 +1,11 @@ +Index: chromium-79.0.3941.4/third_party/widevine/cdm/widevine_cdm_version.h +=================================================================== +--- chromium-79.0.3941.4.orig/third_party/widevine/cdm/widevine_cdm_version.h ++++ chromium-79.0.3941.4/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 "unknown" + + #endif // WIDEVINE_CDM_VERSION_H_ diff --git a/gcc-enable-lto.patch b/gcc-enable-lto.patch new file mode 100644 index 0000000000000000000000000000000000000000..cdfdf4505a27069ad610badad7e624c1472c0f03 --- /dev/null +++ b/gcc-enable-lto.patch @@ -0,0 +1,70 @@ +Index: chromium-120.0.6099.18/build/config/BUILDCONFIG.gn +=================================================================== +--- chromium-120.0.6099.18.orig/build/config/BUILDCONFIG.gn ++++ chromium-120.0.6099.18/build/config/BUILDCONFIG.gn +@@ -135,6 +135,8 @@ declare_args() { + # set "is_official_build" to true for any build intended to ship to end-users. + is_official_build = false + ++ gcc_lto = false ++ + # Set to true when compiling with the Clang compiler. + is_clang = current_os != "linux" || + (current_cpu != "s390x" && current_cpu != "s390" && +@@ -354,6 +356,12 @@ default_compiler_configs = [ + "//build/config/sanitizers:default_sanitizer_flags", + ] + ++if (gcc_lto) { ++ default_compiler_configs += [ ++ "//build/config/compiler:gcc_lto", ++ ] ++} ++ + if (is_win) { + default_compiler_configs += [ + "//build/config/win:default_cfg_compiler", +Index: chromium-120.0.6099.18/build/config/compiler/BUILD.gn +=================================================================== +--- chromium-120.0.6099.18.orig/build/config/compiler/BUILD.gn ++++ chromium-120.0.6099.18/build/config/compiler/BUILD.gn +@@ -2342,6 +2342,10 @@ if (is_win) { + common_optimize_on_cflags += [ "-fno-math-errno" ] + } + ++config("gcc_lto") { ++ cflags = [ "-flto" ] ++} ++ + config("default_stack_frames") { + if (!is_win) { + if (enable_frame_pointers) { +Index: chromium-120.0.6099.18/sandbox/linux/BUILD.gn +=================================================================== +--- chromium-120.0.6099.18.orig/sandbox/linux/BUILD.gn ++++ chromium-120.0.6099.18/sandbox/linux/BUILD.gn +@@ -253,6 +253,9 @@ component("seccomp_bpf") { + "//build:chromeos_buildflags", + "//sandbox:sandbox_buildflags", + ] ++ if (gcc_lto) { ++ configs -= [ "//build/config/compiler:gcc_lto" ] ++ } + + if (is_android) { + sources += [ +Index: chromium-120.0.6099.18/base/BUILD.gn +=================================================================== +--- chromium-120.0.6099.18.orig/base/BUILD.gn ++++ chromium-120.0.6099.18/base/BUILD.gn +@@ -3830,6 +3830,10 @@ test("base_unittests") { + } + } + ++ if (gcc_lto) { ++ configs -= [ "//build/config/compiler:gcc_lto" ] ++ } ++ + if (use_partition_alloc) { + sources += [ + "allocator/partition_allocator/src/partition_alloc/address_pool_manager_unittest.cc", diff --git a/linux-arm64-0.19.11.tgz b/linux-arm64-0.19.11.tgz deleted file mode 100644 index b9217b3c5621a210da35c774872e24930c7e8661..0000000000000000000000000000000000000000 Binary files a/linux-arm64-0.19.11.tgz and /dev/null differ diff --git a/linux-riscv64-0.19.11.tgz b/linux-riscv64-0.19.11.tgz deleted file mode 100644 index 583e4c2189bae17538c79f5804c9322d66a3fcc7..0000000000000000000000000000000000000000 Binary files a/linux-riscv64-0.19.11.tgz and /dev/null differ diff --git a/linux-x64-0.19.11.tgz b/linux-x64-0.19.11.tgz deleted file mode 100644 index 6baeca86529ac65f81429d91cde76e2e31ab6f29..0000000000000000000000000000000000000000 Binary files a/linux-x64-0.19.11.tgz and /dev/null differ diff --git a/master_preferences b/master_preferences index f14b145f16a2b997cae99dead695cf43f5626cc0..fb748072713beaade420d39df7995870abacc4ee 100644 --- a/master_preferences +++ b/master_preferences @@ -1,30 +1,30 @@ { - "homepage": "https://www.openeuler.org/", - "homepage_is_newtabpage": false, - "distribution": { - "skip_first_run_ui": true, - "alternate_shortcut_text": false, - "oem_bubble": true, - "chrome_shortcut_icon_index": 0, - "create_all_shortcuts": true, - "show_welcome_page": true, - "system_level": false, - "verbose_logging": false, - "make_chrome_default": false, - "make_chrome_default_for_user": false - }, - "download": { - "extensions_to_open": "ymp" - }, - "browser": { - "show_home_button": true, - "check_default_browser": false, - "custom_chrome_frame": true -}, -"bookmark_bar": { - "show_on_all_tabs": true -}, - "first_run_tabs": [ - "https://www.openeuler.org/" - ] -} + "homepage": "https://www.openeuler.org/", + "homepage_is_newtabpage": false, + "distribution": { + "skip_first_run_ui": true, + "alternate_shortcut_text": false, + "oem_bubble": true, + "chrome_shortcut_icon_index": 0, + "create_all_shortcuts": true, + "show_welcome_page": true, + "system_level": false, + "verbose_logging": false, + "make_chrome_default": false, + "make_chrome_default_for_user": false + }, + "download": { + "extensions_to_open": "ymp" + }, + "browser": { + "show_home_button": true, + "check_default_browser": false, + "custom_chrome_frame": true + }, + "bookmark_bar": { + "show_on_all_tabs": true + }, + "first_run_tabs": [ + "https://www.openeuler.org/" + ] + } diff --git a/remove_unbundle.sh b/remove_unbundle.sh deleted file mode 100644 index 95fcd992983123845416b27b198fd33d0d9c6295..0000000000000000000000000000000000000000 --- a/remove_unbundle.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -SOURCE1="keeplibs.txt" -keeplibs=($(cat "${SOURCE1}")) -build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove \ No newline at end of file diff --git a/riscv-angle.patch b/riscv-angle.patch deleted file mode 100644 index f4746988a4a74dd2e0f131a403256c284f0a6dba..0000000000000000000000000000000000000000 --- a/riscv-angle.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: chromium-115.0.5790.98/third_party/angle/src/common/platform.h -=================================================================== ---- chromium-115.0.5790.98.orig/third_party/angle/src/common/platform.h -+++ chromium-115.0.5790.98/third_party/angle/src/common/platform.h -@@ -108,7 +108,7 @@ - #endif - - // Mips and arm devices need to include stddef for size_t. --#if defined(__mips__) || defined(__arm__) || defined(__aarch64__) -+#if defined(__mips__) || defined(__arm__) || defined(__aarch64__) || defined(__riscv) - # include - #endif - diff --git a/riscv-base.patch b/riscv-base.patch deleted file mode 100644 index 513f89b7ceac7179d27c2eade327e3a6cf33fe13..0000000000000000000000000000000000000000 --- a/riscv-base.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: chromium-115.0.5790.170/base/system/sys_info.cc -=================================================================== ---- chromium-115.0.5790.170.orig/base/system/sys_info.cc -+++ chromium-115.0.5790.170/base/system/sys_info.cc -@@ -185,6 +185,8 @@ std::string SysInfo::ProcessCPUArchitect - return "ARM"; - #elif defined(ARCH_CPU_ARM64) - return "ARM_64"; -+#elif defined(ARCH_CPU_RISCV64) -+ return "RISCV_64"; - #else - return std::string(); - #endif diff --git a/riscv-build.patch b/riscv-build.patch index 220817e672205acb6ec1cfd583ad55f631046fe3..2139861f5e47429b161b5a62161700602239c975 100644 --- a/riscv-build.patch +++ b/riscv-build.patch @@ -1,13 +1,13 @@ -Index: chromium-119.0.6045.123/build/nocompile.gni +Index: chromium-122.0.6261.111/build/config/rust.gni =================================================================== ---- chromium-119.0.6045.123.orig/build/nocompile.gni -+++ chromium-119.0.6045.123/build/nocompile.gni -@@ -57,7 +57,7 @@ if (is_win) { - declare_args() { - enable_nocompile_tests = (is_linux || is_chromeos || is_apple || is_win) && - is_clang && host_cpu == target_cpu -- enable_nocompile_tests_new = is_clang && !is_nacl -+ enable_nocompile_tests_new = is_clang && !is_nacl && false - } - - if (enable_nocompile_tests_new) { +--- chromium-122.0.6261.111.orig/build/config/rust.gni ++++ chromium-122.0.6261.111/build/config/rust.gni +@@ -214,6 +214,8 @@ if (is_linux || is_chromeos) { + } else { + rust_abi_target = "arm-unknown-linux-gnueabi" + float_suffix + } ++ } else if (current_cpu == "riscv64") { ++ rust_abi_target = "riscv64gc-unknown-linux-gnu" + } else { + # Best guess for other future platforms. + rust_abi_target = current_cpu + "-unknown-linux-gnu" diff --git a/riscv-cpuinfo.patch b/riscv-cpuinfo.patch new file mode 100644 index 0000000000000000000000000000000000000000..0509ae21b6d8edb207cb3c85a904d9ca510f3676 --- /dev/null +++ b/riscv-cpuinfo.patch @@ -0,0 +1,32 @@ +Index: chromium-124.0.6367.201/third_party/cpuinfo/BUILD.gn +=================================================================== +--- chromium-124.0.6367.201.orig/third_party/cpuinfo/BUILD.gn ++++ chromium-124.0.6367.201/third_party/cpuinfo/BUILD.gn +@@ -123,6 +123,12 @@ source_set("cpu_specific") { + ] + } + ++ if (current_cpu == "riscv64") { ++ sources = [ ++ "src/src/riscv/uarch.c", ++ ] ++ } ++ + # Because "init.c" is reused again, but only has sources in the corresponding + # build config. + deps = [ ":x86_cache" ] +@@ -209,6 +215,14 @@ source_set("cpu_and_os_specific") { + } + } + ++ if (is_linux && current_cpu == "riscv64") { ++ sources = [ ++ "src/src/riscv/linux/init.c", ++ "src/src/riscv/linux/riscv-hw.c", ++ "src/src/riscv/linux/riscv-isa.c", ++ ] ++ } ++ + if (is_android && (current_cpu == "x86" || current_cpu == "x64")) { + sources = [ + "src/src/x86/linux/cpuinfo.c", diff --git a/riscv-sandbox.patch b/riscv-sandbox.patch index 99501ca770a9bb41d62fc588ce6429a75757c84f..a73aa9db5fb6bf0a06f2d1a7e534d4d22308b847 100644 --- a/riscv-sandbox.patch +++ b/riscv-sandbox.patch @@ -1,7 +1,7 @@ -Index: chromium-117.0.5938.132/sandbox/features.gni +Index: chromium-122.0.6261.128/sandbox/features.gni =================================================================== ---- chromium-117.0.5938.132.orig/sandbox/features.gni -+++ chromium-117.0.5938.132/sandbox/features.gni +--- chromium-122.0.6261.128.orig/sandbox/features.gni ++++ chromium-122.0.6261.128/sandbox/features.gni @@ -9,7 +9,8 @@ use_seccomp_bpf = (is_linux || is_chromeos || is_android) && (current_cpu == "x86" || current_cpu == "x64" || @@ -12,10 +12,10 @@ Index: chromium-117.0.5938.132/sandbox/features.gni # SSBD (Speculative Store Bypass Disable) is a mitigation of Spectre Variant 4. # As Spectre Variant 4 can be mitigated by site isolation, opt-out SSBD on site -Index: chromium-117.0.5938.132/sandbox/linux/bpf_dsl/linux_syscall_ranges.h +Index: chromium-122.0.6261.128/sandbox/linux/bpf_dsl/linux_syscall_ranges.h =================================================================== ---- chromium-117.0.5938.132.orig/sandbox/linux/bpf_dsl/linux_syscall_ranges.h -+++ chromium-117.0.5938.132/sandbox/linux/bpf_dsl/linux_syscall_ranges.h +--- chromium-122.0.6261.128.orig/sandbox/linux/bpf_dsl/linux_syscall_ranges.h ++++ chromium-122.0.6261.128/sandbox/linux/bpf_dsl/linux_syscall_ranges.h @@ -56,6 +56,13 @@ #define MAX_PUBLIC_SYSCALL __NR_syscalls #define MAX_SYSCALL MAX_PUBLIC_SYSCALL @@ -30,10 +30,10 @@ Index: chromium-117.0.5938.132/sandbox/linux/bpf_dsl/linux_syscall_ranges.h #else #error "Unsupported architecture" #endif -Index: chromium-117.0.5938.132/sandbox/linux/bpf_dsl/seccomp_macros.h +Index: chromium-122.0.6261.128/sandbox/linux/bpf_dsl/seccomp_macros.h =================================================================== ---- chromium-117.0.5938.132.orig/sandbox/linux/bpf_dsl/seccomp_macros.h -+++ chromium-117.0.5938.132/sandbox/linux/bpf_dsl/seccomp_macros.h +--- chromium-122.0.6261.128.orig/sandbox/linux/bpf_dsl/seccomp_macros.h ++++ chromium-122.0.6261.128/sandbox/linux/bpf_dsl/seccomp_macros.h @@ -343,6 +343,48 @@ struct regs_struct { #define SECCOMP_PT_PARM4(_regs) (_regs).regs[3] #define SECCOMP_PT_PARM5(_regs) (_regs).regs[4] @@ -83,10 +83,10 @@ Index: chromium-117.0.5938.132/sandbox/linux/bpf_dsl/seccomp_macros.h #else #error Unsupported target platform -Index: chromium-117.0.5938.132/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc +Index: chromium-122.0.6261.128/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc =================================================================== ---- chromium-117.0.5938.132.orig/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc -+++ chromium-117.0.5938.132/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc +--- chromium-122.0.6261.128.orig/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc ++++ chromium-122.0.6261.128/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc @@ -60,6 +60,9 @@ bool IsBaselinePolicyAllowed(int sysno) #if defined(__mips__) SyscallSets::IsMipsPrivate(sysno) || @@ -133,10 +133,10 @@ Index: chromium-117.0.5938.132/sandbox/linux/seccomp-bpf-helpers/baseline_policy if (sysno == __NR_pipe) { return Allow(); } -Index: chromium-117.0.5938.132/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc +Index: chromium-122.0.6261.128/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc =================================================================== ---- chromium-117.0.5938.132.orig/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc -+++ chromium-117.0.5938.132/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc +--- chromium-122.0.6261.128.orig/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc ++++ chromium-122.0.6261.128/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc @@ -37,6 +37,7 @@ #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \ @@ -145,7 +145,7 @@ Index: chromium-117.0.5938.132/sandbox/linux/seccomp-bpf-helpers/syscall_paramet !defined(PTRACE_GET_THREAD_AREA) // Also include asm/ptrace-abi.h since ptrace.h in older libc (for instance // the one in Ubuntu 16.04 LTS) is missing PTRACE_GET_THREAD_AREA. -@@ -449,8 +450,10 @@ ResultExpr RestrictPtrace() { +@@ -463,8 +464,10 @@ ResultExpr RestrictPtrace() { #endif return Switch(request) .Cases({ @@ -157,10 +157,10 @@ Index: chromium-117.0.5938.132/sandbox/linux/seccomp-bpf-helpers/syscall_paramet PTRACE_GETREGSET, #endif #if defined(__arm__) -Index: chromium-117.0.5938.132/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc +Index: chromium-122.0.6261.128/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc =================================================================== ---- chromium-117.0.5938.132.orig/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc -+++ chromium-117.0.5938.132/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc +--- chromium-122.0.6261.128.orig/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc ++++ chromium-122.0.6261.128/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc @@ -103,7 +103,7 @@ bool SyscallSets::IsUmask(int sysno) { // Both EPERM and ENOENT are valid errno unless otherwise noted in comment. bool SyscallSets::IsFileSystem(int sysno) { @@ -389,7 +389,7 @@ Index: chromium-117.0.5938.132/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc case __NR_inotify_init: #endif case __NR_inotify_init1: -@@ -1137,7 +1140,7 @@ bool SyscallSets::IsMisc(int sysno) { +@@ -1134,7 +1137,7 @@ bool SyscallSets::IsMisc(int sysno) { #if defined(__x86_64__) case __NR_tuxcall: #endif @@ -398,13 +398,14 @@ Index: chromium-117.0.5938.132/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc case __NR_vserver: #endif return true; -@@ -1196,6 +1199,17 @@ bool SyscallSets::IsMipsMisc(int sysno) +@@ -1193,6 +1196,18 @@ bool SyscallSets::IsMipsMisc(int sysno) } #endif // defined(__mips__) +#if defined(__riscv) +bool SyscallSets::IsRiscvPrivate(int sysno) { + switch (sysno) { ++ case __NR_riscv_hwprobe: + case __NR_riscv_flush_icache: + return true; + default: @@ -416,10 +417,10 @@ Index: chromium-117.0.5938.132/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc bool SyscallSets::IsGoogle3Threading(int sysno) { switch (sysno) { case __NR_getitimer: -Index: chromium-117.0.5938.132/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h +Index: chromium-122.0.6261.128/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h =================================================================== ---- chromium-117.0.5938.132.orig/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h -+++ chromium-117.0.5938.132/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h +--- chromium-122.0.6261.128.orig/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h ++++ chromium-122.0.6261.128/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h @@ -52,7 +52,7 @@ class SANDBOX_EXPORT SyscallSets { #endif @@ -464,10 +465,10 @@ Index: chromium-117.0.5938.132/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h static bool IsGoogle3Threading(int sysno); }; -Index: chromium-117.0.5938.132/sandbox/linux/seccomp-bpf/syscall.cc +Index: chromium-122.0.6261.128/sandbox/linux/seccomp-bpf/syscall.cc =================================================================== ---- chromium-117.0.5938.132.orig/sandbox/linux/seccomp-bpf/syscall.cc -+++ chromium-117.0.5938.132/sandbox/linux/seccomp-bpf/syscall.cc +--- chromium-122.0.6261.128.orig/sandbox/linux/seccomp-bpf/syscall.cc ++++ chromium-122.0.6261.128/sandbox/linux/seccomp-bpf/syscall.cc @@ -18,7 +18,7 @@ namespace sandbox { namespace { @@ -537,10 +538,10 @@ Index: chromium-117.0.5938.132/sandbox/linux/seccomp-bpf/syscall.cc #else #error "Unimplemented architecture" #endif -Index: chromium-117.0.5938.132/sandbox/linux/services/credentials.cc +Index: chromium-122.0.6261.128/sandbox/linux/services/credentials.cc =================================================================== ---- chromium-117.0.5938.132.orig/sandbox/linux/services/credentials.cc -+++ chromium-117.0.5938.132/sandbox/linux/services/credentials.cc +--- chromium-122.0.6261.128.orig/sandbox/linux/services/credentials.cc ++++ chromium-122.0.6261.128/sandbox/linux/services/credentials.cc @@ -80,7 +80,7 @@ bool ChrootToSafeEmptyDir() { pid_t pid = -1; alignas(16) char stack_buf[PTHREAD_STACK_MIN]; @@ -550,10 +551,10 @@ Index: chromium-117.0.5938.132/sandbox/linux/services/credentials.cc // The stack grows downward. void* stack = stack_buf + sizeof(stack_buf); #else -Index: chromium-117.0.5938.132/sandbox/linux/services/syscall_wrappers.cc +Index: chromium-122.0.6261.128/sandbox/linux/services/syscall_wrappers.cc =================================================================== ---- chromium-117.0.5938.132.orig/sandbox/linux/services/syscall_wrappers.cc -+++ chromium-117.0.5938.132/sandbox/linux/services/syscall_wrappers.cc +--- chromium-122.0.6261.128.orig/sandbox/linux/services/syscall_wrappers.cc ++++ chromium-122.0.6261.128/sandbox/linux/services/syscall_wrappers.cc @@ -61,7 +61,7 @@ long sys_clone(unsigned long flags, #if defined(ARCH_CPU_X86_64) return syscall(__NR_clone, flags, child_stack, ptid, ctid, tls); @@ -563,10 +564,10 @@ Index: chromium-117.0.5938.132/sandbox/linux/services/syscall_wrappers.cc // CONFIG_CLONE_BACKWARDS defined. return syscall(__NR_clone, flags, child_stack, ptid, tls, ctid); #endif -Index: chromium-117.0.5938.132/sandbox/linux/syscall_broker/broker_process.cc +Index: chromium-122.0.6261.128/sandbox/linux/syscall_broker/broker_process.cc =================================================================== ---- chromium-117.0.5938.132.orig/sandbox/linux/syscall_broker/broker_process.cc -+++ chromium-117.0.5938.132/sandbox/linux/syscall_broker/broker_process.cc +--- chromium-122.0.6261.128.orig/sandbox/linux/syscall_broker/broker_process.cc ++++ chromium-122.0.6261.128/sandbox/linux/syscall_broker/broker_process.cc @@ -122,44 +122,46 @@ bool BrokerProcess::IsSyscallBrokerable( // and are default disabled in Android. So, we should refuse to broker them // to be consistent with the platform's restrictions. @@ -639,10 +640,10 @@ Index: chromium-117.0.5938.132/sandbox/linux/syscall_broker/broker_process.cc case __NR_unlink: return !fast_check || policy_->allowed_command_set.test(COMMAND_UNLINK); #endif -Index: chromium-117.0.5938.132/sandbox/linux/system_headers/linux_seccomp.h +Index: chromium-122.0.6261.128/sandbox/linux/system_headers/linux_seccomp.h =================================================================== ---- chromium-117.0.5938.132.orig/sandbox/linux/system_headers/linux_seccomp.h -+++ chromium-117.0.5938.132/sandbox/linux/system_headers/linux_seccomp.h +--- chromium-122.0.6261.128.orig/sandbox/linux/system_headers/linux_seccomp.h ++++ chromium-122.0.6261.128/sandbox/linux/system_headers/linux_seccomp.h @@ -39,6 +39,10 @@ #define EM_AARCH64 183 #endif @@ -665,10 +666,10 @@ Index: chromium-117.0.5938.132/sandbox/linux/system_headers/linux_seccomp.h // For prctl.h #ifndef PR_SET_SECCOMP #define PR_SET_SECCOMP 22 -Index: chromium-117.0.5938.132/sandbox/linux/system_headers/linux_signal.h +Index: chromium-122.0.6261.128/sandbox/linux/system_headers/linux_signal.h =================================================================== ---- chromium-117.0.5938.132.orig/sandbox/linux/system_headers/linux_signal.h -+++ chromium-117.0.5938.132/sandbox/linux/system_headers/linux_signal.h +--- chromium-122.0.6261.128.orig/sandbox/linux/system_headers/linux_signal.h ++++ chromium-122.0.6261.128/sandbox/linux/system_headers/linux_signal.h @@ -13,7 +13,7 @@ // (not undefined, but defined different values and in different memory // layouts). So, fill the gap here. @@ -678,10 +679,10 @@ Index: chromium-117.0.5938.132/sandbox/linux/system_headers/linux_signal.h #define LINUX_SIGHUP 1 #define LINUX_SIGINT 2 -Index: chromium-117.0.5938.132/sandbox/linux/system_headers/linux_stat.h +Index: chromium-122.0.6261.128/sandbox/linux/system_headers/linux_stat.h =================================================================== ---- chromium-117.0.5938.132.orig/sandbox/linux/system_headers/linux_stat.h -+++ chromium-117.0.5938.132/sandbox/linux/system_headers/linux_stat.h +--- chromium-122.0.6261.128.orig/sandbox/linux/system_headers/linux_stat.h ++++ chromium-122.0.6261.128/sandbox/linux/system_headers/linux_stat.h @@ -150,7 +150,7 @@ struct kernel_stat { int st_blocks; int st_pad4[14]; @@ -691,10 +692,10 @@ Index: chromium-117.0.5938.132/sandbox/linux/system_headers/linux_stat.h struct kernel_stat { unsigned long st_dev; unsigned long st_ino; -Index: chromium-117.0.5938.132/sandbox/linux/system_headers/linux_syscalls.h +Index: chromium-122.0.6261.128/sandbox/linux/system_headers/linux_syscalls.h =================================================================== ---- chromium-117.0.5938.132.orig/sandbox/linux/system_headers/linux_syscalls.h -+++ chromium-117.0.5938.132/sandbox/linux/system_headers/linux_syscalls.h +--- chromium-122.0.6261.128.orig/sandbox/linux/system_headers/linux_syscalls.h ++++ chromium-122.0.6261.128/sandbox/linux/system_headers/linux_syscalls.h @@ -35,5 +35,9 @@ #include "sandbox/linux/system_headers/arm64_linux_syscalls.h" #endif @@ -705,11 +706,11 @@ Index: chromium-117.0.5938.132/sandbox/linux/system_headers/linux_syscalls.h + #endif // SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SYSCALLS_H_ -Index: chromium-117.0.5938.132/sandbox/linux/system_headers/riscv64_linux_syscalls.h +Index: chromium-122.0.6261.128/sandbox/linux/system_headers/riscv64_linux_syscalls.h =================================================================== --- /dev/null -+++ chromium-117.0.5938.132/sandbox/linux/system_headers/riscv64_linux_syscalls.h -@@ -0,0 +1,1222 @@ ++++ chromium-122.0.6261.128/sandbox/linux/system_headers/riscv64_linux_syscalls.h +@@ -0,0 +1,1226 @@ +// Copyright 2014 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. @@ -1695,6 +1696,10 @@ Index: chromium-117.0.5938.132/sandbox/linux/system_headers/riscv64_linux_syscal +#define __NR_recvmmsg 243 +#endif + ++#if !defined(__NR_riscv_hwprobe) ++#define __NR_riscv_hwprobe 258 ++#endif ++ +#if !defined(__NR_riscv_flush_icache) +#define __NR_riscv_flush_icache 259 +#endif @@ -1932,10 +1937,10 @@ Index: chromium-117.0.5938.132/sandbox/linux/system_headers/riscv64_linux_syscal +#endif + +#endif // SANDBOX_LINUX_SYSTEM_HEADERS_RISCV64_LINUX_SYSCALLS_H_ -Index: chromium-117.0.5938.132/sandbox/policy/linux/bpf_cdm_policy_linux.cc +Index: chromium-122.0.6261.128/sandbox/policy/linux/bpf_cdm_policy_linux.cc =================================================================== ---- chromium-117.0.5938.132.orig/sandbox/policy/linux/bpf_cdm_policy_linux.cc -+++ chromium-117.0.5938.132/sandbox/policy/linux/bpf_cdm_policy_linux.cc +--- chromium-122.0.6261.128.orig/sandbox/policy/linux/bpf_cdm_policy_linux.cc ++++ chromium-122.0.6261.128/sandbox/policy/linux/bpf_cdm_policy_linux.cc @@ -33,7 +33,7 @@ ResultExpr CdmProcessPolicy::EvaluateSys case __NR_ftruncate: case __NR_fallocate: @@ -1945,10 +1950,10 @@ Index: chromium-117.0.5938.132/sandbox/policy/linux/bpf_cdm_policy_linux.cc case __NR_getrlimit: #endif #if defined(__i386__) || defined(__arm__) -Index: chromium-117.0.5938.132/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc +Index: chromium-122.0.6261.128/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc =================================================================== ---- chromium-117.0.5938.132.orig/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc -+++ chromium-117.0.5938.132/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc +--- chromium-122.0.6261.128.orig/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc ++++ chromium-122.0.6261.128/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc @@ -38,7 +38,7 @@ ResultExpr CrosAmdGpuProcessPolicy::Eval case __NR_sched_setscheduler: case __NR_sysinfo: @@ -1958,10 +1963,10 @@ Index: chromium-117.0.5938.132/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linu case __NR_readlink: case __NR_stat: #endif -Index: chromium-117.0.5938.132/sandbox/policy/linux/bpf_gpu_policy_linux.cc +Index: chromium-122.0.6261.128/sandbox/policy/linux/bpf_gpu_policy_linux.cc =================================================================== ---- chromium-117.0.5938.132.orig/sandbox/policy/linux/bpf_gpu_policy_linux.cc -+++ chromium-117.0.5938.132/sandbox/policy/linux/bpf_gpu_policy_linux.cc +--- chromium-122.0.6261.128.orig/sandbox/policy/linux/bpf_gpu_policy_linux.cc ++++ chromium-122.0.6261.128/sandbox/policy/linux/bpf_gpu_policy_linux.cc @@ -73,7 +73,7 @@ ResultExpr GpuProcessPolicy::EvaluateSys (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) case __NR_ftruncate64: @@ -1971,10 +1976,10 @@ Index: chromium-117.0.5938.132/sandbox/policy/linux/bpf_gpu_policy_linux.cc case __NR_getdents: #endif case __NR_getdents64: -Index: chromium-117.0.5938.132/sandbox/policy/linux/bpf_network_policy_linux.cc +Index: chromium-122.0.6261.128/sandbox/policy/linux/bpf_network_policy_linux.cc =================================================================== ---- chromium-117.0.5938.132.orig/sandbox/policy/linux/bpf_network_policy_linux.cc -+++ chromium-117.0.5938.132/sandbox/policy/linux/bpf_network_policy_linux.cc +--- chromium-122.0.6261.128.orig/sandbox/policy/linux/bpf_network_policy_linux.cc ++++ chromium-122.0.6261.128/sandbox/policy/linux/bpf_network_policy_linux.cc @@ -255,7 +255,7 @@ ResultExpr NetworkProcessPolicy::Evaluat case __NR_fdatasync: case __NR_fsync: @@ -1984,10 +1989,10 @@ Index: chromium-117.0.5938.132/sandbox/policy/linux/bpf_network_policy_linux.cc case __NR_getdents: #endif case __NR_getdents64: -Index: chromium-117.0.5938.132/sandbox/policy/linux/bpf_print_compositor_policy_linux.cc +Index: chromium-122.0.6261.128/sandbox/policy/linux/bpf_print_compositor_policy_linux.cc =================================================================== ---- chromium-117.0.5938.132.orig/sandbox/policy/linux/bpf_print_compositor_policy_linux.cc -+++ chromium-117.0.5938.132/sandbox/policy/linux/bpf_print_compositor_policy_linux.cc +--- chromium-122.0.6261.128.orig/sandbox/policy/linux/bpf_print_compositor_policy_linux.cc ++++ chromium-122.0.6261.128/sandbox/policy/linux/bpf_print_compositor_policy_linux.cc @@ -33,7 +33,7 @@ ResultExpr PrintCompositorProcessPolicy: case __NR_fdatasync: case __NR_fsync: @@ -1997,11 +2002,11 @@ Index: chromium-117.0.5938.132/sandbox/policy/linux/bpf_print_compositor_policy_ case __NR_getrlimit: #endif #if defined(__i386__) || defined(__arm__) -Index: chromium-117.0.5938.132/sandbox/policy/linux/bpf_renderer_policy_linux.cc +Index: chromium-122.0.6261.128/sandbox/policy/linux/bpf_renderer_policy_linux.cc =================================================================== ---- chromium-117.0.5938.132.orig/sandbox/policy/linux/bpf_renderer_policy_linux.cc -+++ chromium-117.0.5938.132/sandbox/policy/linux/bpf_renderer_policy_linux.cc -@@ -71,7 +71,7 @@ ResultExpr RendererProcessPolicy::Evalua +--- chromium-122.0.6261.128.orig/sandbox/policy/linux/bpf_renderer_policy_linux.cc ++++ chromium-122.0.6261.128/sandbox/policy/linux/bpf_renderer_policy_linux.cc +@@ -82,7 +82,7 @@ ResultExpr RendererProcessPolicy::Evalua case __NR_ftruncate64: #endif #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ @@ -2010,10 +2015,10 @@ Index: chromium-117.0.5938.132/sandbox/policy/linux/bpf_renderer_policy_linux.cc case __NR_getrlimit: case __NR_setrlimit: // We allow setrlimit to dynamically adjust the address space limit as -Index: chromium-117.0.5938.132/sandbox/policy/linux/bpf_service_policy_linux.cc +Index: chromium-122.0.6261.128/sandbox/policy/linux/bpf_service_policy_linux.cc =================================================================== ---- chromium-117.0.5938.132.orig/sandbox/policy/linux/bpf_service_policy_linux.cc -+++ chromium-117.0.5938.132/sandbox/policy/linux/bpf_service_policy_linux.cc +--- chromium-122.0.6261.128.orig/sandbox/policy/linux/bpf_service_policy_linux.cc ++++ chromium-122.0.6261.128/sandbox/policy/linux/bpf_service_policy_linux.cc @@ -26,7 +26,7 @@ ResultExpr ServiceProcessPolicy::Evaluat return RestrictIoctl(); // Allow the system calls below. @@ -2023,10 +2028,10 @@ Index: chromium-117.0.5938.132/sandbox/policy/linux/bpf_service_policy_linux.cc case __NR_getrlimit: #endif #if defined(__i386__) || defined(__arm__) -Index: chromium-117.0.5938.132/sandbox/policy/linux/bpf_utility_policy_linux.cc +Index: chromium-122.0.6261.128/sandbox/policy/linux/bpf_utility_policy_linux.cc =================================================================== ---- chromium-117.0.5938.132.orig/sandbox/policy/linux/bpf_utility_policy_linux.cc -+++ chromium-117.0.5938.132/sandbox/policy/linux/bpf_utility_policy_linux.cc +--- chromium-122.0.6261.128.orig/sandbox/policy/linux/bpf_utility_policy_linux.cc ++++ chromium-122.0.6261.128/sandbox/policy/linux/bpf_utility_policy_linux.cc @@ -34,7 +34,7 @@ ResultExpr UtilityProcessPolicy::Evaluat case __NR_fdatasync: case __NR_fsync: diff --git a/riscv-swiftshader.patch b/riscv-swiftshader.patch index 323ee2e65371fa52153fb5bc68fa88e523e94c84..712e9d209f330d8f965e12cc4679b5c28ccf368f 100644 --- a/riscv-swiftshader.patch +++ b/riscv-swiftshader.patch @@ -1,7 +1,7 @@ -Index: chromium-115.0.5790.170/third_party/swiftshader/src/Reactor/BUILD.gn +Index: chromium-122.0.6261.111/third_party/swiftshader/src/Reactor/BUILD.gn =================================================================== ---- chromium-115.0.5790.170.orig/third_party/swiftshader/src/Reactor/BUILD.gn -+++ chromium-115.0.5790.170/third_party/swiftshader/src/Reactor/BUILD.gn +--- chromium-122.0.6261.111.orig/third_party/swiftshader/src/Reactor/BUILD.gn ++++ chromium-122.0.6261.111/third_party/swiftshader/src/Reactor/BUILD.gn @@ -307,7 +307,7 @@ if (supports_subzero) { if (supports_llvm) { @@ -11,3 +11,15 @@ Index: chromium-115.0.5790.170/third_party/swiftshader/src/Reactor/BUILD.gn deps = [ ":swiftshader_reactor_base", +Index: chromium-122.0.6261.111/third_party/swiftshader/third_party/llvm-16.0/BUILD.gn +=================================================================== +--- chromium-122.0.6261.111.orig/third_party/swiftshader/third_party/llvm-16.0/BUILD.gn ++++ chromium-122.0.6261.111/third_party/swiftshader/third_party/llvm-16.0/BUILD.gn +@@ -773,6 +773,7 @@ swiftshader_llvm_source_set("swiftshader + "llvm/lib/MC/MCContext.cpp", + "llvm/lib/MC/MCDXContainerStreamer.cpp", + "llvm/lib/MC/MCDXContainerWriter.cpp", ++ "llvm/lib/MC/MCDisassembler/MCDisassembler.cpp", + "llvm/lib/MC/MCDisassembler/MCRelocationInfo.cpp", + "llvm/lib/MC/MCDwarf.cpp", + "llvm/lib/MC/MCELFObjectTargetWriter.cpp", diff --git a/swiftshader-2.patch b/swiftshader-2.patch new file mode 100644 index 0000000000000000000000000000000000000000..64cfd36b51a89b4b6b4f90b443451fce2401c62f --- /dev/null +++ b/swiftshader-2.patch @@ -0,0 +1,29 @@ +description: additional swiftshader stuff exposed by official builds +author: Andres Salomon + +--- a/chrome/BUILD.gn ++++ b/chrome/BUILD.gn +@@ -1719,7 +1719,6 @@ if (is_linux || is_chromeos) { + ":chrome_symbols", + ] + if (is_linux) { +- deps += [ ":swiftshader_vk_symbols" ] + } + if (!is_chromeos) { + deps += [ ":angle_libvulkan_symbols" ] +@@ -1752,6 +1751,7 @@ if (is_linux || is_chromeos) { + + deps = [ "//components/crash/core/app:chrome_crashpad_handler" ] + } ++if (false) { + extract_symbols("swiftshader_vk_symbols") { + binary = "$root_out_dir/libvk_swiftshader.so" + +@@ -1764,6 +1764,7 @@ if (is_linux || is_chromeos) { + + deps = [ "//third_party/swiftshader/src/Vulkan:swiftshader_libvulkan" ] + } ++} + extract_symbols("angle_egl_symbols") { + binary = "$root_out_dir/libEGL.so" + diff --git a/swiftshader.patch b/swiftshader.patch new file mode 100644 index 0000000000000000000000000000000000000000..dbafaece2681d4cd7eaef6282246f583b8d3c2c7 --- /dev/null +++ b/swiftshader.patch @@ -0,0 +1,34 @@ +description: avoid building the swiftshader library +author: Michael Gilbert + +--- a/BUILD.gn ++++ b/BUILD.gn +@@ -495,7 +495,7 @@ group("gn_all") { + ] + } + +- if ((is_win || is_mac || is_linux || is_chromeos || is_fuchsia) && ++ if (false && + (target_cpu == "x86" || target_cpu == "x64")) { + deps += [ + "//third_party/swiftshader/src/Vulkan:icd_file", +--- a/third_party/angle/gni/angle.gni ++++ b/third_party/angle/gni/angle.gni +@@ -171,7 +171,7 @@ declare_args() { + ((angle_use_x11 && !is_chromeos) || angle_use_wayland || is_castos)) && + !is_fuchsia && !angle_is_winuwp && !is_ggp && !is_win_arm64 + +- angle_enable_vulkan = ++ angle_enable_vulkan = false && + angle_has_build && + !(is_android && build_with_chromium && is_official_build) && + ((is_win && !angle_is_winuwp) || +--- a/gpu/vulkan/features.gni ++++ b/gpu/vulkan/features.gni +@@ -14,5 +14,5 @@ declare_args() { + # Enable swiftshader vulkan. Disabling it can save build time, however + # --use-vulkan=swiftshader and some tests which use swiftshader vulkan will + # not work. +- enable_swiftshader_vulkan = true ++ enable_swiftshader_vulkan = false + } diff --git a/system-libdrm.patch b/system-libdrm.patch new file mode 100644 index 0000000000000000000000000000000000000000..171241108f58a5c209c9caa40ae3b35bc158b0f7 --- /dev/null +++ b/system-libdrm.patch @@ -0,0 +1,42 @@ +Index: chromium-114.0.5735.90/build/linux/unbundle/libdrm.gn +=================================================================== +--- chromium-114.0.5735.90.orig/build/linux/unbundle/libdrm.gn ++++ chromium-114.0.5735.90/build/linux/unbundle/libdrm.gn +@@ -11,7 +11,10 @@ pkg_config("system_libdrm") { + + shim_headers("libdrm_shim") { + root_path = "src/include" +- headers = [ "drm.h" ] ++ headers = [ ++ "drm.h", ++ "drm_fourcc.h", ++ ] + } + + source_set("libdrm") { +Index: chromium-114.0.5735.90/ui/ozone/platform/drm/gpu/hardware_display_controller.cc +=================================================================== +--- chromium-114.0.5735.90.orig/ui/ozone/platform/drm/gpu/hardware_display_controller.cc ++++ chromium-114.0.5735.90/ui/ozone/platform/drm/gpu/hardware_display_controller.cc +@@ -18,7 +18,7 @@ + #include "base/metrics/histogram_macros.h" + #include "base/ranges/algorithm.h" + #include "base/trace_event/typed_macros.h" +-#include "third_party/libdrm/src/include/drm/drm_fourcc.h" ++#include + #include "third_party/perfetto/include/perfetto/tracing/traced_value.h" + #include "third_party/skia/include/core/SkCanvas.h" + #include "third_party/skia/include/core/SkImage.h" +Index: chromium-114.0.5735.90/media/gpu/chromeos/video_decoder_pipeline_unittest.cc +=================================================================== +--- chromium-114.0.5735.90.orig/media/gpu/chromeos/video_decoder_pipeline_unittest.cc ++++ chromium-114.0.5735.90/media/gpu/chromeos/video_decoder_pipeline_unittest.cc +@@ -25,7 +25,7 @@ + #include "media/gpu/chromeos/dmabuf_video_frame_pool.h" + #include "testing/gmock/include/gmock/gmock.h" + #include "testing/gtest/include/gtest/gtest.h" +-#include "third_party/libdrm/src/include/drm/drm_fourcc.h" ++#include + + #if BUILDFLAG(IS_CHROMEOS_ASH) + // gn check does not account for BUILDFLAG(), so including this header will