From d9749abbcf705156d2f135b5f37d2052497f0e0d02e6aba49bea8a9621666628 Mon Sep 17 00:00:00 2001 From: Andreas Stieger Date: Sun, 19 May 2024 04:52:11 +0000 Subject: [PATCH 001/345] Accepting request 1175065 from home:oertel:branches:network:chromium next attempt, an actually running chromium-125 OBS-URL: https://build.opensuse.org/request/show/1175065 OBS-URL: https://build.opensuse.org/package/show/network:chromium/chromium-beta?expand=0&rev=1 --- .gitattributes | 23 + .gitignore | 1 + Cr122-ffmpeg-new-channel-layout.patch | 350 + INSTALL.sh | 153 + README.SUSE | 9 + _constraints | 24 + chrome-wrapper | 34 + chromium-102-regex_pattern-array.patch | 16 + chromium-106-ffmpeg-duration.patch | 17 + chromium-115-compiler-SkColor4f.patch | 26 + chromium-117-string-convert.patch | 21 + chromium-117-system-zstd.patch | 47 + chromium-119-assert.patch | 12 + chromium-120-emplace.patch | 463 + chromium-120-make_unique-struct.patch | 12 + ...-121-nullptr_t-without-namespace-std.patch | 12 + chromium-121-rust-clang_lib.patch | 41 + ...karound_clang_bug-structured_binding.patch | 70 + chromium-123-missing-QtGui.patch | 12 + chromium-123-stats-collector.patch | 19 + chromium-124-system-libxml.patch | 24 + chromium-125-appservice-include.patch | 26 + chromium-125-compiler.patch | 270 + chromium-125-debian-bad-font-gc0.patch | 250 + chromium-125-debian-bad-font-gc00.patch | 159 + chromium-125-debian-bad-font-gc000.patch | 107 + chromium-125-debian-bad-font-gc0000.patch | 425 + chromium-125-debian-bad-font-gc1.patch | 258 + chromium-125-debian-bad-font-gc11.patch | 420 + chromium-125-debian-bad-font-gc2.patch | 3727 +++++++ chromium-125-debian-bad-font-gc3.patch | 38 + chromium-125-disable-FFmpegAllowLists.patch | 12 + chromium-125-emplace-struct.patch | 68 + ...mium-125-ffmpeg-5.x-reordered_opaque.patch | 105 + chromium-125-lens-include.patch | 25 + chromium-125-lp155-typename.patch | 376 + chromium-125-missing-header-files.patch | 246 + chromium-125-mojo-bindings-include.patch | 25 + chromium-125-ninja.patch | 27 + chromium-125-no-vector-consts.patch | 259 + chromium-125-no_matching_constructor.patch | 1141 +++ chromium-125-tabstrip-include.patch | 26 + chromium-125-vulkan-include.patch | 16 + chromium-125.0.6422.60.tar.xz | 3 + ...-java-only-allowed-in-android-builds.patch | 16 + chromium-93-ffmpeg-4.4.patch | 67 + chromium-94-ffmpeg-roll.patch | 12 + chromium-buildname.patch | 13 + ...ble-GlobalMediaControlsCastStartStop.patch | 13 + chromium-disable-parallel-gold.patch | 13 + chromium-libusb_interrupt_event_handler.patch | 15 + chromium-master-prefs-path.patch | 16 + chromium-norar.patch | 107 + chromium-prop-codecs.patch | 17 + chromium-symbolic.svg | 30 + chromium.changes | 8798 +++++++++++++++++ chromium.spec | 1049 ++ esbuild.tar.gz | 3 + exclude_ymp.patch | 10 + ffmpeg-new-channel-layout.patch | 304 + fix_building_widevinecdm_with_chromium.patch | 11 + gcc-enable-lto.patch | 70 + master_preferences | 31 + system-libdrm.patch | 42 + 64 files changed, 20032 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 Cr122-ffmpeg-new-channel-layout.patch create mode 100644 INSTALL.sh create mode 100644 README.SUSE create mode 100644 _constraints create mode 100644 chrome-wrapper create mode 100644 chromium-102-regex_pattern-array.patch create mode 100644 chromium-106-ffmpeg-duration.patch create mode 100644 chromium-115-compiler-SkColor4f.patch create mode 100644 chromium-117-string-convert.patch create mode 100644 chromium-117-system-zstd.patch create mode 100644 chromium-119-assert.patch create mode 100644 chromium-120-emplace.patch create mode 100644 chromium-120-make_unique-struct.patch create mode 100644 chromium-121-nullptr_t-without-namespace-std.patch create mode 100644 chromium-121-rust-clang_lib.patch create mode 100644 chromium-122-workaround_clang_bug-structured_binding.patch create mode 100644 chromium-123-missing-QtGui.patch create mode 100644 chromium-123-stats-collector.patch create mode 100644 chromium-124-system-libxml.patch create mode 100644 chromium-125-appservice-include.patch create mode 100644 chromium-125-compiler.patch create mode 100644 chromium-125-debian-bad-font-gc0.patch create mode 100644 chromium-125-debian-bad-font-gc00.patch create mode 100644 chromium-125-debian-bad-font-gc000.patch create mode 100644 chromium-125-debian-bad-font-gc0000.patch create mode 100644 chromium-125-debian-bad-font-gc1.patch create mode 100644 chromium-125-debian-bad-font-gc11.patch create mode 100644 chromium-125-debian-bad-font-gc2.patch create mode 100644 chromium-125-debian-bad-font-gc3.patch create mode 100644 chromium-125-disable-FFmpegAllowLists.patch create mode 100644 chromium-125-emplace-struct.patch create mode 100644 chromium-125-ffmpeg-5.x-reordered_opaque.patch create mode 100644 chromium-125-lens-include.patch create mode 100644 chromium-125-lp155-typename.patch create mode 100644 chromium-125-missing-header-files.patch create mode 100644 chromium-125-mojo-bindings-include.patch create mode 100644 chromium-125-ninja.patch create mode 100644 chromium-125-no-vector-consts.patch create mode 100644 chromium-125-no_matching_constructor.patch create mode 100644 chromium-125-tabstrip-include.patch create mode 100644 chromium-125-vulkan-include.patch create mode 100644 chromium-125.0.6422.60.tar.xz create mode 100644 chromium-91-java-only-allowed-in-android-builds.patch create mode 100644 chromium-93-ffmpeg-4.4.patch create mode 100644 chromium-94-ffmpeg-roll.patch create mode 100644 chromium-buildname.patch create mode 100644 chromium-disable-GlobalMediaControlsCastStartStop.patch create mode 100644 chromium-disable-parallel-gold.patch create mode 100644 chromium-libusb_interrupt_event_handler.patch create mode 100644 chromium-master-prefs-path.patch create mode 100644 chromium-norar.patch create mode 100644 chromium-prop-codecs.patch create mode 100644 chromium-symbolic.svg create mode 100644 chromium.changes create mode 100644 chromium.spec create mode 100644 esbuild.tar.gz create mode 100644 exclude_ymp.patch create mode 100644 ffmpeg-new-channel-layout.patch create mode 100644 fix_building_widevinecdm_with_chromium.patch create mode 100644 gcc-enable-lto.patch create mode 100644 master_preferences create mode 100644 system-libdrm.patch diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/Cr122-ffmpeg-new-channel-layout.patch b/Cr122-ffmpeg-new-channel-layout.patch new file mode 100644 index 0000000..da6bebf --- /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 0000000..bcf52d7 --- /dev/null +++ b/INSTALL.sh @@ -0,0 +1,153 @@ +#!/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 (Beta)" +CHANNEL="beta" +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 +if [ -f "${OUTPUTDIR}/libqt6_shim.so" ]; then + file="libqt6_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/README.SUSE b/README.SUSE new file mode 100644 index 0000000..7fd2b87 --- /dev/null +++ b/README.SUSE @@ -0,0 +1,9 @@ +README for SUSE packagers +========================= +Patches for chromium can typically be found in the following places: + +Stephan Hartmann - https://github.com/stha09/chromium-patches/releases +Gentoo - https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/files +Fedora - https://src.fedoraproject.org/rpms/chromium/tree/rawhide +Arch - https://github.com/archlinux/svntogit-packages/tree/packages/chromium/trunk +Arch: https://gitlab.com/Matt.Jolly/chromium-patches/ diff --git a/_constraints b/_constraints new file mode 100644 index 0000000..1c5642b --- /dev/null +++ b/_constraints @@ -0,0 +1,24 @@ + + + + + 30 + + + 14 + + + + + aarch64 + + + + asimdrdm + + + 11 + + + + diff --git a/chrome-wrapper b/chrome-wrapper new file mode 100644 index 0000000..b57024a --- /dev/null +++ b/chrome-wrapper @@ -0,0 +1,34 @@ +#!/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="beta" + +# 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 + +# 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 0000000..28b9856 --- /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-106-ffmpeg-duration.patch b/chromium-106-ffmpeg-duration.patch new file mode 100644 index 0000000..8bdb934 --- /dev/null +++ b/chromium-106-ffmpeg-duration.patch @@ -0,0 +1,17 @@ +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 + // adjust the duration downward by however much exists before zero. +- if (audio_codec_ == AudioCodec::kAAC && frame->duration) { ++ if (audio_codec_ == AudioCodec::kAAC && frame->pkt_duration) { + const base::TimeDelta pkt_duration = ConvertFromTimeBase( + glue_->format_context()->streams[stream_index_]->time_base, +- frame->duration + std::min(static_cast(0), frame->pts)); ++ frame->pkt_duration + std::min(static_cast(0), frame->pts)); + const base::TimeDelta frame_duration = + base::Seconds(frames_read / static_cast(sample_rate_)); + diff --git a/chromium-115-compiler-SkColor4f.patch b/chromium-115-compiler-SkColor4f.patch new file mode 100644 index 0000000..583f74b --- /dev/null +++ b/chromium-115-compiler-SkColor4f.patch @@ -0,0 +1,26 @@ +diff -up chromium-115.0.5790.40/third_party/blink/renderer/modules/canvas/canvas2d/canvas_style.cc.me chromium-115.0.5790.40/third_party/blink/renderer/modules/canvas/canvas2d/canvas_style.cc +--- chromium-115.0.5790.40/third_party/blink/renderer/modules/canvas/canvas2d/canvas_style.cc.me 2023-06-24 10:38:11.011511463 +0200 ++++ chromium-115.0.5790.40/third_party/blink/renderer/modules/canvas/canvas2d/canvas_style.cc 2023-06-24 13:07:35.865375884 +0200 +@@ -84,6 +84,7 @@ CanvasStyle::CanvasStyle(const CanvasSty + + void CanvasStyle::ApplyToFlags(cc::PaintFlags& flags, + float global_alpha) const { ++ SkColor4f custom_color = SkColor4f{0.0f, 0.0f, 0.0f, global_alpha}; + switch (type_) { + case kColor: + ApplyColorToFlags(flags, global_alpha); +@@ -91,12 +92,12 @@ void CanvasStyle::ApplyToFlags(cc::Paint + case kGradient: + GetCanvasGradient()->GetGradient()->ApplyToFlags(flags, SkMatrix::I(), + ImageDrawOptions()); +- flags.setColor(SkColor4f(0.0f, 0.0f, 0.0f, global_alpha)); ++ flags.setColor(custom_color); + break; + case kImagePattern: + GetCanvasPattern()->GetPattern()->ApplyToFlags( + flags, AffineTransformToSkMatrix(GetCanvasPattern()->GetTransform())); +- flags.setColor(SkColor4f(0.0f, 0.0f, 0.0f, global_alpha)); ++ flags.setColor(custom_color); + break; + default: + NOTREACHED(); diff --git a/chromium-117-string-convert.patch b/chromium-117-string-convert.patch new file mode 100644 index 0000000..ccf82b9 --- /dev/null +++ b/chromium-117-string-convert.patch @@ -0,0 +1,21 @@ +diff -up chromium-117.0.5938.62/net/dns/host_resolver_cache.cc.me chromium-117.0.5938.62/net/dns/host_resolver_cache.cc +diff -up chromium-117.0.5938.62/net/dns/host_resolver_cache.h.me chromium-117.0.5938.62/net/dns/host_resolver_cache.h +--- chromium-117.0.5938.62/net/dns/host_resolver_cache.h.me 2023-09-14 15:21:24.632965004 +0200 ++++ chromium-117.0.5938.62/net/dns/host_resolver_cache.h 2023-09-15 09:15:48.511300845 +0200 +@@ -143,12 +143,14 @@ class NET_EXPORT HostResolverCache final + } + + bool operator()(const Key& lhs, const KeyRef& rhs) const { ++ const std::string rhs_domain_name{rhs.domain_name}; + return std::tie(lhs.domain_name, lhs.network_anonymization_key) < +- std::tie(rhs.domain_name, *rhs.network_anonymization_key); ++ std::tie(rhs_domain_name, *rhs.network_anonymization_key); + } + + bool operator()(const KeyRef& lhs, const Key& rhs) const { +- return std::tie(lhs.domain_name, *lhs.network_anonymization_key) < ++ const std::string lhs_domain_name{lhs.domain_name}; ++ return std::tie(lhs_domain_name, *lhs.network_anonymization_key) < + std::tie(rhs.domain_name, rhs.network_anonymization_key); + } + }; diff --git a/chromium-117-system-zstd.patch b/chromium-117-system-zstd.patch new file mode 100644 index 0000000..2bb746d --- /dev/null +++ b/chromium-117-system-zstd.patch @@ -0,0 +1,47 @@ +From ae3ae3711784865bdc38bf119a6182a7b8dae91c Mon Sep 17 00:00:00 2001 +From: Matt Jolly +Date: Sun, 17 Sep 2023 16:51:42 +1000 +Subject: [PATCH] Add system-zstd + +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 ++++ 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") ++ ++pkg_config("system_zstd") { ++ packages = [ "libzstd" ] ++} ++ ++shim_headers("zstd_shim") { ++ root_path = "src/lib" ++ headers = [ ++ "zdict.h", ++ "zstd.h", ++ "zstd_errors.h", ++ ] ++} ++ ++source_set("zstd") { ++ deps = [ ":zstd_shim" ] ++ public_configs = [ ":system_zstd" ] ++} ++ ++source_set("decompress") { ++ deps = [ ":zstd_shim" ] ++ public_configs = [ ":system_zstd" ] ++} diff --git a/chromium-119-assert.patch b/chromium-119-assert.patch new file mode 100644 index 0000000..04fe47a --- /dev/null +++ b/chromium-119-assert.patch @@ -0,0 +1,12 @@ +diff -up chromium-119.0.6045.59/v8/src/base/small-vector.h.than chromium-119.0.6045.59/v8/src/base/small-vector.h +--- chromium-119.0.6045.59/v8/src/base/small-vector.h.than 2023-11-01 16:13:12.645301345 +0100 ++++ chromium-119.0.6045.59/v8/src/base/small-vector.h 2023-11-01 16:13:29.660610182 +0100 +@@ -22,7 +22,7 @@ template ::value); + + public: diff --git a/chromium-120-emplace.patch b/chromium-120-emplace.patch new file mode 100644 index 0000000..1f32676 --- /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 0000000..fd6bed8 --- /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 0000000..ffffa44 --- /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 0000000..e919275 --- /dev/null +++ b/chromium-121-rust-clang_lib.patch @@ -0,0 +1,41 @@ +diff -up chromium-121.0.6167.57/build/config/clang/BUILD.gn.rust-clang_lib chromium-121.0.6167.57/build/config/clang/BUILD.gn +--- chromium-121.0.6167.57/build/config/clang/BUILD.gn.rust-clang_lib 2024-01-10 16:43:01.000000000 +0100 ++++ chromium-121.0.6167.57/build/config/clang/BUILD.gn 2024-01-20 19:51:38.481992799 +0100 +@@ -112,6 +112,7 @@ template("clang_lib") { + _prefix = "lib" + _suffix = "" + _ext = "a" ++ _libprefix = "" + if (is_win) { + _dir = "windows" + _prefix = "" +@@ -127,7 +128,19 @@ template("clang_lib") { + } + } else if (is_apple) { + _dir = "darwin" +- } else if (is_linux || is_chromeos) { ++ } else if (is_linux) { ++ _libprefix = "64" ++ _dir = "linux" ++ if (current_cpu == "x64") { ++ _suffix ="-x86_64" ++ } else if (current_cpu == "arm64") { ++ _suffix = "-aarch64" ++ } else if (current_cpu == "riscv64") { ++ _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") { +@@ -166,7 +193,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" ] + } 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 0000000..f7018af --- /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 0000000..46917c5 --- /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 0000000..1bf86a1 --- /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-system-libxml.patch b/chromium-124-system-libxml.patch new file mode 100644 index 0000000..eff9de1 --- /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 0000000..85731ca --- /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-compiler.patch b/chromium-125-compiler.patch new file mode 100644 index 0000000..6f104ef --- /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 0000000..e140e68 --- /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 0000000..f6a96eb --- /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 0000000..b2df4eb --- /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 0000000..1ef302e --- /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 0000000..eedd777 --- /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 0000000..9eb422e --- /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 0000000..eac23ab --- /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 0000000..f6726ae --- /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 0000000..0b90f9f --- /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 0000000..273169c --- /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 0000000..846bcaf --- /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 0000000..c695843 --- /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 0000000..5916362 --- /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 0000000..05c4766 --- /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 0000000..546e7c2 --- /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 0000000..5032472 --- /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 0000000..32d9400 --- /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-125-no_matching_constructor.patch b/chromium-125-no_matching_constructor.patch new file mode 100644 index 0000000..909dd11 --- /dev/null +++ b/chromium-125-no_matching_constructor.patch @@ -0,0 +1,1141 @@ +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_); +- track_event_sessions_.emplace_back(args.internal_instance_index, *args.config, +- args.backend_type); ++ track_event_sessions_.emplace_back() = {args.internal_instance_index, *args.config, ++ args.backend_type}; + } + + void TraceLog::OnStart(const perfetto::DataSourceBase::StartArgs&) { +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(); +- patterns_to_delete.emplace_back(setting_type, rule->primary_pattern, +- rule->secondary_pattern); ++ patterns_to_delete.emplace_back() = {setting_type, rule->primary_pattern, ++ rule->secondary_pattern}; + permissions::PermissionUmaUtil::RecordOneTimePermissionEvent( + setting_type, + permissions::OneTimePermissionEvent::EXPIRED_ON_SUSPEND); +@@ -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)) { +- patterns_to_delete.emplace_back( +- content_setting_type, rule->primary_pattern, rule->secondary_pattern); ++ patterns_to_delete.emplace_back() = { ++ content_setting_type, rule->primary_pattern, rule->secondary_pattern}; + permissions::PermissionUmaUtil::RecordOneTimePermissionEvent( + content_setting_type, trigger_event); + } +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( + "supported.test", +- SAMLProfileAttributes("placeholderName", "placeholderDomain", +- "placeholderToken"))); ++ SAMLProfileAttributes{"placeholderName", "placeholderDomain", ++ "placeholderToken"})); + + // Extract domains and attributes from the command line switch. + const base::CommandLine& command_line = +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); + + // Store the details necessary to open the omnibox match via browser commands. +- location_bar_->set_navigation_params(LocationBar::NavigationParams( ++ 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, match.extra_headers)); ++ destination_url_entered_with_http_scheme, match.extra_headers}); + + if (browser_) { + auto navigation = chrome::OpenCurrentURL(browser_); +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"); + } + +- brands.emplace_back(*brand, *version); ++ brands.emplace_back() = {*brand, *version}; + } + + client_hints.brands = std::move(brands); +@@ -384,7 +384,7 @@ Status ParseMobileEmulation(const base:: + "a 'version' field of type string"); + } + +- full_version_list.emplace_back(*brand, *version); ++ full_version_list.emplace_back() = {*brand, *version}; + } + + client_hints.full_version_list = std::move(full_version_list); +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); + } + } +@@ -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) { +- SkISize size(plane_surfaces[i]->width(), plane_surfaces[i]->height()); ++ SkISize size{plane_surfaces[i]->width(), plane_surfaces[i]->height()}; + SkImageInfo dst_info = SkImageInfo::Make( + size, (i == 0) ? kAlpha_8_SkColorType : kR8G8_unorm_SkColorType, + kUnpremul_SkAlphaType); +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_) { +- files.emplace_back(item.second->full_path(), item.second->url(), +- item.second->referrer().url); ++ files.emplace_back() = {item.second->full_path(), item.second->url(), ++ item.second->referrer().url}; + } + download::DownloadSaveItemData::AttachItemData(download_, std::move(files)); + } +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, cross_origin_exposed), ++ DestinationEnumEvent{event_type, event_data, cross_origin_exposed}, + destination); + } + } +@@ -8827,7 +8827,7 @@ + } + + SendFencedFrameReportingBeaconInternal( +- 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( +- 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( +- 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, + std::optional hue_interpolation_method) { + return base::AdoptRef(new FontPalette( +- start, end, NonNormalizedPercentages(start_percentage, end_percentage), ++ start, end, NonNormalizedPercentages{start_percentage, end_percentage}, + normalized_percentage, alpha_multiplier, color_interpolation_space, + hue_interpolation_method)); + } +@@ -170,7 +170,7 @@ class PLATFORM_EXPORT FontPalette : publ + double normalized_percentage) { + double end_percentage = normalized_percentage * 100.0; + double start_percentage = 100.0 - end_percentage; +- return NonNormalizedPercentages(start_percentage, end_percentage); ++ return NonNormalizedPercentages{start_percentage, end_percentage}; + } + + double GetAlphaMultiplier() const { +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}; + result_color_records.push_back(result_color_record); + } + return result_color_records; +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 { + m_pDevice->SetClip_PathFill( + *pPath, &mtObj2Device, +- CFX_FillRenderOptions(ClipPath.GetClipType(i))); ++ CFX_FillRenderOptions{ClipPath.GetClipType(i)}); + } + } + +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, +- PrimaryVersion(gfx::ColorSpace::PrimaryID::SMPTE170M, +- kDefaultSinceVersion)}, ++ PrimaryVersion{gfx::ColorSpace::PrimaryID::SMPTE170M, ++ kDefaultSinceVersion}}, + {ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_BT601_625_LINE, +- PrimaryVersion(gfx::ColorSpace::PrimaryID::BT470BG, +- kDefaultSinceVersion)}, ++ PrimaryVersion{gfx::ColorSpace::PrimaryID::BT470BG, ++ kDefaultSinceVersion}}, + {ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_SMPTE170M, +- PrimaryVersion(gfx::ColorSpace::PrimaryID::SMPTE170M, +- kDefaultSinceVersion)}, ++ PrimaryVersion{gfx::ColorSpace::PrimaryID::SMPTE170M, ++ kDefaultSinceVersion}}, + {ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_BT709, +- PrimaryVersion(gfx::ColorSpace::PrimaryID::BT709, kDefaultSinceVersion)}, ++ PrimaryVersion{gfx::ColorSpace::PrimaryID::BT709, kDefaultSinceVersion}}, + {ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_BT2020, +- PrimaryVersion(gfx::ColorSpace::PrimaryID::BT2020, kDefaultSinceVersion)}, ++ PrimaryVersion{gfx::ColorSpace::PrimaryID::BT2020, kDefaultSinceVersion}}, + {ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_SRGB, +- PrimaryVersion(gfx::ColorSpace::PrimaryID::BT709, kDefaultSinceVersion)}, ++ PrimaryVersion{gfx::ColorSpace::PrimaryID::BT709, kDefaultSinceVersion}}, + {ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_DISPLAYP3, +- PrimaryVersion(gfx::ColorSpace::PrimaryID::P3, kDefaultSinceVersion)}, ++ PrimaryVersion{gfx::ColorSpace::PrimaryID::P3, kDefaultSinceVersion}}, + {ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_ADOBERGB, +- PrimaryVersion(gfx::ColorSpace::PrimaryID::ADOBE_RGB, +- kDefaultSinceVersion)}, ++ PrimaryVersion{gfx::ColorSpace::PrimaryID::ADOBE_RGB, ++ kDefaultSinceVersion}}, + {ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_WIDE_GAMUT_COLOR_SPIN, +- PrimaryVersion( ++ PrimaryVersion{ + gfx::ColorSpace::PrimaryID::WIDE_GAMUT_COLOR_SPIN, +- ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_WIDE_GAMUT_COLOR_SPIN_SINCE_VERSION)}, ++ ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_WIDE_GAMUT_COLOR_SPIN_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_BT470M, +- PrimaryVersion( ++ PrimaryVersion{ + gfx::ColorSpace::PrimaryID::BT470M, +- ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_BT470M_SINCE_VERSION)}, ++ ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_BT470M_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_SMPTE240M, +- PrimaryVersion( ++ PrimaryVersion{ + gfx::ColorSpace::PrimaryID::SMPTE240M, +- ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_SMPTE240M_SINCE_VERSION)}, ++ ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_SMPTE240M_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_XYZ_D50, +- PrimaryVersion( ++ PrimaryVersion{ + gfx::ColorSpace::PrimaryID::XYZ_D50, +- ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_XYZ_D50_SINCE_VERSION)}, ++ ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_XYZ_D50_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_SMPTEST428_1, +- PrimaryVersion( ++ PrimaryVersion{ + gfx::ColorSpace::PrimaryID::SMPTEST428_1, +- ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_SMPTEST428_1_SINCE_VERSION)}, ++ ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_SMPTEST428_1_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_SMPTEST431_2, +- PrimaryVersion( ++ PrimaryVersion{ + gfx::ColorSpace::PrimaryID::SMPTEST431_2, +- ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_SMPTEST431_2_SINCE_VERSION)}, ++ ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_SMPTEST431_2_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_FILM, +- PrimaryVersion( ++ PrimaryVersion{ + gfx::ColorSpace::PrimaryID::FILM, +- ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_FILM_SINCE_VERSION)}}); ++ ZCR_COLOR_MANAGER_V1_CHROMATICITY_NAMES_FILM_SINCE_VERSION}}}); + + // A map from the zcr_color_manager_v1 eotf_names enum values + // representing well-known EOTFs, to their equivalent TransferIDs. +@@ -107,68 +107,68 @@ constexpr auto kEotfMap = base::MakeFixe + zcr_color_manager_v1_eotf_names, + TransferVersion>({ + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_LINEAR, +- TransferVersion(gfx::ColorSpace::TransferID::LINEAR, +- kDefaultSinceVersion)}, ++ TransferVersion{gfx::ColorSpace::TransferID::LINEAR, ++ kDefaultSinceVersion}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_SRGB, +- TransferVersion(gfx::ColorSpace::TransferID::SRGB, kDefaultSinceVersion)}, ++ TransferVersion{gfx::ColorSpace::TransferID::SRGB, kDefaultSinceVersion}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_SRGB_HDR, +- TransferVersion(gfx::ColorSpace::TransferID::SRGB_HDR, +- ZCR_COLOR_MANAGER_V1_EOTF_NAMES_SRGB_HDR_SINCE_VERSION)}, ++ TransferVersion{gfx::ColorSpace::TransferID::SRGB_HDR, ++ ZCR_COLOR_MANAGER_V1_EOTF_NAMES_SRGB_HDR_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_BT709, +- TransferVersion(gfx::ColorSpace::TransferID::BT709, +- ZCR_COLOR_MANAGER_V1_EOTF_NAMES_BT709_SINCE_VERSION)}, ++ TransferVersion{gfx::ColorSpace::TransferID::BT709, ++ ZCR_COLOR_MANAGER_V1_EOTF_NAMES_BT709_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_BT2087, +- TransferVersion(gfx::ColorSpace::TransferID::GAMMA24, +- kDefaultSinceVersion)}, ++ TransferVersion{gfx::ColorSpace::TransferID::GAMMA24, ++ kDefaultSinceVersion}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_ADOBERGB, + // This is ever so slightly inaccurate. The number ought to be + // 2.19921875f, not 2.2 +- TransferVersion(gfx::ColorSpace::TransferID::GAMMA22, +- kDefaultSinceVersion)}, ++ TransferVersion{gfx::ColorSpace::TransferID::GAMMA22, ++ kDefaultSinceVersion}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_PQ, +- TransferVersion(gfx::ColorSpace::TransferID::PQ, kDefaultSinceVersion)}, ++ TransferVersion{gfx::ColorSpace::TransferID::PQ, kDefaultSinceVersion}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_HLG, +- TransferVersion(gfx::ColorSpace::TransferID::HLG, +- ZCR_COLOR_MANAGER_V1_EOTF_NAMES_HLG_SINCE_VERSION)}, ++ TransferVersion{gfx::ColorSpace::TransferID::HLG, ++ ZCR_COLOR_MANAGER_V1_EOTF_NAMES_HLG_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_SMPTE170M, +- TransferVersion(gfx::ColorSpace::TransferID::SMPTE170M, +- ZCR_COLOR_MANAGER_V1_EOTF_NAMES_SMPTE170M_SINCE_VERSION)}, ++ TransferVersion{gfx::ColorSpace::TransferID::SMPTE170M, ++ ZCR_COLOR_MANAGER_V1_EOTF_NAMES_SMPTE170M_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_SMPTE240M, +- TransferVersion(gfx::ColorSpace::TransferID::SMPTE240M, +- ZCR_COLOR_MANAGER_V1_EOTF_NAMES_SMPTE240M_SINCE_VERSION)}, ++ TransferVersion{gfx::ColorSpace::TransferID::SMPTE240M, ++ ZCR_COLOR_MANAGER_V1_EOTF_NAMES_SMPTE240M_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_SMPTEST428_1, +- TransferVersion( ++ TransferVersion{ + gfx::ColorSpace::TransferID::SMPTEST428_1, +- ZCR_COLOR_MANAGER_V1_EOTF_NAMES_SMPTEST428_1_SINCE_VERSION)}, ++ ZCR_COLOR_MANAGER_V1_EOTF_NAMES_SMPTEST428_1_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_LOG, +- TransferVersion(gfx::ColorSpace::TransferID::LOG, +- ZCR_COLOR_MANAGER_V1_EOTF_NAMES_LOG_SINCE_VERSION)}, ++ TransferVersion{gfx::ColorSpace::TransferID::LOG, ++ ZCR_COLOR_MANAGER_V1_EOTF_NAMES_LOG_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_LOG_SQRT, +- TransferVersion(gfx::ColorSpace::TransferID::LOG_SQRT, +- ZCR_COLOR_MANAGER_V1_EOTF_NAMES_LOG_SQRT_SINCE_VERSION)}, ++ TransferVersion{gfx::ColorSpace::TransferID::LOG_SQRT, ++ ZCR_COLOR_MANAGER_V1_EOTF_NAMES_LOG_SQRT_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_IEC61966_2_4, +- TransferVersion( ++ TransferVersion{ + gfx::ColorSpace::TransferID::IEC61966_2_4, +- ZCR_COLOR_MANAGER_V1_EOTF_NAMES_IEC61966_2_4_SINCE_VERSION)}, ++ ZCR_COLOR_MANAGER_V1_EOTF_NAMES_IEC61966_2_4_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_BT1361_ECG, +- TransferVersion(gfx::ColorSpace::TransferID::BT1361_ECG, +- ZCR_COLOR_MANAGER_V1_EOTF_NAMES_BT1361_ECG_SINCE_VERSION)}, ++ TransferVersion{gfx::ColorSpace::TransferID::BT1361_ECG, ++ ZCR_COLOR_MANAGER_V1_EOTF_NAMES_BT1361_ECG_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_BT2020_10, +- TransferVersion(gfx::ColorSpace::TransferID::BT2020_10, +- ZCR_COLOR_MANAGER_V1_EOTF_NAMES_BT2020_10_SINCE_VERSION)}, ++ TransferVersion{gfx::ColorSpace::TransferID::BT2020_10, ++ ZCR_COLOR_MANAGER_V1_EOTF_NAMES_BT2020_10_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_BT2020_12, +- TransferVersion(gfx::ColorSpace::TransferID::BT2020_12, +- ZCR_COLOR_MANAGER_V1_EOTF_NAMES_BT2020_12_SINCE_VERSION)}, ++ TransferVersion{gfx::ColorSpace::TransferID::BT2020_12, ++ ZCR_COLOR_MANAGER_V1_EOTF_NAMES_BT2020_12_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_SCRGB_LINEAR_80_NITS, +- TransferVersion( ++ TransferVersion{ + gfx::ColorSpace::TransferID::SCRGB_LINEAR_80_NITS, +- ZCR_COLOR_MANAGER_V1_EOTF_NAMES_SCRGB_LINEAR_80_NITS_SINCE_VERSION)}, ++ ZCR_COLOR_MANAGER_V1_EOTF_NAMES_SCRGB_LINEAR_80_NITS_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_GAMMA18, +- TransferVersion(gfx::ColorSpace::TransferID::GAMMA18, +- ZCR_COLOR_MANAGER_V1_EOTF_NAMES_GAMMA18_SINCE_VERSION)}, ++ TransferVersion{gfx::ColorSpace::TransferID::GAMMA18, ++ ZCR_COLOR_MANAGER_V1_EOTF_NAMES_GAMMA18_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_GAMMA28, +- TransferVersion(gfx::ColorSpace::TransferID::GAMMA28, +- ZCR_COLOR_MANAGER_V1_EOTF_NAMES_GAMMA28_SINCE_VERSION)}, ++ TransferVersion{gfx::ColorSpace::TransferID::GAMMA28, ++ ZCR_COLOR_MANAGER_V1_EOTF_NAMES_GAMMA28_SINCE_VERSION}}, + }); + + // A map from the SDR zcr_color_manager_v1 eotf_names enum values +@@ -177,18 +177,18 @@ constexpr auto kEotfMap = base::MakeFixe + constexpr auto kTransferMap = + base::MakeFixedFlatMap({ + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_LINEAR, +- TransferFnVersion(SkNamedTransferFn::kLinear, kDefaultSinceVersion)}, ++ TransferFnVersion{SkNamedTransferFn::kLinear, kDefaultSinceVersion}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_SRGB, +- TransferFnVersion(SkNamedTransferFnExt::kSRGB, kDefaultSinceVersion)}, ++ TransferFnVersion{SkNamedTransferFnExt::kSRGB, kDefaultSinceVersion}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_BT709, +- TransferFnVersion( ++ TransferFnVersion{ + SkNamedTransferFnExt::kRec709, +- ZCR_COLOR_MANAGER_V1_EOTF_NAMES_BT709_SINCE_VERSION)}, ++ ZCR_COLOR_MANAGER_V1_EOTF_NAMES_BT709_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_BT2087, +- TransferFnVersion(gamma24, kDefaultSinceVersion)}, ++ TransferFnVersion{gamma24, kDefaultSinceVersion}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_ADOBERGB, +- TransferFnVersion(SkNamedTransferFnExt::kA98RGB, +- kDefaultSinceVersion)}, ++ TransferFnVersion{SkNamedTransferFnExt::kA98RGB, ++ kDefaultSinceVersion}}, + }); + + // A map from the HDR zcr_color_manager_v1 eotf_names enum values +@@ -197,70 +197,70 @@ constexpr auto kTransferMap = + constexpr auto kHDRTransferMap = + base::MakeFixedFlatMap( + {{ZCR_COLOR_MANAGER_V1_EOTF_NAMES_LINEAR, +- TransferFnVersion(SkNamedTransferFn::kLinear, kDefaultSinceVersion)}, ++ TransferFnVersion{SkNamedTransferFn::kLinear, kDefaultSinceVersion}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_SRGB_HDR, +- TransferFnVersion( ++ TransferFnVersion{ + SkNamedTransferFnExt::kSRGB, +- ZCR_COLOR_MANAGER_V1_EOTF_NAMES_SRGB_HDR_SINCE_VERSION)}, ++ ZCR_COLOR_MANAGER_V1_EOTF_NAMES_SRGB_HDR_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_PQ, +- TransferFnVersion(SkNamedTransferFn::kPQ, kDefaultSinceVersion)}, ++ TransferFnVersion{SkNamedTransferFn::kPQ, kDefaultSinceVersion}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_HLG, +- TransferFnVersion(SkNamedTransferFn::kHLG, +- ZCR_COLOR_MANAGER_V1_EOTF_NAMES_HLG_SINCE_VERSION)}, ++ TransferFnVersion{SkNamedTransferFn::kHLG, ++ ZCR_COLOR_MANAGER_V1_EOTF_NAMES_HLG_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_EOTF_NAMES_EXTENDEDSRGB10, +- TransferFnVersion( ++ TransferFnVersion{ + SkNamedTransferFnExt::kSRGBExtended1023Over510, +- ZCR_COLOR_MANAGER_V1_EOTF_NAMES_EXTENDEDSRGB10_SINCE_VERSION)}}); ++ ZCR_COLOR_MANAGER_V1_EOTF_NAMES_EXTENDEDSRGB10_SINCE_VERSION}}}); + + // A map from zcr_color_manager_v1 matrix_names enum values to + // gfx::ColorSpace::MatrixIDs. + constexpr auto kMatrixMap = + base::MakeFixedFlatMap( + {{ZCR_COLOR_MANAGER_V1_MATRIX_NAMES_RGB, +- MatrixVersion(gfx::ColorSpace::MatrixID::RGB, kDefaultSinceVersion)}, ++ MatrixVersion{gfx::ColorSpace::MatrixID::RGB, kDefaultSinceVersion}}, + {ZCR_COLOR_MANAGER_V1_MATRIX_NAMES_BT709, +- MatrixVersion(gfx::ColorSpace::MatrixID::BT709, +- kDefaultSinceVersion)}, ++ MatrixVersion{gfx::ColorSpace::MatrixID::BT709, ++ kDefaultSinceVersion}}, + {ZCR_COLOR_MANAGER_V1_MATRIX_NAMES_BT470BG, +- MatrixVersion( ++ MatrixVersion{ + gfx::ColorSpace::MatrixID::BT470BG, +- ZCR_COLOR_MANAGER_V1_MATRIX_NAMES_BT470BG_SINCE_VERSION)}, ++ ZCR_COLOR_MANAGER_V1_MATRIX_NAMES_BT470BG_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_MATRIX_NAMES_BT2020_NCL, +- MatrixVersion(gfx::ColorSpace::MatrixID::BT2020_NCL, +- kDefaultSinceVersion)}, ++ MatrixVersion{gfx::ColorSpace::MatrixID::BT2020_NCL, ++ kDefaultSinceVersion}}, + {ZCR_COLOR_MANAGER_V1_MATRIX_NAMES_BT2020_CL, +- MatrixVersion(gfx::ColorSpace::MatrixID::BT2020_CL, +- kDefaultSinceVersion)}, ++ MatrixVersion{gfx::ColorSpace::MatrixID::BT2020_CL, ++ kDefaultSinceVersion}}, + {ZCR_COLOR_MANAGER_V1_MATRIX_NAMES_FCC, +- MatrixVersion(gfx::ColorSpace::MatrixID::FCC, kDefaultSinceVersion)}, ++ MatrixVersion{gfx::ColorSpace::MatrixID::FCC, kDefaultSinceVersion}}, + {ZCR_COLOR_MANAGER_V1_MATRIX_NAMES_YCOCG, +- MatrixVersion(gfx::ColorSpace::MatrixID::YCOCG, +- ZCR_COLOR_MANAGER_V1_MATRIX_NAMES_YCOCG_SINCE_VERSION)}, ++ MatrixVersion{gfx::ColorSpace::MatrixID::YCOCG, ++ ZCR_COLOR_MANAGER_V1_MATRIX_NAMES_YCOCG_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_MATRIX_NAMES_YDZDX, +- MatrixVersion(gfx::ColorSpace::MatrixID::YDZDX, +- ZCR_COLOR_MANAGER_V1_MATRIX_NAMES_YDZDX_SINCE_VERSION)}, ++ MatrixVersion{gfx::ColorSpace::MatrixID::YDZDX, ++ ZCR_COLOR_MANAGER_V1_MATRIX_NAMES_YDZDX_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_MATRIX_NAMES_GBR, +- MatrixVersion(gfx::ColorSpace::MatrixID::GBR, +- ZCR_COLOR_MANAGER_V1_MATRIX_NAMES_GBR_SINCE_VERSION)}, ++ MatrixVersion{gfx::ColorSpace::MatrixID::GBR, ++ ZCR_COLOR_MANAGER_V1_MATRIX_NAMES_GBR_SINCE_VERSION}}, + {ZCR_COLOR_MANAGER_V1_MATRIX_NAMES_SMPTE170M, +- MatrixVersion(gfx::ColorSpace::MatrixID::SMPTE170M, +- kDefaultSinceVersion)}, ++ MatrixVersion{gfx::ColorSpace::MatrixID::SMPTE170M, ++ kDefaultSinceVersion}}, + {ZCR_COLOR_MANAGER_V1_MATRIX_NAMES_SMPTE240M, +- MatrixVersion(gfx::ColorSpace::MatrixID::SMPTE240M, +- kDefaultSinceVersion)}}); ++ MatrixVersion{gfx::ColorSpace::MatrixID::SMPTE240M, ++ kDefaultSinceVersion}}}); + + // A map from zcr_color_manager_v1 range_names enum values to + // gfx::ColorSpace::RangeIDs. + constexpr auto kRangeMap = + base::MakeFixedFlatMap( + {{ZCR_COLOR_MANAGER_V1_RANGE_NAMES_LIMITED, +- RangeVersion(gfx::ColorSpace::RangeID::LIMITED, +- kDefaultSinceVersion)}, ++ RangeVersion{gfx::ColorSpace::RangeID::LIMITED, ++ kDefaultSinceVersion}}, + {ZCR_COLOR_MANAGER_V1_RANGE_NAMES_FULL, +- RangeVersion(gfx::ColorSpace::RangeID::FULL, kDefaultSinceVersion)}, ++ RangeVersion{gfx::ColorSpace::RangeID::FULL, kDefaultSinceVersion}}, + {ZCR_COLOR_MANAGER_V1_RANGE_NAMES_DERIVED, +- RangeVersion(gfx::ColorSpace::RangeID::DERIVED, +- kDefaultSinceVersion)}}); ++ RangeVersion{gfx::ColorSpace::RangeID::DERIVED, ++ kDefaultSinceVersion}}}); + + zcr_color_manager_v1_chromaticity_names ToColorManagerChromaticity( + gfx::ColorSpace::PrimaryID primaryID, +@@ -283,4 +283,4 @@ zcr_color_manager_v1_eotf_names ToColorM + + } // namespace ui::wayland + +-#endif // UI_BASE_WAYLAND_COLOR_MANAGER_UTIL_H_ +\ No newline at end of file ++#endif // UI_BASE_WAYLAND_COLOR_MANAGER_UTIL_H_ +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; + } +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}; + } + } + +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 + } + + 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 0000000..731e78b --- /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 0000000..3ce543a --- /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-125.0.6422.60.tar.xz b/chromium-125.0.6422.60.tar.xz new file mode 100644 index 0000000..b246c30 --- /dev/null +++ b/chromium-125.0.6422.60.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:93f5850101225945d7ec80959b38460e6a63777055bf2d9e893860c33cb60080 +size 3453234996 diff --git a/chromium-91-java-only-allowed-in-android-builds.patch b/chromium-91-java-only-allowed-in-android-builds.patch new file mode 100644 index 0000000..c0b118c --- /dev/null +++ b/chromium-91-java-only-allowed-in-android-builds.patch @@ -0,0 +1,16 @@ +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 + + + _CURRENT_DIR = os.path.join(os.path.dirname(__file__)) +-_JAVA_PATH = os.path.join(_CURRENT_DIR, "..", "jdk", "current", "bin", "java") +-assert os.path.isfile(_JAVA_PATH), "java only allowed in android builds" ++_JAVA_PATH = "java" + + class Compiler(object): + """Runs the Closure compiler on given source files to typecheck them diff --git a/chromium-93-ffmpeg-4.4.patch b/chromium-93-ffmpeg-4.4.patch new file mode 100644 index 0000000..feeeb9e --- /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-94-ffmpeg-roll.patch b/chromium-94-ffmpeg-roll.patch new file mode 100644 index 0000000..7878a01 --- /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-buildname.patch b/chromium-buildname.patch new file mode 100644 index 0000000..0ac9ea9 --- /dev/null +++ b/chromium-buildname.patch @@ -0,0 +1,13 @@ +Index: chromium-73.0.3683.27/components/version_ui_strings.grdp +=================================================================== +--- chromium-73.0.3683.27.orig/components/version_ui_strings.grdp ++++ chromium-73.0.3683.27/components/version_ui_strings.grdp +@@ -7,7 +7,7 @@ + Official Build + + +- Developer Build ++ openSUSE Build + + + (32-bit) diff --git a/chromium-disable-GlobalMediaControlsCastStartStop.patch b/chromium-disable-GlobalMediaControlsCastStartStop.patch new file mode 100644 index 0000000..dbe2936 --- /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-parallel-gold.patch b/chromium-disable-parallel-gold.patch new file mode 100644 index 0000000..78c438e --- /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-libusb_interrupt_event_handler.patch b/chromium-libusb_interrupt_event_handler.patch new file mode 100644 index 0000000..5f53dc1 --- /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-master-prefs-path.patch b/chromium-master-prefs-path.patch new file mode 100644 index 0000000..5c0bb55 --- /dev/null +++ b/chromium-master-prefs-path.patch @@ -0,0 +1,16 @@ +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; +- if (!base::PathService::Get(base::DIR_EXE, &dir_exe)) { +- return base::FilePath(); +- } +- ++ dir_exe = base::FilePath("/etc/chromium"); + return installer::InitialPreferences::Path(dir_exe); + } + diff --git a/chromium-norar.patch b/chromium-norar.patch new file mode 100644 index 0000000..ccb94bd --- /dev/null +++ b/chromium-norar.patch @@ -0,0 +1,107 @@ +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(); +- } else if (inspection_type == DownloadFileType::RAR) { +- StartExtractRarFeatures(); + #if BUILDFLAG(IS_MAC) + } else if (inspection_type == DownloadFileType::DMG) { + StartExtractDmgFeatures(); +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", + "//third_party/lzma_sdk/google:seven_zip_reader", +- "//third_party/unrar:unrar", + ] + + public_deps = [ +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 std::optional& password, + mojo::PendingRemote temp_file_getter, + AnalyzeRarFileCallback callback) { ++#if 0 + DCHECK(rar_file.IsValid()); + temp_file_getter_.Bind(std::move(temp_file_getter)); + callback_ = std::move(callback); +@@ -90,6 +91,9 @@ void SafeArchiveAnalyzer::AnalyzeRarFile + /*password=*/password, + std::move(analysis_finished_callback), + std::move(temp_file_getter_callback), &results_); ++#else ++ NOTREACHED(); ++#endif + } + + void SafeArchiveAnalyzer::AnalyzeSevenZipFile( +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" +-#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 "mojo/public/cpp/bindings/remote.h" +@@ -67,7 +66,6 @@ class SafeArchiveAnalyzer : public chrom + void Timeout(); + + safe_browsing::ZipAnalyzer zip_analyzer_; +- safe_browsing::RarAnalyzer rar_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-prop-codecs.patch b/chromium-prop-codecs.patch new file mode 100644 index 0000000..03b6093 --- /dev/null +++ b/chromium-prop-codecs.patch @@ -0,0 +1,17 @@ +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") { + } + } + +-if (proprietary_codecs && media_use_ffmpeg) { +- assert( +- ffmpeg_branding != "Chromium", +- "proprietary codecs and ffmpeg_branding set to Chromium are incompatible") +-} +- + # Common configuration for targets in the media directory; these must not be + # exported since things like USE_NEON and USE_CRAS have different meanings + # elsewhere in the code base. diff --git a/chromium-symbolic.svg b/chromium-symbolic.svg new file mode 100644 index 0000000..7240095 --- /dev/null +++ b/chromium-symbolic.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/chromium.changes b/chromium.changes new file mode 100644 index 0000000..4b18d3b --- /dev/null +++ b/chromium.changes @@ -0,0 +1,8798 @@ +------------------------------------------------------------------- +Thu May 16 16:57:33 CEST 2024 - ro@suse.de + +- Chromium 125.0.6422.60 + * High CVE-2024-4947: Type Confusion in V8 + * High CVE-2024-4948: Use after free in Dawn + * Medium CVE-2024-4949: Use after free in V8 + * Low CVE-2024-4950: Inappropriate implementation in Downloads + +- Chromium 125.0.6422.41 + * New upstream (early) stable release. + +- drop upstreamed patches: + * chromium-124-uint-includes.patch + * chromium-124-fps-optional.patch + * chromium-124-span-optional.patch + * chromium-124-extractor-bitset.patch + * chromium-124-atomic.patch + * chromium-124-webgpu-optional.patch + * chromium-124-angle-powf.patch + +- add debian upstream patches added for 125: + * chromium-125-appservice-include.patch + * chromium-125-lens-include.patch + * chromium-125-mojo-bindings-include.patch + * chromium-125-no-vector-consts.patch + * chromium-125-vulkan-include.patch + * chromium-125-tabstrip-include.patch + * chromium-125-ninja.patch + +- add debian fixes patches to fix font gc crashes: + * chromium-125-debian-bad-font-gc0000.patch + * chromium-125-debian-bad-font-gc000.patch + * chromium-125-debian-bad-font-gc00.patch + * chromium-125-debian-bad-font-gc0.patch + * chromium-125-debian-bad-font-gc11.patch + * chromium-125-debian-bad-font-gc1.patch + * chromium-125-debian-bad-font-gc2.patch + * chromium-125-debian-bad-font-gc3.patch + +- add from fedora (reverse applied for older ffmpeg): + * chromium-125-ffmpeg-5.x-reordered_opaque.patch + +- re-diff and rename: + * from chromium-110-compiler.patch + to chromium-125-compiler.patch + * from chromium-120-emplace-struct.patch + to chromium-125-emplace-struct.patch + * from chromium-disable-FFmpegAllowLists.patch + to chromium-125-disable-FFmpegAllowLists.patch + * from chromium-122-missing-header-files.patch + to chromium-125-missing-header-files.patch + * from chromium-122-no_matching_constructor.patch + to chromium-125-no_matching_constructor.patch + * from chromium-122-lp155-typename.patch + to chromium-125-lp155-typename.patch + +- third_party/zstd + added to keeplibs for + third_party/blink/renderer/platform:platform +- third_party/tflite/src/third_party/xla/xla/tsl/util + added to keeplibs for + third_party/tflite/tflite +- third_party/lens_server_proto + added to keeplibs for + gen/third_party/lens_server_proto + +------------------------------------------------------------------- +Fri May 10 12:16:29 UTC 2024 - Andreas Stieger + +- Chromium 124.0.6367.201 + * CVE-2024-4671: Use after free in Visuals +- Chromium 124.0.6367.155 (boo#1224045) + * CVE-2024-4558: Use after free in ANGLE + * CVE-2024-4559: Heap buffer overflow in WebAudio + +------------------------------------------------------------------- +Fri May 3 11:10:19 CEST 2024 - ro@suse.de + +- drop patches: + * chromium-123-WebUI-static_assert.patch + +------------------------------------------------------------------- +Thu May 2 19:41:37 UTC 2024 - Andreas Stieger + +- Chromium 124.0.6367.118 (boo#1223846) + * CVE-2024-4331: Use after free in Picture In Picture + * CVE-2024-4368: Use after free in Dawn + +------------------------------------------------------------------- +Wed May 1 11:29:39 UTC 2024 - Callum Farmer + +- Add patches: + * chromium-123-missing-QtGui.patch +- Restore libxml 2.12 check for chromium-124-system-libxml.patch + which replaced chromium-121-blink-libxml-const.patch + +------------------------------------------------------------------- +Fri Apr 26 14:56:40 CEST 2024 - ro@suse.de + +- Chromium 124.0.6367.78 (boo#1223845) + * CVE-2024-4058: Type Confusion in ANGLE + * CVE-2024-4059: Out of bounds read in V8 API + * CVE-2024-4060: Use after free in Dawn + +------------------------------------------------------------------- +Wed Apr 17 17:38:12 CEST 2024 - ro@suse.de + +- Chromium 124.0.6367.60 (boo#1222958) + * CVE-2024-3832: Object corruption in V8. + * CVE-2024-3833: Object corruption in WebAssembly. + * CVE-2024-3834: Use after free in Downloads. Reported by ChaobinZhang + * CVE-2024-3837: Use after free in QUIC. + * CVE-2024-3838: Inappropriate implementation in Autofill. + * CVE-2024-3839: Out of bounds read in Fonts. + * CVE-2024-3840: Insufficient policy enforcement in Site Isolation. + * CVE-2024-3841: Insufficient data validation in Browser Switcher. + * CVE-2024-3843: Insufficient data validation in Downloads. + * CVE-2024-3844: Inappropriate implementation in Extensions. + * CVE-2024-3845: Inappropriate implementation in Network. + * CVE-2024-3846: Inappropriate implementation in Prompts. + * CVE-2024-3847: Insufficient policy enforcement in WebUI. +- drop patches: + * chromium-123-optional2.patch + * chromium-122-avoid-SFINAE-TypeConverter.patch + * chromium-123-PA-InternalAllocator.patch +- rediff patches: + * chromium-110-compiler.patch + * chromium-120-emplace.patch + * chromium-122-no_matching_constructor.patch + * chromium-122-lp155-typename.patch +- add patches: from debian/fixes + * chromium-123-stats-collector.patch +- add patches: from debian/upstream + * chromium-124-angle-powf.patch + * chromium-124-atomic.patch + * chromium-124-extractor-bitset.patch + * chromium-124-fps-optional.patch + * chromium-124-span-optional.patch + * chromium-124-uint-includes.patch + * chromium-124-webgpu-optional.patch +- add patches: + * chromium-123-WebUI-static_assert.patch + workaround for compile issue in webui_contents_wrapper.h + * chromium-124-system-libxml.patch (from fedora) + +------------------------------------------------------------------- +Sun Apr 14 11:06:41 UTC 2024 - Andreas Stieger + +- Chromium 123.0.6312.122 (boo#1222707) + * CVE-2024-3157: Out of bounds write in Compositing + * CVE-2024-3516: Heap buffer overflow in ANGLE + * CVE-2024-3515: Use after free in Dawn +- Chromium 123.0.6312.105 (boo#1222260) + * CVE-2024-3156: Inappropriate implementation in V8 + * CVE-2024-3158: Use after free in Bookmarks + * CVE-2024-3159: Out of bounds memory access in V8 +- Chromium 123.0.6312.86 (boo#1222035) + * CVE-2024-2883: Use after free in ANGLE + * CVE-2024-2885: Use after free in Dawn + * CVE-2024-2886: Use after free in WebCodecs + * CVE-2024-2887: Type Confusion in WebAssembly +- Chromium 123.0.6312.58 (boo#1221732) + * CVE-2024-2625: Object lifecycle issue in V8 + * CVE-2024-2626: Out of bounds read in Swiftshader + * CVE-2024-2627: Use after free in Canvas + * CVE-2024-2628: Inappropriate implementation in Downloads +- drop patches: + * chromium-117-blink-BUILD-mnemonic.patch + * chromium-121-blink-libxml-const.patch + * chromium-122-BookmarkNode-missing-operator.patch + * chromium-122-WebUI-static_assert.patch + * chromium-122-PA-undo-internal-alloc.patch + +------------------------------------------------------------------- +Mon Mar 18 13:13:01 UTC 2024 - Callum Farmer + +- Use Python 3.11 on Leap +- Rename chromium-122-skip_bubble_contents_wrapper_static_assert.patch + to chromium-122-WebUI-static_assert.patch +- Rename chromium-122-disable-FFmpegAllowLists.patch to + chromium-disable-FFmpegAllowLists.patch +- Rename chromium-122-static-assert.patch to + chromium-122-BookmarkNode-missing-operator.patch +- Rename chromium-122-undo-internal-alloc.patch to + chromium-122-PA-undo-internal-alloc.patch +- Rename chromium-122-typename.patch to + chromium-122-lp155-typename.patch +- Removed patches: + * chromium-121-v8-c++20-p1.patch + * chromium-121-v8-c++20.patch + * chromium-122-unique_ptr.patch + * chromium-122-python3-assignment-expressions.patch + * chromium-122-el8-support-64kpage.patch + * chromium-122-el7-inline-function.patch + * chromium-122-el7-extra-operator.patch + * chromium-122-el7-default-constructor-involving-anonymous-union.patch + * chromium-122-constexpr.patch + * chromium-122-clang-build-flags.patch + * chromium-122-clang16-disable-auto-upgrade-debug-info.patch + * chromium-122-clang16-buildflags.patch + * chromium-122-arm64-memory_tagging.patch + * chromium-121-el7-clang-version-warning.patch + * chromium-116-lp155-url_load_stats-size-t.patch + * chromium-icu72-2.patch + * chromium-122-debian-upstream-mojo.patch +- Patches merged into other patches: + * chromium-122-debian-upstream-bitset.patch + * chromium-122-debian-upstream-optional.patch + * chromium-122-debian-upstream-uniqptr.patch + * chromium-122-debian-fixes-optional.patch + * chromium-122-norar.patch +- Restore time clamper change to + chromium-122-missing-header-files.patch +- Fix missing/invalid casting in + chromium-122-no_matching_constructor.patch + +------------------------------------------------------------------- +Wed Mar 13 05:35:05 UTC 2024 - Andreas Stieger + +- Chromium 122.0.6261.128 (boo#1221335) + * CVE-2024-2400: Use after free in Performance Manager + +------------------------------------------------------------------- +Fri Mar 8 16:14:39 CET 2024 - ro@suse.de + +- Chromium 122.0.6261.111 (boo#1220131,boo#1220604,boo#1221105) + * New upstream security release. + * CVE-2024-2173: Out of bounds memory access in V8. + * CVE-2024-2174: Inappropriate implementation in V8. + * CVE-2024-2176: Use after free in FedCM. +- Chromium 122.0.6261.94 + * CVE-2024-1669: Out of bounds memory access in Blink. + * CVE-2024-1670: Use after free in Mojo. + * CVE-2024-1671: Inappropriate implementation in Site Isolation. + * CVE-2024-1672: Inappropriate implementation in Content Security Policy. + * CVE-2024-1673: Use after free in Accessibility. + * CVE-2024-1674: Inappropriate implementation in Navigation. + * CVE-2024-1675: Insufficient policy enforcement in Download. + * CVE-2024-1676: Inappropriate implementation in Navigation. + * Type Confusion in V8 + * rediff chromium-disable-GlobalMediaControlsCastStartStop.patch + * drop chromium-114-lld-argument.patch + replaced by chromium-122-clang16-disable-auto-upgrade-debug-info.patch + * drop chromium-121-no_matching_constructor.patch + replaced by chromium-122-no_matching_constructor.patch + * drop chromium-113-webview-namespace.patch (obsolete) + * reduce chromium-norar.patch + by the hunks in chromium-122-norar.patch + * drop chromium-114-revert-av1enc-lp154.patch + replaced by chromium-122-revert-av1enc-el9.patch + * drop chromium-115-lp155-typename.patch + chromium-116-lp155-typenames.patch + chromium-117-lp155-typename.patch + chromium-120-lp155-typename.patch + replaced by chromium-122-typename.patch + * drop chromium-121-missing-header-files.patch + replaced by chromium-122-missing-header-files.patch + * drop chromium-121-workaround_clang_bug-structured_binding.patch + replaced by chromium-122-workaround_clang_bug-structured_binding.patch + * drop chromium-121-no_matching_constructor.patch + replaced by chromium-122-no_matching_constructor.patch + * drop chromium-121-python3-invalid-escape-sequence.patch (upstream) + * drop chromium-disable-FFmpegAllowLists.patch + replaced by chromium-122-disable-FFmpegAllowLists.patch + * drop chromium-121-avoid-SFINAE-TypeConverter.patch + replaced by chromium-122-avoid-SFINAE-TypeConverter.patch + * add buildrequires for rust + * add patches from fedora package for 121 and 122 + * chromium-121-el7-clang-version-warning.patch + * chromium-121-v8-c++20-p1.patch + * chromium-121-v8-c++20.patch + * chromium-122-arm64-memory_tagging.patch + * chromium-122-clang16-buildflags.patch + * chromium-122-clang16-disable-auto-upgrade-debug-info.patch + * chromium-122-clang-build-flags.patch + * chromium-122-constexpr.patch + * chromium-122-disable-FFmpegAllowLists.patch + * chromium-122-el7-default-constructor-involving-anonymous-union.patch + * chromium-122-el7-extra-operator.patch + * chromium-122-el7-inline-function.patch + * chromium-122-el8-support-64kpage.patch + * chromium-122-missing-header-files.patch + * chromium-122-no_matching_constructor.patch + * chromium-122-norar.patch + * chromium-122-python3-assignment-expressions.patch + * chromium-122-revert-av1enc-el9.patch + * chromium-122-static-assert.patch + * chromium-122-typename.patch + * chromium-122-unique_ptr.patch + * chromium-122-workaround_clang_bug-structured_binding.patch + * from debian add + * chromium-122-undo-internal-alloc.patch + * chromium-122-debian-upstream-bitset.patch + * chromium-122-debian-upstream-mojo.patch + * chromium-122-debian-upstream-optional.patch + * chromium-122-debian-upstream-uniqptr.patch + * chromium-122-debian-fixes-optional.patch + * added compile fix needed on code15 + chromium-122-skip_bubble_contents_wrapper_static_assert.patch + to prevent "static assertion expression is not an integral constant expression" + "in call to 'operator+(&"."[0], ShoppingInsightsSidePanelUI::GetWebUIName())'" + in bubble_contents_wrapper.h:153 +- replace Cr121-ffmpeg-new-channel-layout.patch by + Cr122-ffmpeg-new-channel-layout.patch (rediff against 122) +- drop chromium-121-system-old-ffmpeg.patch + +------------------------------------------------------------------- +Fri Mar 8 13:16:51 UTC 2024 - Callum Farmer + +- Add Cr121-ffmpeg-new-channel-layout.patch to rollback more FFmpeg + changes so that FFmpeg 4 will work on Leap +- Prepare for libxml 2.12 + +------------------------------------------------------------------- +Sat Mar 2 12:39:17 UTC 2024 - Callum Farmer + +- Chromium 121.0.6167.184 (boo#1219118, boo#1219387, boo#1219661) + * CVE-2024-1284: Use after free in Mojo + * CVE-2024-1283: Heap buffer overflow in Skia + * CVE-2024-1060: Use after free in Canvas + * CVE-2024-1059: Use after free in WebRTC + * CVE-2024-1077: Use after free in Network + * CVE-2024-0807: Use after free in WebAudio + * CVE-2024-0812: Inappropriate implementation in Accessibility + * CVE-2024-0808: Integer underflow in WebUI + * CVE-2024-0810: Insufficient policy enforcement in DevTools + * CVE-2024-0814: Incorrect security UI in Payments + * CVE-2024-0813: Use after free in Reading Mode + * CVE-2024-0806: Use after free in Passwords + * CVE-2024-0805: Inappropriate implementation in Downloads + * CVE-2024-0804: Insufficient policy enforcement in iOS Security UI + * CVE-2024-0811: Inappropriate implementation in Extensions API + * CVE-2024-0809: Inappropriate implementation in Autofill +- Removed patches: + * chromium-117-includes.patch + * chromium-118-includes.patch + * chromium-119-dont-redefine-ATSPI-version-macros.patch + * chromium-120-missing-header-files.patch + * chromium-120-no_matching_constructor.patch + * chromium-120-nullptr_t-without-namespace-std.patch + * chromium-120-workaround_clang_bug-structured_binding.patch + * gcc13-fix.patch + * chromium-113-webauth-include-variant.patch + * chromium-110-system-libffi.patch +- Added patches: + * chromium-121-no_matching_constructor.patch + * chromium-121-nullptr_t-without-namespace-std.patch + * chromium-121-workaround_clang_bug-structured_binding.patch + * chromium-121-missing-header-files.patch + * chromium-121-rust-clang_lib.patch + * chromium-121-python3-invalid-escape-sequence.patch + * chromium-121-rust-clang_lib.patch + * chromium-121-avoid-SFINAE-TypeConverter.patch + * chromium-121-blink-libxml-const.patch +- Add patch chromium-disable-FFmpegAllowLists.patch: + disable codec checker this will always fail (bsc#1219070) + +------------------------------------------------------------------- +Wed Jan 17 08:54:07 UTC 2024 - Andreas Stieger + +- Chromium 120.0.6099.224 (boo#1218892) + * CVE-2024-0517: Out of bounds write in V8 + * CVE-2024-0518: Type Confusion in V8 + * CVE-2024-0519: Out of bounds memory access in V8 + * Various fixes from internal audits, fuzzing and other initiatives + +------------------------------------------------------------------- +Sun Jan 14 10:07:12 UTC 2024 - Callum Farmer + +- Replace chromium-120-lp155-revert-clang-build-failure.patch + with chromium-120-make_unique-struct.patch - which avoids + reverting changes and instead provides a stub constructor to fix + build on Leap + +------------------------------------------------------------------- +Sat Jan 13 08:29:26 UTC 2024 - Andreas Stieger + +- Chromium 120.0.6099.216 (boo#1217839, boo#1218048, boo#1218302, + boo#1218533, boo#1218719) + * CVE-2024-0333: Insufficient data validation in Extensions + * CVE-2024-0222: Use after free in ANGLE + * CVE-2024-0223: Heap buffer overflow in ANGLE + * CVE-2024-0224: Use after free in WebAudio + * CVE-2024-0225: Use after free in WebGPU + * CVE-2023-7024: Heap buffer overflow in WebRTC + * CVE-2023-6702: Type Confusion in V8 + * CVE-2023-6703: Use after free in Blink + * CVE-2023-6704: Use after free in libavif (boo#1218303) + * CVE-2023-6705: Use after free in WebRTC + * CVE-2023-6706: Use after free in FedCM + * CVE-2023-6707: Use after free in CSS + * CVE-2023-6508: Use after free in Media Stream + * CVE-2023-6509: Use after free in Side Panel Search + * CVE-2023-6510: Use after free in Media Capture + * CVE-2023-6511: Inappropriate implementation in Autofill + * CVE-2023-6512: Inappropriate implementation in Web Browser UI +- drop patches: + * chromium-system-libusb.patch + * chromium-119-nullptr_t-without-namespace-std.patch + * chromium-119-no_matching_constructor.patch + * chromium-117-workaround_clang_bug-structured_binding.patch +- add patches: + * chromium-120-nullptr_t-without-namespace-std.patch + * chromium-120-emplace.patch + * chromium-120-lp155-typename.patch + * chromium-120-no_matching_constructor.patch + * chromium-120-missing-header-files.patch + * chromium-120-emplace-struct.patch + * chromium-120-workaround_clang_bug-structured_binding.patch +- add patches for Leap that revert braking changes: + * chromium-120-lp155-revert-clang-build-failure.patch + +------------------------------------------------------------------- +Wed Nov 29 06:26:02 UTC 2023 - Andreas Stieger + +- Chromium 119.0.6045.199 (boo#1217616) + * CVE-2023-6348: Type Confusion in Spellcheck + * CVE-2023-6347: Use after free in Mojo + * CVE-2023-6346: Use after free in WebAudio + * CVE-2023-6350: Out of bounds memory access in libavif (boo#1217614) + * CVE-2023-6351: Use after free in libavif (boo#1217615) + * CVE-2023-6345: Integer overflow in Skia + * Various fixes from internal audits, fuzzing and other initiatives + +------------------------------------------------------------------- +Wed Nov 15 06:18:42 UTC 2023 - Andreas Stieger + +- Chromium 119.0.6045.159 (boo#1217142) + * CVE-2023-5997: Use after free in Garbage Collection + * CVE-2023-6112: Use after free in Navigation + * Various fixes from internal audits, fuzzing and other initiatives + +------------------------------------------------------------------- +Fri Nov 10 18:50:48 UTC 2023 - Andreas Stieger + +- Chromium 119.0.6045.123 (boo#1216978) + * CVE-2023-5996: Use after free in WebAudio +- Chromium 119.0.6045.105 (boo#1216783) + * CVE-2023-5480: Inappropriate implementation in Payments + * CVE-2023-5482: Insufficient data validation in USB + * CVE-2023-5849: Integer overflow in USB + * CVE-2023-5850: Incorrect security UI in Downloads + * CVE-2023-5851: Inappropriate implementation in Downloads + * CVE-2023-5852: Use after free in Printing + * CVE-2023-5853: Incorrect security UI in Downloads + * CVE-2023-5854: Use after free in Profiles + * CVE-2023-5855: Use after free in Reading Mode + * CVE-2023-5856: Use after free in Side Panel + * CVE-2023-5857: Inappropriate implementation in Downloads + * CVE-2023-5858: Inappropriate implementation in WebApp Provider + * CVE-2023-5859: Incorrect security UI in Picture In Picture +- dropped patches: + * chromium-98-gtk4-build.patch + * chromium-118-system-freetype.patch + * chromium-118-no_matching_constructor.patch +- added patches: + * chromium-119-no_matching_constructor.patch + * chromium-119-dont-redefine-ATSPI-version-macros.patch + * chromium-119-nullptr_t-without-namespace-std.patch + * chromium-119-assert.patch + +------------------------------------------------------------------- +Tue Oct 24 21:20:15 UTC 2023 - Andreas Stieger + +- Chromium 118.0.5993.117 (boo#1216549) + * CVE-2023-5472: Use after free in Profiles + * Various fixes from internal audits, fuzzing and other initiatives + +------------------------------------------------------------------- +Wed Oct 18 20:39:57 UTC 2023 - Andreas Stieger + +- Chromium 118.0.5993.88: + * unspecified security fix (boo#1216392) + +------------------------------------------------------------------- +Wed Oct 11 18:56:28 UTC 2023 - Andreas Stieger + +- refresh chromium-117-emplace_back_on_vector-c++20.patch and + chromium-117-lp155-constructors.patch to + chromium-118-no_matching_constructor.patch + +------------------------------------------------------------------- +Tue Oct 10 20:18:54 UTC 2023 - Andreas Stieger + +- Chromium 118.0.5993.70 (boo#1216111) + * CVE-2023-5218: Use after free in Site Isolation + * CVE-2023-5487: Inappropriate implementation in Fullscreen + * CVE-2023-5484: Inappropriate implementation in Navigation + * CVE-2023-5475: Inappropriate implementation in DevTools + * CVE-2023-5483: Inappropriate implementation in Intents + * CVE-2023-5481: Inappropriate implementation in Downloads + * CVE-2023-5476: Use after free in Blink History + * CVE-2023-5474: Heap buffer overflow in PDF + * CVE-2023-5479: Inappropriate implementation in Extensions API + * CVE-2023-5485: Inappropriate implementation in Autofill + * CVE-2023-5478: Inappropriate implementation in Autofill + * CVE-2023-5477: Inappropriate implementation in Installer + * CVE-2023-5486: Inappropriate implementation in Input + * CVE-2023-5473: Use after free in Cast +- Build with system freetype (again), and zstd +- add patches: + * chromium-118-system-freetype.patch + * chromium-117-system-zstd.patch + +------------------------------------------------------------------- +Sat Oct 7 15:32:52 UTC 2023 - Andreas Stieger + +- Chromium 118.0.5993.54 +- add patches: + * chromium-118-includes.patch + +------------------------------------------------------------------- +Wed Oct 4 05:22:08 UTC 2023 - Andreas Stieger + +- Chromium 117.0.5938.149: + * CVE-2023-5346: Type Confusion in V8 (boo#1215924) + +------------------------------------------------------------------- +Wed Sep 27 21:39:34 UTC 2023 - Andreas Stieger + +- Chromium 117.0.5938.132 (boo#1215776): + * CVE-2023-5217: Heap buffer overflow in vp8 encoding in libvpx (boo#1215778) + * CVE-2023-5186: Use after free in Passwords + * CVE-2023-5187: Use after free in Extensions + +------------------------------------------------------------------- +Fri Sep 22 06:27:24 UTC 2023 - Andreas Stieger + +- Chromium 117.0.5938.92: + * stability improvements + +------------------------------------------------------------------- +Wed Sep 20 13:59:22 UTC 2023 - Andreas Stieger + +- Add explicit build dependency on libepoxy for Tumbleweed + +------------------------------------------------------------------- +Sun Sep 17 11:47:10 UTC 2023 - Andreas Stieger + +- Chromium 117.0.5938.88 (boo#1215279) + * CVE-2023-4900: Inappropriate implementation in Custom Tabs + * CVE-2023-4901: Inappropriate implementation in Prompts + * CVE-2023-4902: Inappropriate implementation in Input + * CVE-2023-4903: Inappropriate implementation in Custom Mobile Tabs + * CVE-2023-4904: Insufficient policy enforcement in Downloads + * CVE-2023-4905: Inappropriate implementation in Prompts + * CVE-2023-4906: Insufficient policy enforcement in Autofill + * CVE-2023-4907: Inappropriate implementation in Intents + * CVE-2023-4908: Inappropriate implementation in Picture in Picture + * CVE-2023-4909: Inappropriate implementation in Interstitials +- drop patches: + * chromium-100-InMilliseconds-constexpr.patch + * chromium-115-Qt-moc-version.patch + * chromium-116-profile-view-utils-vector-include.patch + * chromium-116-blink-variant-include.patch + * chromium-116-abseil-limits-include.patch + * chromium-116-lp155-constuctors.patch + * chromium-115-workaround_clang_bug-structured_binding.patch + * chromium-115-emplace_back_on_vector-c++20.patch +- add patches: + * chromium-117-blink-BUILD-mnemonic.patch + * chromium-117-includes.patch + * chromium-117-lp155-constructors.patch + * chromium-117-string-convert.patch + * chromium-117-lp155-typename.patch + * chromium-117-workaround_clang_bug-structured_binding.patch + * chromium-117-emplace_back_on_vector-c++20.patch + +------------------------------------------------------------------- +Wed Sep 13 20:04:46 UTC 2023 - Andreas Stieger + +- CVE-2023-4863: build with the bundled library on Leap (boo#1215231) + +------------------------------------------------------------------- +Tue Sep 12 06:18:00 UTC 2023 - Andreas Stieger + +- Chromium 116.0.5845.187 (boo#1215231): + * CVE-2023-4863: Heap buffer overflow in WebP + +------------------------------------------------------------------- +Wed Sep 6 05:08:13 UTC 2023 - Andreas Stieger + +- Chromium 116.0.5845.179 (boo#1215023): + * CVE-2023-4761: Out of bounds memory access in FedCM + * CVE-2023-4762: Type Confusion in V8 + * CVE-2023-4763: Use after free in Networks + * CVE-2023-4764: Incorrect security UI in BFCache + +------------------------------------------------------------------- +Wed Aug 30 00:57:21 UTC 2023 - Andreas Stieger + +- Chromium 116.0.5845.140 (boo#1214758): + * CVE-2023-4572: Use after free in MediaStream + +------------------------------------------------------------------- +Wed Aug 23 06:09:03 UTC 2023 - Andreas Stieger + +- Chromium 116.0.5845.110 (boo#1214487): + * CVE-2023-4427: Out of bounds memory access in V8 + * CVE-2023-4428: Out of bounds memory access in CSS + * CVE-2023-4429: Use after free in Loader + * CVE-2023-4430: Use after free in Vulkan + * CVE-2023-4431: Out of bounds memory access in Fonts + +------------------------------------------------------------------- +Mon Aug 14 19:17:09 UTC 2023 - Andreas Stieger + +- Chromium 116.0.5845.96 + * New CSS features: Motion Path, and "display" and + "content-visibility" animations + * Web APIs: AbortSignal.any(), BYOB support for Fetch, Back/ + forward cache NotRestoredReason API, Document Picture-in- + Picture, Expanded Wildcards in Permissions Policy Origins, + FedCM bundle: Login Hint API, User Info API, and RP Context API, + Non-composed Mouse and Pointer enter/leave events, + Remove document.open sandbox inheritance, + Report Critical-CH caused restart in NavigationTiming +- fix a number of security issues (boo#1214301): + * CVE-2023-2312: Use after free in Offline + * CVE-2023-4349: Use after free in Device Trust Connectors + * CVE-2023-4350: Inappropriate implementation in Fullscreen + * CVE-2023-4351: Use after free in Network + * CVE-2023-4352: Type Confusion in V8 + * CVE-2023-4353: Heap buffer overflow in ANGLE + * CVE-2023-4354: Heap buffer overflow in Skia + * CVE-2023-4355: Out of bounds memory access in V8 + * CVE-2023-4356: Use after free in Audio + * CVE-2023-4357: Insufficient validation of untrusted input in XML + * CVE-2023-4358: Use after free in DNS + * CVE-2023-4359: Inappropriate implementation in App Launcher + * CVE-2023-4360: Inappropriate implementation in Color + * CVE-2023-4361: Inappropriate implementation in Autofill + * CVE-2023-4362: Heap buffer overflow in Mojom IDL + * CVE-2023-4363: Inappropriate implementation in WebShare + * CVE-2023-4364: Inappropriate implementation in Permission Prompts + * CVE-2023-4365: Inappropriate implementation in Fullscreen + * CVE-2023-4366: Use after free in Extensions + * CVE-2023-4367: Insufficient policy enforcement in Extensions API + * CVE-2023-4368: Insufficient policy enforcement in Extensions API +- drop patches: + * chromium-115-add_BoundSessionRefreshCookieFetcher::Result.patch + * chromium-115-verify_name_match-include.patch + * chromium-86-fix-vaapi-on-intel.patch + * chromium-115-skia-include.patch + * chromium-115-dont-pass-nullptr-to-construct-re2-StringPiece.patch +- add patches: + * chromium-116-profile-view-utils-vector-include.patch + * chromium-116-blink-variant-include.patch + * chromium-116-lp155-url_load_stats-size-t.patch + * chromium-116-abseil-limits-include.patch + * chromium-116-lp155-typenames.patch + * chromium-116-lp155-constuctors.patch +- Build with bundled re2 on Leap + +------------------------------------------------------------------- +Wed Aug 9 17:24:31 UTC 2023 - Andreas Stieger + +- Fix crash with extensions (boo#1214003) + chromium-115-dont-pass-nullptr-to-construct-re2-StringPiece.patch + +------------------------------------------------------------------- +Thu Aug 3 06:00:39 UTC 2023 - Andreas Stieger + +- Chromium 115.0.5790.170 (boo#1213920) + * CVE-2023-4068: Type Confusion in V8 + * CVE-2023-4069: Type Confusion in V8 + * CVE-2023-4070: Type Confusion in V8 + * CVE-2023-4071: Heap buffer overflow in Visuals + * CVE-2023-4072: Out of bounds read and write in WebGL + * CVE-2023-4073: Out of bounds memory access in ANGLE + * CVE-2023-4074: Use after free in Blink Task Scheduling + * CVE-2023-4075: Use after free in Cast + * CVE-2023-4076: Use after free in WebRTC + * CVE-2023-4077: Insufficient data validation in Extensions + * CVE-2023-4078: Inappropriate implementation in Extensions + +------------------------------------------------------------------- +Fri Jul 28 22:01:46 UTC 2023 - Andreas Stieger + +- Specify re2 build dependency in a way that makes Leap packages + build in devel project and in Maintenance + +------------------------------------------------------------------- +Sun Jul 23 11:55:15 UTC 2023 - Andreas Stieger + +- Chromium 115.0.5790.102: + * stability fix +- Add build fixes on Leap: + * chromium-115-emplace_back_on_vector-c++20.patch + * chromium-115-compiler-SkColor4f.patch + * chromium-115-workaround_clang_bug-structured_binding.patch + * chromium-115-add_BoundSessionRefreshCookieFetcher::Result.patch +- adjust chromium-115-lp155-typename.patch +- drop chromium-114-workaround_clang_bug-structured_binding.patch + +------------------------------------------------------------------- +Wed Jul 19 09:23:32 UTC 2023 - Andreas Stieger + +- Chromium 115.0.5790.98 + * Security: The Storage, Service Worker, and Communication APIs + are now partitioned in third-party contexts to prevent certain + types of side-channel cross-site tracking + * HTTPS: Automatically and optimistically upgrade all main-frame + navigations to HTTPS, with fast fallback to HTTP. + * CSS: accept multiple values of the display property + * CSS: support boolean context style container queries + * CSS: support scroll-driven animations + * Increase the maximum size of a WebAssembly.Module() on the main + thread to 8 MB + * FedCM: Support credential management mediation requirements for + auto re-authentication + * Deprecate the document.domain setter + * Deprecate mutation events + * Security fixes (boo#1213462): + CVE-2023-3727: Use after free in WebRTC + CVE-2023-3728: Use after free in WebRTC + CVE-2023-3730: Use after free in Tab Groups + CVE-2023-3732: Out of bounds memory access in Mojo + CVE-2023-3733: Inappropriate implementation in WebApp Installs + CVE-2023-3734: Inappropriate implementation in Picture In Picture + CVE-2023-3735: Inappropriate implementation in Web API Permission Prompts + CVE-2023-3736: Inappropriate implementation in Custom Tabs + CVE-2023-3737: Inappropriate implementation in Notifications + CVE-2023-3738: Inappropriate implementation in Autofill + CVE-2023-3740: Insufficient validation of untrusted input in Themes + Various fixes from internal audits, fuzzing and other initiatives +- drop chromium-113-typename.patch +- add chromium-115-skia-include.patch +- add chromium-115-verify_name_match-include.patch +- add chromium-115-lp155-typename.patch +- Add chromium-115-Qt-moc-version.patch: support Qt5 & Qt6 without + built-in copy of shim + +------------------------------------------------------------------- +Tue Jun 27 07:39:29 UTC 2023 - Andreas Stieger + +- Chromium 114.0.5735.198 (boo#1212755): + * CVE-2023-3420: Type Confusion in V8 + * CVE-2023-3421: Use after free in Media + * CVE-2023-3422: Use after free in Guest View + +------------------------------------------------------------------- +Sun Jun 25 09:54:37 UTC 2023 - Callum Farmer + +- Install Qt5 library & prepare for Qt6 in 115 + +------------------------------------------------------------------- +Wed Jun 14 05:23:16 UTC 2023 - Andreas Stieger + +- Chromium 114.0.5735.133 (boo#1212302): + * CVE-2023-3214: Use after free in Autofill payments + * CVE-2023-3215: Use after free in WebRTC + * CVE-2023-3216: Type Confusion in V8 + * CVE-2023-3217: Use after free in WebXR + * Various fixes from internal audits, fuzzing and other initiatives + +------------------------------------------------------------------- +Wed Jun 7 18:13:06 UTC 2023 - Andreas Stieger + +- Fix Leap 15.4 build - chromium-114-revert-av1enc-lp154.patch + +------------------------------------------------------------------- +Tue Jun 6 05:34:13 UTC 2023 - Andreas Stieger + +- Chromium 114.0.5735.106 (boo#1212044): + * CVE-2023-3079: Type Confusion in V8 + +------------------------------------------------------------------- +Sun Jun 4 18:52:01 UTC 2023 - Callum Farmer + +- Chromium 114.0.5735.90 (boo#1211843): + * CSS text-wrap: balance is available + * Cookies partitioned by top level site (CHIPS) + * New Popover API +- Security fixes: + * CVE-2023-2929: Out of bounds write in Swiftshader + * CVE-2023-2930: Use after free in Extensions + * CVE-2023-2931: Use after free in PDF + * CVE-2023-2932: Use after free in PDF + * CVE-2023-2933: Use after free in PDF + * CVE-2023-2934: Out of bounds memory access in Mojo + * CVE-2023-2935: Type Confusion in V8 + * CVE-2023-2936: Type Confusion in V8 + * CVE-2023-2937: Inappropriate implementation in Picture In Picture + * CVE-2023-2938: Inappropriate implementation in Picture In Picture + * CVE-2023-2939: Insufficient data validation in Installer + * CVE-2023-2940: Inappropriate implementation in Downloads + * CVE-2023-2941: Inappropriate implementation in Extensions API +- Drop patches: + * chromium-103-VirtualCursor-std-layout.patch + * chromium-113-system-zlib.patch + * chromium-113-workaround_clang_bug-structured_binding.patch +- Add patches + * chromium-114-workaround_clang_bug-structured_binding.patch + * chromium-114-lld-argument.patch + +------------------------------------------------------------------- +Tue May 30 21:53:45 UTC 2023 - Callum Farmer + +- Un-bundle zlib again +- Remove un-needed patches: + * chromium-112-default-comparison-operators.patch + * chromium-109-clang-lp154.patch + * chromium-clang-nomerge.patch + * chromium-ffmpeg-lp152.patch + * chromium-lp151-old-drm.patch +- Added patches: + * chromium-113-system-zlib.patch + +------------------------------------------------------------------- +Sun May 28 21:32:03 UTC 2023 - Andreas Stieger + +- build with llvm15 on Leap + +------------------------------------------------------------------- +Tue May 16 21:16:23 UTC 2023 - Andreas Stieger + +- Chromium 113.0.5672.126 (boo#1211442): + * CVE-2023-2721: Use after free in Navigation + * CVE-2023-2722: Use after free in Autofill UI + * CVE-2023-2723: Use after free in DevTools + * CVE-2023-2724: Type Confusion in V8 + * CVE-2023-2725: Use after free in Guest View + * CVE-2023-2726: Inappropriate implementation in WebApp Installs + * Various fixes from internal audits, fuzzing and other initiatives + +------------------------------------------------------------------- +Tue May 9 19:14:20 UTC 2023 - Andreas Stieger + +- Chromium 113.0.5672.92 (boo#1211211) +- Multiple security fixes (boo#1211036): + * CVE-2023-2459: Inappropriate implementation in Prompts + * CVE-2023-2460: Insufficient validation of untrusted input in Extensions + * CVE-2023-2461: Use after free in OS Inputs + * CVE-2023-2462: Inappropriate implementation in Prompts + * CVE-2023-2463: Inappropriate implementation in Full Screen Mode + * CVE-2023-2464: Inappropriate implementation in PictureInPicture + * CVE-2023-2465: Inappropriate implementation in CORS + * CVE-2023-2466: Inappropriate implementation in Prompts + * CVE-2023-2467: Inappropriate implementation in Prompts + * CVE-2023-2468: Inappropriate implementation in PictureInPicture +- drop chromium-94-sql-no-assert.patch +- drop no-location-leap151.patch +- add chromium-113-webview-namespace.patch +- add chromium-113-webauth-include-variant.patch +- add chromium-113-typename.patch +- add chromium-113-workaround_clang_bug-structured_binding.patch + +------------------------------------------------------------------- +Wed Apr 19 19:55:51 UTC 2023 - Andreas Stieger + +- Chromium 112.0.5615.165 (boo#1210618): + * CVE-2023-2133: Out of bounds memory access in Service Worker API + * CVE-2023-2134: Out of bounds memory access in Service Worker API + * CVE-2023-2135: Use after free in DevTools + * CVE-2023-2136: Integer overflow in Skia + * CVE-2023-2137: Heap buffer overflow in sqlite +- drop chromium-112-feed_protos.patch + +------------------------------------------------------------------- +Sun Apr 16 02:10:30 UTC 2023 - Andreas Stieger + +- Fix Leap 15.4 build failures from default comparison operators + defined outside of the class definition, a C++20 feature + adding chromium-112-default-comparison-operators.patch + +------------------------------------------------------------------- +Sat Apr 15 10:49:51 UTC 2023 - Andreas Stieger + +- Chromium 112.0.5615.121: + * CVE-2023-2033: Type Confusion in V8 (boo#1210478) + +------------------------------------------------------------------- +Fri Apr 7 07:57:40 UTC 2023 - Andreas Stieger + +- Revert a breaking change with chromium-112-feed_protos.patch + +------------------------------------------------------------------- +Tue Apr 4 22:38:23 UTC 2023 - Andreas Stieger + +- Chromium 112.0.5615.49 + * CSS now supports nesting rules. + * The algorithm to set the initial focus on elements was updated. + * No-op fetch() handlers on service workers are skipped from now on to make navigations faster + * The setter for document.domain is now deprecated. + * The recorder in devtools can now record with pierce selectors. + * Security fixes (boo#1210126): + * CVE-2023-1810: Heap buffer overflow in Visuals + * CVE-2023-1811: Use after free in Frames + * CVE-2023-1812: Out of bounds memory access in DOM Bindings + * CVE-2023-1813: Inappropriate implementation in Extensions + * CVE-2023-1814: Insufficient validation of untrusted input in Safe Browsing + * CVE-2023-1815: Use after free in Networking APIs + * CVE-2023-1816: Incorrect security UI in Picture In Picture + * CVE-2023-1817: Insufficient policy enforcement in Intents + * CVE-2023-1818: Use after free in Vulkan + * CVE-2023-1819: Out of bounds read in Accessibility + * CVE-2023-1820: Heap buffer overflow in Browser History + * CVE-2023-1821: Inappropriate implementation in WebShare + * CVE-2023-1822: Incorrect security UI in Navigation + * CVE-2023-1823: Inappropriate implementation in FedCM + +------------------------------------------------------------------- +Mon Mar 27 20:12:21 UTC 2023 - Andreas Stieger + +- Chromium 111.0.5563.147: + * nth-child() validation performance regression for SAP apps + +------------------------------------------------------------------- +Thu Mar 23 08:40:11 UTC 2023 - Guillaume GARDET + +- Update gcc13-fix.patch with few fixes required for aarch64, + borrowed from Fedora's gcc13 patch + +------------------------------------------------------------------- +Wed Mar 22 09:03:45 UTC 2023 - Andreas Stieger + +- Chromium 111.0.5563.110 (boo#1209598) + * CVE-2023-1528: Use after free in Passwords + * CVE-2023-1529: Out of bounds memory access in WebHID + * CVE-2023-1530: Use after free in PDF + * CVE-2023-1531: Use after free in ANGLE + * CVE-2023-1532: Out of bounds read in GPU Video + * CVE-2023-1533: Use after free in WebProtect + * CVE-2023-1534: Out of bounds read in ANGLE + +------------------------------------------------------------------- +Mon Mar 20 11:59:36 UTC 2023 - Martin Liška + +- Add gcc13-fix.patch in order to support GCC 13. + +------------------------------------------------------------------- +Thu Mar 9 23:54:55 UTC 2023 - Callum Farmer + +- Revert back to GCC 11 on 15.4 as Clang 13 doesn't support GCC 12 + +------------------------------------------------------------------- +Thu Mar 9 15:48:22 UTC 2023 - Callum Farmer + +- Bump Leap's GCC to 12 as Chromium really likes newer standards + +------------------------------------------------------------------- +Thu Mar 9 01:58:25 UTC 2023 - Andreas Stieger + +- Chromium 111.0.5563.64 + * New View Transitions API + * CSS Color Level 4 + * New developer tools in style panel for color functionality + * CSS added trigonometric functions, additional root font units + and extended the n-th child pseudo selector. + * previousslide and nextslide actions are now part of the Media + Session API + * A number of security fixes (boo#1209040) + * CVE-2023-1213: Use after free in Swiftshader + * CVE-2023-1214: Type Confusion in V8 + * CVE-2023-1215: Type Confusion in CSS + * CVE-2023-1216: Use after free in DevTools + * CVE-2023-1217: Stack buffer overflow in Crash reporting + * CVE-2023-1218: Use after free in WebRTC + * CVE-2023-1219: Heap buffer overflow in Metrics + * CVE-2023-1220: Heap buffer overflow in UMA + * CVE-2023-1221: Insufficient policy enforcement in Extensions API + * CVE-2023-1222: Heap buffer overflow in Web Audio API + * CVE-2023-1223: Insufficient policy enforcement in Autofill + * CVE-2023-1224: Insufficient policy enforcement in Web Payments API + * CVE-2023-1225: Insufficient policy enforcement in Navigation + * CVE-2023-1226: Insufficient policy enforcement in Web Payments API + * CVE-2023-1227: Use after free in Core + * CVE-2023-1228: Insufficient policy enforcement in Intents + * CVE-2023-1229: Inappropriate implementation in Permission prompts + * CVE-2023-1230: Inappropriate implementation in WebApp Installs + * CVE-2023-1231: Inappropriate implementation in Autofill + * CVE-2023-1232: Insufficient policy enforcement in Resource Timing + * CVE-2023-1233: Insufficient policy enforcement in Resource Timing + * CVE-2023-1234: Inappropriate implementation in Intents + * CVE-2023-1235: Type Confusion in DevTools + * CVE-2023-1236: Inappropriate implementation in Internals +- drop patches: + * chromium-86-ImageMemoryBarrierData-init.patch + * chromium-93-InkDropHost-crash.patch + * chromium-110-NativeThemeBase-fabs.patch + * chromium-110-CredentialUIEntry-const.patch + * chromium-110-DarkModeLABColorSpace-pow.patch + * v8-move-the-Stack-object-from-ThreadLocalTop.patch + * chromium-icu72-1.patch + +------------------------------------------------------------------- +Thu Feb 23 08:21:24 UTC 2023 - Andreas Stieger + +- Chromium 110.0.5481.177 (boo#1208589) + * CVE-2023-0927: Use after free in Web Payments API + * CVE-2023-0928: Use after free in SwiftShader + * CVE-2023-0929: Use after free in Vulkan + * CVE-2023-0930: Heap buffer overflow in Video + * CVE-2023-0931: Use after free in Video + * CVE-2023-0932: Use after free in WebRTC + * CVE-2023-0933: Integer overflow in PDF + * CVE-2023-0941: Use after free in Prompts + * Various fixes from internal audits, fuzzing and other initiatives + +------------------------------------------------------------------- +Thu Feb 16 20:30:43 UTC 2023 - Andreas Stieger + +- Chromium 110.0.5481.100 + * fix regression on SAP Business Objects web UI + * fix date formatting behavior change from ICU 72 + +------------------------------------------------------------------- +Wed Feb 8 20:16:01 UTC 2023 - Andreas Stieger + +- Chromium 110.0.5481.77 (boo#1208029): + * CVE-2023-0696: Type Confusion in V8 + * CVE-2023-0697: Inappropriate implementation in Full screen mode + * CVE-2023-0698: Out of bounds read in WebRTC + * CVE-2023-0699: Use after free in GPU + * CVE-2023-0700: Inappropriate implementation in Download + * CVE-2023-0701: Heap buffer overflow in WebUI + * CVE-2023-0702: Type Confusion in Data Transfer + * CVE-2023-0703: Type Confusion in DevTools + * CVE-2023-0704: Insufficient policy enforcement in DevTools + * CVE-2023-0705: Integer overflow in Core + * Various fixes from internal audits, fuzzing and other initiatives +- build with bundled libavif +- dropped patches: + * chromium-109-compiler.patch + * chromium-icu72-3.patch +- added patches: + * chromium-110-compiler.patch + * chromium-110-system-libffi.patch + * chromium-110-NativeThemeBase-fabs.patch + * chromium-110-CredentialUIEntry-const.patch + * chromium-110-DarkModeLABColorSpace-pow.patch + * v8-move-the-Stack-object-from-ThreadLocalTop.patch + +------------------------------------------------------------------- +Wed Jan 25 04:51:29 UTC 2023 - Andreas Stieger + +- Chromium 109.0.5414.119 (boo#1207512): + * CVE-2023-0471: Use after free in WebTransport + * CVE-2023-0472: Use after free in WebRTC + * CVE-2023-0473: Type Confusion in ServiceWorker API + * CVE-2023-0474: Use after free in GuestView + * Various fixes from internal audits, fuzzing and other + initiatives + +------------------------------------------------------------------- +Tue Jan 17 21:03:29 UTC 2023 - Callum Farmer + +- Added patches: + * chromium-icu72-1.patch: ensure TextCodecCJK doesn't conflict + with system icu (bsc#1207147) + * chromium-icu72-2.patch: align default characters for old icu + with that of ICU 72 + * chromium-icu72-3.patch: make V8 aware of space in ICU 72 time + format + +------------------------------------------------------------------- +Tue Jan 10 21:24:55 UTC 2023 - Andreas Stieger + +- Chromium 109.0.5414.74: + * Add support for MathML Core + * CSS: Auto range support for font descriptors inside @font-face + rule + * CSS: Add lh length unit + * CSS: Add hyphenate-limit-chars property + * CSS: Snap border, outline and column-rule widths before layout + * API: Improved screen sharing and web conferencing: hints for + suppressing local audio playback, and Conditional Focus + * API: HTTP response status code in the Resource Timing API + * API: Same-site cross-origin prerendering triggered by the + speculation rules API + * Remove Event.path API + * CVE-2023-0128: Use after free in Overview Mode + * CVE-2023-0129: Heap buffer overflow in Network Service + * CVE-2023-0130: Inappropriate implementation in Fullscreen API + * CVE-2023-0131: Inappropriate implementation in iframe Sandbox + * CVE-2023-0132: Inappropriate implementation in Permission prompts + * CVE-2023-0133: Inappropriate implementation in Permission prompts + * CVE-2023-0134: Use after free in Cart + * CVE-2023-0135: Use after free in Cart + * CVE-2023-0136: Inappropriate implementation in Fullscreen API + * CVE-2023-0137: Heap buffer overflow in Platform Apps + * CVE-2023-0138: Heap buffer overflow in libphonenumber + * CVE-2023-0139: Insufficient validation of untrusted input in Downloads + * CVE-2023-0140: Inappropriate implementation in File System API + * CVE-2023-0141: Insufficient policy enforcement in CORS + * Various fixes from internal audits, fuzzing and other initiatives +- drop patches: + * chromium-gcc11.patch - not needed + * chromium-107-system-zlib.patch - upstream + * chromium-108-compiler.patch +- add patches: + * chromium-109-compiler.patch + * chromium-109-clang-lp154.patch + +------------------------------------------------------------------- +Sun Dec 18 17:31:22 UTC 2022 - Callum Farmer + +- Add chromium-disable-GlobalMediaControlsCastStartStop.patch: + disable GlobalMediaControlsCastStartStop to fix crashes + occurring when interacting with the Media UI (bsc#1198124) + +------------------------------------------------------------------- +Wed Dec 14 09:01:57 UTC 2022 - Andreas Stieger + +- Chromium 108.0.5359.124 (boo#1206403): + * CVE-2022-4436: Use after free in Blink Media + * CVE-2022-4437: Use after free in Mojo IPC + * CVE-2022-4438: Use after free in Blink Frames + * CVE-2022-4439: Use after free in Aura + * CVE-2022-4440: Use after free in Profiles + +------------------------------------------------------------------- +Wed Dec 7 20:43:54 UTC 2022 - Andreas Stieger + +- Chromium 108.0.5359.98 + * Fix regression in computing selection renders white text on white + background in apps. (Issue: 158422) + * Fixed translate infobar button to show selected language. + (Issue: 155350) + * Fixed broken Arabic language. (Issue: 158978) + * Fixed pre-rendering if the preference is disabled at start up. + (Issue: 159393) + * Fixed JavaScript rendering issue. (Issue: 159655) + * No further indications in the ChangeLog + +------------------------------------------------------------------- +Tue Nov 20 23:27:56 UTC 2012 - tittiatcoke@gmail.com + +- Update to 25.0.1329 + * No further indications in the ChangeLog +- Removed patch chomium-ffmpeg-no-pkgconfig.patch +- Building now internal libffmpegsumo.so based on the standard + chromium ffmpeg codecs + +------------------------------------------------------------------- +Tue Nov 6 18:42:46 UTC 2012 - tittiatcoke@gmail.com + +- Update to 25.0.1319 + * No further indications in the Changelog + +------------------------------------------------------------------- +Fri Oct 26 08:58:02 UTC 2012 - tittiatcoke@gmail.com + +- Update to 24.0.1308 + * Updated V8 - 3.14.5.0 + * Bookmarks are now searched by their title while typing into + the omnibox with matching bookmarks being shown in the + autocomplete suggestions pop-down list. Matching is done by + prefix. + * Fixed chromium issues 155871, 154173, 155133. + +------------------------------------------------------------------- +Tue Oct 16 12:41:55 UTC 2012 - coolo@suse.com + +- add explicit buildrequire on libbz2-devel + +------------------------------------------------------------------- +Sun Oct 7 11:28:56 UTC 2012 - tittiatcoke@gmail.com + +- Update to 24.0.1290 + * No further indications in the ChangeLog. + +------------------------------------------------------------------- +Sun Sep 30 09:38:06 UTC 2012 - tittiatcoke@gmail.com + +- Update to 24.0.1283 + * Security Fixes (bnc#782257) + - High CVE-2012-2889: UXSS in frame handling + - High CVE-2012-2886: UXSS in v8 bindings. + - High CVE-2012-2881: DOM tree corruption with plug-ins. + - High CVE-2012-2876: Buffer overflow in SSE2 optimizations. + - High CVE-2012-2883: Out-of-bounds write in Skia. + - High CVE-2012-2887: Use-after-free in onclick handling. + - High CVE-2012-2888: Use-after-free in SVG text references. + - High CVE-2012-2894: Crash in graphics context handling. + - High CVE-2012-2896: Integer overflow in WebGL. + - Medium CVE-2012-2877: Browser crash with extensions + and modal dialogs + - Low CVE-2012-2879: DOM topology corruption. + - Medium CVE-2012-2884: Out-of-bounds read in Skia. + - High CVE-2012-2874: Out-of-bounds write in Skia. + - High CVE-2012-2878: Use-after-free in plug-in handling. + - Medium CVE-2012-2880: Race condition in plug-in paint buffer. + - High CVE-2012-2882: Wild pointer in OGG container handling. + - Medium CVE-2012-2885: Possible double free on exit. + - Low CVE-2012-2891: Address leak over IPC. + - Low CVE-2012-2892: Pop-up block bypass. + - High CVE-2012-2893: Double free in XSL transforms. + + +------------------------------------------------------------------- +Sat Sep 15 06:27:56 UTC 2012 - tittiatcoke@gmail.com + +- Update to 23.0.1268 + * Updated V8 - 3.13.6.0 + * Updated WebKit - 537.10 + * Make the new sandbox more robust when denying socket calls. + * Fix crashes (Issues 142388 and 146606) + +------------------------------------------------------------------- +Fri Sep 7 15:49:57 UTC 2012 - tittiatcoke@gmail.com + +- Update to 23.0.1259 + * No further indications in the ChangeLog. + +------------------------------------------------------------------- +Sun Sep 2 14:31:22 UTC 2012 - tittiatcoke@gmail.com + +- Update to 23.0.1255 + * Security Fixes (bnc#778005): + - Medium CVE-2012-2865: Out-of-bounds read in line breaking. + - High CVE-2012-2866: Bad cast with run-ins. + - Low CVE-2012-2867: Browser crash with SPDY. + - Medium CVE-2012-2868: Race condition with workers and XHR. + - High CVE-2012-2869: Avoid stale buffer in URL loading. + - Low CVE-2012-2870: Lower severity memory management issues + in XPath. + - High CVE-2012-2871: Bad cast in XSL transforms. + - Medium CVE-2012-2872: XSS in SSL interstitial. + +------------------------------------------------------------------- +Wed Aug 29 19:19:31 UTC 2012 - tittiatcoke@gmail.com + +- Update to 23.0.1249 + * No longer building with system libraries. This caused issues + with high CPU utilization and a blank homescreen. Now the + in-source libraries are used. + +------------------------------------------------------------------- +Sun Aug 19 08:32:45 UTC 2012 - tittiatcoke@gmail.com + +- Update to 23.0.1240 + * Duplex Printing defaults to Yes, which prints extra pages even + for a 1 page print out (Issue 138312). + * Print preview takes forever on Win XP (issue: 140044) + * Anti-DDoS inversion of logic (Issues: 141643, 141081) + * Projectmanager.com application causes Flash to hang + (Issue: 141018) + * An additional scroll bar appears at the right on many sites + (issue: 140239) + * Setting and unsetting display:none obliterates current scroll + position (issue: 140101) +- Utilize the patched zlib sources from Chromium in order to build + +------------------------------------------------------------------- +Fri Aug 3 15:54:24 UTC 2012 - tittiatcoke@gmail.com + +- Update to 22.0.1226 + * Security Fixes (bnc#770821): + CVE-2012-2843: Use-after-free in layout height tracking + CVE-2012-2842: Use-after-free in counter handling + +------------------------------------------------------------------- +Mon Jul 30 13:21:27 UTC 2012 - aj@suse.de + +- Fix build with glibc 2.16 (struct siginfo is not exported anymore). + +------------------------------------------------------------------- +Sun Jul 29 13:32:21 UTC 2012 - tittiatcoke@gmail.com + +- Update to 22.0.1221 + * Several crash fixes (Issues: 131310, 134574) + * Can't press Enter to save to PDF (Issue: 137690) + +------------------------------------------------------------------- +Wed Jul 25 14:17:53 UTC 2012 - tittiatcoke@gmail.com + +- Update to 22.0.1218 + * New Connection Manager + * New Print UI. + * No further indications in the ChangeLog. + +------------------------------------------------------------------- +Sun Jul 8 13:10:48 UTC 2012 - tittiatcoke@gmail.com + +- Update to 22.0.1201 + * No further indications in the ChangeLog. + +- exclude ppc and ppc64. There is no v8 for ppc. (Update from + dvaleev@suse.com) + +------------------------------------------------------------------- +Fri Jun 29 08:52:58 UTC 2012 - tittiatcoke@gmail.com + +- Update to 22.0.1190 + * Security Fixes: + * CVE-2012-2815: Leak of iframe fragment id + * CVE-2012-2816: Prevent sandboxed processes interfering with + each other + * CVE-2012-2817: Use-after-free in table section handling + * CVE-2012-2818: Use-after-free in counter layout + * CVE-2012-2819: Crash in texture handling + * CVE-2012-2820: Out-of-bounds read in SVG filter handling + * CVE-2012-2821: Autofill display problem + * CVE-2012-2823: Use-after-free in SVG resource handling + * CVE-2012-2826: Out-of-bounds read in texture conversion + * CVE-2012-2829: Use-after-free in first-letter handling + * CVE-2012-2830: Wild pointer in array value setting + * CVE-2012-2831: Use-after-free in SVG reference handling + * CVE-2012-2834: Integer overflow in Matroska container + * CVE-2012-2825: Wild read in XSL handling + * CVE-2012-2807: Integer overflows in libxml + * Fix update-alternatives within the spec-file + +------------------------------------------------------------------- +Thu Jun 21 12:20:28 UTC 2012 - tittiatcoke@gmail.com + +- Update to 22.0.1183 + * Content settings for Cookies now also show protected storage + granted to hosted apps + * Chromoting client plugin correctly up-scales on when page-zoom + is >100%. + +------------------------------------------------------------------- +Tue Jun 19 13:06:52 UTC 2012 - tittiatcoke@gmail.com + +- Update to 21.0.1181 + * Bugfixes. + * Remove obsolete patch + * Do not execute update-alternatives when building + +------------------------------------------------------------------- +Fri Jun 15 12:19:24 UTC 2012 - coolo@suse.com + +- fix update-alternative usage to fix build + +------------------------------------------------------------------- +Thu May 31 08:27:09 UTC 2012 - tittiatcoke@gmail.com + +- Update to 21.0.1158 + * Bugfixes + * Gamepad API prototype http://www.w3.org/TR/gamepad/ + available by default. + * TLS 1.1 is enabled by default. + +------------------------------------------------------------------- +Sun May 20 16:40:03 UTC 2012 - tittiatcoke@gmail.com + +- Update to 21.0.1145 + * Fixed several issues around audio not playing with videos + * Crash Fixes + * Improvements to trackpad on Cr-48 + * Security Fixes (bnc#762481) + - CVE-2011-3083: Browser crash with video + FTP + - CVE-2011-3084: Load links from internal pages in their + own process. + - CVE-2011-3085: UI corruption with long autofilled values + - CVE-2011-3086: Use-after-free with style element. + - CVE-2011-3087: Incorrect window navigation + - CVE-2011-3088: Out-of-bounds read in hairline drawing + - CVE-2011-3089: Use-after-free in table handling. + - CVE-2011-3090: Race condition with workers. + - CVE-2011-3091: Use-after-free with indexed DB + - CVE-2011-3092: Invalid write in v8 regex + - CVE-2011-3093: Out-of-bounds read in glyph handling + - CVE-2011-3094: Out-of-bounds read in Tibetan handling + - CVE-2011-3095: Out-of-bounds write in OGG container. + - CVE-2011-3096: Use-after-free in GTK omnibox handling. + - CVE-2011-3098: Bad search path for Windows Media Player + plug-in + - CVE-2011-3100: Out-of-bounds read drawing dash paths. + - CVE-2011-3101: Work around Linux Nvidia driver bug + - CVE-2011-3102: Off-by-one out-of-bounds write in libxml. + +------------------------------------------------------------------- +Sun May 13 19:53:59 UTC 2012 - tittiatcoke@gmail.com + +- Update to 21.0.1137 + * Fixes crashes when manually typing in URL's + +------------------------------------------------------------------- +Fri May 11 14:22:22 UTC 2012 - tittiatcoke@gmail.com + +- Update to 21.0.1135.0 + * Added patch for Sqlite which should resolve crashes when build + with GCC 4.7 + * Fixes for rendering and stability + * Fixed about:inducebrowsercrashforrealz (Issue: 124843) + * Mouse over on apps/extensions makes place holder blank in + web store. (Issue: 125777) + * Security Fixes (bnc#760264): + - CVE-2011-3078: Use after free in floats handling. + - CVE-2012-1521: Use after free in xml parser. + - CVE-2011-3079: IPC validation failure. + - CVE-2011-3080: Race condition in sandbox IPC + - CVE-2011-3081: Use after free in floats handling. + +------------------------------------------------------------------- +Sun Apr 29 15:38:00 UTC 2012 - tittiatcoke@gmail.com + +- Update to 20.0.1123.0 + +------------------------------------------------------------------- +Fri Apr 27 09:54:43 UTC 2012 - tittiatcoke@gmail.com + +- Update to 20.0.1119.0 + Fixes +- Adjust spec-file to include two new resource files that are + required for the UI. (bnc#759381) + +------------------------------------------------------------------- +Wed Apr 25 11:32:07 UTC 2012 - tittiatcoke@gmail.com + +- Update to 20.0.1116.0 + * Fixes and update to newer v8 version + +------------------------------------------------------------------- +Thu Apr 19 09:12:44 UTC 2012 - tittiatcoke@gmail.com + +- Added the ChromeDriver as a separate package. Normal users + will not require this as it is a standalone server for testing + webbrowsers + +------------------------------------------------------------------- +Tue Apr 17 13:53:49 UTC 2012 - tittiatcoke@gmail.com + +- Update to 20.0.1106.0 + * Fixes issues with fonts (Issue: 108645). + * Enable the Chrome To Mobile page action for users with + compatible registered devices + * file: downloads allowed again + +------------------------------------------------------------------- +Fri Apr 13 09:12:42 UTC 2012 - fcrozat@suse.com + +- Use desktop_database macros at install time. + +------------------------------------------------------------------- +Fri Apr 6 14:32:07 UTC 2012 - tittiatcoke@gmail.com + +- Update to 20.0.1094.0 + Fixes: + * Other Devices menu shows last update time for other sessions, + and allows sessions to be hidden using a context menu. + * Fix sync issue with sessions (open tabs) triggering an + unrecoverable error. + * Fixed Sync/Apps: NTP apps icons missing after sync. + [Issue: 117857] + * Fixed bookmarks drag-n-drop in Bookmark Manager. + [Issue: 118715] + Security Fixes: + * Medium CVE-2011-3066: Out-of-bounds read in Skia clipping. + * Medium CVE-2011-3067: Cross-origin iframe replacement. + * High CVE-2011-3068: Use-after-free in run-in handling. + * High CVE-2011-3069: Use-after-free in line box handling. + * High CVE-2011-3070: Use-after-free in v8 bindings. + * High CVE-2011-3071: Use-after-free in HTMLMediaElement. + * Low CVE-2011-3072: Cross-origin violation parenting pop-up + window. + * High CVE-2011-3073: Use-after-free in SVG resource handling. + * Medium CVE-2011-3074: Use-after-free in media handling. + * High CVE-2011-3075: Use-after-free applying style command. + * High CVE-2011-3076: Use-after-free in focus handling. + * Medium CVE-2011-3077: Read-after-free in script bindings. + +------------------------------------------------------------------- +Tue Apr 3 06:51:49 UTC 2012 - tittiatcoke@gmail.com + +- Update to 20.0.1090 + Fixes: + * Fixed issue cannot add GMail app to Chrome. [Issue: 119975] + * Fixed theme and bookmarks bar notifications. [Issue: 117027] + * Fixed popup prompting permission for flash plugin. + [Issue: 120358] + Security Fixes: + * Medium CVE-2011-3058: Bad interaction possibly leading to + XSS in EUC-JP. + * Medium CVE-2011-3059: Out-of-bounds read in SVG text handling. + * Medium CVE-2011-3060: Out-of-bounds read in text fragment + handling. + * Medium CVE-2011-3061: SPDY proxy certificate checking error. + * High CVE-2011-3062: Off-by-one in OpenType Sanitizer. + * Low CVE-2011-3063: Validate navigation requests from the + renderer more carefully. + * High CVE-2011-3064: Use-after-free in SVG clipping. + * High CVE-2011-3065: Memory corruption in Skia. + * Medium CVE-2011-3057: Invalid read in v8. + +------------------------------------------------------------------- +Sat Mar 24 06:40:10 UTC 2012 - tittiatcoke@gmail.com + +- Update to 19.0.1079 + Security Fixes (bnc#754456): + * High CVE-2011-3050: Use-after-free with first-letter handling + * High CVE-2011-3045: libpng integer issue from upstream + * High CVE-2011-3051: Use-after-free in CSS cross-fade handling + * High CVE-2011-3052: Memory corruption in WebGL canvas handling + * High CVE-2011-3053: Use-after-free in block splitting + * Low CVE-2011-3054: Apply additional isolations to webui + privileges + * Low CVE-2011-3055: Prompt in the browser native UI for unpacked + extension installation + * High CVE-2011-3056: Cross-origin violation with “magic iframe”. + * Low CVE-2011-3049: Extension web request API can interfere with + system requests + Other Fixes: + * The short-cut key for caps lock (Shift + Search) is disabled + when an accessibility screen reader is enabled + * Fixes an issue with files not being displayed in File Manager + when some file names contain UTF-8 characters (generally + accented characters) + * Fixed dialog boxes in settings. (Issue: 118031) + * Fixed flash videos turning white on mac when running with + --disable-composited-core-animation-plugins (Issue: 117916) + * Change to look for correctly sized favicon when multiple images + are provided. (Issue: 118275) + * Fixed issues - 116044, 117470, 117068, 117668, 118620 + +------------------------------------------------------------------- +Wed Mar 21 12:36:42 UTC 2012 - tittiatcoke@gmail.com + +- Update to 19.0.1077 + +------------------------------------------------------------------- +Sun Mar 18 17:35:02 UTC 2012 - tittiatcoke@gmail.com + +- Update to 19.0.1074 +- Build Chromium on openSUSE > 12.1 with the gold linker +- Fix build issues with GCC 4.7 + +------------------------------------------------------------------- +Thu Mar 15 12:51:21 UTC 2012 - tittiatcoke@gmail.com + +- Update to 19.0.1071 + * Several fixes and improvements in the new Settings, Extensions, + and Help pages. + * Fixed the flashing when switched between composited and + non-composited mode. [Issue: 116603] + * Fixed stability issues 116913, 117217, 117347, 117081 + +------------------------------------------------------------------- +Sun Mar 11 08:01:15 UTC 2012 - tittiatcoke@gmail.com + +- Update to 19.0.1066 + * Fixed Chrome install/update resets Google search preferences + (Issue: 105390) + * Don't trigger accelerated compositing on 3D CSS when using + swiftshader (Issue: 116401) + * Fixed a GPU crash (Issue: 116096) + * More fixes for Back button frequently hangs (Issue: 93427) + * Bastion now works (Issue: 116285) + * Fixed Composited layer sorting irregularity with accelerated + canvas (Issue: 102943) + * Fixed Composited layer sorting irregularity with accelerated + canvas (Issue: 102943) + * Fixed Google Feedback causes render process to use too much + memory (Issue: 114489) + * Fixed after upgrade, some pages are rendered as blank + (Issue: 109888) + * Fixed Pasting text into a single-line text field shouldn't + keep literal newlines (Issue: 106551) +- Security Fixes: + * Critical CVE-2011-3047: Errant plug-in load and GPU process + memory corruption + * Critical CVE-2011-3046: UXSS and bad history navigation. + +------------------------------------------------------------------- +Mon Mar 5 20:53:06 UTC 2012 - vdziewiecki@suse.com + +- add Provides: browser(npapi) FATE#313084 + +------------------------------------------------------------------- +Sat Mar 3 16:55:15 UTC 2012 - tittiatcoke@gmail.com + +- Update to 19.0.1060 + * Fixed NTP signed in state is missing (Issue: 112676) + * Fixed gmail seems to redraw itself (all white) occasionally + (Issue: 111263) + * Focus "OK" button on Javascript dialogs (Issue: 111015) + * Fixed Back button frequently hangs (Issue: 93427) + * Increase the buffer size to fix muted playback rate + (Issue: 108239) + * Fixed Empty span with line-height renders with non-zero height + (Issue: 109811) + * Marked the Certum Trusted Network CA as an issuer of + extended-validation (EV) certificates. + * Fixed importing of bookmarks, history, etc. from Firefox 10+. + * Fixed issues - 114001, 110785, 114168, 114598, 111663, 113636, + 112676 + * Fixed several crashes (Issues: 111376, 108688, 114391) + * Fixed Firefox browser in Import Bookmarks and Settings + drop-down (Issue: 114476) + * Sync: Sessions aren't associating pre-existing tabs + (Issue: 113319) + * Fixed All "Extensions" make an entry under the "NTP Apps" + page (Issue: 113672) ++ Security Fixes (bnc#750407): + * High CVE-2011-3031: Use-after-free in v8 element wrapper. + * High CVE-2011-3032: Use-after-free in SVG value handling. + * High CVE-2011-3033: Buffer overflow in the Skia drawing library. + * High CVE-2011-3034: Use-after-free in SVG document handling. + * High CVE-2011-3035: Use-after-free in SVG use handling. + * High CVE-2011-3036: Bad cast in line box handling. + * High CVE-2011-3037: Bad casts in anonymous block splitting. + * High CVE-2011-3038: Use-after-free in multi-column handling. + * High CVE-2011-3039: Use-after-free in quote handling. + * High CVE-2011-3040: Out-of-bounds read in text handling. + * High CVE-2011-3041: Use-after-free in class attribute handling. + * High CVE-2011-3042: Use-after-free in table section handling. + * High CVE-2011-3043: Use-after-free in flexbox with floats. + * High CVE-2011-3044: Use-after-free with SVG animation elements. +- Remove the external ffmepg headers and start using the ones + delivered with Chromium. Changes to Chromium are no longer in line + with any ffmpeg version :-(. So we can only use the Chromium + ffmpeg headers. + +------------------------------------------------------------------- +Mon Feb 20 14:39:23 UTC 2012 - tittiatcoke@gmail.com + +- Update to 19.0.1046 + * Security updates + + CVE-2011-3015: Integer overflows in PDF codecs. + + CVE-2011-3016: Read-after-free with counter nodes. + + CVE-2011-3017: Possible use-after-free in database handling. + + CVE-2011-3018: Heap overflow in path rendering. + + CVE-2011-3019: Heap buffer overflow in MKV handling. + + CVE-2011-3020: Native client validator error. + + CVE-2011-3021: Use-after-free in subframe loading. + + CVE-2011-3022: Inappropriate use of http for translation script. + + CVE-2011-3023: Use-after-free with drag and drop. + + CVE-2011-3024: Browser crash with empty x509 certificate. + + CVE-2011-3025: Out-of-bounds read in h.264 parsing. + + CVE-2011-3026: Integer overflow / truncation in libpng. + + CVE-2011-3027: Bad cast in column handling. + +------------------------------------------------------------------- +Wed Feb 15 07:40:59 UTC 2012 - tittiatcoke@gmail.com + +- Update to 19.0.1042 + * Make speech input bubble borders close with the bubble + [Issue: 112194] + * Fixed stability issues + [Issues: 113531, 113492, 113654, 113546, 113847, 114011] + * Use Google’s online spellchecker to identify misspelled words + as well as provide suggestions, for pasted text only. + * Fix: open incognito windows at exit created extra normal + windows when the session was restored + * When translating a page, get the code and translation via HTTPS + +------------------------------------------------------------------- +Fri Feb 10 05:36:56 UTC 2012 - tittiatcoke@gmail.com + +- Update to 19.0.1037 + * Fix crashing timing bug where panel animates after its closed + (issue#111120) + * Remove patch to build with newer glib version. This was merged + upstream + * Added option to disable building with gold for x86_64. Used + linker option "--icf=none" is not supported yet. + +------------------------------------------------------------------- +Mon Feb 6 10:45:25 UTC 2012 - tittiatcoke@gmail.com + +- Update to 19.0.1031 + * Block plugins for platform apps + To block plugins a new content settings has been added, with + the highest priority (i.e. at the front of the list). This + could be used down the track to hang off more platform app + specific stuff. + * Remove unconditional -msse3 -mssse3 CFLAGS from media.gyp + (issue#107532) + * Refactoring of Settings page + * Other bugfixes + * Security Fixes: + CVE-2011-3953: Avoid clipboard monitoring after paste event. + CVE-2011-3954: Crash with excessive database usage. + CVE-2011-3955: Crash aborting an IndexDB transaction + CVE-2011-3956: Incorrect handling of sandboxed origins inside + extensions + CVE-2011-3957: Use-after-free in PDF garbage collection + CVE-2011-3958: Bad casts with column spans + CVE-2011-3959: Buffer overflow in locale handling + CVE-2011-3960: Out-of-bounds read in audio decoding + CVE-2011-3961: Race condition after crash of utility process + CVE-2011-3962: Out-of-bounds read in path clipping + CVE-2011-3963: Out-of-bounds read in PDF fax image handling + CVE-2011-3964: URL bar confusion after drag + drop + CVE-2011-3965: Crash in signature check + CVE-2011-3966: Use-after-free in stylesheet error handling + CVE-2011-3967: Crash with unusual certificate. + CVE-2011-3968: Use-after-free in CSS handling + CVE-2011-3969: Use-after-free in SVG layout. + CVE-2011-3970: Out-of-bounds read in libxslt + CVE-2011-3971: Use-after-free with mousemove events + CVE-2011-3972: Out-of-bounds read in shader translator + +------------------------------------------------------------------- +Sun Jan 29 21:11:37 UTC 2012 - tittiatcoke@gmail.com + +- Update to 18.0.1022 + * Security fixes (bnc#743319) + + CVE-2011-3924 Use-after-free vulnerability + + CVE-2011-3925 Use-after-free vulnerability + + CVE-2011-3926 Heap-based buffer overflow in the tree builder + + CVE-2011-3927 Skia does not perform all required + initialization of values + + CVE-2011-3928 Use-after-free vulnerability + * Compile the chrome_sandbox binary with -fPIE flags + +------------------------------------------------------------------- +Mon Jan 23 09:44:42 UTC 2012 - tittiatcoke@gmail.com + +- Update to 18.0.1017 + * Security Issues fixed (bnc#740493) + + CVE-2011-3921 Use-after-free in animation frames + + CVE-2011-3919 Heap-buffer-overflow in libxml + + CVE-2011-3922 Stack-buffer-overflow in glyph handling + +------------------------------------------------------------------- +Sat Dec 31 22:29:20 UTC 2011 - tittiatcoke@gmail.com + +- Update to 18.0.992 + * Delay some extension startup until after first run import. + (issue 108286) + * Add function support for Sleep with TimeDelta input. + (issue 108171) + * Make webstore installs work when the Downloads folder is missing. + (issue 108812) + * Disable GL_EXT_texture_storage support in Linux. (issue 107782) + +------------------------------------------------------------------- +Wed Dec 28 12:00:11 UTC 2011 - tittiatcoke@gmail.com + +- Update to 18.0.985 + + Webkit layout: + * Suppress a leak in http/tests/appcache/reload.html + (issue 108621) + * Suppress a leak in xmlhttprequest/workers/referer.html + (issue 108622) + * Extend the suppression for uninit value in + fast/forms/input-text-paste-maxlength.html (issue 106183) + * Suppress memory leaks in + fast/files/workers/worker-read-blob-async.html + (issue 108624) + * Suppress a leak in + websocket/tests/hybi/workers/receive-arraybuffer.html + (issue 108627) + * Suppress a leak in + http/tests/xmlhttprequest/workers/methods-async.html + (issue 108628) + + Set opaque on the WebMediaPlayerClient based on the decoder + +------------------------------------------------------------------- +Mon Dec 19 06:41:16 UTC 2011 - tittiatcoke@gmail.com + +- Update to 18.0.975 + + Updating extensions code to use UTF16. (issue#71980) + + Assign F5 to cycle forward (issue#107417) + + [Sync] Add NOTREACHED for empty passphrase (issue#104189) + + Add libudev as build-dependency (issue#79050) + + Enable mnemonic and bookmark folder key activation on menu + (issue#107869) +- Removed conflict with xine-browser-plugins. + +------------------------------------------------------------------- +Wed Dec 14 10:25:20 UTC 2011 - tittiatcoke@gmail.com + +- Update to 18.0.972 + * Security issues fixed: (bnc#736716) + + CVE-2011-3903: Out-of-bounds read in regex matching. + + CVE-2011-3905: Out-of-bounds reads in libxml. + + CVE-2011-3906: Out-of-bounds read in PDF parser. + + CVE-2011-3907: URL bar spoofing with view-source. + + CVE-2011-3908: Out-of-bounds read in SVG parsing. + + CVE-2011-3909: [64-bit only] Memory corruption in CSS + property array. + + CVE-2011-3910: Out-of-bounds read in YUV video frame + handling. + + CVE-2011-3911: Out-of-bounds read in PDF. + + CVE-2011-3912: Use-after-free in SVG filters. + + CVE-2011-3914: Out-of-bounds write in v8 i18n handling + + CVE-2011-3915: Buffer overflow in PDF font handling. + + CVE-2011-3916: Out-of-bounds reads in PDF cross references. + + CVE-2011-3917: Stack-buffer-overflow in FileWatcher. + + CVE-2011-3904: Use-after-free in bidi handling. + * No longer build against the system libjpeg, but build against + the libjpeg that comes with Chromium to prevent graphics + issues + * Chromium for openSUSE:Factory now builds against libjpeg8 + * Removed explicit -fPIC from the C-flags + +------------------------------------------------------------------- +Sat Dec 10 18:51:39 UTC 2011 - tittiatcoke@gmail.com + +- Update to 18.0.968 + + Print preview: Disable the right context menu items in print + preview. (issue#106876,#106915) + + Fix page zoom for plug-in documents (PDF, etc.) + (issue#106013,#106228) + + ntp: track number of times a user switches pages in a single + session (issue#106575) + +