7
0

Accepting request 1169276 from home:dziobian:gulgul-ultron:19

- Update to electron 29.3.1
  * ABI break: NODE_MODULE_VERSION is now 121
  * Chromium 122.0.6261.156
  * Node 20.9.0
  * V8 12.2
  * The deprecated gpu-process-crashed event on app has been removed.
  * The deprecated renderer-process-crashed event on app and crashed
    event on WebContents and <webview> have been removed.
  * Added WebContentsView and BaseWindow, replacing the now-deprecated BrowserView APIs.
  * Added new webUtils.getPathForFile method to replace File.path augmentation. 
  * see https://www.electronjs.org/blog/electron-29-0 and https://github.com/electron/electron/releases/tag/v29.0.0 for more
  * Security fixes for Angle (CVE-2024-3516) and Compositing (CVE-2024-3157)
- Drop upstreamed patches
  * atspi.patch
  * chromium-117-blink-BUILD-mnemonic.patch
  * local_frame-local_frame_client-incomplete-WebBackgroundResourceFetchAssets.patch
  * node-upgrade-llhttp-to-8.patch
  * policy_templates-deterministic.patch
  * v8-hide-private-symbols.patch
  * web_local_frame_client-incomplete-WebBackgroundResourceFetchAssets.patch
- Add patches to fix build errors
  * aarch64-Xclang.patch
  * absl2023-encapsulated_web_transport-StrCat.patch
  * boringssl-internal-addc-cxx.patch
  * chromium-122-avoid-SFINAE-TypeConverter.patch
  * chromium-122-BookmarkNode-missing-operator.patch
  * distributed_point_functions-aes_128_fixed_key_hash-missing-StrCat.patch
  * distributed_point_functions-evaluate_prg_hwy-signature.patch
  * fake_ssl_socket_client-Wlto-type-mismatch.patch
  * grid_sizing_tree-Wchanges-meaning.patch
  * hit_test_request-missing-optional.patch
  * InternalAllocator-too-many-initializers.patch
  * mt21_util-flax-vector-conversions.patch
  * plus_address_types-missing-optional.patch
  * race_network_request_write_buffer_manager-missing-optional.patch
  * resolution_monitor-missing-bitset.patch
  * script_promise_resolver-explicit-specialization.patch
  * search_engine_choice_service-missing-optional.patch
  * system-yuv.patch
- Replace abseil-remove-unused-targets.patch with chromium-122-abseil-shims.patch
- Remove dead code from third_party/
  * remove-dawn.patch
  * remove-openscreen.patch
  * remove-password-manager-and-policy.patch
  * remove-puffin.patch
  * remove-rust.patch
  * remove AFL-2.0, BSD-Protection and IJG from licence list,
    because the relevant libraries (xdg-mime, bsdiff and iccjpeg)
    are no longer shipped.
- Leap, Fedora: use bundled re2
  * drop replace-StringPiece-with-string_view.patch
- Fedora 38: use bundled abseil
  * drop pending_task_safety_flag-abseil-2022-nullability.patch
  * drop thread_annotations-fix-build-with-system-abseil.patch
- Leap 15.5: Reverse upstream changes to build with old wayland
  * wayland-proto-31-cursor-shape.patch
- Leap 15.5/6: Reverse upstream changes to build with old ffmpeg
  * Cr122-ffmpeg-new-channel-layout.patch
- aarch64: reduce debuginfo due to linker OOM

OBS-URL: https://build.opensuse.org/request/show/1169276
OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-electron?expand=0&rev=141
This commit is contained in:
2024-04-19 21:15:15 +00:00
committed by Git OBS Bridge
parent 91bf85bb5c
commit 026fa6c008
55 changed files with 3090 additions and 1804 deletions

View File

@@ -0,0 +1,350 @@
From 84d1d7adcd1697348e3f821811179c525d3b5717 Mon Sep 17 00:00:00 2001
From: Dale Curtis <dalecurtis@chromium.org>
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 <jrummell@chromium.org>
Auto-Submit: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
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<int32_t*>(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<AVMasteringDisplayMetadata*>(side_data.data);
- gfx::HdrMetadataSmpteSt2086 smpte_st_2086;
- if (mdcv->has_primaries) {
- smpte_st_2086.primaries = {
- static_cast<float>(av_q2d(mdcv->display_primaries[0][0])),
- static_cast<float>(av_q2d(mdcv->display_primaries[0][1])),
- static_cast<float>(av_q2d(mdcv->display_primaries[1][0])),
- static_cast<float>(av_q2d(mdcv->display_primaries[1][1])),
- static_cast<float>(av_q2d(mdcv->display_primaries[2][0])),
- static_cast<float>(av_q2d(mdcv->display_primaries[2][1])),
- static_cast<float>(av_q2d(mdcv->white_point[0])),
- static_cast<float>(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<int32_t*>(side_data.data));
+ break;
+ }
+ case AV_PKT_DATA_MASTERING_DISPLAY_METADATA: {
+ AVMasteringDisplayMetadata* mdcv =
+ reinterpret_cast<AVMasteringDisplayMetadata*>(side_data.data);
+ gfx::HdrMetadataSmpteSt2086 smpte_st_2086;
+ if (mdcv->has_primaries) {
+ smpte_st_2086.primaries = {
+ static_cast<float>(av_q2d(mdcv->display_primaries[0][0])),
+ static_cast<float>(av_q2d(mdcv->display_primaries[0][1])),
+ static_cast<float>(av_q2d(mdcv->display_primaries[1][0])),
+ static_cast<float>(av_q2d(mdcv->display_primaries[1][1])),
+ static_cast<float>(av_q2d(mdcv->display_primaries[2][0])),
+ static_cast<float>(av_q2d(mdcv->display_primaries[2][1])),
+ static_cast<float>(av_q2d(mdcv->white_point[0])),
+ static_cast<float>(av_q2d(mdcv->white_point[1])),
+ };
}
- case AV_PKT_DATA_CONTENT_LIGHT_LEVEL: {
- AVContentLightMetadata* clli =
- reinterpret_cast<AVContentLightMetadata*>(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<AVContentLightMetadata*>(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<AVDOVIDecoderConfigurationRecord*>(
- 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<AVDOVIDecoderConfigurationRecord*>(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<int32_t*>(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<int32_t*>(sd.data))
+ .rotation;
+ info.tags["rotate"] = base::NumberToString(rotation_);
+ break;
+ }
}
// Extract dictionary from streams also. Needed for containers that attach

View File

@@ -0,0 +1,55 @@
From ee6e6d3e45af1f7210e144a17f14fb21a7e86588 Mon Sep 17 00:00:00 2001
From: mikt <mikt@google.com>
Date: Tue, 30 Jan 2024 03:09:24 +0000
Subject: [PATCH] [PA] Fix InternalAllocator for GCC builds
Internal Allocator has a few missing member functions, that are required
as a part of named requirement Allocator.
https://en.cppreference.com/w/cpp/named_req/Allocator
It broke builds on GCC, so adding these to fix.
https://crrev.com/c/5196856/comments/0c4bbfd9_6433016b
Change-Id: Ifce5f3e47c94c7bb1e298ac4cd7d0d1e4c6de59c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5231905
Commit-Queue: Mikihito Matsuura <mikt@google.com>
Reviewed-by: Kalvin Lee <kdlee@chromium.org>
Reviewed-by: Takashi Sakamoto <tasak@google.com>
Cr-Commit-Position: refs/heads/main@{#1253709}
---
.../internal_allocator_forward.h | 21 +++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/base/allocator/partition_allocator/src/partition_alloc/internal_allocator_forward.h b/base/allocator/partition_allocator/src/partition_alloc/internal_allocator_forward.h
index 45fec29f8cc93..b31a145ff6e99 100644
--- a/base/allocator/partition_allocator/src/partition_alloc/internal_allocator_forward.h
+++ b/base/allocator/partition_allocator/src/partition_alloc/internal_allocator_forward.h
@@ -27,11 +27,24 @@ PartitionRoot& InternalAllocatorRoot();
template <typename T>
class InternalAllocator {
public:
- // Member types required by allocator completeness requirements.
using value_type = T;
- using size_type = std::size_t;
- using difference_type = std::ptrdiff_t;
- using propagate_on_container_move_assignment = std::true_type;
+ using is_always_equal = std::true_type;
+
+ InternalAllocator() = default;
+
+ template <typename U>
+ InternalAllocator(const InternalAllocator<U>&) {} // NOLINT
+
+ template <typename U>
+ InternalAllocator& operator=(const InternalAllocator<U>&) {
+ return *this;
+ }
+
+ template <typename U>
+ bool operator==(const InternalAllocator<U>&) {
+ // InternalAllocator<T> can free allocations made by InternalAllocator<U>.
+ return true;
+ }
value_type* allocate(std::size_t count);

View File

@@ -1,24 +1,24 @@
--- src/content/browser/renderer_host/render_frame_host_impl.cc.orig 2023-02-08 21:38:09.974003318 +0100
+++ src/content/browser/renderer_host/render_frame_host_impl.cc 2023-02-13 14:13:50.217792624 +0100
@@ -5,6 +5,7 @@
#include <cstdint>
#include <deque>
#include <limits>
#include <memory>
+#include <new>
#include <optional>
#include <tuple>
#include <unordered_map>
#include <utility>
@@ -1876,7 +1877,12 @@
// completes. Among other things, this ensures that any `SafeRef`s from
// `DocumentService` and `RenderFrameHostUserData` subclasses are still valid
// when their destructors run.
document_associated_data_->RemoveAllServices();
- document_associated_data_.reset();
+ // HACK: Using .reset() here works on MSVC and LLVM libc++ because the std::optional
+ // is still valid while the destructor runs. This does not work on GNU libstdc++
+ // however which invalidates the optional before calling the destructor, causing a crash.
+ // Upstream bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1415154
+ document_associated_data_->~DocumentAssociatedData();
+ new(&document_associated_data_) absl::optional<DocumentAssociatedData>(absl::nullopt);
+ new(&document_associated_data_) std::optional<DocumentAssociatedData>(std::nullopt);
// If this was the last active frame in the SiteInstanceGroup, the
// DecrementActiveFrameCount call will trigger the deletion of the

View File

@@ -22,6 +22,7 @@
<overwrite>
<conditions>
<arch>x86_64</arch>
<arch>riscv64</arch>
</conditions>
<hardware>
<memory>

15
aarch64-Xclang.patch Normal file
View File

@@ -0,0 +1,15 @@
--- src/base/allocator/partition_allocator/src/partition_alloc/BUILD.gn.orig
+++ src/base/allocator/partition_allocator/src/partition_alloc/BUILD.gn
@@ -292,12 +292,6 @@ if (is_clang_or_gcc) {
# but they're not backwards compatible. Use base::CPU::has_mte()
# beforehand to confirm or use indirect functions (ifuncs) to select
# an MTE-specific implementation at dynamic link-time.
- cflags = [
- "-Xclang",
- "-target-feature",
- "-Xclang",
- "+mte",
- ]
}
}

View File

@@ -1,120 +0,0 @@
These targets are dead code but they aren't available with system abseil
--- src/third_party/abseil-cpp/BUILD.gn.old
+++ src/third_party/abseil-cpp/BUILD.gn
@@ -61,8 +61,6 @@ group("absl_component_deps") {
"//third_party/abseil-cpp/absl/base",
"//third_party/abseil-cpp/absl/base:config",
"//third_party/abseil-cpp/absl/base:core_headers",
- "//third_party/abseil-cpp/absl/base:nullability",
- "//third_party/abseil-cpp/absl/base:prefetch",
"//third_party/abseil-cpp/absl/cleanup",
"//third_party/abseil-cpp/absl/container:btree",
"//third_party/abseil-cpp/absl/container:fixed_array",
@@ -78,23 +76,16 @@ group("absl_component_deps") {
"//third_party/abseil-cpp/absl/functional:bind_front",
"//third_party/abseil-cpp/absl/functional:function_ref",
- "//third_party/abseil-cpp/absl/functional:overload",
"//third_party/abseil-cpp/absl/hash",
- "//third_party/abseil-cpp/absl/log:absl_check",
- "//third_party/abseil-cpp/absl/log:absl_log",
- "//third_party/abseil-cpp/absl/log:die_if_null",
"//third_party/abseil-cpp/absl/memory",
"//third_party/abseil-cpp/absl/meta:type_traits",
"//third_party/abseil-cpp/absl/numeric:bits",
"//third_party/abseil-cpp/absl/numeric:int128",
"//third_party/abseil-cpp/absl/random",
- "//third_party/abseil-cpp/absl/random:distributions",
"//third_party/abseil-cpp/absl/status",
"//third_party/abseil-cpp/absl/status:statusor",
"//third_party/abseil-cpp/absl/strings",
"//third_party/abseil-cpp/absl/strings:cord",
- "//third_party/abseil-cpp/absl/strings:has_ostream_operator",
"//third_party/abseil-cpp/absl/strings:str_format",
- "//third_party/abseil-cpp/absl/strings:string_view",
"//third_party/abseil-cpp/absl/synchronization",
"//third_party/abseil-cpp/absl/time",
"//third_party/abseil-cpp/absl/types:optional",
@@ -191,7 +184,6 @@ if (build_with_chromium) {
"absl/algorithm:algorithm_test",
"absl/algorithm:container_test",
"absl/base:config_test",
- "absl/base:nullability_test",
"absl/base:prefetch_test",
"absl/cleanup:cleanup_test",
@@ -198,26 +190,12 @@ if (build_with_chromium) {
# TODO(mbonadei): Fix issue with EXPECT_DEATH and uncomment.
# "absl/container:btree_test",
"absl/container:common_policy_traits_test",
- "absl/container:fixed_array_test",
- "absl/container:flat_hash_set_test",
"absl/container:inlined_vector_test",
"absl/container:node_slot_policy_test",
- "absl/container:raw_hash_set_allocator_test",
"absl/container:sample_element_size_test",
- "absl/crc:crc32c_test",
- "absl/crc:crc_cord_state_test",
- "absl/crc:crc_memcpy_test",
- "absl/crc:non_temporal_memcpy_test",
- "absl/debugging:stacktrace_test",
- "absl/flags:flag_test",
"absl/functional:any_invocable_test",
- "absl/functional:function_ref_test",
- "absl/functional:overload_test",
- "absl/hash:hash_instantiated_test",
"absl/hash:hash_test",
"absl/hash:low_level_hash_test",
- "absl/log:absl_check_test",
- "absl/log:absl_log_basic_test",
"absl/log:die_if_null_test",
"absl/log:flags_test",
"absl/log:globals_test",
@@ -226,18 +207,13 @@ if (build_with_chromium) {
"absl/log:log_streamer_test",
"absl/log:scoped_mock_log_test",
"absl/log:stripping_test",
- "absl/log/internal:fnmatch_test",
"absl/log/internal:stderr_log_sink_test",
"absl/memory:memory_test",
"absl/meta:type_traits_test",
- "absl/numeric:int128_test",
"absl/profiling:exponential_biased_test",
"absl/profiling:periodic_sampler_test",
- "absl/status:status_test",
"absl/status:statusor_test",
"absl/strings:ascii_test",
- "absl/strings:char_formatting_test",
- "absl/strings:charset_test",
"absl/strings:cord_buffer_test",
"absl/strings:cord_data_edge_test",
"absl/strings:cord_rep_btree_navigator_test",
@@ -250,18 +226,11 @@ if (build_with_chromium) {
"absl/strings:cordz_test",
"absl/strings:cordz_update_scope_test",
"absl/strings:cordz_update_tracker_test",
- "absl/strings:damerau_levenshtein_distance_test",
- "absl/strings:has_absl_stringify_test",
- "absl/strings:has_ostream_operator_test",
"absl/strings:match_test",
"absl/strings:str_replace_test",
"absl/strings:string_view_test",
- "absl/synchronization:kernel_timeout_internal_test",
- "absl/synchronization:waiter_test",
- "absl/time:time_test",
"absl/types:optional_test",
"absl/types:variant_test",
- "absl/utility:if_constexpr_test",
"//third_party/googletest:gtest_main",
]
}
--- src/third_party/fuzztest/BUILD.gn.orig
+++ src/third_party/fuzztest/BUILD.gn
@@ -259,7 +259,6 @@ source_set("fuzztest_internal") {
# destined for ClusterFuzz.
"//testing/libfuzzer:fuzzing_engine",
"//third_party/abseil-cpp/absl/flags:flag",
- "//third_party/abseil-cpp/absl/random:bit_gen_ref",
]
public_deps = [

View File

@@ -0,0 +1,11 @@
--- src/net/third_party/quiche/src/quiche/web_transport/encapsulated/encapsulated_web_transport.cc.old 2024-04-12 13:02:31.332129400 +0200
+++ src/net/third_party/quiche/src/quiche/web_transport/encapsulated/encapsulated_web_transport.cc 2024-04-12 23:25:18.357846900 +0200
@@ -524,7 +524,7 @@ void EncapsulatedSession::OnFatalError(a
void EncapsulatedSession::OnWriteError(absl::Status error) {
OnFatalError(absl::StrCat(
- error, " while trying to write encapsulated WebTransport data"));
+ error.ToString(absl::StatusToStringMode::kWithEverything), " while trying to write encapsulated WebTransport data"));
}
EncapsulatedSession::InnerStream::InnerStream(EncapsulatedSession* session,

View File

@@ -4,9 +4,9 @@ ANGLE supports this setting but it is not properly exposed in the GN build
--- a/third_party/angle/BUILD.gn
+++ b/third_party/angle/BUILD.gn
@@ -138,6 +138,7 @@
}
]
defines = [ angle_vma_version_define ]
defines = []
+ defines+= ["ANGLE_LINK_GLX"]
if (is_win) {

View File

@@ -0,0 +1,58 @@
Remove this code which is disabled (media/base/media_switches.cc) and depends on a private header
--- src/media/base/libaom_thread_wrapper.cc.old 2024-04-02 09:53:17.097624400 +0000
+++ src/media/base/libaom_thread_wrapper.cc 2024-04-08 17:15:53.578155000 +0000
@@ -5,16 +5,8 @@
#include "base/logging.h"
#include "media/base/codec_worker_impl.h"
#include "media/base/libvpx_thread_wrapper.h"
-#include "third_party/libaom/source/libaom/aom_util/aom_thread.h"
namespace media {
-void InitLibAomThreadWrapper() {
- const AVxWorkerInterface interface =
- CodecWorkerImpl<AVxWorkerInterface, AVxWorkerImpl, AVxWorker,
- AVxWorkerStatus, NOT_OK, OK,
- WORK>::GetCodecWorkerInterface();
- CHECK(aom_set_worker_interface(&interface));
-}
} // namespace media
--- src/media/base/libvpx_thread_wrapper.cc.old 2024-04-02 09:53:17.097624400 +0000
+++ src/media/base/libvpx_thread_wrapper.cc 2024-04-08 17:15:46.565471400 +0000
@@ -5,17 +5,8 @@
#include "media/base/libvpx_thread_wrapper.h"
#include "media/base/codec_worker_impl.h"
-#include "third_party/libvpx/source/libvpx/vpx_util/vpx_thread.h"
namespace media {
-void InitLibVpxThreadWrapper() {
- const VPxWorkerInterface interface =
- CodecWorkerImpl<VPxWorkerInterface, VPxWorkerImpl, VPxWorker,
- VPxWorkerStatus, NOT_OK, OK,
- WORK>::GetCodecWorkerInterface();
-
- CHECK(vpx_set_worker_interface(&interface));
-}
} // namespace media
--- src/media/base/media.cc.old 2024-04-02 09:53:17.097624400 +0000
+++ src/media/base/media.cc 2024-04-08 17:16:15.369345800 +0000
@@ -53,14 +53,8 @@ class MediaInitializer {
#endif // BUILDFLAG(ENABLE_FFMPEG)
#if BUILDFLAG(ENABLE_LIBVPX)
- if (base::FeatureList::IsEnabled(kLibvpxUseChromeThreads)) {
- InitLibVpxThreadWrapper();
- }
#endif // BUILDFLAG(ENABLE_LIBVPX)
#if BUILDFLAG(ENABLE_LIBAOM)
- if (base::FeatureList::IsEnabled(kLibaomUseChromeThreads)) {
- InitLibAomThreadWrapper();
- }
#endif // BUILDFLAG(ENABLE_LIBAOM)
}

View File

@@ -1,15 +0,0 @@
author: Andres Salomon <dilinger@debian.org>
https://chromium-review.googlesource.com/c/chromium/src/+/4883576 broke
builds with atspi >= 2.50. This fixes it.
--- a/build/config/linux/atspi2/BUILD.gn
+++ b/build/config/linux/atspi2/BUILD.gn
@@ -20,6 +20,7 @@ if (use_atk) {
major = atspi_version[0]
minor = atspi_version[1]
micro = atspi_version[2]
+ not_needed(["major", "micro"])
# ATSPI 2.49.90 now defines these for us and it's an error for us to
# redefine them on the compiler command line.

View File

@@ -0,0 +1,60 @@
--- webrtc-6261b/third_party/boringssl/src/crypto/internal.h.orig 2024-03-13 22:27:36.595241500 +0000
+++ webrtc-6261b/third_party/boringssl/src/crypto/internal.h 2024-03-14 19:45:48.047485200 +0000
@@ -1146,11 +1146,28 @@ static inline uint64_t CRYPTO_rotr_u64(u
// bit. |carry| must be zero or one.
#if OPENSSL_HAS_BUILTIN(__builtin_addc)
+#ifdef __cplusplus
+extern "C++" {
+static constexpr unsigned CRYPTO_GENERIC_ADDC(unsigned x, unsigned y,
+ unsigned carry, unsigned *out_carry){
+ return __builtin_addc(x, y, carry, out_carry);
+}
+static constexpr unsigned long CRYPTO_GENERIC_ADDC(unsigned long x, unsigned long y,
+ unsigned long carry, unsigned long *out_carry){
+ return __builtin_addcl(x, y, carry, out_carry);
+}
+static constexpr unsigned long long CRYPTO_GENERIC_ADDC(unsigned long long x, unsigned long long y,
+ unsigned long long carry, unsigned long long *out_carry){
+ return __builtin_addcll(x, y, carry, out_carry);
+}
+}
+#else
#define CRYPTO_GENERIC_ADDC(x, y, carry, out_carry) \
(_Generic((x), \
unsigned: __builtin_addc, \
unsigned long: __builtin_addcl, \
unsigned long long: __builtin_addcll))((x), (y), (carry), (out_carry))
+#endif
static inline uint32_t CRYPTO_addc_u32(uint32_t x, uint32_t y, uint32_t carry,
uint32_t *out_carry) {
@@ -1198,11 +1215,28 @@ static inline uint64_t CRYPTO_addc_u64(u
// bit. |borrow| must be zero or one.
#if OPENSSL_HAS_BUILTIN(__builtin_subc)
+#ifdef __cplusplus
+extern "C++" {
+static constexpr unsigned CRYPTO_GENERIC_SUBC(unsigned x, unsigned y,
+ unsigned borrow, unsigned *out_borrow){
+ return __builtin_subc(x, y, borrow, out_borrow);
+}
+static constexpr unsigned long CRYPTO_GENERIC_SUBC(unsigned long x, unsigned long y,
+ unsigned long borrow, unsigned long *out_borrow){
+ return __builtin_subcl(x, y, borrow, out_borrow);
+}
+static constexpr unsigned long long CRYPTO_GENERIC_SUBC(unsigned long long x, unsigned long long y,
+ unsigned long long borrow, unsigned long long *out_borrow){
+ return __builtin_subcll(x, y, borrow, out_borrow);
+}
+}
+#else
#define CRYPTO_GENERIC_SUBC(x, y, borrow, out_borrow) \
(_Generic((x), \
unsigned: __builtin_subc, \
unsigned long: __builtin_subcl, \
unsigned long long: __builtin_subcll))((x), (y), (borrow), (out_borrow))
+#endif
static inline uint32_t CRYPTO_subc_u32(uint32_t x, uint32_t y, uint32_t borrow,
uint32_t *out_borrow) {

View File

@@ -64,6 +64,7 @@ This feature does not build with brotli < 1.1
"CompressionDictionaryTransportBackend",
- base::FEATURE_ENABLED_BY_DEFAULT);
+ base::FEATURE_DISABLED_BY_DEFAULT);
const base::FeatureParam<CompressionDictionaryTransportBackendVersion>::Option
kCompressionDictionaryTransportBackendVersionOptions[] = {
{CompressionDictionaryTransportBackendVersion::kV1, "v1"},
// When both this feature and the kCompressionDictionaryTransportBackend feature
// are enabled, the following will happen:

View File

@@ -1,22 +0,0 @@
[ 332s] ERROR at //third_party/blink/renderer/core/BUILD.gn:1697:14: Assignment had no effect.
[ 332s] mnemonic = "ELOC_PROTO"
[ 332s] ^-----------
[ 332s] You set the variable "mnemonic" here and it was unused before it went
[ 332s] out of scope.
[ 332s] See //BUILD.gn:1166:7: which caused the file to be included.
[ 332s] "//third_party/blink/renderer/core:gen_files_for_web_tests",
[ 332s] ^----------------------------------------------------------
Index: chromium-117.0.5938.22/third_party/blink/renderer/core/BUILD.gn
===================================================================
--- chromium-117.0.5938.22.orig/third_party/blink/renderer/core/BUILD.gn
+++ chromium-117.0.5938.22/third_party/blink/renderer/core/BUILD.gn
@@ -1694,8 +1694,6 @@ action_foreach("element_locator_test_pro
python_path_root = "${root_out_dir}/pyproto"
python_path_proto = "${python_path_root}/third_party/blink/renderer/core/lcp_critical_path_predictor"
- mnemonic = "ELOC_PROTO"
-
source_dir = "lcp_critical_path_predictor/test_proto"
sources = rebase_path([ "lcp_image_id.asciipb" ], "", source_dir)

View File

@@ -0,0 +1,32 @@
commit 04866680f4f9a8475ae3795ad6ed59649ba478d7
Author: Jose Dapena Paz <jdapena@igalia.com>
Date: Tue Jan 23 12:04:05 2024 +0000
libstdc++: fix static assertion in NodeUuidEquality
libstdc++ equality checks in static assertion that it is possible to
compare for equality base::Uuid to BookmarkNode*. This was a missing
operator in NodeUuidEquality that this changeset adds.
Bug: 957519
Change-Id: Icc9809cb43d321f0b3e3394ef27ab55672aec5e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5227686
Reviewed-by: Mikel Astiz <mastiz@chromium.org>
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1250753}
diff --git a/components/bookmarks/browser/uuid_index.h b/components/bookmarks/browser/uuid_index.h
index 77cb1a1a54dd9..639d6fefcd831 100644
--- a/components/bookmarks/browser/uuid_index.h
+++ b/components/bookmarks/browser/uuid_index.h
@@ -23,6 +23,10 @@ class NodeUuidEquality {
bool operator()(const BookmarkNode* n1, const base::Uuid& uuid2) const {
return n1->uuid() == uuid2;
}
+
+ bool operator()(const base::Uuid& uuid1, const BookmarkNode* n2) const {
+ return uuid1 == n2->uuid();
+ }
};
// Used to hash BookmarkNode instances by UUID.

View File

@@ -0,0 +1,408 @@
diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_base.gn src/build/linux/unbundle/absl_base.gn
--- src/build/linux/unbundle.old/absl_base.gn 2024-04-02 09:53:10.734295000 +0000
+++ src/build/linux/unbundle/absl_base.gn 2024-04-07 17:46:37.658214100 +0000
@@ -13,6 +13,14 @@ pkg_config("system_absl_core_headers") {
packages = [ "absl_core_headers" ]
}
+pkg_config("system_absl_nullability") {
+ packages = [ "absl_nullability" ]
+}
+
+pkg_config("system_absl_prefetch") {
+ packages = [ "absl_prefetch" ]
+}
+
shim_headers("base_shim") {
root_path = "."
prefix = "absl/base/"
@@ -60,8 +68,41 @@ source_set("core_headers") {
public_configs = [ ":system_absl_core_headers" ]
}
-source_set("config_test") {
+shim_headers("nullability_shim") {
+ root_path = "."
+ prefix = "absl/base/"
+ headers = [
+ "nullability.h",
+ ]
+}
+
+source_set("nullability") {
+ deps = [ ":nullability_shim" ]
+ public_configs = [ ":system_absl_nullability" ]
}
+shim_headers("prefetch_shim") {
+ root_path = "."
+ prefix = "absl/base/"
+ headers = [
+ "prefetch.h",
+ ]
+}
+
+source_set("prefetch") {
+ deps = [ ":prefetch_shim" ]
+ public_configs = [ ":system_absl_prefetch" ]
+}
+
+source_set("no_destructor") {
+ # Dummy — unavailable with abseil 202308 aand chromium 122 does not use it
+}
+
+source_set("config_test") {
+}
+source_set("no_destructor_test") {
+}
+source_set("nullability_test") {
+}
source_set("prefetch_test") {
}
diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_container.gn src/build/linux/unbundle/absl_container.gn
--- src/build/linux/unbundle.old/absl_container.gn 2024-04-02 09:53:10.734295000 +0000
+++ src/build/linux/unbundle/absl_container.gn 2024-04-07 17:12:25.979311400 +0000
@@ -111,9 +111,19 @@ source_set("node_hash_set") {
source_set("common_policy_traits_test") {
}
+source_set("fixed_array_test") {
+}
+source_set("flat_hash_map_test") {
+}
+source_set("flat_hash_set_test") {
+}
source_set("inlined_vector_test") {
}
source_set("node_slot_policy_test") {
}
+source_set("raw_hash_set_allocator_test") {
+}
+source_set("raw_hash_set_test") {
+}
source_set("sample_element_size_test") {
}
diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_crc.gn src/build/linux/unbundle/absl_crc.gn
--- src/build/linux/unbundle.old/absl_crc.gn 1970-01-01 00:00:00.000000000 +0000
+++ src/build/linux/unbundle/absl_crc.gn 2024-04-07 17:29:23.349823700 +0000
@@ -0,0 +1,4 @@
+source_set("crc32c_test") {}
+source_set("crc_cord_state_test") {}
+source_set("crc_memcpy_test") {}
+source_set("non_temporal_memcpy_test") {}
diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_debugging.gn src/build/linux/unbundle/absl_debugging.gn
--- src/build/linux/unbundle.old/absl_debugging.gn 2024-04-02 09:53:10.734295000 +0000
+++ src/build/linux/unbundle/absl_debugging.gn 2024-04-07 17:12:54.682550100 +0000
@@ -45,3 +45,6 @@ source_set("symbolize") {
deps = [ ":symbolize_shim" ]
public_configs = [ ":system_absl_symbolize" ]
}
+
+source_set("stacktrace_test") {
+}
diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_flags.gn src/build/linux/unbundle/absl_flags.gn
--- src/build/linux/unbundle.old/absl_flags.gn 2024-04-02 09:53:10.734295000 +0000
+++ src/build/linux/unbundle/absl_flags.gn 2024-04-07 17:14:21.789944600 +0000
@@ -48,3 +48,5 @@ source_set("usage") {
deps = [ ":usage_shim" ]
public_configs = [ ":system_absl_flags_usage" ]
}
+
+source_set("flag_test") {}
diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_functional.gn src/build/linux/unbundle/absl_functional.gn
--- src/build/linux/unbundle.old/absl_functional.gn 2024-04-02 09:53:10.734295000 +0000
+++ src/build/linux/unbundle/absl_functional.gn 2024-04-07 17:14:18.081948700 +0000
@@ -46,4 +46,10 @@ source_set("function_ref") {
public_configs = [ ":system_absl_function_ref" ]
}
+source_set("overload") {
+ # Dummy — unavailable with abseil 202308 aand chromium 122 does not use it
+}
+
source_set("any_invocable_test") {}
+source_set("function_ref_test") {}
+source_set("overload_test") {}
diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_hash.gn src/build/linux/unbundle/absl_hash.gn
--- src/build/linux/unbundle.old/absl_hash.gn 2024-04-02 09:53:10.734295000 +0000
+++ src/build/linux/unbundle/absl_hash.gn 2024-04-07 17:19:44.496916100 +0000
@@ -16,6 +16,8 @@ source_set("hash") {
public_configs = [ ":system_absl_hash" ]
}
+source_set("hash_instantiated_test") {
+}
source_set("hash_test") {
}
source_set("low_level_hash_test") {
diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_log.gn src/build/linux/unbundle/absl_log.gn
--- src/build/linux/unbundle.old/absl_log.gn 2024-04-02 09:53:10.734295000 +0000
+++ src/build/linux/unbundle/absl_log.gn 2024-04-07 17:45:56.568886800 +0000
@@ -1,3 +1,67 @@
+import("//build/config/linux/pkg_config.gni")
+import("//build/shim_headers.gni")
+
+pkg_config("system_absl_absl_check") {
+ packages = [ "absl_absl_check" ]
+}
+
+pkg_config("system_absl_absl_log") {
+ packages = [ "absl_absl_log" ]
+}
+
+pkg_config("system_absl_die_if_null") {
+ packages = [ "absl_die_if_null" ]
+}
+
+pkg_config("system_absl_log") {
+ packages = [ "absl_log" ]
+}
+shim_headers("absl_check_shim") {
+ root_path = "."
+ prefix = "absl/log/"
+ headers = [ "absl_check.h" ]
+}
+
+source_set("absl_check") {
+ deps = [ ":absl_check_shim" ]
+ public_configs = [ ":system_absl_absl_check" ]
+}
+
+shim_headers("absl_log_shim") {
+ root_path = "."
+ prefix = "absl/log/"
+ headers = [ "absl_log.h" ]
+}
+
+source_set("absl_log") {
+ deps = [ ":absl_log_shim" ]
+ public_configs = [ ":system_absl_absl_log" ]
+}
+
+shim_headers("die_if_null_shim") {
+ root_path = "."
+ prefix = "absl/log/"
+ headers = [ "die_if_null.h" ]
+}
+
+source_set("die_if_null") {
+ deps = [ ":die_if_null_shim" ]
+ public_configs = [ ":system_absl_die_if_null" ]
+}
+
+shim_headers("log_shim") {
+ root_path = "."
+ prefix = "absl/log/"
+ headers = [ "log.h" ]
+}
+
+source_set("log") {
+ deps = [ ":log_shim" ]
+ public_configs = [ ":system_absl_log" ]
+}
+
+source_set("absl_check_test") {}
+source_set("absl_log_basic_test") {}
source_set("basic_log_test") {}
source_set("check_test") {}
source_set("die_if_null_test") {}
@@ -11,3 +75,4 @@ source_set("log_sink_test") {}
source_set("log_streamer_test") {}
source_set("scoped_mock_log_test") {}
source_set("stripping_test") {}
+source_set("vlog_is_on_test") {}
diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_log_internal.gn src/build/linux/unbundle/absl_log_internal.gn
--- src/build/linux/unbundle.old/absl_log_internal.gn 2024-04-02 09:53:10.734295000 +0000
+++ src/build/linux/unbundle/absl_log_internal.gn 2024-04-07 17:19:34.195045600 +0000
@@ -1 +1,2 @@
+source_set("fnmatch_test") {}
source_set("stderr_log_sink_test") {}
diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_numeric.gn src/build/linux/unbundle/absl_numeric.gn
--- src/build/linux/unbundle.old/absl_numeric.gn 2024-04-02 09:53:10.734295000 +0000
+++ src/build/linux/unbundle/absl_numeric.gn 2024-04-07 17:20:05.380981000 +0000
@@ -30,3 +30,5 @@ source_set("int128") {
deps = [ ":int128_shim" ]
public_configs = [ ":system_absl_int128" ]
}
+
+source_set("int128_test") {}
diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_random.gn src/build/linux/unbundle/absl_random.gn
--- src/build/linux/unbundle.old/absl_random.gn 2024-04-02 09:53:10.734295000 +0000
+++ src/build/linux/unbundle/absl_random.gn 2024-04-07 17:36:36.041139000 +0000
@@ -1,6 +1,48 @@
import("//build/config/linux/pkg_config.gni")
import("//build/shim_headers.gni")
+pkg_config("system_absl_random_bit_gen_ref") {
+ packages = [ "absl_random_bit_gen_ref" ]
+}
+
+shim_headers("bit_gen_ref_shim") {
+ root_path = "."
+ prefix = "absl/random/"
+ headers = [ "bit_gen_ref.h" ]
+}
+
+source_set("bit_gen_ref") {
+ deps = [ ":bit_gen_ref_shim" ]
+ public_configs = [ ":system_absl_random_bit_gen_ref" ]
+}
+
+pkg_config("system_absl_random_distributions") {
+ packages = [ "absl_random_distributions" ]
+}
+
+shim_headers("distributions_shim") {
+ root_path = "."
+ prefix = "absl/random/"
+ headers = [
+ "bernoulli_distribution.h",
+ "beta_distribution.h",
+ "discrete_distribution.h",
+ "distributions.h",
+ "exponential_distribution.h",
+ "gaussian_distribution.h",
+ "log_uniform_int_distribution.h",
+ "poisson_distribution.h",
+ "uniform_int_distribution.h",
+ "uniform_real_distribution.h",
+ "zipf_distribution.h",
+ ]
+}
+
+source_set("distributions") {
+ deps = [ ":distributions_shim" ]
+ public_configs = [ ":system_absl_random_distributions" ]
+}
+
pkg_config("system_absl_random_random") {
packages = [ "absl_random_random" ]
}
@@ -15,3 +57,4 @@ source_set("random") {
deps = [ ":random_shim" ]
public_configs = [ ":system_absl_random_random" ]
}
+
diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_status.gn src/build/linux/unbundle/absl_status.gn
--- src/build/linux/unbundle.old/absl_status.gn 2024-04-02 09:53:10.734295000 +0000
+++ src/build/linux/unbundle/absl_status.gn 2024-04-07 17:20:21.398873800 +0000
@@ -34,5 +34,7 @@ source_set("statusor") {
public_configs = [ ":system_absl_statusor" ]
}
+source_set("status_test") {
+}
source_set("statusor_test") {
}
diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_strings.gn src/build/linux/unbundle/absl_strings.gn
--- src/build/linux/unbundle.old/absl_strings.gn 2024-04-02 09:53:10.734295000 +0000
+++ src/build/linux/unbundle/absl_strings.gn 2024-04-07 17:52:10.775957800 +0000
@@ -9,6 +9,10 @@ pkg_config("system_absl_strings") {
packages = [ "absl_strings" ]
}
+pkg_config("system_absl_string_view") {
+ packages = [ "absl_string_view" ]
+}
+
pkg_config("system_absl_str_format") {
packages = [ "absl_str_format" ]
}
@@ -59,8 +63,27 @@ source_set("str_format") {
public_configs = [ ":system_absl_str_format" ]
}
+shim_headers("string_view_shim") {
+ root_path = "."
+ prefix = "absl/strings/"
+ headers = [ "string_view.h" ]
+}
+
+source_set("string_view") {
+ deps = [ ":string_view_shim" ]
+ public_configs = [ ":system_absl_string_view" ]
+}
+
+source_set("has_ostream_operator") {
+ # Dummy — unavailable with abseil 202308 aand chromium 122 does not use it
+}
+
source_set("ascii_test") {
}
+source_set("char_formatting_test") {
+}
+source_set("charset_test") {
+}
source_set("cord_buffer_test") {
}
source_set("cord_data_edge_test") {
@@ -85,8 +108,30 @@ source_set("cordz_update_scope_test") {
}
source_set("cordz_update_tracker_test") {
}
+source_set("damerau_levenshtein_distance_test") {
+}
+source_set("has_absl_stringify_test") {
+}
+source_set("has_ostream_operator_test") {
+}
source_set("match_test") {
}
+source_set("str_format_arg_test") {
+}
+source_set("str_format_bind_test") {
+}
+source_set("str_format_checker_test") {
+}
+source_set("str_format_convert_test") {
+}
+source_set("str_format_extension_test") {
+}
+source_set("str_format_output_test") {
+}
+source_set("str_format_parser_test") {
+}
+source_set("str_format_test") {
+}
source_set("str_replace_test") {
}
source_set("string_view_test") {
diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_synchronization.gn src/build/linux/unbundle/absl_synchronization.gn
--- src/build/linux/unbundle.old/absl_synchronization.gn 2024-04-02 09:53:10.734295000 +0000
+++ src/build/linux/unbundle/absl_synchronization.gn 2024-04-07 17:26:28.412783500 +0000
@@ -20,3 +20,6 @@ source_set("synchronization") {
deps = [ ":synchronization_shim" ]
public_configs = [ ":system_absl_synchronization" ]
}
+
+source_set("kernel_timeout_internal_test") {}
+source_set("waiter_test") {}
diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_time.gn src/build/linux/unbundle/absl_time.gn
--- src/build/linux/unbundle.old/absl_time.gn 2024-04-02 09:53:10.734295000 +0000
+++ src/build/linux/unbundle/absl_time.gn 2024-04-07 17:26:42.305628700 +0000
@@ -19,3 +19,5 @@ source_set("time") {
deps = [ ":time_shim" ]
public_configs = [ ":system_absl_time" ]
}
+
+source_set("time_test") {}
diff '--color=auto' -uprN src/build/linux/unbundle.old/absl_utility.gn src/build/linux/unbundle/absl_utility.gn
--- src/build/linux/unbundle.old/absl_utility.gn 2024-04-02 09:53:10.734295000 +0000
+++ src/build/linux/unbundle/absl_utility.gn 2024-04-07 17:26:54.834405600 +0000
@@ -15,3 +15,5 @@ source_set("utility") {
deps = [ ":utility_shim" ]
public_configs = [ ":system_absl_utility" ]
}
+
+source_set("if_constexpr_test") {}
diff '--color=auto' -uprN src/build/linux/unbundle.old/replace_gn_files.py src/build/linux/unbundle/replace_gn_files.py
--- src/build/linux/unbundle.old/replace_gn_files.py 2024-04-02 09:53:10.734295000 +0000
+++ src/build/linux/unbundle/replace_gn_files.py 2024-04-07 17:29:53.274515100 +0000
@@ -20,6 +20,7 @@ REPLACEMENTS = {
'absl_base': 'third_party/abseil-cpp/absl/base/BUILD.gn',
'absl_cleanup': 'third_party/abseil-cpp/absl/cleanup/BUILD.gn',
'absl_container': 'third_party/abseil-cpp/absl/container/BUILD.gn',
+ 'absl_crc': 'third_party/abseil-cpp/absl/crc/BUILD.gn',
'absl_debugging': 'third_party/abseil-cpp/absl/debugging/BUILD.gn',
'absl_flags': 'third_party/abseil-cpp/absl/flags/BUILD.gn',
'absl_functional': 'third_party/abseil-cpp/absl/functional/BUILD.gn',

View File

@@ -0,0 +1,80 @@
diff --git a/base/types/to_address.h.new b/base/types/to_address.h.new
new file mode 100644
index 0000000..ac71b01
--- /dev/null
+++ b/base/types/to_address.h
@@ -0,0 +1,40 @@
+// Copyright 2024 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_TYPES_TO_ADDRESS_H_
+#define BASE_TYPES_TO_ADDRESS_H_
+
+#include <memory>
+#include <type_traits>
+
+// SFINAE-compatible wrapper for `std::to_address()`.
+//
+// The standard does not require `std::to_address()` to be SFINAE-compatible
+// when code attempts instantiation with non-pointer-like types, and libstdc++'s
+// implementation hard errors. For the sake of templated code that wants simple,
+// unified handling, Chromium instead uses this wrapper, which provides that
+// guarantee. This allows code to use "`to_address()` would be valid here" as a
+// constraint to detect pointer-like types.
+namespace base {
+
+// Note that calling `std::to_address()` with a function pointer renders the
+// program ill-formed.
+template <typename T>
+ requires(!std::is_function_v<T>)
+constexpr T* to_address(T* p) noexcept {
+ return p;
+}
+
+// These constraints cover the cases where `std::to_address()`'s fancy pointer
+// overload is well-specified.
+template <typename P>
+ requires requires(const P& p) { std::pointer_traits<P>::to_address(p); } ||
+ requires(const P& p) { p.operator->(); }
+constexpr auto to_address(const P& p) noexcept {
+ return std::to_address(p);
+}
+
+} // namespace base
+
+#endif // BASE_TYPES_TO_ADDRESS_H_
diff --git a/mojo/public/cpp/bindings/type_converter.h b/mojo/public/cpp/bindings/type_converter.h.new
index 2eddbb0..317245f 100644
--- a/mojo/public/cpp/bindings/type_converter.h
+++ b/mojo/public/cpp/bindings/type_converter.h
@@ -11,6 +11,8 @@
#include <memory>
#include <type_traits>
+#include "base/types/to_address.h"
+
namespace mojo {
// NOTE: When possible, please consider using StructTraits / UnionTraits /
@@ -99,16 +99,16 @@
template <typename T, typename U>
requires requires(const U& obj) {
- not std::is_pointer_v<U>;
- { mojo::ConvertTo<T>(std::to_address(obj)) } -> std::same_as<T>;
+ !std::is_pointer_v<U>;
+ { mojo::ConvertTo<T>(base::to_address(obj)) } -> std::same_as<T>;
}
inline T ConvertTo(const U& obj) {
- return mojo::ConvertTo<T>(std::to_address(obj));
+ return mojo::ConvertTo<T>(base::to_address(obj));
}
template <typename T, typename U>
requires requires(const U& obj) {
- not std::is_pointer_v<U>;
+ !std::is_pointer_v<U>;
TypeConverter<T, U>::Convert(obj);
}
inline T ConvertTo(const U& obj) {

View File

@@ -103,6 +103,14 @@ if [ $? -ne 0 ]; then
cleanup_and_exit 1
fi
echo '>>>>>> Generate DAWN_VERSION'
python3 build/util/lastchange.py \
-s third_party/dawn --revision gpu/webgpu/DAWN_VERSION
if [ $? -ne 0 ]; then
echo 'ERROR: lastchange.py -s third_party/dawn failed'
cleanup_and_exit 1
fi
popd
echo ">>>>>> Apply electron-${ELECTRON_PKGVERSION} patches"
@@ -163,10 +171,8 @@ keeplibs=(
base/third_party/superfasthash #Not a shared library.
base/third_party/symbolize #Derived code, not vendored dependency.
base/third_party/valgrind #Copy of a private header.
base/third_party/xdg_mime #Seems not to be available as a shared library.
base/third_party/xdg_user_dirs #Derived code, not vendored dependency.
chrome/third_party/mozilla_security_manager #Derived code, not vendored dependency.
courgette/third_party #Derived code, not vendored dependency.
net/third_party/mozilla_security_manager #Derived code, not vendored dependency.
net/third_party/nss #Derived code, not vendored dependency.
net/third_party/quiche #Not available as a shared library yet. An old version is in Factory (google-quiche-source)
@@ -218,21 +224,18 @@ keeplibs=(
third_party/emoji-segmenter #not available as a shared library
third_party/fdlibm #derived code, not vendored dep
third_party/hunspell #heavily forked version
third_party/iccjpeg #not in any distro
third_party/inspector_protocol #integral part of chrome
third_party/ipcz #not in any distro
third_party/jstemplate #javascript
third_party/khronos #Modified to add ANGLE definitions
third_party/leveldatabase #use of private headers
third_party/libaddressinput #seems not to be available as a separate library
third_party/libaom #version in Factory is too old
third_party/libaom #15.5 is too old
third_party/libaom/source/libaom/third_party/fastfeat
third_party/libaom/source/libaom/third_party/SVT-AV1
third_party/libaom/source/libaom/third_party/vector
third_party/libaom/source/libaom/third_party/x86inc
third_party/libavif #leap too old
#third_party/libgav1 #Usage of private headers (ObuFrameHeader from utils/types.h) in VAAPI code only
third_party/libphonenumber #Depends on protobuf which cannot be unbundled
third_party/libavif #bleeding-edge nightly. try unbundling again when 1.1 gets released
third_party/libgav1 #Usage of private headers (ObuFrameHeader from utils/types.h)
third_party/libsrtp #Needs to be built against boringssl, not openssl
third_party/libsync #not yet in any distro
third_party/libudev #Headers for a optional delay-loaded dependency
@@ -245,6 +248,7 @@ keeplibs=(
third_party/libxcb-keysyms #Derived code, not vendored dep
third_party/libxml/chromium #added chromium code
third_party/libyuv #The version in Fedora is too old
third_party/lit #javacript
third_party/lottie #javascript
third_party/lss #Wrapper for linux ABI
#third_party/maldoca #integral part of chrome, but not used in electron.
@@ -254,10 +258,7 @@ keeplibs=(
third_party/metrics_proto #integral part of chrome
third_party/modp_b64 #not in Factory or Rawhide. pkgconfig(stringencoders) Mageia, AltLinux, Debian have it
third_party/node #javascript code
third_party/omnibox_proto #integral part of chrome
third_party/one_euro_filter #not in any distro
third_party/openscreen #Integral part of chrome, needed even if you're building without.
third_party/openscreen/src/third_party/tinycbor #not in any distro
third_party/ots #not available as a shared library. Fedora has the cli version as opentype-sanitizer
#we don't build pdf support, removing it from tarball to save space
#third_party/pdfium #Part of chrome, not available separately.
@@ -270,14 +271,10 @@ keeplibs=(
third_party/perfetto/protos/third_party/chromium #derived code, not vendored dep
third_party/pffft #not in any distro, also heavily patched
third_party/polymer #javascript
third_party/private-join-and-compute #not in any distro, also heavily patched
third_party/private_membership #derived code, not vendored dep
third_party/protobuf #Heavily forked. Apparently was officially unbundlable back in the GYP days, and may be again in the future.
third_party/puffin #integral part of chrome
third_party/re2 # fedora too old
third_party/rnnoise #use of private headers
third_party/shell-encryption #not available on any distro, also heavily patched
third_party/skia #integral part of chrome
third_party/smhasher #not in Rawhide or Factory. AltLinux has it (libsmhasher) CONSIDER UNBUNDLING if we have it
third_party/speech-dispatcher #Headers for a delay-loaded optional dependency
third_party/sqlite #heavily forked version
third_party/swiftshader #not available as a shared library
@@ -290,9 +287,9 @@ keeplibs=(
#third_party/tflite #Not used by electron, but chrome needs it.
#third_party/tflite/src/third_party/eigen3
#third_party/tflite/src/third_party/fft2d
third_party/vulkan-deps/spirv-headers #Leap too old
third_party/vulkan-deps/spirv-tools #Leap too old
third_party/vulkan-deps/vulkan-headers #Leap too old. CONSIDER UNBUNDLING when all distros have new enough vulkan sdk
third_party/vulkan-deps/spirv-headers #15.5 too old
third_party/vulkan-deps/spirv-tools #15.5 too old
third_party/vulkan-deps/vulkan-headers #15.5 too old. CONSIDER UNBUNDLING when all distros have new enough vulkan sdk
third_party/vulkan_memory_allocator #not in Factory
third_party/webgpu-cts #Javascript code. Needed even if you're building chrome without webgpu
third_party/webrtc #Integral part of chrome
@@ -313,7 +310,6 @@ keeplibs=(
third_party/x11proto #derived code, not vendored dep
third_party/zlib/contrib/minizip #https://bugzilla.redhat.com/show_bug.cgi?id=2240599 https://github.com/zlib-ng/minizip-ng/issues/447
third_party/zlib/google #derived code, not vendored dep
third_party/zxcvbn-cpp #not in any distro, also heavily patched
url/third_party/mozilla #derived code, not vendored dep
v8/src/third_party/siphash #derived code, not vendored dep
v8/src/third_party/utf8-decoder #derived code, not vendored dep
@@ -333,6 +329,8 @@ find third_party/electron_node/deps/cares -type f ! -name "*.gn" -a ! -name "*.g
find third_party/electron_node/deps/nghttp2 -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete
find third_party/electron_node/deps/openssl -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete
find third_party/electron_node/deps/v8 -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete
rm -rvf third_party/electron_node/deps/v8/tools
ln -srv v8/tools -t third_party/electron_node/deps/v8/
find third_party/electron_node/deps/zlib -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete

View File

@@ -10,7 +10,7 @@ author: Michael Gilbert <mgilbert@debian.org>
- "//third_party/catapult/telemetry:bitmaptools($host_toolchain)",
]
if (!is_android) {
if (!is_castos) {
if (!is_castos && !is_fuchsia) {
@@ -379,7 +378,6 @@ group("gn_all") {
"//testing/android/junit:junit_unit_tests",
"//third_party/android_build_tools/lint:custom_lint_java",
@@ -171,17 +171,18 @@ author: Michael Gilbert <mgilbert@debian.org>
--- a/chrome/chrome_paks.gni
+++ b/chrome/chrome_paks.gni
@@ -168,7 +168,6 @@ template("chrome_extra_paks") {
@@ -190,8 +190,6 @@ template("chrome_extra_paks") {
"$root_gen_dir/chrome/webui_gallery_resources.pak",
"$root_gen_dir/chrome/whats_new_resources.pak",
"$root_gen_dir/content/browser/devtools/devtools_resources.pak",
- "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
- "$root_gen_dir/content/traces_internals_resources.pak",
]
deps += [
"//chrome/browser/resources:component_extension_resources",
@@ -198,7 +297,6 @@ template("chrome_extra_paks") {
"//chrome/browser/resources:component_extension_resources",
@@ -199,7 +197,6 @@ template("chrome_extra_paks") {
"//chrome/browser/resources:dev_ui_paks",
"//chrome/browser/resources/search_engine_choice:resources",
"//content/browser/devtools:devtools_resources",
- "//content/browser/tracing:resources",
]
@@ -189,18 +190,20 @@ author: Michael Gilbert <mgilbert@debian.org>
sources += [
--- a/content/shell/BUILD.gn
+++ b/content/shell/BUILD.gn
@@ -458,11 +458,6 @@ repack("pak") {
@@ -535,13 +535,6 @@ repack("pak") {
sources += [ "$root_gen_dir/content/webxr_internals_resources.pak" ]
}
- if (!is_android) {
- if (!is_android && !is_ios) {
- deps += [ "//content/browser/tracing:resources" ]
- sources += [ "$root_gen_dir/content/browser/tracing/tracing_resources.pak" ]
- sources += [
- "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
- "$root_gen_dir/content/traces_internals_resources.pak",
- ]
- }
-
if (is_ios) {
sources += [
"$root_gen_dir/device/bluetooth/strings/bluetooth_strings_en-US.pak",
--- a/content/browser/tracing/BUILD.gn
+++ /dev/null
@@ -1,39 +0,0 @@

View File

@@ -2,9 +2,9 @@ Upstream allows some customization of runtime behavior by performing binary witc
This cannot work with a systemwide electron, and any program depending on features gated behind a fuse would need additional patching anyway.
This patch removes fuse switches from the binary and makes the makes the compiler able to optimize away any dependant code which is now dead.
--- src/electron/build/fuses/build.py.old 2022-09-22 10:38:21.630415700 +0200
+++ src/electron/build/fuses/build.py 2022-09-25 19:02:31.522510400 +0200
@@ -7,7 +7,9 @@
--- src/electron/build/fuses/build.py.orig 2024-03-27 16:05:03.002778083 +0100
+++ src/electron/build/fuses/build.py 2024-03-27 20:08:44.765543587 +0100
@@ -7,7 +7,9 @@ import sys
dir_path = os.path.dirname(os.path.realpath(__file__))
@@ -15,7 +15,7 @@ This patch removes fuse switches from the binary and makes the makes the compile
TEMPLATE_H = """
#ifndef ELECTRON_FUSES_H_
@@ -23,7 +25,7 @@
@@ -21,7 +23,7 @@ TEMPLATE_H = """
namespace electron::fuses {
@@ -24,7 +24,7 @@ This patch removes fuse switches from the binary and makes the makes the compile
{getters}
@@ -41,8 +43,6 @@
@@ -42,8 +44,6 @@ TEMPLATE_CC = """
namespace electron::fuses {
@@ -33,19 +33,31 @@ This patch removes fuse switches from the binary and makes the makes the compile
{getters}
} // namespace electron:fuses
@@ -71,12 +71,18 @@
@@ -70,23 +70,18 @@ for fuse in fuses:
index += 1
initial_config += fuse_defaults[fuse]
name = ''.join(word.title() for word in fuse.split('_'))
- getters_h += "FUSE_EXPORT bool Is{name}Enabled();\n".replace("{name}", name)
- getters_cc += """
-bool Is{name}Enabled() {
-#if DCHECK_IS_ON()
- // RunAsNode is checked so early that base::CommandLine isn't yet
- // initialized, so guard here to avoid a CHECK.
- if (base::CommandLine::InitializedForCurrentProcess()) {
- base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch("{switch_name}")) {
- std::string switch_value = command_line->GetSwitchValueASCII("{switch_name}");
- return switch_value == "1";
- }
- }
-#endif
+ getters_h += """
+constexpr bool INLINE_Is{name}Enabled() {
return kFuseWire[{index}] == '1';
}
-""".replace("{name}", name).replace("{switch_name}", f"set-fuse-{fuse.lower()}").replace("{index}", str(index))
+#define Is{name}Enabled INLINE_Is{name}Enabled
""".replace("{name}", name).replace("{index}", str(index))
+""".replace("{name}", name).replace("{index}", str(index))
+ getters_cc += """
+#undef Is{name}Enabled
+FUSE_EXPORT bool Is{name}Enabled() {
@@ -55,7 +67,7 @@ This patch removes fuse switches from the binary and makes the makes the compile
def c_hex(n):
s = hex(n)[2:]
@@ -88,12 +94,13 @@
@@ -98,12 +93,13 @@ def hex_arr(s):
arr.append(c_hex(ord(char)))
return ",".join(arr)

View File

@@ -0,0 +1,10 @@
--- src/third_party/distributed_point_functions/code/dpf/aes_128_fixed_key_hash.cc.old 2024-04-02 11:53:27.644284500 +0200
+++ src/third_party/distributed_point_functions/code/dpf/aes_128_fixed_key_hash.cc 2024-04-02 22:24:29.350771600 +0200
@@ -26,6 +26,7 @@
#include "absl/numeric/int128.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
+#include "absl/strings/str_cat.h"
#include "absl/types/span.h"
#include "openssl/err.h"

View File

@@ -0,0 +1,27 @@
--- src/third_party/distributed_point_functions/code/dpf/internal/evaluate_prg_hwy.cc.old 2024-04-02 11:53:27.644284500 +0200
+++ src/third_party/distributed_point_functions/code/dpf/internal/evaluate_prg_hwy.cc 2024-04-02 22:35:43.377586600 +0200
@@ -50,16 +50,18 @@ namespace hn = hwy::HWY_NAMESPACE;
#if HWY_TARGET == HWY_SCALAR
absl::Status EvaluateSeedsHwy(
- int64_t num_seeds, int num_levels, const absl::uint128* seeds_in,
- const bool* control_bits_in, const absl::uint128* paths,
+ int64_t num_seeds, int num_levels, int num_correction_words,
+ const absl::uint128* seeds_in, const bool* control_bits_in,
+ const absl::uint128* paths, int paths_rightshift,
const absl::uint128* correction_seeds, const bool* correction_controls_left,
const bool* correction_controls_right, const Aes128FixedKeyHash& prg_left,
const Aes128FixedKeyHash& prg_right, absl::uint128* seeds_out,
bool* control_bits_out) {
- return EvaluateSeedsNoHwy(num_seeds, num_levels, seeds_in, control_bits_in,
- paths, correction_seeds, correction_controls_left,
- correction_controls_right, prg_left, prg_right,
- seeds_out, control_bits_out);
+ return EvaluateSeedsNoHwy(
+ num_seeds, num_levels, num_correction_words, seeds_in, control_bits_in,
+ paths, paths_rightshift, correction_seeds, correction_controls_left,
+ correction_controls_right, prg_left, prg_right, seeds_out,
+ control_bits_out);
}
#else

View File

@@ -23,7 +23,7 @@ Index: electron-17.1.0/chrome/browser/process_singleton_posix.cc
+ const std::vector<uint8_t> additional_data,
SocketReader* reader);
private:
// Called when the ProcessSingleton that owns this class is about to be
@@ -684,7 +684,7 @@ void ProcessSingleton::LinuxWatcher::Sta
void ProcessSingleton::LinuxWatcher::HandleMessage(
const std::string& current_dir,

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3afad92fdef5a5b3428744feaaa44992557555fb1aa90fdb616f66fe248e3f56
size 556045071

3
electron-29.3.1.tar.zst Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bfa684d21f467a2cb4dbbcbd542a94b9c53fcc153b8dd29319af035f2d5d8e9c
size 572836493

View File

@@ -0,0 +1,20 @@
Correct ODR violation due to ambiguous name.
When this header is compiled by itself, `scoped_refptr` refers to the type declared in `base/memory/scoped_refptr.h`.
When `third_party/webrtc/api/scoped_refptr.h` is included before, the name changes to refer to `::webrtc::scoped_refptr` instead,
leading to mismatch across translation units. This is detected and reported by GCC.
--- src/components/webrtc/fake_ssl_client_socket.h.old
+++ src/components/webrtc/fake_ssl_client_socket.h
@@ -111,8 +111,8 @@ class FakeSSLClientSocket : public net::
// The callback passed to Connect().
net::CompletionOnceCallback user_connect_callback_;
- scoped_refptr<net::DrainableIOBuffer> write_buf_;
- scoped_refptr<net::DrainableIOBuffer> read_buf_;
+ ::scoped_refptr<net::DrainableIOBuffer> write_buf_;
+ ::scoped_refptr<net::DrainableIOBuffer> read_buf_;
};
} // namespace webrtc

View File

@@ -0,0 +1,37 @@
From 05a74771fed5491740588ec7b39ba64a7b710013 Mon Sep 17 00:00:00 2001
From: Jose Dapena Paz <jdapena@igalia.com>
Date: Thu, 1 Feb 2024 17:34:38 +0000
Subject: [PATCH] GCC: avoid clash between getter and type in
grid_sizing_tree.h
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Rename GridSubsizingTree::GridItems getter to GetGridItems to avoid
type clash.
Bug: 819294
Change-Id: I4112929d9f85dc4573002b429cc982d50085d3c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5224147
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1255116}
---
.../core/layout/grid/grid_layout_algorithm.cc | 13 +++++++------
.../renderer/core/layout/grid/grid_sizing_tree.h | 2 +-
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/third_party/blink/renderer/core/layout/grid/grid_sizing_tree.h b/third_party/blink/renderer/core/layout/grid/grid_sizing_tree.h
index 45d55e2b36da4..2148ea9ea0657 100644
--- a/third_party/blink/renderer/core/layout/grid/grid_sizing_tree.h
+++ b/third_party/blink/renderer/core/layout/grid/grid_sizing_tree.h
@@ -188,7 +188,7 @@ class GridSizingSubtree
/* subtree_root */ grid_tree_->LookupSubgridIndex(subgrid_data));
}
- GridItems& GridItems() const {
+ ::blink::GridItems& GridItems() const {
DCHECK(grid_tree_);
return grid_tree_->At(subtree_root_).grid_items;
}

View File

@@ -41,13 +41,13 @@ index 8298861d5..147dfc3 100644
#include <memory>
@@ -17,7 +18,6 @@
#include "base/callback.h"
#include "base/numerics/safe_conversions.h"
#include "components/crash/core/common/crash_key.h"
#include "skia/ext/font_utils.h"
-#include "third_party/harfbuzz-ng/utils/hb_scoped.h"
#include "third_party/skia/include/core/SkFontMgr.h"
#include "third_party/skia/include/core/SkStream.h"
#include "third_party/skia/include/core/SkTypeface.h"
@@ -45,11 +45,11 @@
}

View File

@@ -0,0 +1,29 @@
From 3a75d7f8dc3a08a38dd893031f8996b91a00764b Mon Sep 17 00:00:00 2001
From: Jose Dapena Paz <jdapena@igalia.com>
Date: Tue, 23 Jan 2024 17:55:15 +0000
Subject: [PATCH] IWYU: usage of std::optional in hit_test_request.h requires
include
Bug: 957519
Change-Id: I1ec32af603720d13bfa4e22e20142459802284b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5227329
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1250917}
---
third_party/blink/renderer/core/layout/hit_test_request.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/third_party/blink/renderer/core/layout/hit_test_request.h b/third_party/blink/renderer/core/layout/hit_test_request.h
index c33144dc975b6..38968126fe520 100644
--- a/third_party/blink/renderer/core/layout/hit_test_request.h
+++ b/third_party/blink/renderer/core/layout/hit_test_request.h
@@ -23,6 +23,8 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_HIT_TEST_REQUEST_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_HIT_TEST_REQUEST_H_
+#include <optional>
+
#include "base/functional/callback.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/heap/member.h"

View File

@@ -3,27 +3,18 @@ https://github.com/GNOME/libxml2/commit/61034116d0a3c8b295c6137956adc3ae55720711
Make code compatible with both signatures
--- src/third_party/blink/renderer/core/xml/xslt_processor.h.orig 2023-11-15 19:51:53.839267200 +0000
+++ src/third_party/blink/renderer/core/xml/xslt_processor.h 2023-11-18 12:29:54.948129800 +0000
@@ -78,6 +78,7 @@ class XSLTProcessor final : public Scrip
--- src/third_party/blink/renderer/core/xml/xslt_processor.h.orig 2024-04-02 09:53:19.064289800 +0000
+++ src/third_party/blink/renderer/core/xml/xslt_processor.h 2024-04-06 17:07:37.951981800 +0000
@@ -77,6 +77,7 @@ class XSLTProcessor final : public Scrip
void reset();
static void ParseErrorFunc(void* user_data, xmlError*);
+ static void ParseErrorFunc(void* user_data, xmlError const*);
+ static void ParseErrorFunc(void* user_data, xmlError*);
static void ParseErrorFunc(void* user_data, const xmlError*);
static void GenericErrorFunc(void* user_data, const char* msg, ...);
// Only for libXSLT callbacks
--- src/third_party/blink/renderer/core/xml/xslt_processor_libxslt.cc.orig 2023-11-15 19:51:53.839267200 +0000
+++ src/third_party/blink/renderer/core/xml/xslt_processor_libxslt.cc 2023-11-18 15:17:13.507401500 +0000
@@ -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, xmlError* error) {
+void XSLTProcessor::ParseErrorFunc(void* user_data, xmlError const *error) {
FrameConsole* console = static_cast<FrameConsole*>(user_data);
if (!console)
return;
--- src/third_party/blink/renderer/core/xml/xslt_processor_libxslt.cc.orig 2024-04-02 09:53:19.064289800 +0000
+++ src/third_party/blink/renderer/core/xml/xslt_processor_libxslt.cc 2024-04-06 17:06:56.822190000 +0000
@@ -92,6 +92,10 @@ void XSLTProcessor::ParseErrorFunc(void*
nullptr)));
}

View File

@@ -1,60 +0,0 @@
From a0f788c981dd733a811e057b88c6dc1f99b9d791 Mon Sep 17 00:00:00 2001
From: Stephan Hartmann <stha09@googlemail.com>
Date: Tue, 31 Oct 2023 15:15:46 +0000
Subject: [PATCH] libstdc++: fix incomplete type in blink::LocalFrame and
client
Full definition of blink::WebBackgroundResourceFetchAssets is
required for scoped_refptr release.
Bug: 957519
Change-Id: If69e3c575f48132db6d74ce8279fc63b21f79125
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4994625
Commit-Queue: Stephan Hartmann <stha09@googlemail.com>
Reviewed-by: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1217593}
---
third_party/blink/renderer/core/frame/local_frame.h | 2 +-
third_party/blink/renderer/core/frame/local_frame_client.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/third_party/blink/renderer/core/frame/local_frame.h b/third_party/blink/renderer/core/frame/local_frame.h
index b233430e604976..7efb913cb4ec55 100644
--- a/third_party/blink/renderer/core/frame/local_frame.h
+++ b/third_party/blink/renderer/core/frame/local_frame.h
@@ -67,6 +67,7 @@
#include "third_party/blink/public/mojom/script/script_evaluation_params.mojom-blink-forward.h"
#include "third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom-blink-forward.h"
#include "third_party/blink/public/platform/task_type.h"
+#include "third_party/blink/public/platform/web_background_resource_fetch_assets.h"
#include "third_party/blink/public/platform/web_vector.h"
#include "third_party/blink/public/web/web_script_execution_callback.h"
#include "third_party/blink/renderer/core/core_export.h"
@@ -157,7 +158,6 @@ class SystemClipboard;
class TextFragmentHandler;
class TextSuggestionController;
class VirtualKeyboardOverlayChangedObserver;
-class WebBackgroundResourceFetchAssets;
class WebContentSettingsClient;
class WebInputEventAttribution;
class WebPluginContainerImpl;
diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h
index b83ee768ac5622..c0fa11ea9ec9f3 100644
--- a/third_party/blink/renderer/core/frame/local_frame_client.h
+++ b/third_party/blink/renderer/core/frame/local_frame_client.h
@@ -56,6 +56,7 @@
#include "third_party/blink/public/mojom/portal/portal.mojom-blink-forward.h"
#include "third_party/blink/public/platform/child_url_loader_factory_bundle.h"
#include "third_party/blink/public/platform/scheduler/web_scoped_virtual_time_pauser.h"
+#include "third_party/blink/public/platform/web_background_resource_fetch_assets.h"
#include "third_party/blink/public/platform/web_content_settings_client.h"
#include "third_party/blink/public/platform/web_effective_connection_type.h"
#include "third_party/blink/public/platform/web_worker_fetch_context.h"
@@ -104,7 +105,6 @@ class ResourceError;
class ResourceRequest;
class ResourceResponse;
class SourceLocation;
-class WebBackgroundResourceFetchAssets;
class WebContentCaptureClient;
class WebDedicatedWorkerHostFactoryClient;
class WebLocalFrame;

View File

@@ -0,0 +1,20 @@
--- src/media/gpu/v4l2/mt21/mt21_util.h.old 2024-04-02 09:53:17.170957700 +0000
+++ src/media/gpu/v4l2/mt21/mt21_util.h 2024-04-04 16:55:59.555998900 +0000
@@ -590,7 +590,7 @@ __attribute__((always_inline)) uint8x16_
vshlq_u32(
vshlq_u32(accumulator[i], vreinterpretq_s32_u32(unary_len[i])),
vsubq_s32(vreinterpretq_s32_u32(binary_len[i]),
- dword_literal_32)));
+ vreinterpretq_s32_u32(dword_literal_32))));
},
4)
@@ -747,7 +747,7 @@ __attribute__((always_inline)) uint8x16_
const uint8x16_t min_pred = vminq_u8(up, right);
const uint8x16_t max_pred = vmaxq_u8(up, right);
const uint8x16_t right_grad = vreinterpretq_u8_s8(vaddq_s8(
- right, vsubq_s8(vreinterpretq_s8_u8(up), vreinterpretq_s8_u8(up_right))));
+ vreinterpretq_s8_u8(right), vsubq_s8(vreinterpretq_s8_u8(up), vreinterpretq_s8_u8(up_right))));
const uint8x16_t up_right_above_max = vcgtq_u8(up_right, max_pred);
const uint8x16_t up_right_below_min = vcltq_u8(up_right, min_pred);
uint8x16_t pred = vbslq_u8(up_right_above_max, max_pred, min_pred);

View File

@@ -36,9 +36,9 @@ Disable various compiler configs (currently warning suppression). Like chromium
- cflags_cc += [ "-Wno-sign-compare" ]
}
}
--- src/third_party/electron_node/deps/base64/BUILD.gn.orig
+++ src/third_party/electron_node/deps/base64/BUILD.gn
@@ -13,11 +13,6 @@ static_library("base64") {
--- src/third_party/electron_node/deps/base64/BUILD.gn.orig 2024-03-27 16:38:36.306226966 +0100
+++ src/third_party/electron_node/deps/base64/BUILD.gn 2024-03-27 20:24:12.219928228 +0100
@@ -21,11 +21,6 @@ static_library("base64") {
public_configs = [ ":base64_config" ]
@@ -50,39 +50,39 @@ Disable various compiler configs (currently warning suppression). Like chromium
sources = [
"base64/include/libbase64.h",
@@ -75,7 +70,6 @@ source_set("base64_ssse3") {
@@ -44,7 +39,6 @@ source_set("base64_ssse3") {
defines = [ "HAVE_SSSE3=1" ]
cflags = [ "-mssse3" ]
- cflags_c = [ "-Wno-implicit-fallthrough" ]
sources = [ "base64/lib/arch/ssse3/ssse3_codec.c" ]
}
@@ -86,7 +80,6 @@ source_set("base64_sse41") {
sources = [ "base64/lib/arch/ssse3/codec.c" ]
@@ -57,7 +51,6 @@ source_set("base64_sse41") {
defines = [ "HAVE_SSE41=1" ]
cflags = [ "-msse4.1" ]
- cflags_c = [ "-Wno-implicit-fallthrough" ]
sources = [ "base64/lib/arch/sse41/sse41_codec.c" ]
}
@@ -100,7 +93,6 @@ source_set("base64_sse42") {
sources = [ "base64/lib/arch/sse41/codec.c" ]
@@ -74,7 +67,6 @@ source_set("base64_sse42") {
]
cflags = [ "-msse4.2" ]
- cflags_c = [ "-Wno-implicit-fallthrough" ]
sources = [ "base64/lib/arch/sse42/sse42_codec.c" ]
}
@@ -111,7 +103,6 @@ source_set("base64_avx") {
sources = [ "base64/lib/arch/sse42/codec.c" ]
@@ -87,7 +79,6 @@ source_set("base64_avx") {
defines = [ "HAVE_AVX=1" ]
cflags = [ "-mavx" ]
- cflags_c = [ "-Wno-implicit-fallthrough" ]
sources = [ "base64/lib/arch/avx/avx_codec.c" ]
}
@@ -122,10 +113,6 @@ source_set("base64_avx2") {
sources = [ "base64/lib/arch/avx/codec.c" ]
@@ -100,10 +91,6 @@ source_set("base64_avx2") {
defines = [ "HAVE_AVX2=1" ]
cflags = [ "-mavx2" ]
@@ -90,25 +90,25 @@ Disable various compiler configs (currently warning suppression). Like chromium
- "-Wno-implicit-fallthrough",
- "-Wno-implicit-function-declaration",
- ]
sources = [ "base64/lib/arch/avx2/avx2_codec.c" ]
}
@@ -136,7 +123,6 @@ source_set("base64_neon32") {
sources = [ "base64/lib/arch/avx2/codec.c" ]
@@ -116,7 +103,6 @@ source_set("base64_neon32") {
defines = [ "HAVE_NEON32=1" ]
cflags = [ "-mfpu=neon" ]
- cflags_c = [ "-Wno-implicit-fallthrough" ]
sources = [ "base64/lib/arch/neon32/neon32_codec.c" ]
}
@@ -146,7 +132,6 @@ source_set("base64_neon64") {
sources = [ "base64/lib/arch/neon32/codec.c" ]
@@ -128,7 +114,6 @@ source_set("base64_neon64") {
if (target_cpu == "arm64") {
defines = [ "HAVE_NEON64=1" ]
- cflags_c = [ "-Wno-implicit-fallthrough" ]
sources = [ "base64/lib/arch/neon64/neon64_codec.c" ]
}
sources = [ "base64/lib/arch/neon64/codec.c" ]
--- src/third_party/electron_node/deps/histogram/BUILD.gn.old
+++ src/third_party/electron_node/deps/histogram/BUILD.gn
@@ -1,12 +1,6 @@

View File

@@ -1,100 +0,0 @@
From fd36a8dadba7fcbd74f0ab82a8ee1b3150ce5167 Mon Sep 17 00:00:00 2001
From: Paolo Insogna <paolo@cowtech.it>
Date: Wed, 12 Oct 2022 00:30:01 +0200
Subject: [PATCH] deps: update llhttp to 8.1.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
PR-URL: https://github.com/nodejs/node/pull/44967
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Beth Griggs <bethanyngriggs@gmail.com>
---
deps/llhttp/CMakeLists.txt | 2 +-
deps/llhttp/README.md | 235 ++
deps/llhttp/include/llhttp.h | 258 +-
deps/llhttp/src/api.c | 89 +-
deps/llhttp/src/llhttp.c | 6236 +++++++++++++++++++++++-----------
src/node_http_parser.cc | 63 +-
tools/update-llhttp.sh | 2 +-
7 files changed, 4909 insertions(+), 1976 deletions(-)
diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc
index 6dbc8b806dc4..ce658bac6fab 100644
--- a/third_party/electron_node/src/node_http_parser.cc
+++ b/third_party/electron_node/src/node_http_parser.cc
@@ -1148,28 +1148,51 @@ void ConnectionsList::Expired(const FunctionCallbackInfo<Value>& args) {
}
const llhttp_settings_t Parser::settings = {
- Proxy<Call, &Parser::on_message_begin>::Raw,
- Proxy<DataCall, &Parser::on_url>::Raw,
- Proxy<DataCall, &Parser::on_status>::Raw,
- Proxy<DataCall, &Parser::on_header_field>::Raw,
- Proxy<DataCall, &Parser::on_header_value>::Raw,
- Proxy<Call, &Parser::on_headers_complete>::Raw,
- Proxy<DataCall, &Parser::on_body>::Raw,
- Proxy<Call, &Parser::on_message_complete>::Raw,
- Proxy<Call, &Parser::on_chunk_header>::Raw,
- Proxy<Call, &Parser::on_chunk_complete>::Raw,
-
- // on_url_complete
- nullptr,
- // on_status_complete
- nullptr,
- // on_header_field_complete
- nullptr,
- // on_header_value_complete
- nullptr,
+ Proxy<Call, &Parser::on_message_begin>::Raw,
+ Proxy<DataCall, &Parser::on_url>::Raw,
+ Proxy<DataCall, &Parser::on_status>::Raw,
+
+ // on_method
+ nullptr,
+ // on_version
+ nullptr,
+
+ Proxy<DataCall, &Parser::on_header_field>::Raw,
+ Proxy<DataCall, &Parser::on_header_value>::Raw,
+
+ // on_chunk_extension_name
+ nullptr,
+ // on_chunk_extension_value
+ nullptr,
+
+ Proxy<Call, &Parser::on_headers_complete>::Raw,
+ Proxy<DataCall, &Parser::on_body>::Raw,
+ Proxy<Call, &Parser::on_message_complete>::Raw,
+
+ // on_url_complete
+ nullptr,
+ // on_status_complete
+ nullptr,
+ // on_method_complete
+ nullptr,
+ // on_version_complete
+ nullptr,
+ // on_header_field_complete
+ nullptr,
+ // on_header_value_complete
+ nullptr,
+ // on_chunk_extension_name_complete
+ nullptr,
+ // on_chunk_extension_value_complete
+ nullptr,
+
+ Proxy<Call, &Parser::on_chunk_header>::Raw,
+ Proxy<Call, &Parser::on_chunk_complete>::Raw,
+
+ // on_reset,
+ nullptr,
};
-
void InitializeHttpParser(Local<Object> target,
Local<Value> unused,
Local<Context> context,

View File

@@ -1,3 +1,66 @@
-------------------------------------------------------------------
Fri Apr 19 20:11:24 UTC 2024 - Bruno Pitrus <brunopitrus@hotmail.com>
- Update to electron 29.3.1
* ABI break: NODE_MODULE_VERSION is now 121
* Chromium 122.0.6261.156
* Node 20.9.0
* V8 12.2
* The deprecated gpu-process-crashed event on app has been removed.
* The deprecated renderer-process-crashed event on app and crashed
event on WebContents and <webview> have been removed.
* Added WebContentsView and BaseWindow, replacing the now-deprecated BrowserView APIs.
* Added new webUtils.getPathForFile method to replace File.path augmentation.
* see https://www.electronjs.org/blog/electron-29-0 and https://github.com/electron/electron/releases/tag/v29.0.0 for more
* Security fixes for Angle (CVE-2024-3516) and Compositing (CVE-2024-3157)
- Drop upstreamed patches
* atspi.patch
* chromium-117-blink-BUILD-mnemonic.patch
* local_frame-local_frame_client-incomplete-WebBackgroundResourceFetchAssets.patch
* node-upgrade-llhttp-to-8.patch
* policy_templates-deterministic.patch
* v8-hide-private-symbols.patch
* web_local_frame_client-incomplete-WebBackgroundResourceFetchAssets.patch
- Add patches to fix build errors
* aarch64-Xclang.patch
* absl2023-encapsulated_web_transport-StrCat.patch
* boringssl-internal-addc-cxx.patch
* chromium-122-avoid-SFINAE-TypeConverter.patch
* chromium-122-BookmarkNode-missing-operator.patch
* distributed_point_functions-aes_128_fixed_key_hash-missing-StrCat.patch
* distributed_point_functions-evaluate_prg_hwy-signature.patch
* fake_ssl_socket_client-Wlto-type-mismatch.patch
* grid_sizing_tree-Wchanges-meaning.patch
* hit_test_request-missing-optional.patch
* InternalAllocator-too-many-initializers.patch
* mt21_util-flax-vector-conversions.patch
* plus_address_types-missing-optional.patch
* race_network_request_write_buffer_manager-missing-optional.patch
* resolution_monitor-missing-bitset.patch
* script_promise_resolver-explicit-specialization.patch
* search_engine_choice_service-missing-optional.patch
* system-yuv.patch
- Replace abseil-remove-unused-targets.patch with chromium-122-abseil-shims.patch
- Remove dead code from third_party/
* remove-dawn.patch
* remove-openscreen.patch
* remove-password-manager-and-policy.patch
* remove-puffin.patch
* remove-rust.patch
* remove AFL-2.0, BSD-Protection and IJG from licence list,
because the relevant libraries (xdg-mime, bsdiff and iccjpeg)
are no longer shipped.
- Leap, Fedora: use bundled re2
* drop replace-StringPiece-with-string_view.patch
- Fedora 38: use bundled abseil
* drop pending_task_safety_flag-abseil-2022-nullability.patch
* drop thread_annotations-fix-build-with-system-abseil.patch
- Leap 15.5: Reverse upstream changes to build with old wayland
* wayland-proto-31-cursor-shape.patch
- Leap 15.5/6: Reverse upstream changes to build with old ffmpeg
* Cr122-ffmpeg-new-channel-layout.patch
- aarch64: reduce debuginfo due to linker OOM
-------------------------------------------------------------------
Thu Apr 11 18:55:40 UTC 2024 - Bruno Pitrus <brunopitrus@hotmail.com>

View File

@@ -22,7 +22,7 @@
%define mod_name electron
# https://github.com/nodejs/node/blob/main/doc/abi_version_registry.json
%define abi_version 119
%define abi_version 121
# Do not provide libEGL.so, etc…
%define __provides_exclude ^lib.*\\.so.*$
@@ -54,13 +54,27 @@ BuildArch: i686
#the QT ui is currently borderline unusable (too small fonts in menu and wrong colors)
%bcond_with qt
%ifarch aarch64 riscv64
#Video acceleration API to support. Useful for e.g. signal messenger.
#One cannot enable both, unfortunately.
#Apparently more arm hardware supports v4l2 than vaapi,
#but that code does not build on armv{6,7}hl due to too high cpu requirements.
#bcond_without v4l2
#bcond_with vaapi
%else
#bcond_with v4l2
#bcond_without vaapi
%endif
#DISABLING THIS — cannot use video acceleration with system aom/vpx
%bcond_with v4l2
%bcond_with vaapi
%ifnarch %ix86 %arm
%if (0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora})
@@ -74,11 +88,6 @@ BuildArch: i686
%endif
%bcond_without system_nghttp2
%bcond_without system_crc32c
%bcond_without system_dav1d
%bcond_without system_highway
%bcond_without system_nvctrl
%if 0%{?suse_version} || 0%{?fedora} < 40
%bcond_without system_minizip
@@ -97,11 +106,13 @@ BuildArch: i686
%bcond_without system_spirv
%bcond_without harfbuzz_5
%bcond_without link_vulkan
%bcond_without wayland_32
%else
%bcond_with system_aom
%bcond_with system_spirv
%bcond_with harfbuzz_5
%bcond_with link_vulkan
%bcond_with wayland_32
%endif
@@ -121,20 +132,20 @@ BuildArch: i686
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} >= 39
%bcond_without bro_11
%bcond_without ffmpeg_6
%else
%bcond_with bro_11
%bcond_with ffmpeg_6
%endif
%if 0%{?fedora}
%bcond_without system_llhttp
%bcond_without llhttp_8
%bcond_without system_histogram
%bcond_without system_simdutf
%else
%bcond_with system_llhttp
%bcond_with llhttp_8
%bcond_with system_histogram
%bcond_with system_simdutf
%endif
@@ -146,27 +157,22 @@ BuildArch: i686
%bcond_with system_vma
%endif
#requires `imageSequenceTrackPresent` and `enableParsingGainMapMetadata` both of which are only in post-1.0.0 nightlies
%bcond_with system_avif
# Some chromium code assumes absl::string_view is a typedef for std::string_view. This is not true on GCC7 systems such as Leap.
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} >= 37
%bcond_without system_abseil
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora} >= 39
%bcond_without abseil_2023
%bcond_without system_abseil
%else
%bcond_with abseil_2023
%bcond_with system_abseil
%endif
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700
%bcond_without re2_11
#re2-11 has abseil as a public dependency. If you use system re2 you must use system abseil.
%bcond_without system_re2
%else
%bcond_with re2_11
%endif
%else
%bcond_with system_abseil
%bcond_with system_re2
%endif
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150700 || 0%{?fedora}
@@ -201,10 +207,10 @@ BuildArch: i686
Name: nodejs-electron
Version: 28.3.0
Version: 29.3.1
Release: 0
Summary: Build cross platform desktop apps with JavaScript, HTML, and CSS
License: AFL-2.0 AND Apache-2.0 AND blessing AND BSD-2-Clause AND BSD-3-Clause AND BSD-Protection AND BSD-Source-Code AND bzip2-1.0.6 AND IJG AND ISC AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND MIT AND MIT-CMU AND MIT-open-group AND (MPL-1.1 OR GPL-2.0-or-later OR LGPL-2.1-or-later) AND MPL-2.0 AND OpenSSL AND SGI-B-2.0 AND SUSE-Public-Domain AND X11%{!?with_system_minizip: AND Zlib}
License: Apache-2.0 AND blessing AND BSD-2-Clause AND BSD-3-Clause AND BSD-Source-Code AND bzip2-1.0.6 AND ISC AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND MIT AND MIT-CMU AND MIT-open-group AND (MPL-1.1 OR GPL-2.0-or-later OR LGPL-2.1-or-later) AND MPL-2.0 AND OpenSSL AND SGI-B-2.0 AND SUSE-Public-Domain AND X11%{!?with_system_minizip: AND Zlib}
Group: Development/Languages/NodeJS
URL: https://github.com/electron/electron
Source0: %{mod_name}-%{version}.tar.zst
@@ -216,16 +222,15 @@ Source11: electron.desktop
# Reverse upstream changes to be able to build against ffmpeg-4
Source400: ffmpeg-new-channel-layout.patch
Source401: audio_file_reader-ffmpeg-AVFrame-duration.patch
Source402: Cr122-ffmpeg-new-channel-layout.patch
# and against harfbuzz 4
Source415: harfbuzz-replace-chromium-scoped-type.patch
Source416: harfbuzz-replace-HbScopedPointer.patch
# and icu 71
Source417: v8-icu73-alt_calendar.patch
Source418: v8-icu73-simple-case-folding.patch
# and re2 10
Source430: replace-StringPiece-with-string_view.patch
# and abseil 2022
Source440: pending_task_safety_flag-abseil-2022-nullability.patch
# and wayland 1.31
Source450: wayland-proto-31-cursor-shape.patch
# PATCHES for openSUSE-specific things
@@ -252,10 +257,16 @@ Patch75: gcc-asmflags.patch
Patch76: disable-devtools-tests.patch
Patch77: angle_link_glx.patch
Patch78: rdynamic.patch
Patch79: v8-hide-private-symbols.patch
Patch80: icon.patch
Patch81: disable-tests.patch
Patch82: node-compiler.patch
Patch83: remove-rust.patch
Patch84: aarch64-Xclang.patch
Patch85: remove-dawn.patch
Patch86: aom-vpx-no-thread-wrapper.patch
Patch87: remove-openscreen.patch
Patch88: remove-password-manager-and-policy.patch
Patch89: remove-puffin.patch
# PATCHES to use system libs
Patch1000: do-not-build-libvulkan.so.patch
@@ -268,7 +279,6 @@ Patch1045: angle-system-xxhash.patch
Patch1047: cares_public_headers.patch
Patch1048: chromium-remove-bundled-roboto-font.patch
Patch1053: swiftshader-use-system-llvm.patch
Patch1054: thread_annotations-fix-build-with-system-abseil.patch
Patch1063: system-libbsd.patch
Patch1065: base-system-nspr.patch
Patch1066: system-gtest.patch
@@ -283,6 +293,8 @@ Patch1076: crashpad-use-system-abseil.patch
Patch1077: system-wayland.patch
Patch1078: system-simdutf.patch
Patch1079: system-libm.patch
Patch1080: system-yuv.patch
Patch1081: chromium-122-abseil-shims.patch
# PATCHES to fix interaction with third-party software
@@ -305,18 +317,10 @@ Patch2024: electron-16-std-vector-non-const.patch
Patch2029: electron-16-webpack-fix-openssl-3.patch
Patch2031: partition_alloc-no-lto.patch
Patch2032: seccomp_bpf-no-lto.patch
# adjust to llhttp 8 api changes
%if %{with llhttp_8}
Patch2033: node-upgrade-llhttp-to-8.patch
%else
Source2033: node-upgrade-llhttp-to-8.patch
%endif
Patch2034: swiftshader-LLVMJIT-AddressSanitizerPass-dead-code-remove.patch
Patch2035: RenderFrameHostImpl-use-after-free.patch
Patch2037: abseil-remove-unused-targets.patch
# https://github.com/electron/electron/pull/40032
Patch2040: build-without-extensions.patch
Patch2041: chromium-117-blink-BUILD-mnemonic.patch
%if %{without bro_11}
Patch2042: brotli-remove-shared-dictionary.patch
%else
@@ -329,8 +333,7 @@ Source2047: bundled-minizip.patch
%else
Patch2047: bundled-minizip.patch
%endif
# https://sources.debian.org/patches/chromium/119.0.6045.199-1/fixes/atspi.patch/
Patch2048: atspi.patch
Patch2048: absl2023-encapsulated_web_transport-StrCat.patch
# PATCHES that should be submitted upstream verbatim or near-verbatim
Patch3016: chromium-98-EnumTable-crash.patch
@@ -346,24 +349,34 @@ Patch3080: compact_enc_det_generated_tables-Wnarrowing.patch
Patch3096: remove-date-reproducible-builds.patch
Patch3118: material_color_utilities-tones-missing-round.patch
Patch3126: perfetto-numeric_storage-double_t.patch
Patch3127: policy_templates-deterministic.patch
Patch3129: text_break_iterator-icu74-breakAllLineBreakClassTable-should-be-consistent.patch
Patch3130: web_local_frame_client-incomplete-WebBackgroundResourceFetchAssets.patch
Patch3131: local_frame-local_frame_client-incomplete-WebBackgroundResourceFetchAssets.patch
Patch3132: v8-instance-type-inl-constexpr-used-before-its-definition.patch
Patch3133: swiftshader-llvm18-LLVMReactor-getInt8PtrTy.patch
Patch3134: swiftshader-llvm18-LLVMJIT-Host.patch
Patch3135: swiftshader-llvm18-LLVMJIT-CodeGenOptLevel.patch
Patch3136: CVE-2024-30260-undici-clear-proxy-authorization.patch
Patch3137: CVE-2024-30261-undici-fetch-integrity.patch
Patch3138: distributed_point_functions-aes_128_fixed_key_hash-missing-StrCat.patch
Patch3139: chromium-122-avoid-SFINAE-TypeConverter.patch
Patch3140: plus_address_types-missing-optional.patch
Patch3141: chromium-122-BookmarkNode-missing-operator.patch
Patch3142: search_engine_choice_service-missing-optional.patch
Patch3143: race_network_request_write_buffer_manager-missing-optional.patch
Patch3144: mt21_util-flax-vector-conversions.patch
Patch3145: script_promise_resolver-explicit-specialization.patch
Patch3146: hit_test_request-missing-optional.patch
Patch3147: grid_sizing_tree-Wchanges-meaning.patch
Patch3148: resolution_monitor-missing-bitset.patch
Patch3149: boringssl-internal-addc-cxx.patch
Patch3150: InternalAllocator-too-many-initializers.patch
Patch3151: distributed_point_functions-evaluate_prg_hwy-signature.patch
Patch3152: fake_ssl_socket_client-Wlto-type-mismatch.patch
BuildRequires: brotli
%if %{with system_cares}
BuildRequires: c-ares-devel
%endif
%if %{with system_crc32c}
BuildRequires: cmake(Crc32c)
%endif
BuildRequires: double-conversion-devel
BuildRequires: desktop-file-utils
%if 0%{?fedora}
@@ -387,15 +400,9 @@ BuildRequires: libaom-devel >= 3.7~
%endif
BuildRequires: libbsd-devel
BuildRequires: libpng-devel
%if %{with system_nvctrl}
BuildRequires: libXNVCtrl-devel
%endif
%if %{with system_llhttp}
%if %{with llhttp_8}
BuildRequires: llhttp-devel >= 8
%else
BuildRequires: llhttp-devel < 8
%endif
%endif
%if %{with swiftshader} && %{without subzero}
BuildRequires: llvm-devel >= 16
@@ -442,6 +449,7 @@ BuildRequires: VulkanMemoryAllocator-devel >= 3
BuildRequires: wayland-devel >= 1.20
BuildRequires: zstd
%if %{with system_abseil}
BuildRequires: pkgconfig(absl_absl_check)
BuildRequires: pkgconfig(absl_algorithm_container)
BuildRequires: pkgconfig(absl_any_invocable)
BuildRequires: pkgconfig(absl_base)
@@ -479,15 +487,11 @@ BuildRequires: pkgconfig(absl_time)
BuildRequires: pkgconfig(absl_type_traits)
BuildRequires: pkgconfig(absl_utility)
BuildRequires: pkgconfig(absl_variant)
%if %{with abseil_2023}
BuildRequires: pkgconfig(absl_core_headers) >= 20230000
%endif
%endif
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(cairo) >= 1.6
%if %{with system_dav1d}
BuildRequires: pkgconfig(dav1d) >= 1
%endif
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(dri)
BuildRequires: pkgconfig(expat)
@@ -512,6 +516,9 @@ BuildRequires: pkgconfig(jsoncpp)
%if 0%{?fedora}
Recommends: (ffmpeg-libs%{_isa} or libavcodec-freeworld%{_isa})
%endif
%if %{with ffmpeg_6}
BuildRequires: pkgconfig(libavcodec) >= 60
%endif
%if %{with ffmpeg_5}
BuildRequires: pkgconfig(libavcodec) >= 59
BuildRequires: pkgconfig(libavformat) >= 59
@@ -543,12 +550,8 @@ BuildRequires: pkgconfig(libcares)
BuildRequires: pkgconfig(libcurl)
BuildRequires: pkgconfig(libdrm)
BuildRequires: pkgconfig(libevent)
%if %{with system_highway}
BuildRequires: pkgconfig(libhwy) >= 1
%endif
%if %{with system_nghttp2}
BuildRequires: pkgconfig(libnghttp2)
%endif
BuildRequires: pkgconfig(libnotify)
BuildRequires: pkgconfig(libpci)
BuildRequires: pkgconfig(libpulse)
@@ -580,12 +583,8 @@ BuildRequires: pkgconfig(pangocairo)
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Widgets)
%endif
BuildRequires: pkgconfig(re2)
%if %{without system_abseil}
#re2-11 has abseil as a public dependency. The headers collide with the bundled ones, causing linker errors.
BuildRequires: cmake(re2) < 11
%endif
%if %{with system_abseil} && %{with re2_11}
%if %{with system_abseil} && %{with system_re2}
#re2-11 has abseil as a public dependency. If you use system re2 you must use system abseil.
BuildRequires: cmake(re2) >= 11
%endif
%if %{with system_spirv}
@@ -600,6 +599,9 @@ BuildRequires: pkgconfig(SPIRV-Tools) >= 2022.2
BuildRequires: pkgconfig(vulkan) >= 1.3
%endif
BuildRequires: pkgconfig(wayland-protocols)
%if %{with wayland_32}
BuildRequires: pkgconfig(wayland-protocols) >= 1.32
%endif
BuildRequires: pkgconfig(xkbcommon)
BuildRequires: pkgconfig(xshmfence)
BuildRequires: pkgconfig(zlib)
@@ -669,20 +671,18 @@ Development documentation for the Electron runtime.
# Use stable path to source to make use of ccache
%autosetup -n src -p1
# Sanity check if macro corresponds to the actual ABI
test $(grep ^node_module_version electron/build/args/all.gn | sed 's/.* = //') = %abi_version
%if %{without system_abseil}
patch -R -p1 < %PATCH1054
patch -R -p1 < %PATCH1076
%endif
%if %{with system_abseil} && %{with abseil_2023}
patch -R -p1 < %PATCH1054
%endif
%if %{with system_abseil} && %{without abseil_2023}
patch -R -p1 < %SOURCE440
%if %{without ffmpeg_6}
patch -R -p1 < %SOURCE402
%endif
%if %{with ffmpeg_5}
@@ -693,7 +693,6 @@ patch -R -p1 < %SOURCE400
%if %{without harfbuzz_5}
patch -R -p1 < %SOURCE415
patch -R -p1 < %SOURCE416
@@ -704,14 +703,14 @@ patch -R -p1 < %SOURCE417
patch -R -p1 < %SOURCE418
%endif
%if %{without wayland_32}
patch -R -p1 < %SOURCE450
%endif
# This one depends on an ffmpeg nightly, reverting unconditionally.
patch -R -p1 < %SOURCE401
%if %{without system_abseil} || (%{with system_abseil} && %{without re2_11})
patch -R -p1 < %SOURCE430
%endif
# Link system wayland-protocols-devel into where chrome expects them
mkdir -p third_party/wayland/src
mkdir -p third_party/wayland-protocols/kde/src
@@ -782,7 +781,6 @@ ARCH_FLAGS="$ARCH_FLAGS -DIS_SERIAL_ENABLED_PLATFORM"
ARCH_FLAGS="$(echo $ARCH_FLAGS | sed -e 's/ -fexceptions / /g')"
%endif
# for wayland
export CXXFLAGS="${ARCH_FLAGS} -I/usr/include/wayland -I/usr/include/libxkbcommon"
export CFLAGS="${CXXFLAGS}"
@@ -841,7 +839,7 @@ export RANLIB=gcc-ranlib-13
%ifarch %ix86 %arm
%limit_build -m 1200
%else
%limit_build -m 3500
%limit_build -m 4000
%endif
%ifarch aarch64
@@ -852,7 +850,7 @@ unset MALLOC_PERTURB_
%if %{with lto}
%ifarch aarch64
export LDFLAGS="$LDFLAGS -flto=auto --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=1 -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
export LDFLAGS="$LDFLAGS -flto=3 --param ggc-min-expand=20 --param ggc-min-heapsize=32768 --param lto-max-streaming-parallelism=1 -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
%else
# x64 is fine with the the default settings (the machines have 30GB+ ram)
export LDFLAGS="$LDFLAGS -flto=auto"
@@ -861,6 +859,8 @@ export LDFLAGS="$LDFLAGS -flto=auto"
gn_system_libraries=(
brotli
crc32c
dav1d
double-conversion
ffmpeg
flac
@@ -868,6 +868,7 @@ gn_system_libraries=(
fontconfig
freetype
harfbuzz-ng
highway
icu
jsoncpp
libdrm
@@ -877,10 +878,10 @@ gn_system_libraries=(
libsecret
libusb
libwebp
libXNVCtrl
libxml
libxslt
opus
re2
snappy
woff2
zlib
@@ -892,6 +893,7 @@ gn_system_libraries+=(
absl_algorithm
absl_base
absl_cleanup
absl_crc
absl_container
absl_debugging
absl_flags
@@ -923,38 +925,25 @@ find third_party/libavif -type f ! -name "*.gn" -a ! -name "*.gni" -delete
gn_system_libraries+=( libavif )
%endif
%if %{with system_crc32c}
find third_party/crc32c -type f ! -name "*.gn" -a ! -name "*.gni" -delete
gn_system_libraries+=( crc32c )
%endif
%if %{with system_dav1d}
find third_party/dav1d -type f ! -name "*.gn" -a ! -name "*.gni" -delete
gn_system_libraries+=( dav1d )
%endif
%if %{with system_highway}
find third_party/highway -type f ! -name "*.gn" -a ! -name "*.gni" -delete
gn_system_libraries+=( highway )
%endif
%if %{with system_minizip}
find third_party/zlib/contrib -type f ! -name "*.gn" -a ! -name "*.gni" -delete
%endif
%if %{with system_nvctrl}
find third_party/angle/src/third_party/libXNVCtrl/ -type f ! -name "*.gn" -a ! -name "*.gni" -delete
gn_system_libraries+=( libXNVCtrl )
%if %{with system_re2}
find third_party/re2 -type f ! -name "*.gn" -a ! -name "*.gni" -delete
gn_system_libraries+=( re2 )
%endif
%if %{with system_spirv}
rm -rf third_party/swiftshader/third_party/SPIRV-Headers/include
find third_party/swiftshader/third_party/SPIRV-Headers/ -type f ! -name "*.gn" -a ! -name "*.gni" -delete
find third_party/swiftshader/third_party/SPIRV-Tools/ -type f ! -name "*.gn" -a ! -name "*.gni" -delete
rm -rf third_party/vulkan-deps/spirv-headers/src/include
find third_party/vulkan-deps/spirv-headers/ -type f ! -name "*.gn" -a ! -name "*.gni" -delete
find third_party/vulkan-deps/spirv-tools/ -type f ! -name "*.gn" -a ! -name "*.gni" -delete
gn_system_libraries+=(
@@ -988,10 +977,6 @@ build/linux/unbundle/replace_gn_files.py --system-libraries ${gn_system_librarie
find third_party/angle/src/third_party/volk -type f ! -name "*.gn" -a ! -name "*.gni" -delete
%endif
%if %{with system_nghttp2}
find third_party/electron_node/deps/nghttp2 -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete
%endif
%if %{with system_llhttp}
find third_party/electron_node/deps/llhttp -type f ! -name "*.gn" -a ! -name "*.gni" -a ! -name "*.gyp" -a ! -name "*.gypi" -delete
%endif
@@ -1089,6 +1074,7 @@ myconf_gn+=" enable_print_preview=false"
myconf_gn+=" enable_printing=false"
myconf_gn+=" enable_basic_printing=false"
myconf_gn+=' use_cups=false'
myconf_gn+=' enable_print_content_analysis=false'
#we don't build PDF support, so disabling the below:
#myconf_gn+=" use_system_lcms2=true"
#myconf_gn+=" use_system_libopenjpeg2=true"
@@ -1097,6 +1083,8 @@ myconf_gn+=' use_cups=false'
#do not build chrome pepper plugins support
myconf_gn+=" enable_plugins=false"
myconf_gn+=" enable_ppapi=false"
#it is set by default to enable_ppapi but is required by electron_api_web_frame.cc
myconf_gn+=' content_enable_legacy_ipc=true'
#do not build webextensions support
myconf_gn+=' enable_electron_extensions=false'
@@ -1122,14 +1110,15 @@ myconf_gn+=" symbol_level=1"
myconf_gn+=" blink_symbol_level=0"
myconf_gn+=" v8_symbol_level=0"
%endif
%ifarch aarch64 #“No space left on device” with symbol level 2
myconf_gn+=" symbol_level=1"
myconf_gn+=" blink_symbol_level=1"
myconf_gn+=" v8_symbol_level=1"
%ifarch aarch64
# linker OOM, sorry.
# we still seem to get some debug generated during linking when LTO is enabled
myconf_gn+=' symbol_level=0'
myconf_gn+=' blink_symbol_level=0'
myconf_gn+=' v8_symbol_level=0'
%endif
# do not build some chrome features not used by electron
# (some of these only go to buildflag_headers and are dead code rn, but disabling them preemptively as long as they're visible)
myconf_gn+=" enable_vr=false"
@@ -1168,21 +1157,22 @@ myconf_gn+=' enable_supervised_users=false'
myconf_gn+=' enable_compose=false'
myconf_gn+=' enterprise_cloud_content_analysis=false'
myconf_gn+=' enterprise_local_content_analysis=false'
myconf_gn+=' enterprise_data_controls=false'
myconf_gn+=' enterprise_client_certificates=false'
myconf_gn+=' enterprise_watermark=false'
myconf_gn+=' enterprise_content_analysis=false'
#FIXME: possibly enable this when skia gets built with rust code by default.
#Need to patch in optflags and possibly FFI LTO hacks (see signal-desktop package for how it's done)
myconf_gn+=' enable_rust=false'
myconf_gn+=' enable_chromium_prelude=false'
#See net/base/features.cc. It's not enabled yet.
#FIXME: enable this and add shims to build with system zstd when it's enabled
myconf_gn+=' disable_zstd_filter=true'
myconf_gn+=' chrome_root_store_policy_supported=false'
myconf_gn+=' chrome_certificate_policies_supported=false'
myconf_gn+=' use_kerberos=false'
myconf_gn+=' disable_histogram_support=true'
@@ -1197,7 +1187,6 @@ myconf_gn+=" enable_service_discovery=false"
#disable some debug/tracing hooks, they increase size and we do not build chrome://tracing anyway (see disable-catapult.patch)
myconf_gn+=" enable_trace_logging=false"
myconf_gn+=" optional_trace_events_enabled=false"
myconf_gn+=" use_runtime_vlog=false"
myconf_gn+=" rtc_disable_logging=true"
myconf_gn+=" rtc_disable_metrics=true"
myconf_gn+=" rtc_disable_trace_events=true"
@@ -1223,13 +1212,15 @@ myconf_gn+=" use_unofficial_version_number=false"
myconf_gn+=" use_lld=false"
%if %{with vaapi}
myconf_gn+=' use_vaapi=true'
myconf_gn+=' use_vaapi_x11=true'
myconf_gn+=' use_libgav1_parser=true'
myconf_gn+=' use_vaapi=true use_vaapi_image_codecs=true'
%else
myconf_gn+=' use_vaapi=false'
myconf_gn+=' use_vaapi_x11=false'
myconf_gn+=' use_libgav1_parser=false'
myconf_gn+=' use_vaapi=false use_vaapi_image_codecs=false'
%endif
%if %{with v4l2}
myconf_gn+=' use_v4l2_codec=true'
%else
myconf_gn+=' use_v4l2_codec=false'
%endif
myconf_gn+=" treat_warnings_as_errors=false"
@@ -1251,9 +1242,7 @@ myconf_gn+=" use_system_libpng=true"
myconf_gn+=" use_system_harfbuzz=true"
myconf_gn+=" use_system_freetype=true"
myconf_gn+=" use_system_cares=true"
%if %{with system_nghttp2}
myconf_gn+=" use_system_nghttp2=true"
%endif
%if %{with system_llhttp}
myconf_gn+=" use_system_llhttp=true"
%endif
@@ -1271,21 +1260,6 @@ myconf_gn+=" gcc_lto=true"
# endif with lto
%endif
%ifarch %arm
# Bundled libaom is broken on ARMv7
%if %{without system_aom}
# [74796s] FAILED: v8_context_snapshot_generator
# [74796s] python3 "../../build/toolchain/gcc_link_wrapper.py" --output="./v8_context_snapshot_generator" -- g++ -Wl,--build-id=sha1 -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -rdynamic -Wl,-z,defs -Wl,--as-needed -pie -Wl,--disable-new-dtags -Wl,-rpath=\$ORIGIN -Wl,--as-needed -fuse-ld=lld -o "./v8_context_snapshot_generator" -Wl,--start-group @"./v8_context_snapshot_generator.rsp" -Wl,--end-group -latomic -ldl -lpthread -lrt -lgmodule-2.0 -lglib-2.0 -lgobject-2.0 -lgthread-2.0 -ljsoncpp -labsl_base -labsl_raw_logging_internal -labsl_log_severity -labsl_spinlock_wait -labsl_cord -labsl_cordz_info -labsl_cord_internal -labsl_cordz_functions -labsl_exponential_biased -labsl_cordz_handle -labsl_synchronization -labsl_graphcycles_internal -labsl_stacktrace -labsl_symbolize -labsl_debugging_internal -labsl_demangle_internal -labsl_malloc_internal -labsl_time -labsl_civil_time -labsl_time_zone -labsl_bad_optional_access -labsl_strings -labsl_strings_internal -labsl_int128 -labsl_throw_delegate -labsl_hash -labsl_city -labsl_bad_variant_access -labsl_low_level_hash -labsl_raw_hash_set -labsl_hashtablez_sampler -labsl_failure_signal_handler -labsl_examine_stack -labsl_random_distributions -labsl_random_seed_sequences -labsl_random_internal_pool_urbg -labsl_random_internal_randen -labsl_random_internal_randen_hwaes -labsl_random_internal_randen_hwaes_impl -labsl_random_internal_randen_slow -labsl_random_internal_platform -labsl_random_internal_seed_material -labsl_random_seed_gen_exception -labsl_status -labsl_str_format_internal -labsl_strerror -labsl_statusor -licui18n -licuuc -licudata -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -ldouble-conversion -levent -lz -ljpeg -lpng16 -lxml2 -lxslt -lresolv -lgio-2.0 -lbrotlidec -lwebpdemux -lwebpmux -lwebp -lfreetype -lexpat -lfontconfig -lharfbuzz-subset -lharfbuzz -lyuv -lopus -lvpx -lm -ldav1d -lX11 -lXcomposite -lXdamage -lXext -lXfixes -lXrender -lXrandr -lXtst -lpipewire-0.3 -lgbm -lEGL -ldrm -lcrc32c -lbsd -lxcb -lxkbcommon -lwayland-client -ldbus-1 -lre2 -lpangocairo-1.0 -lpango-1.0 -lcairo -latk-1.0 -latk-bridge-2.0 -lasound -lpulse -lavcodec -lavformat -lavutil -lXi -lpci -lxxhash -lXNVCtrl -lsnappy -lavif -ljxl -lwoff2dec -latspi
# [74796s] ld.lld: error: undefined symbol: aom_arm_cpu_caps
# [74796s] >>> referenced by av1_rtcd.h:1079 (../../third_party/libaom/source/config/linux/arm/config/av1_rtcd.h:1079)
# [74796s] >>> libaom/av1_rtcd.o:(setup_rtcd_internal) in archive obj/third_party/libaom/libaom.a
# [74796s] >>> referenced by aom_dsp_rtcd.h:3560 (../../third_party/libaom/source/config/linux/arm/config/aom_dsp_rtcd.h:3560)
# [74796s] >>> libaom/aom_dsp_rtcd.o:(setup_rtcd_internal) in archive obj/third_party/libaom/libaom.a
# [74796s] >>> referenced by aom_scale_rtcd.h:162 (../../third_party/libaom/source/config/linux/arm/config/aom_scale_rtcd.h:162)
# [74796s] >>> libaom/aom_scale_rtcd.o:(setup_rtcd_internal) in archive obj/third_party/libaom/libaom.a
myconf_gn+=" enable_libaom=false"
%endif
%endif
%if %{with pipewire}
myconf_gn+=" rtc_use_pipewire=true rtc_link_pipewire=true"
@@ -1298,6 +1272,7 @@ myconf_gn+=" use_qt=true"
# Do not build WebGPU support. It is huge and not used by ANY known apps (we would know if it was — it's hidden behind an experimental flag).
myconf_gn+=" use_dawn=false"
myconf_gn+=' skia_use_dawn=false'
# The proprietary codecs just force the chromium to say they can use it and
# offload the actual computation to the ffmpeg, otherwise the chromium

View File

@@ -2,7 +2,7 @@ Compile files which declare functions in inline assembly without LTO due to http
--- src/base/allocator/partition_allocator/src/partition_alloc/BUILD.gn.old 2022-10-01 13:53:03.367797474 +0200
+++ src/base/allocator/partition_allocator/src/partition_alloc/BUILD.gn 2022-10-05 14:23:53.999860356 +0200
@@ -51,6 +51,33 @@
@@ -90,6 +90,33 @@ if (!is_debug || partition_alloc_optimiz
_add_configs += [ "//build/config/compiler:no_optimize" ]
}
@@ -33,11 +33,12 @@ Compile files which declare functions in inline assembly without LTO due to http
+ }
+}
+
component("partition_alloc") {
public_deps = [
":allocator_base",
@@ -262,24 +278,9 @@
}
component("raw_ptr") {
# `gn check` is unhappy with most `#includes` when PA isn't
# actually built.
@@ -497,25 +524,10 @@ if (is_clang_or_gcc) {
# The Android NDK supports PR_MTE_* macros as of NDK r23.
defines += [ "HAS_PR_MTE_MACROS" ]
}
+ deps = [ ":allocator_base" ]
if (use_starscan) {
@@ -64,7 +65,7 @@ Compile files which declare functions in inline assembly without LTO due to http
}
}
if (use_freelist_pool_offsets) {
@@ -289,7 +295,6 @@
@@ -536,7 +548,6 @@ if (is_clang_or_gcc) {
":memory_tagging",
"//build/config/compiler:wexit_time_destructors",
]

View File

@@ -1,107 +0,0 @@
From fd3b346e27ac350d025227899a5ab390f04bbec8 Mon Sep 17 00:00:00 2001
From: Tommi <tommi@webrtc.org>
Date: Fri, 27 Oct 2023 22:38:33 +0200
Subject: [PATCH] Allow absl::Nonnull and absl::Nullable.
This CL includes follow-up changes from
https://webrtc-review.googlesource.com/c/src/+/324280
Bug: none
Change-Id: I6abad16e05cac7197c51ffa7b1d3fb991843df6e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/325243
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41030}
---
DEPS | 1 +
api/task_queue/BUILD.gn | 5 ++++-
api/task_queue/pending_task_safety_flag.cc | 3 ++-
api/task_queue/pending_task_safety_flag.h | 6 ++++--
g3doc/abseil-in-webrtc.md | 1 +
5 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/DEPS b/DEPS
index a98e19d5e1..4575918d23 100644
--- a/third_party/webrtc/DEPS
+++ b/third_party/webrtc/DEPS
@@ -2602,6 +2602,7 @@ include_rules = [
"+absl/base/attributes.h",
"+absl/base/config.h",
"+absl/base/const_init.h",
+ "+absl/base/nullability.h",
"+absl/base/macros.h",
"+absl/cleanup/cleanup.h",
"+absl/container/inlined_vector.h",
diff --git a/api/task_queue/BUILD.gn b/api/task_queue/BUILD.gn
index 527fac414b..e0e2e50514 100644
--- a/third_party/webrtc/api/task_queue/BUILD.gn
+++ b/third_party/webrtc/api/task_queue/BUILD.gn
@@ -132,7 +132,10 @@ rtc_library("pending_task_safety_flag") {
"../../rtc_base/system:no_unique_address",
"../../rtc_base/system:rtc_export",
]
- absl_deps = [ "//third_party/abseil-cpp/absl/functional:any_invocable" ]
+ absl_deps = [
+ "//third_party/abseil-cpp/absl/base:nullability",
+ "//third_party/abseil-cpp/absl/functional:any_invocable",
+ ]
}
if (rtc_include_tests) {
diff --git a/api/task_queue/pending_task_safety_flag.cc b/api/task_queue/pending_task_safety_flag.cc
index 3145550829..4d8fc2b9f4 100644
--- a/third_party/webrtc/api/task_queue/pending_task_safety_flag.cc
+++ b/third_party/webrtc/api/task_queue/pending_task_safety_flag.cc
@@ -37,7 +37,8 @@ PendingTaskSafetyFlag::CreateDetached() {
rtc::scoped_refptr<PendingTaskSafetyFlag>
PendingTaskSafetyFlag::CreateAttachedToTaskQueue(
bool alive,
- TaskQueueBase* attached_queue) {
+ absl::Nonnull<TaskQueueBase*> attached_queue) {
+ RTC_DCHECK(attached_queue) << "Null TaskQueue provided";
return rtc::scoped_refptr<PendingTaskSafetyFlag>(
new PendingTaskSafetyFlag(alive, attached_queue));
}
diff --git a/api/task_queue/pending_task_safety_flag.h b/api/task_queue/pending_task_safety_flag.h
index b601b94215..12b1e00ee4 100644
--- a/third_party/webrtc/api/task_queue/pending_task_safety_flag.h
+++ b/third_party/webrtc/api/task_queue/pending_task_safety_flag.h
@@ -13,6 +13,7 @@
#include <utility>
+#include "absl/base/nullability.h"
#include "absl/functional/any_invocable.h"
#include "api/ref_counted_base.h"
#include "api/scoped_refptr.h"
@@ -72,7 +73,7 @@ class RTC_EXPORT PendingTaskSafetyFlag final
// a given task queue and the `alive()` flag specified.
static rtc::scoped_refptr<PendingTaskSafetyFlag> CreateAttachedToTaskQueue(
bool alive,
- TaskQueueBase* attached_queue);
+ absl::Nonnull<TaskQueueBase*> attached_queue);
// Same as `CreateDetached()` except the initial state of the returned flag
// will be `!alive()`.
@@ -101,7 +102,8 @@ class RTC_EXPORT PendingTaskSafetyFlag final
protected:
explicit PendingTaskSafetyFlag(bool alive) : alive_(alive) {}
- PendingTaskSafetyFlag(bool alive, TaskQueueBase* attached_queue)
+ PendingTaskSafetyFlag(bool alive,
+ absl::Nonnull<TaskQueueBase*> attached_queue)
: alive_(alive), main_sequence_(attached_queue) {}
private:
diff --git a/g3doc/abseil-in-webrtc.md b/g3doc/abseil-in-webrtc.md
index 32fc42d953..034f6c2fb4 100644
--- a/third_party/webrtc/g3doc/abseil-in-webrtc.md
+++ b/third_party/webrtc/g3doc/abseil-in-webrtc.md
@@ -29,6 +29,7 @@ will generate a shared library.
* `absl::bind_front`
* `absl::Cleanup`
* `absl::InlinedVector`
+* `absl::Nonnull` and `absl::Nullable`
* `absl::WrapUnique`
* `absl::optional` and related stuff from `absl/types/optional.h`.
* `absl::string_view`

View File

@@ -1,12 +1,12 @@
Fix inconsistent type alias use
On linux ix86, `double_t` evaluates to `long double`. This contradicts the `double` expected below.
--- src/third_party/perfetto/src/trace_processor/db/storage/numeric_storage.cc.old 2023-10-13 11:25:09.719946900 +0200
+++ src/third_party/perfetto/src/trace_processor/db/storage/numeric_storage.cc 2023-10-14 23:54:10.728423000 +0200
@@ -29,7 +29,7 @@ namespace storage {
--- src/third_party/perfetto/src/trace_processor/db/column/numeric_storage.cc.old 2023-10-13 11:25:09.719946900 +0200
+++ src/third_party/perfetto/src/trace_processor/db/column/numeric_storage.cc 2023-10-14 23:54:10.728423000 +0200
@@ -39,7 +39,7 @@ namespace trace_processor {
namespace column {
namespace {
// All viable numeric values for ColumnTypes.
-using NumericValue = std::variant<uint32_t, int32_t, int64_t, double_t>;
+using NumericValue = std::variant<uint32_t, int32_t, int64_t, double>;

View File

@@ -0,0 +1,31 @@
From 8d253767f895b45053c39ea99a8f02bbe7071d3a Mon Sep 17 00:00:00 2001
From: Jose Dapena Paz <jdapena@igalia.com>
Date: Mon, 19 Feb 2024 19:00:26 +0000
Subject: [PATCH] IWYU: usage of std::optional in plus_address_types.h requires
include
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Bug: 41455655
Change-Id: Ibfda146f5bf7485ad31828f1dc22eb39b57f83b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5306779
Reviewed-by: Jan Keitel <jkeitel@google.com>
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1262436}
---
components/plus_addresses/plus_address_types.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/components/plus_addresses/plus_address_types.h b/components/plus_addresses/plus_address_types.h
index 7a7eaa2a818a9..77569d345011a 100644
--- a/components/plus_addresses/plus_address_types.h
+++ b/components/plus_addresses/plus_address_types.h
@@ -5,6 +5,7 @@
#ifndef COMPONENTS_PLUS_ADDRESSES_PLUS_ADDRESS_TYPES_H_
#define COMPONENTS_PLUS_ADDRESSES_PLUS_ADDRESS_TYPES_H_
+#include <optional>
#include <string>
#include <unordered_map>

View File

@@ -1,11 +0,0 @@
--- src/components/policy/resources/policy_templates.py.old 2023-11-09 20:20:20.842699700 +0000
+++ src/components/policy/resources/policy_templates.py 2023-11-10 19:29:35.698934300 +0000
@@ -35,7 +35,7 @@ def _SafeListDir(directory):
# On macOS, Finder.app creates .DS_Store files when a user visit a
# directory causing failure of the script laters on because there
# are no such group as .DS_Store. Skip the file to prevent the error.
- return filter(lambda name:(name != '.DS_Store'),os.listdir(directory))
+ return filter(lambda name:(name != '.DS_Store'),sorted(os.listdir(directory)))
TEMPLATES_PATH = os.path.join(
os.path.dirname(__file__), 'templates')

View File

@@ -0,0 +1,32 @@
From 5b2d53797e5580cbfea00d732fe25a97c7048b5b Mon Sep 17 00:00:00 2001
From: Jose Dapena Paz <jdapena@igalia.com>
Date: Wed, 24 Jan 2024 06:46:33 +0000
Subject: [PATCH] IWYU: missing include for std::optional usage in
race_network_request_write_buffer_manager.h
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Bug: 957519
Change-Id: Id3a6c3cc3c1273208bde43b70a2bd298695f7cc4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5223947
Reviewed-by: Shunya Shishido <sisidovski@chromium.org>
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1251264}
---
.../service_worker/race_network_request_write_buffer_manager.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/content/common/service_worker/race_network_request_write_buffer_manager.h b/content/common/service_worker/race_network_request_write_buffer_manager.h
index 0e7f17417dbd9..ad9ea1348a977 100644
--- a/content/common/service_worker/race_network_request_write_buffer_manager.h
+++ b/content/common/service_worker/race_network_request_write_buffer_manager.h
@@ -5,6 +5,8 @@
#ifndef CONTENT_COMMON_SERVICE_WORKER_RACE_NETWORK_REQUEST_WRITE_BUFFER_MANAGER_H_
#define CONTENT_COMMON_SERVICE_WORKER_RACE_NETWORK_REQUEST_WRITE_BUFFER_MANAGER_H_
+#include <optional>
+
#include "base/containers/span.h"
#include "content/common/content_export.h"
#include "mojo/public/cpp/system/data_pipe.h"

81
remove-dawn.patch Normal file
View File

@@ -0,0 +1,81 @@
Remove this unused component which brings a huge dependency on //third_party/dawn/native which we don't want to build
--- src/content/utility/BUILD.gn.orig
+++ src/content/utility/BUILD.gn
@@ -64,9 +64,6 @@ source_set("utility") {
"//services/data_decoder:lib",
"//services/data_decoder/public/cpp",
"//services/network:network_service",
- "//services/on_device_model:on_device_model_service",
- "//services/on_device_model/public/cpp",
- "//services/on_device_model/public/mojom",
"//services/service_manager/public/cpp",
"//services/service_manager/public/mojom",
"//services/shape_detection:lib",
--- src/content/utility/services.cc.orig
+++ src/content/utility/services.cc
@@ -31,7 +31,6 @@
#include "services/audio/service_factory.h"
#include "services/data_decoder/data_decoder_service.h"
#include "services/network/network_service.h"
-#include "services/on_device_model/on_device_model_service.h"
#include "services/tracing/public/mojom/tracing_service.mojom.h"
#include "services/tracing/tracing_service.h"
#include "services/video_capture/public/mojom/video_capture_service.mojom.h"
@@ -327,13 +326,6 @@ auto RunVideoCapture(
return service;
}
-auto RunOnDeviceModel(
- mojo::PendingReceiver<on_device_model::mojom::OnDeviceModelService>
- receiver) {
- return std::make_unique<on_device_model::OnDeviceModelService>(
- std::move(receiver));
-}
-
#if BUILDFLAG(ENABLE_VR) && !BUILDFLAG(IS_ANDROID)
auto RunXrDeviceService(
mojo::PendingReceiver<device::mojom::XRDeviceService> receiver) {
@@ -408,9 +400,6 @@ void RegisterMainThreadServices(mojo::Se
services.Add(RunTracing);
services.Add(RunVideoCapture);
- if (optimization_guide::features::CanLaunchOnDeviceModelService()) {
- services.Add(RunOnDeviceModel);
- }
#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && BUILDFLAG(IS_CHROMEOS)
services.Add(RunShapeDetectionService);
--- src/content/utility/utility_main.cc.old 2024-04-02 09:53:16.050958400 +0000
+++ src/content/utility/utility_main.cc 2024-04-07 17:41:04.823696600 +0000
@@ -32,7 +32,6 @@
#include "sandbox/policy/mojom/sandbox.mojom.h"
#include "sandbox/policy/sandbox.h"
#include "sandbox/policy/sandbox_type.h"
-#include "services/on_device_model/on_device_model_service.h"
#include "services/tracing/public/cpp/trace_startup.h"
#include "third_party/icu/source/common/unicode/unistr.h"
#include "third_party/icu/source/i18n/unicode/timezone.h"
@@ -202,10 +201,6 @@ int UtilityMain(MainFunctionParams param
? base::MessagePumpType::UI
: base::MessagePumpType::DEFAULT;
- if (parameters.command_line->GetSwitchValueASCII(switches::kUtilitySubType) ==
- on_device_model::mojom::OnDeviceModelService::Name_) {
- CHECK(on_device_model::OnDeviceModelService::PreSandboxInit());
- }
#if BUILDFLAG(IS_MAC)
auto sandbox_type =
@@ -283,11 +278,6 @@ int UtilityMain(MainFunctionParams param
case sandbox::mojom::Sandbox::kAudio:
pre_sandbox_hook = base::BindOnce(&audio::AudioPreSandboxHook);
break;
- case sandbox::mojom::Sandbox::kOnDeviceModelExecution:
- on_device_model::OnDeviceModelService::AddSandboxLinuxOptions(
- sandbox_options);
- pre_sandbox_hook = base::BindOnce(&GpuPreSandboxHook);
- break;
case sandbox::mojom::Sandbox::kSpeechRecognition:
pre_sandbox_hook =
base::BindOnce(&speech::SpeechRecognitionPreSandboxHook);

10
remove-openscreen.patch Normal file
View File

@@ -0,0 +1,10 @@
--- src/chrome/common/BUILD.gn.old
+++ src/chrome/common/BUILD.gn
@@ -350,7 +350,6 @@ static_library("common_lib") {
"//extensions/common:core_api_provider",
"//extensions/common/api",
"//extensions/strings",
- "//media/cast:net",
"//services/device/public/cpp/usb",
]
}

View File

@@ -0,0 +1,282 @@
From 54ec71011a6ebb873590802a70b2bc07578ba201 Mon Sep 17 00:00:00 2001
From: Szabolcs David <davidsz@inf.u-szeged.hu>
Date: Mon, 10 Oct 2022 17:20:43 +0200
Subject: Make user agent helpers buildable without unwanted dependencies
"//components/policy" is enormously large with its resource files and
we don't want to build it for only one preference name.
User agent utils are required to fill
navigator.userAgentData members in JavaScript.
Task-number: QTBUG-107260
Task-number: QTBUG-107451
Change-Id: I752df68a8095ddb3f598a71f0419c1a2c9c408bb
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
chromium/components/embedder_support/user_agent_utils.cc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/chromium/components/embedder_support/user_agent_utils.cc b/chromium/components/embedder_support/user_agent_utils.cc
index c957a691efc..408fb837d80 100644
--- a/components/embedder_support/user_agent_utils.cc
+++ b/components/embedder_support/user_agent_utils.cc
@@ -446,12 +446,14 @@ blink::UserAgentMetadata GetUserAgentMetadata(const PrefService* pref_service,
blink::UserAgentMetadata metadata;
bool enable_updated_grease_by_policy = true;
+#if 0
if (pref_service) {
if (pref_service->HasPrefPath(
policy::policy_prefs::kUserAgentClientHintsGREASEUpdateEnabled))
enable_updated_grease_by_policy = pref_service->GetBoolean(
policy::policy_prefs::kUserAgentClientHintsGREASEUpdateEnabled);
}
+#endif
// Low entropy client hints.
metadata.brand_version_list =
--
cgit v1.2.3
…and now come Electron—specific changes to support the above:
--- src/components/browsing_data/core/BUILD.gn.old
+++ src/components/browsing_data/core/BUILD.gn
@@ -36,9 +36,7 @@ static_library("core") {
deps = [
"//base",
"//components/autofill/core/browser",
- "//components/bookmarks/browser",
"//components/history/core/browser",
- "//components/password_manager/core/browser",
"//components/pref_registry",
"//components/prefs",
"//components/strings",
--- src/components/sync/BUILD.gn.old
+++ src/components/sync/BUILD.gn
@@ -11,7 +11,6 @@ group("sync") {
"//components/sync/engine",
"//components/sync/model",
"//components/sync/nigori",
- "//components/sync/service",
]
if (is_chromeos) {
public_deps += [ "//components/sync/chromeos" ]
--- src/components/permissions/prediction_service/BUILD.gn.old
+++ src/components/permissions/prediction_service/BUILD.gn
@@ -31,8 +31,6 @@ source_set("prediction_service") {
]
public_deps = [
":prediction_service_messages_proto",
- "//components/optimization_guide/core",
- "//components/optimization_guide/proto:optimization_guide_proto",
]
if (build_with_tflite_lib) {
--- src/components/embedder_support/BUILD.gn.old
+++ src/components/embedder_support/BUILD.gn
@@ -24,11 +24,8 @@ static_library("browser_util") {
deps = [
":embedder_support",
"//build:branding_buildflags",
- "//components/background_sync",
- "//components/content_settings/browser",
"//components/content_settings/core/browser",
"//components/permissions",
- "//components/policy/core/common",
"//components/prefs",
"//components/version_info",
"//content/public/browser",
--- src/components/permissions/BUILD.gn.old
+++ src/components/permissions/BUILD.gn
@@ -109,8 +109,6 @@ source_set("permissions") {
deps = [
"//base",
"//build:chromeos_buildflags",
- "//components/back_forward_cache",
- "//components/content_settings/browser",
"//components/content_settings/core/browser",
"//components/favicon/core:core",
"//components/keyed_service/content",
--- src/components/proxy_config/BUILD.gn.old
+++ src/components/proxy_config/BUILD.gn
@@ -23,9 +23,6 @@ component("proxy_config") {
deps = [
"//base",
- "//components/policy:generated",
- "//components/policy/core/browser",
- "//components/policy/core/common",
"//components/prefs",
"//components/strings",
"//net",
@@ -42,7 +39,7 @@ component("proxy_config") {
deps += [ "//components/pref_registry" ]
}
- if (!is_ios) {
+ if (false) {
sources += [
"proxy_policy_handler.cc",
"proxy_policy_handler.h",
--- src/components/content_settings/core/browser/BUILD.gn.old
+++ src/components/content_settings/core/browser/BUILD.gn
@@ -70,7 +70,7 @@ static_library("browser") {
"//url",
]
- if (!is_ios) {
+ if (false) {
sources += [
"cookie_settings_policy_handler.cc",
"cookie_settings_policy_handler.h",
@@ -82,8 +82,6 @@ static_library("browser") {
if (use_blink) {
deps += [
"//components/permissions:permissions_common",
- "//components/policy:generated",
- "//components/policy/core/browser",
"//components/privacy_sandbox:privacy_sandbox_prefs",
]
}
--- src/electron/chromium_src/BUILD.gn.orig
+++ src/electron/chromium_src/BUILD.gn
@@ -466,7 +466,7 @@ source_set("chrome_spellchecker") {
"//chrome/browser/spellchecker/spellcheck_service.h",
]
- if (!is_mac) {
+ if (false) {
sources += [
"//chrome/browser/spellchecker/spellcheck_language_blocklist_policy_handler.cc",
"//chrome/browser/spellchecker/spellcheck_language_blocklist_policy_handler.h",
--- src/chrome/common/BUILD.gn.old
+++ src/chrome/common/BUILD.gn
@@ -210,14 +210,11 @@ static_library("common_lib") {
"//components/nacl/common:switches",
"//components/net_log",
"//components/network_session_configurator/common",
- "//components/ntp_tiles",
"//components/offline_pages/buildflags",
"//components/offline_pages/core:switches",
"//components/omnibox/common",
"//components/page_load_metrics/common:page_load_metrics_mojom",
"//components/password_manager/core/common",
- "//components/policy:generated",
- "//components/policy/core/common",
"//components/prefs",
"//components/safe_browsing:buildflags",
"//components/safe_search_api",
@@ -606,8 +603,6 @@ static_library("url_constants") {
"//components/lens:buildflags",
"//components/nacl/common:buildflags",
"//components/optimization_guide/optimization_guide_internals/webui:url_constants",
- "//components/password_manager/content/common",
- "//components/safe_browsing/core/common",
"//device/vr/buildflags",
]
}
--- src/components/search_engines/BUILD.gn.old
+++ src/components/search_engines/BUILD.gn
@@ -15,47 +15,25 @@ static_library("search_engines") {
"choice_made_location.h",
"default_search_manager.cc",
"default_search_manager.h",
- "default_search_policy_handler.cc",
- "default_search_policy_handler.h",
"eea_countries_ids.h",
"enterprise_site_search_manager.cc",
"enterprise_site_search_manager.h",
- "keyword_table.cc",
- "keyword_table.h",
"keyword_web_data_service.cc",
"keyword_web_data_service.h",
- "search_engine_choice/search_engine_choice_service.cc",
- "search_engine_choice/search_engine_choice_service.h",
- "search_engine_choice_utils.cc",
- "search_engine_choice_utils.h",
"search_engines_pref_names.h",
"search_engines_switches.cc",
"search_engines_switches.h",
- "search_host_to_urls_map.cc",
- "search_host_to_urls_map.h",
"search_terms_data.cc",
"search_terms_data.h",
- "template_url.cc",
- "template_url.h",
"template_url_data.cc",
"template_url_data.h",
"template_url_data_util.cc",
"template_url_data_util.h",
- "template_url_fetcher.cc",
- "template_url_fetcher.h",
"template_url_id.h",
- "template_url_parser.cc",
- "template_url_parser.h",
- "template_url_prepopulate_data.cc",
- "template_url_prepopulate_data.h",
- "template_url_service.cc",
- "template_url_service.h",
"template_url_service_client.h",
"template_url_service_observer.h",
"template_url_starter_pack_data.cc",
"template_url_starter_pack_data.h",
- "util.cc",
- "util.h",
]
public_deps = [
@@ -69,20 +47,14 @@ static_library("search_engines") {
"//components/sync",
"//components/webdata/common",
"//third_party/metrics_proto",
- "//third_party/omnibox_proto",
]
deps = [
"//base:i18n",
"//components/country_codes",
"//components/database_utils",
- "//components/infobars/core",
- "//components/lens:lens",
"//components/omnibox/common",
- "//components/policy:generated",
- "//components/policy/core/browser",
"//components/pref_registry",
- "//components/search_provider_logos:switches",
"//components/signin/public/base",
"//components/strings",
"//components/url_formatter",
@@ -94,7 +66,6 @@ static_library("search_engines") {
"//services/network/public/mojom",
"//sql",
"//third_party/metrics_proto",
- "//third_party/omnibox_proto",
"//ui/base",
"//ui/gfx",
"//ui/gfx/geometry",
@@ -120,7 +91,7 @@ static_library("search_engines") {
]
}
- if (is_linux || is_win || is_mac || is_chromeos_ash) {
+ if (false) {
sources += [
"site_search_policy_handler.cc",
"site_search_policy_handler.h",
--- src/components/search/BUILD.gn.old
+++ src/components/search/BUILD.gn
@@ -6,10 +6,6 @@ static_library("search") {
sources = [
"ntp_features.cc",
"ntp_features.h",
- "search.cc",
- "search.h",
- "search_provider_observer.cc",
- "search_provider_observer.h",
]
deps = [

31
remove-puffin.patch Normal file
View File

@@ -0,0 +1,31 @@
--- src/content/utility/speech/BUILD.gn.orig
+++ src/content/utility/speech/BUILD.gn
@@ -10,7 +10,6 @@ source_set("speech_recognition_sandbox_h
deps = [
"//base",
- "//components/component_updater:component_updater",
"//components/soda:buildflags",
"//components/soda:constants",
"//sandbox/linux:sandbox_services",
--- src/chrome/common/BUILD.gn.old
+++ src/chrome/common/BUILD.gn
@@ -193,7 +193,6 @@ static_library("common_lib") {
"//chrome/installer/util:with_no_strings",
"//components/client_hints/common",
"//components/cloud_devices/common",
- "//components/component_updater",
"//components/content_settings/core/common",
"//components/crash/core/common",
"//components/device_signals/core/common:features",
--- src/components/services/screen_ai/BUILD.gn.old
+++ src/components/services/screen_ai/BUILD.gn
@@ -41,8 +41,6 @@ if (is_linux || is_chromeos) {
deps = [
"//base",
- "//components/component_updater",
- "//components/services/screen_ai/public/cpp:utilities",
"//sandbox/linux:sandbox_services",
"//ui/accessibility:ax_base",
]

52
remove-rust.patch Normal file
View File

@@ -0,0 +1,52 @@
Remove this dead code which brings a dependency on rustc
--- src/components/BUILD.gn.orig 2024-03-27 16:30:09.189645288 +0100
+++ src/components/BUILD.gn 2024-03-28 23:11:14.847582213 +0100
@@ -282,7 +282,6 @@ test("components_unittests") {
"//components/profile_metrics:unit_tests",
"//components/proxy_config:unit_tests",
"//components/push_notification:unit_tests",
- "//components/qr_code_generator:unit_tests",
"//components/query_parser:unit_tests",
"//components/reading_list/core:unit_tests",
"//components/reporting/client:unit_tests",
--- src/chrome/test/BUILD.gn.orig 2024-03-27 16:37:20.829583999 +0100
+++ src/chrome/test/BUILD.gn 2024-03-28 23:15:36.696977127 +0100
@@ -1765,8 +1765,6 @@ if (!is_android && !is_fuchsia) {
"//chrome/common/privacy_budget:test_support",
"//chrome/renderer",
"//chrome/renderer/companion/visual_query:browser_tests",
- "//chrome/services/qrcode_generator/public/cpp",
- "//chrome/services/qrcode_generator/public/mojom",
"//chrome/services/removable_storage_writer:lib",
"//chrome/test/data/webui:resources_grit",
"//chrome/test/data/webui/mojo:mojo_bindings",
@@ -6818,7 +6816,6 @@ if (!is_fuchsia) {
"//chrome/common/themes:unit_tests",
"//chrome/renderer/companion/visual_query:unit_tests",
"//chrome/services/file_util:unit_tests",
- "//chrome/services/qrcode_generator/public/cpp",
"//components/account_id",
"//components/assist_ranker/proto",
"//components/autofill/content/browser:test_support",
--- src/chrome/services/qrcode_generator/BUILD.gn.orig 2024-03-27 16:30:07.952978653 +0100
+++ src/chrome/services/qrcode_generator/BUILD.gn 2024-03-28 23:20:47.829864401 +0100
@@ -15,8 +15,6 @@ source_set("qrcode_generator") {
deps = [
"//base",
"//chrome:strings",
- "//components/qr_code_generator",
- "//components/qr_code_generator:qr_code_generator_features",
"//components/vector_icons",
"//mojo/public/cpp/bindings",
"//net",
--- src/chrome/services/qrcode_generator/public/cpp/BUILD.gn.orig 2024-03-27 16:30:07.952978653 +0100
+++ src/chrome/services/qrcode_generator/public/cpp/BUILD.gn 2024-03-28 23:22:28.019734555 +0100
@@ -15,7 +15,6 @@ source_set("cpp") {
"//chrome:strings",
"//chrome/services/qrcode_generator",
"//chrome/services/qrcode_generator/public/mojom",
- "//components/qr_code_generator:qr_code_generator_features",
"//content/public/browser",
"//skia",
]

View File

@@ -1,965 +0,0 @@
From 8357e4cbfdf74e12426417b65df775760ee4a03b Mon Sep 17 00:00:00 2001
From: David Benjamin <davidben@chromium.org>
Date: Thu, 31 Aug 2023 20:20:34 +0000
Subject: [PATCH] Replace re2::StringPiece with std::string_view
They're the same type nowadays. I've replaced all uses except
//third_party/maldoca as that seems to be a standalone library.
Bug: 1447090
Change-Id: Ib6974182145f3538021b868a2f06d80b07d9ed72
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4826026
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Kelvin Jiang <kelvinjiang@chromium.org>
Owners-Override: Nico Weber <thakis@chromium.org>
Reviewed-by: Dominic Battre <battre@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Commit-Queue: David Benjamin <davidben@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1190948}
---
.../ash/arc/policy/arc_policy_handler.cc | 5 +-
.../policy/managed_configuration_variables.cc | 14 +--
chrome/browser/ash/hats/hats_dialog.cc | 4 +-
.../alternative_browser_driver_posix.cc | 4 +-
.../metrics/perf/perf_events_collector.cc | 2 +-
.../metrics/perf/perf_events_collector.h | 4 +-
.../metrics/perf/process_type_collector.cc | 14 +--
.../metrics/perf/process_type_collector.h | 6 +-
.../ash/network_health_data_collector.cc | 18 ++--
.../ash/ui_hierarchy_data_collector.cc | 8 +-
chrome/updater/test/request_matcher.cc | 6 +-
.../content/renderer/form_autofill_util.cc | 3 +-
.../autofill_structured_address_utils.cc | 3 +-
.../core/local_desk_data_manager.cc | 3 -
.../dom_distiller/core/page_features.cc | 3 +-
.../feedback/redaction_tool/redaction_tool.cc | 89 ++++++++++---------
.../core/dependency_graph_unittest.cc | 12 +--
.../omnibox/browser/document_provider.cc | 5 +-
.../regex_rules_matcher.cc | 8 +-
.../api/web_request/form_data_parser.cc | 18 ++--
gpu/command_buffer/service/program_manager.cc | 3 +-
.../viewer/caspian/caspian_web.cc | 3 +-
22 files changed, 120 insertions(+), 115 deletions(-)
diff --git a/chrome/browser/ash/arc/policy/arc_policy_handler.cc b/chrome/browser/ash/arc/policy/arc_policy_handler.cc
index d66287f893815a8..db5ac7337b7325c 100644
--- a/chrome/browser/ash/arc/policy/arc_policy_handler.cc
+++ b/chrome/browser/ash/arc/policy/arc_policy_handler.cc
@@ -3,7 +3,9 @@
// found in the LICENSE file.
#include "chrome/browser/ash/arc/policy/arc_policy_handler.h"
+
#include <string>
+#include <string_view>
#include "base/check.h"
#include "base/json/json_reader.h"
@@ -19,7 +21,6 @@
#include "components/strings/grit/components_strings.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "third_party/re2/src/re2/re2.h"
-#include "third_party/re2/src/re2/stringpiece.h"
namespace arc {
@@ -39,7 +40,7 @@ absl::optional<base::StringPiece> FindUnknownVariable(
const re2::RE2 regex(unknown_variable_capture);
DCHECK(regex.ok()) << "Error compiling regex: " << regex.error();
- re2::StringPiece capture;
+ std::string_view capture;
const bool found_unknown_variable =
re2::RE2::PartialMatch(input, regex, &capture) &&
capture.data() != nullptr;
diff --git a/chrome/browser/ash/arc/policy/managed_configuration_variables.cc b/chrome/browser/ash/arc/policy/managed_configuration_variables.cc
index c9b924f1e202798..51496f149028475 100644
--- a/chrome/browser/ash/arc/policy/managed_configuration_variables.cc
+++ b/chrome/browser/ash/arc/policy/managed_configuration_variables.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/ash/arc/policy/managed_configuration_variables.h"
#include <string>
+#include <string_view>
#include <vector>
#include "base/check.h"
@@ -27,7 +28,6 @@
#include "components/signin/public/identity_manager/identity_manager.h"
#include "components/user_manager/user.h"
#include "third_party/re2/src/re2/re2.h"
-#include "third_party/re2/src/re2/stringpiece.h"
namespace arc {
@@ -172,11 +172,11 @@ std::vector<base::StringPiece> SplitByColon(base::StringPiece input) {
// replaced with the output of |replacement_getter.Run(capture)|.
std::string SearchAndReplace(
const re2::RE2& regex,
- base::RepeatingCallback<std::string(const re2::StringPiece&)>
+ base::RepeatingCallback<std::string(const std::string_view&)>
replacement_getter,
- re2::StringPiece search_input) {
+ std::string_view search_input) {
std::vector<std::string> output;
- re2::StringPiece capture;
+ std::string_view capture;
// Loop as long as |regex| matches |search_input|.
while (re2::RE2::PartialMatch(search_input, regex, &capture)) {
@@ -192,7 +192,7 @@ std::string SearchAndReplace(
DCHECK(search_input.length() >= prefix_size + capture.length());
size_t remaining_size =
search_input.length() - (prefix_size + capture.length());
- search_input = re2::StringPiece(capture.end(), remaining_size);
+ search_input = std::string_view(capture.end(), remaining_size);
}
// Output the remaining |search_input|.
output.emplace_back(search_input);
@@ -230,10 +230,10 @@ void ReplaceVariables(const VariableResolver& resolver,
// Callback to compute values of variable chains matched with |regex|.
auto chain_resolver = base::BindRepeating(
- [](const VariableResolver& resolver, const re2::StringPiece& variable) {
+ [](const VariableResolver& resolver, const std::string_view& variable) {
// Remove the "${" prefix and the "}" suffix from |variable|.
DCHECK(variable.starts_with("${") && variable.ends_with("}"));
- const re2::StringPiece chain = variable.substr(2, variable.size() - 3);
+ const std::string_view chain = variable.substr(2, variable.size() - 3);
const std::vector<base::StringPiece> variables = SplitByColon(chain);
const std::string chain_value =
diff --git a/chrome/browser/ash/hats/hats_dialog.cc b/chrome/browser/ash/hats/hats_dialog.cc
index 6a90316a3061fca..fd941fb6e87b87d 100644
--- a/chrome/browser/ash/hats/hats_dialog.cc
+++ b/chrome/browser/ash/hats/hats_dialog.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/ash/hats/hats_dialog.h"
+#include <string_view>
+
#include "ash/constants/ash_features.h"
#include "base/containers/flat_map.h"
#include "base/functional/bind.h"
@@ -77,7 +79,7 @@ bool HatsDialog::ParseAnswer(const std::string& input,
int* question,
std::vector<int>* scores) {
std::string question_num_string;
- re2::StringPiece all_scores_string;
+ std::string_view all_scores_string;
if (!RE2::FullMatch(input, kClientQuestionAnsweredRegex, &question_num_string,
&all_scores_string))
return false;
diff --git a/chrome/browser/browser_switcher/alternative_browser_driver_posix.cc b/chrome/browser/browser_switcher/alternative_browser_driver_posix.cc
index 272b933bab96255..bab699bb794ede5 100644
--- a/chrome/browser/browser_switcher/alternative_browser_driver_posix.cc
+++ b/chrome/browser/browser_switcher/alternative_browser_driver_posix.cc
@@ -6,6 +6,8 @@
#include <stdlib.h>
+#include <string_view>
+
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/process/launch.h"
@@ -89,7 +91,7 @@ void ExpandEnvironmentVariables(std::string* arg) {
static re2::LazyRE2 re = {
"\\$\\{([a-zA-Z_][a-zA-Z_0-9]*)\\}|\\$([a-zA-Z_][a-zA-Z_0-9]*)"};
std::string out;
- re2::StringPiece submatch[3] = {};
+ std::string_view submatch[3] = {};
size_t start = 0;
bool matched = false;
while (re->Match(*arg, start, arg->size(), re2::RE2::Anchor::UNANCHORED,
diff --git a/chrome/browser/metrics/perf/perf_events_collector.cc b/chrome/browser/metrics/perf/perf_events_collector.cc
index 1d87ac4ffec692d..e76a36003e1bc38 100644
--- a/chrome/browser/metrics/perf/perf_events_collector.cc
+++ b/chrome/browser/metrics/perf/perf_events_collector.cc
@@ -814,7 +814,7 @@ void PerfCollector::SaveCPUFrequencies(
// static.
bool PerfCollector::LacrosChannelAndVersion(
- re2::StringPiece lacros_path,
+ std::string_view lacros_path,
metrics::SystemProfileProto_Channel& lacros_channel,
std::string& lacros_version) {
std::string channel;
diff --git a/chrome/browser/metrics/perf/perf_events_collector.h b/chrome/browser/metrics/perf/perf_events_collector.h
index 8c2ebf997b8f15d..d9f3ee5b2b9ec48 100644
--- a/chrome/browser/metrics/perf/perf_events_collector.h
+++ b/chrome/browser/metrics/perf/perf_events_collector.h
@@ -8,6 +8,7 @@
#include <map>
#include <memory>
#include <string>
+#include <string_view>
#include <vector>
#include "base/feature_list.h"
@@ -17,7 +18,6 @@
#include "chrome/browser/metrics/perf/random_selector.h"
#include "third_party/metrics_proto/sampled_profile.pb.h"
#include "third_party/metrics_proto/system_profile.pb.h"
-#include "third_party/re2/src/re2/stringpiece.h"
namespace ash {
class DebugDaemonClientProvider;
@@ -114,7 +114,7 @@ class PerfCollector : public internal::MetricCollector {
// Extracts the |lacros_channel| and |lacros_version| from |lacros_path|.
static bool LacrosChannelAndVersion(
- re2::StringPiece lacros_path,
+ std::string_view lacros_path,
metrics::SystemProfileProto_Channel& lacros_channel,
std::string& lacros_version);
diff --git a/chrome/browser/metrics/perf/process_type_collector.cc b/chrome/browser/metrics/perf/process_type_collector.cc
index 96fa7ffe6c52568..9765db5fd17493d 100644
--- a/chrome/browser/metrics/perf/process_type_collector.cc
+++ b/chrome/browser/metrics/perf/process_type_collector.cc
@@ -19,7 +19,7 @@ namespace {
// reporting collection of types.
const char kUmaHistogramName[] = "ChromeOS.CWP.CollectProcessTypes";
-void SkipLine(re2::StringPiece* contents) {
+void SkipLine(std::string_view* contents) {
static const LazyRE2 kSkipLine = {R"(.+\n?)"};
RE2::Consume(contents, *kSkipLine);
}
@@ -60,7 +60,7 @@ std::map<uint32_t, Thread> ProcessTypeCollector::ChromeThreadTypes() {
}
std::map<uint32_t, Process> ProcessTypeCollector::ParseProcessTypes(
- re2::StringPiece contents,
+ std::string_view contents,
std::vector<uint32_t>& lacros_pids,
std::string& lacros_path) {
static const LazyRE2 kLineMatcher = {
@@ -81,7 +81,7 @@ std::map<uint32_t, Process> ProcessTypeCollector::ParseProcessTypes(
bool is_truncated = false;
while (!contents.empty()) {
uint32_t pid = 0;
- re2::StringPiece cmd_line;
+ std::string_view cmd_line;
if (!RE2::Consume(&contents, *kLineMatcher, &pid, &cmd_line)) {
SkipLine(&contents);
is_truncated = true;
@@ -93,13 +93,13 @@ std::map<uint32_t, Process> ProcessTypeCollector::ParseProcessTypes(
continue;
}
- re2::StringPiece cmd;
+ std::string_view cmd;
if (!RE2::Consume(&cmd_line, *kChromeExePathMatcher, &cmd)) {
continue;
}
// Use a second match to record any Lacros PID.
- re2::StringPiece lacros_cmd;
+ std::string_view lacros_cmd;
if (RE2::Consume(&cmd, *kLacrosExePathMatcher, &lacros_cmd)) {
lacros_pids.emplace_back(pid);
if (lacros_path.empty()) {
@@ -142,7 +142,7 @@ std::map<uint32_t, Process> ProcessTypeCollector::ParseProcessTypes(
}
std::map<uint32_t, Thread> ProcessTypeCollector::ParseThreadTypes(
- re2::StringPiece contents) {
+ std::string_view contents) {
static const LazyRE2 kLineMatcher = {
R"(\s*(\d+))" // PID
R"(\s+(\d+))" // TID
@@ -156,7 +156,7 @@ std::map<uint32_t, Thread> ProcessTypeCollector::ParseThreadTypes(
bool is_truncated = false;
while (!contents.empty()) {
uint32_t pid = 0, tid = 0;
- re2::StringPiece comm_cmd;
+ std::string_view comm_cmd;
if (!RE2::Consume(&contents, *kLineMatcher, &pid, &tid, &comm_cmd)) {
SkipLine(&contents);
is_truncated = true;
diff --git a/chrome/browser/metrics/perf/process_type_collector.h b/chrome/browser/metrics/perf/process_type_collector.h
index 5ee391312cffbcc..ea375826e979acd 100644
--- a/chrome/browser/metrics/perf/process_type_collector.h
+++ b/chrome/browser/metrics/perf/process_type_collector.h
@@ -6,10 +6,10 @@
#define CHROME_BROWSER_METRICS_PERF_PROCESS_TYPE_COLLECTOR_H_
#include <map>
+#include <string_view>
#include <vector>
#include "third_party/metrics_proto/execution_context.pb.h"
-#include "third_party/re2/src/re2/stringpiece.h"
namespace metrics {
// Enables collection of process and thread types for Chrome PIDs and TIDs.
@@ -37,13 +37,13 @@ class ProcessTypeCollector {
// PIDs to their process types. It also populates a list of Lacros PID's and
// the Lacros binary path, if any.
static std::map<uint32_t, Process> ParseProcessTypes(
- re2::StringPiece contents,
+ std::string_view contents,
std::vector<uint32_t>& lacros_pids,
std::string& lacros_path);
// Parses the output of `ps -ewLo pid,lwp,comm` command and returns a map of
// Chrome TIDs to their thread types.
- static std::map<uint32_t, Thread> ParseThreadTypes(re2::StringPiece contents);
+ static std::map<uint32_t, Thread> ParseThreadTypes(std::string_view contents);
// Enumeration representing success and various failure modes for collecting
// types data. These values are persisted to logs. Entries should not be
diff --git a/chrome/browser/support_tool/ash/network_health_data_collector.cc b/chrome/browser/support_tool/ash/network_health_data_collector.cc
index 71593d287a60e18..e9014d55890bc9c 100644
--- a/chrome/browser/support_tool/ash/network_health_data_collector.cc
+++ b/chrome/browser/support_tool/ash/network_health_data_collector.cc
@@ -6,6 +6,7 @@
#include <memory>
#include <string>
+#include <string_view>
#include "base/containers/contains.h"
#include "base/functional/bind.h"
@@ -19,7 +20,6 @@
#include "components/feedback/redaction_tool/pii_types.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "third_party/re2/src/re2/re2.h"
-#include "third_party/re2/src/re2/stringpiece.h"
namespace {
@@ -37,11 +37,11 @@ void FindNetworkNamesAndAddToPIIMap(const std::string& network_health_data,
// are stored in "Name: <name>\n" format in `network_health_data`. The GUID is
// put on the line after network name and is in format "GUID: <guid>\n".
re2::RE2 regex_pattern(kRegexPattern);
- re2::StringPiece input(network_health_data);
+ std::string_view input(network_health_data);
- re2::StringPiece skipped_part;
- re2::StringPiece matched_network_name;
- re2::StringPiece matched_guid;
+ std::string_view skipped_part;
+ std::string_view matched_network_name;
+ std::string_view matched_guid;
while (re2::RE2::Consume(&input, regex_pattern, &skipped_part,
&matched_network_name, &matched_guid)) {
@@ -60,11 +60,11 @@ std::string RedactNetworkNames(const std::string& network_health_data) {
// are stored in "Name: <name>\n" format in `network_health_data`. The GUID is
// put on the line after network name and is in format "GUID: <guid>\n".
re2::RE2 regex_pattern(kRegexPattern);
- re2::StringPiece input(network_health_data);
+ std::string_view input(network_health_data);
- re2::StringPiece skipped_part;
- re2::StringPiece matched_network_name;
- re2::StringPiece matched_guid;
+ std::string_view skipped_part;
+ std::string_view matched_network_name;
+ std::string_view matched_guid;
std::string redacted;
while (re2::RE2::Consume(&input, regex_pattern, &skipped_part,
diff --git a/chrome/browser/support_tool/ash/ui_hierarchy_data_collector.cc b/chrome/browser/support_tool/ash/ui_hierarchy_data_collector.cc
index a4f8d472e6ac7ae..23b0a035e09ced0 100644
--- a/chrome/browser/support_tool/ash/ui_hierarchy_data_collector.cc
+++ b/chrome/browser/support_tool/ash/ui_hierarchy_data_collector.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/support_tool/ash/ui_hierarchy_data_collector.h"
#include <string>
+#include <string_view>
#include <utility>
#include <vector>
@@ -23,7 +24,6 @@
#include "components/feedback/redaction_tool/redaction_tool.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "third_party/re2/src/re2/re2.h"
-#include "third_party/re2/src/re2/stringpiece.h"
UiHierarchyDataCollector::UiHierarchyDataCollector() = default;
UiHierarchyDataCollector::~UiHierarchyDataCollector() = default;
@@ -73,13 +73,13 @@ std::string UiHierarchyDataCollector::RemoveWindowTitles(
// `ui_hierarchy_data` stores every component in a new line. Window titles are
// stored in "title=<window title>\n" format in `ui_hierarchy_data`.
re2::RE2 regex_pattern("(?s)(.*?)title=(?-s)(.+)\\n");
- re2::StringPiece input(ui_hierarchy_data);
+ std::string_view input(ui_hierarchy_data);
// `regex_pattern` has two matching groups: first one is for the skipped input
// that doesn't contain any window titles and second one is for the matched
// window title.
- re2::StringPiece skipped_part;
- re2::StringPiece matched_window_title;
+ std::string_view skipped_part;
+ std::string_view matched_window_title;
std::string redacted;
while (re2::RE2::Consume(&input, regex_pattern, &skipped_part,
diff --git a/chrome/updater/test/request_matcher.cc b/chrome/updater/test/request_matcher.cc
index aed797bf07acd98..b643af6d1081dad 100644
--- a/chrome/updater/test/request_matcher.cc
+++ b/chrome/updater/test/request_matcher.cc
@@ -5,6 +5,7 @@
#include "chrome/updater/test/request_matcher.h"
#include <string>
+#include <string_view>
#include <utility>
#include <vector>
@@ -20,7 +21,6 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "third_party/re2/src/re2/re2.h"
-#include "third_party/re2/src/re2/stringpiece.h"
namespace updater::test::request {
@@ -74,7 +74,7 @@ Matcher GetContentMatcher(
const std::vector<std::string>& expected_content_regex_sequence) {
return base::BindLambdaForTesting(
[expected_content_regex_sequence](const HttpRequest& request) {
- re2::StringPiece input(request.decoded_content);
+ std::string_view input(request.decoded_content);
for (const std::string& regex : expected_content_regex_sequence) {
re2::RE2::Options opt;
opt.set_case_sensitive(false);
@@ -184,7 +184,7 @@ Matcher GetMultipartContentMatcher(
re2::RE2::Options opt;
opt.set_case_sensitive(false);
- re2::StringPiece input(request.decoded_content);
+ std::string_view input(request.decoded_content);
for (std::vector<FormExpectations>::const_iterator form_expection =
form_expections.begin();
form_expection < form_expections.end(); ++form_expection) {
diff --git a/components/autofill/content/renderer/form_autofill_util.cc b/components/autofill/content/renderer/form_autofill_util.cc
index a33864a6a9ea033..0261807ae892bfd 100644
--- a/components/autofill/content/renderer/form_autofill_util.cc
+++ b/components/autofill/content/renderer/form_autofill_util.cc
@@ -9,6 +9,7 @@
#include <memory>
#include <set>
#include <string>
+#include <string_view>
#include <utility>
#include <vector>
@@ -2826,7 +2827,7 @@ void TraverseDomForFourDigitCombinations(
return;
}
std::string node_text = node.NodeValue().Utf8();
- re2::StringPiece input(node_text);
+ std::string_view input(node_text);
std::string match;
while (matches.size() < kMaxFourDigitCombinationMatches &&
re2::RE2::FindAndConsume(&input, kFourDigitRegex, &match)) {
diff --git a/components/autofill/core/browser/data_model/autofill_structured_address_utils.cc b/components/autofill/core/browser/data_model/autofill_structured_address_utils.cc
index 89057e9a9244889..10b5cc058697eec 100644
--- a/components/autofill/core/browser/data_model/autofill_structured_address_utils.cc
+++ b/components/autofill/core/browser/data_model/autofill_structured_address_utils.cc
@@ -7,6 +7,7 @@
#include <algorithm>
#include <map>
#include <string>
+#include <string_view>
#include <utility>
#include "base/check.h"
@@ -199,7 +200,7 @@ std::vector<std::string> GetAllPartialMatches(const std::string& value,
const RE2* regex = Re2RegExCache::Instance()->GetRegEx(pattern);
if (!regex || !regex->ok())
return {};
- re2::StringPiece input(value);
+ std::string_view input(value);
std::string match;
std::vector<std::string> matches;
while (re2::RE2::FindAndConsume(&input, *regex, &match)) {
diff --git a/components/desks_storage/core/local_desk_data_manager.cc b/components/desks_storage/core/local_desk_data_manager.cc
index 4840fdef017a0d9..0456408cd4b4162 100644
--- a/components/desks_storage/core/local_desk_data_manager.cc
+++ b/components/desks_storage/core/local_desk_data_manager.cc
@@ -29,9 +29,6 @@
#include "components/services/app_service/public/cpp/app_registry_cache.h"
#include "components/services/app_service/public/cpp/app_registry_cache_wrapper.h"
#include "components/sync/protocol/workspace_desk_specifics.pb.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
-#include "third_party/re2/src/re2/stringpiece.h"
-#include "url/gurl.h"
namespace desks_storage {
diff --git a/components/dom_distiller/core/page_features.cc b/components/dom_distiller/core/page_features.cc
index 6f6f21b52dfdf9e..66671bcb1387b48 100644
--- a/components/dom_distiller/core/page_features.cc
+++ b/components/dom_distiller/core/page_features.cc
@@ -8,6 +8,7 @@
#include <memory>
#include <string>
+#include <string_view>
#include "base/json/json_reader.h"
#include "third_party/re2/src/re2/re2.h"
@@ -35,7 +36,7 @@ std::string GetLastSegment(const std::string& path) {
int CountMatches(const std::string& s, const std::string& p) {
// return len(re.findall(p, s))
- re2::StringPiece sp(s);
+ std::string_view sp(s);
re2::RE2 regexp(p);
int count = 0;
while (re2::RE2::FindAndConsume(&sp, regexp))
diff --git a/components/feedback/redaction_tool/redaction_tool.cc b/components/feedback/redaction_tool/redaction_tool.cc
index 58a90f072b59413..805e477c3be8d15 100644
--- a/components/feedback/redaction_tool/redaction_tool.cc
+++ b/components/feedback/redaction_tool/redaction_tool.cc
@@ -6,6 +6,7 @@
#include <algorithm>
#include <set>
+#include <string_view>
#include <utility>
#include <vector>
@@ -282,24 +283,24 @@ std::string MaybeScrubIPAddress(const std::string& addr) {
// This function can be used to determine if this was the case by evaluating
// the skipped piece. It returns true, if the matched address was erroneous
// and should be skipped instead.
-bool ShouldSkipIPAddress(const re2::StringPiece& skipped) {
+bool ShouldSkipIPAddress(std::string_view skipped) {
// MomdemManager can dump out firmware revision fields that can also
// confuse the IPv4 matcher e.g. "Revision: 81600.0000.00.29.19.16_DO"
// so ignore the replacement if the skipped piece looks like
// "Revision: .*<ipv4>". Note however that if this field contains
// values delimited by multiple spaces, any matches after the first
// will lose the context and be redacted.
- static const re2::StringPiece rev("Revision: ");
- static const re2::StringPiece space(" ");
+ static const std::string_view rev("Revision: ");
+ static const std::string_view space(" ");
const auto pos = skipped.rfind(rev);
- if (pos != re2::StringPiece::npos &&
- skipped.find(space, pos + rev.length()) == re2::StringPiece::npos) {
+ if (pos != std::string_view::npos &&
+ skipped.find(space, pos + rev.length()) == std::string_view::npos) {
return true;
}
// USB paths can be confused with IPv4 Addresses because they can look
// similar: n-n.n.n.n . Ignore replacement if previous char is `-`
- static const re2::StringPiece dash("-");
+ static const std::string_view dash("-");
return skipped.ends_with(dash);
}
@@ -488,12 +489,12 @@ CustomPatternWithAlias kCustomPatternsWithoutContext[] = {
// only contains "c".
// Example: input = "aaabbbc", pattern = "(z+)" leads to input = "aaabbbc",
// the args values are not modified and skipped_input is not modified.
-bool FindAndConsumeAndGetSkippedN(re2::StringPiece* input,
+bool FindAndConsumeAndGetSkippedN(std::string_view* input,
const re2::RE2& pattern,
- re2::StringPiece* skipped_input,
- re2::StringPiece* args[],
+ std::string_view* skipped_input,
+ std::string_view* args[],
int argc) {
- re2::StringPiece old_input = *input;
+ std::string_view old_input = *input;
CHECK_GE(argc, 1);
re2::RE2::Arg a0(argc > 0 ? args[0] : nullptr);
@@ -512,18 +513,18 @@ bool FindAndConsumeAndGetSkippedN(re2::StringPiece* input,
return result;
}
-// All |match_groups| need to be of type re2::StringPiece*.
+// All |match_groups| need to be of type std::string_view*.
template <typename... Arg>
-bool FindAndConsumeAndGetSkipped(re2::StringPiece* input,
+bool FindAndConsumeAndGetSkipped(std::string_view* input,
const re2::RE2& pattern,
- re2::StringPiece* skipped_input,
+ std::string_view* skipped_input,
Arg*... match_groups) {
- re2::StringPiece* args[] = {match_groups...};
+ std::string_view* args[] = {match_groups...};
return FindAndConsumeAndGetSkippedN(input, pattern, skipped_input, args,
std::size(args));
}
-bool HasRepeatedChar(re2::StringPiece text, char c) {
+bool HasRepeatedChar(std::string_view text, char c) {
return std::adjacent_find(text.begin(), text.end(), [c](char c1, char c2) {
return (c1 == c) && (c2 == c);
}) != text.end();
@@ -682,8 +683,8 @@ std::string RedactionTool::RedactMACAddresses(
result.reserve(input.size());
// Keep consuming, building up a result string as we go.
- re2::StringPiece text(input);
- re2::StringPiece skipped, oui, nic;
+ std::string_view text(input);
+ std::string_view skipped, oui, nic;
static const char kMacSeparatorChars[] = "-_";
while (FindAndConsumeAndGetSkipped(&text, *mac_re, &skipped, &oui, &nic)) {
// Look up the MAC address in the hash. Force the separator to be a colon
@@ -731,8 +732,8 @@ std::string RedactionTool::RedactHashes(
result.reserve(input.size());
// Keep consuming, building up a result string as we go.
- re2::StringPiece text(input);
- re2::StringPiece skipped, pre_whitespace, hash_prefix, hash_suffix;
+ std::string_view text(input);
+ std::string_view skipped, pre_whitespace, hash_prefix, hash_suffix;
while (FindAndConsumeAndGetSkipped(&text, *hash_re, &skipped, &pre_whitespace,
&hash_prefix, &hash_suffix)) {
result.append(skipped);
@@ -797,12 +798,12 @@ std::string RedactionTool::RedactAndroidAppStoragePaths(
R"(/data/(data|app|user_de/\d+)/[^/\n]+)(/[^\n\s]+))");
// Keep consuming, building up a result string as we go.
- re2::StringPiece text(input);
- re2::StringPiece skipped;
- re2::StringPiece path_prefix; // path before app_specific;
- re2::StringPiece pre_data; // (path=|exe=|/home/root/<hash>/android-data)
- re2::StringPiece post_data; // (data|app|user_de/\d+)
- re2::StringPiece app_specific; // (/[^\n\s]+)
+ std::string_view text(input);
+ std::string_view skipped;
+ std::string_view path_prefix; // path before app_specific;
+ std::string_view pre_data; // (path=|exe=|/home/root/<hash>/android-data)
+ std::string_view post_data; // (data|app|user_de/\d+)
+ std::string_view app_specific; // (/[^\n\s]+)
while (FindAndConsumeAndGetSkipped(&text, *path_re, &skipped, &path_prefix,
&pre_data, &post_data, &app_specific)) {
// We can record these parts as-is.
@@ -862,10 +863,10 @@ std::string RedactionTool::RedactCreditCardNumbers(
// after the potential match should either be a
// newline or 2-3 non digits.
- re2::StringPiece text(input);
- re2::StringPiece skipped;
- re2::StringPiece sequence;
- re2::StringPiece post_sequence;
+ std::string_view text(input);
+ std::string_view skipped;
+ std::string_view sequence;
+ std::string_view post_sequence;
while (FindAndConsumeAndGetSkipped(&text, *cc_re, &skipped, &sequence,
&post_sequence)) {
@@ -876,7 +877,7 @@ std::string RedactionTool::RedactCreditCardNumbers(
// Timestamps in ms have a surprisingly high number of false positives.
// Also log entries but those usually only match if there are several spaces
// tying unrelated numbers together.
- if (post_sequence.find("ms") != re2::StringPiece::npos) {
+ if (post_sequence.find("ms") != std::string_view::npos) {
metrics_recorder_->RecordCreditCardRedactionHistogram(
CreditCardDetection::kTimestamp);
result.append(sequence);
@@ -947,11 +948,11 @@ std::string RedactionTool::RedactIbans(
"S[AEIKMN]|T[NR]|UA|VG|XK)(?:\\d{2})[ -]?(?:[ \\-A-Z0-9]){11,30})"
"([^a-zA-Z0-9_\\-\\+=/])");
- re2::StringPiece text(input);
- re2::StringPiece skipped;
- re2::StringPiece pre_separating_char;
- re2::StringPiece iban;
- re2::StringPiece post_separating_char;
+ std::string_view text(input);
+ std::string_view skipped;
+ std::string_view pre_separating_char;
+ std::string_view iban;
+ std::string_view post_separating_char;
while (FindAndConsumeAndGetSkipped(&text, *iban_re, &skipped,
&pre_separating_char, &iban,
&post_separating_char)) {
@@ -1086,9 +1087,9 @@ std::string RedactionTool::RedactCustomPatternWithContext(
result.reserve(input.size());
// Keep consuming, building up a result string as we go.
- re2::StringPiece text(input);
- re2::StringPiece skipped;
- re2::StringPiece pre_matched_id, matched_id, post_matched_id;
+ std::string_view text(input);
+ std::string_view skipped;
+ std::string_view pre_matched_id, matched_id, post_matched_id;
while (FindAndConsumeAndGetSkipped(&text, *re, &skipped, &pre_matched_id,
&matched_id, &post_matched_id)) {
std::string matched_id_as_string(matched_id);
@@ -1119,10 +1120,10 @@ std::string RedactionTool::RedactCustomPatternWithContext(
// This takes a |url| argument and returns true if the URL is exempt from
// redaction, returns false otherwise.
-bool IsUrlExempt(re2::StringPiece url,
+bool IsUrlExempt(std::string_view url,
const char* const* first_party_extension_ids) {
// We do not exempt anything with a query parameter.
- if (url.find("?") != re2::StringPiece::npos) {
+ if (url.find("?") != std::string_view::npos) {
return false;
}
@@ -1163,7 +1164,7 @@ bool IsUrlExempt(re2::StringPiece url,
int i = 0;
const char* test_id = first_party_extension_ids[i];
- const re2::StringPiece url_sub =
+ const std::string_view url_sub =
url.substr(sizeof("chrome-extension://") - 1);
while (test_id) {
if (url_sub.starts_with(test_id)) {
@@ -1188,9 +1189,9 @@ std::string RedactionTool::RedactCustomPatternWithoutContext(
result.reserve(input.size());
// Keep consuming, building up a result string as we go.
- re2::StringPiece text(input);
- re2::StringPiece skipped;
- re2::StringPiece matched_id;
+ std::string_view text(input);
+ std::string_view skipped;
+ std::string_view matched_id;
while (FindAndConsumeAndGetSkipped(&text, *re, &skipped, &matched_id)) {
result.append(skipped);
diff --git a/components/keyed_service/core/dependency_graph_unittest.cc b/components/keyed_service/core/dependency_graph_unittest.cc
index 1b1e8ca7b6dbaa3..c97acb6b4c5e9a9 100644
--- a/components/keyed_service/core/dependency_graph_unittest.cc
+++ b/components/keyed_service/core/dependency_graph_unittest.cc
@@ -4,10 +4,10 @@
#include "components/keyed_service/core/dependency_graph.h"
+#include <string_view>
+
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
-#include "base/numerics/safe_conversions.h"
-#include "base/strings/string_piece.h"
#include "components/keyed_service/core/dependency_node.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/re2/src/re2/re2.h"
@@ -171,7 +171,7 @@ std::string NodeNameProvider(const std::string& name, DependencyNode* node) {
// as valid identifiers, but those are not used in the production code calling
// the tested DumpAsGraphviz.
// [1] http://www.graphviz.org/content/dot-language
-bool IsValidDotId(base::StringPiece name) {
+bool IsValidDotId(std::string_view name) {
static const char pattern[] =
"[a-zA-Z\\200-\\377_][0-9a-zA-Z\\200-\\377_]*"
"|-?(?:\\.[0-9]+|[0-9]+(\\.[0-9]*)?)"
@@ -181,8 +181,8 @@ bool IsValidDotId(base::StringPiece name) {
// Returns the source name of the first edge of the graphstr described in DOT
// format in |graphstr|.
-base::StringPiece LocateNodeNameInGraph(base::StringPiece graphstr) {
- re2::StringPiece name;
+std::string_view LocateNodeNameInGraph(std::string_view graphstr) {
+ std::string_view name;
EXPECT_TRUE(RE2::FullMatch(
graphstr, "(?sm).*^[ \\t]*([^ \\t]*(?:[ \\t]+[^ \\t]+)*)[ \\t]*->.*",
&name))
@@ -208,7 +208,7 @@ TEST_F(DependencyGraphTest, DumpAsGraphviz_Escaping) {
SCOPED_TRACE(testing::Message("name=") << name);
std::string graph_str = graph.DumpAsGraphviz(
"Test", base::BindRepeating(&NodeNameProvider, name));
- base::StringPiece dumped_name(LocateNodeNameInGraph(graph_str));
+ std::string_view dumped_name(LocateNodeNameInGraph(graph_str));
EXPECT_TRUE(IsValidDotId(dumped_name)) << "dumped_name=" << dumped_name;
}
}
diff --git a/components/omnibox/browser/document_provider.cc b/components/omnibox/browser/document_provider.cc
index 26ab7b12aaa5231..afa46514faf7b48 100644
--- a/components/omnibox/browser/document_provider.cc
+++ b/components/omnibox/browser/document_provider.cc
@@ -8,6 +8,7 @@
#include <memory>
#include <numeric>
#include <string>
+#include <string_view>
#include <utility>
#include <vector>
@@ -381,7 +382,7 @@ std::string ExtractDocIdFromUrl(const std::string& url) {
"(?:(#[0-9a-zA-Z$\\-\\_\\.\\+\\!\\*\'\\,;:@&=/\\?]+)?)" // Fragment
")");
- std::vector<re2::StringPiece> matched_doc_ids(
+ std::vector<std::string_view> matched_doc_ids(
docs_url_pattern->NumberOfCapturingGroups() + 1);
// ANCHOR_START deviates from google3 which uses UNANCHORED. Using
// ANCHOR_START prevents incorrectly matching with non-drive URLs but which
@@ -393,7 +394,7 @@ std::string ExtractDocIdFromUrl(const std::string& url) {
return std::string();
}
for (const auto& doc_id_group : docs_url_pattern->NamedCapturingGroups()) {
- re2::StringPiece identified_doc_id = matched_doc_ids[doc_id_group.second];
+ std::string_view identified_doc_id = matched_doc_ids[doc_id_group.second];
if (!identified_doc_id.empty()) {
return std::string(identified_doc_id);
}
diff --git a/extensions/browser/api/declarative_net_request/regex_rules_matcher.cc b/extensions/browser/api/declarative_net_request/regex_rules_matcher.cc
index d2f849f6647eb2b..379b7be9fcd36a5 100644
--- a/extensions/browser/api/declarative_net_request/regex_rules_matcher.cc
+++ b/extensions/browser/api/declarative_net_request/regex_rules_matcher.cc
@@ -34,10 +34,6 @@ bool IsExtraHeadersMatcherInternal(
&flat::RegexRule::action_type);
}
-re2::StringPiece ToRE2StringPiece(const ::flatbuffers::String& str) {
- return re2::StringPiece(str.c_str(), str.size());
-}
-
// Helper to check if the |rule| metadata matches the given request |params|.
bool DoesRuleMetadataMatchRequest(const flat_rule::UrlRule& rule,
const RequestParams& params) {
@@ -204,7 +200,7 @@ void RegexRulesMatcher::InitializeMatcher() {
// regexes and modify FilteredRE2 to take a regex object directly.
int re2_id;
re2::RE2::ErrorCode error_code = filtered_re2_.Add(
- ToRE2StringPiece(*rule->url_pattern()),
+ rule->url_pattern()->string_view(),
CreateRE2Options(is_case_sensitive, require_capturing), &re2_id);
// Ideally there shouldn't be any error, since we had already validated the
@@ -323,7 +319,7 @@ RegexRulesMatcher::CreateRegexSubstitutionRedirectAction(
std::string redirect_str = params.url->spec();
bool success =
RE2::Replace(&redirect_str, *info.regex,
- ToRE2StringPiece(*info.regex_rule->regex_substitution()));
+ info.regex_rule->regex_substitution()->string_view());
if (!success) {
// This should generally not happen since we had already checked for a
// match and during indexing, had verified that the substitution pattern
diff --git a/extensions/browser/api/web_request/form_data_parser.cc b/extensions/browser/api/web_request/form_data_parser.cc
index 8f89cde081d5cb3..a835390855006d0 100644
--- a/extensions/browser/api/web_request/form_data_parser.cc
+++ b/extensions/browser/api/web_request/form_data_parser.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include <string_view>
#include <vector>
#include "base/check.h"
@@ -69,7 +70,7 @@ Patterns::Patterns()
base::LazyInstance<Patterns>::Leaky g_patterns = LAZY_INSTANCE_INITIALIZER;
-bool ConsumePrefix(re2::StringPiece* str, re2::StringPiece prefix) {
+bool ConsumePrefix(std::string_view* str, std::string_view prefix) {
if (!str->starts_with(prefix)) {
return false;
}
@@ -107,7 +108,7 @@ class FormDataParserUrlEncoded : public FormDataParser {
// name-value pairs (one for name, one for value).
static const size_t args_size_ = 2u;
- re2::StringPiece source_;
+ std::string_view source_;
bool source_set_;
bool source_malformed_;
@@ -217,8 +218,7 @@ class FormDataParserMultipart : public FormDataParser {
};
// Tests whether |input| has a prefix matching |pattern|.
- static bool StartsWithPattern(const re2::StringPiece& input,
- const RE2& pattern);
+ static bool StartsWithPattern(std::string_view input, const RE2& pattern);
// If |source_| starts with a header, seeks |source_| beyond the header. If
// the header is Content-Disposition, extracts |name| from "name=" and
@@ -276,7 +276,7 @@ class FormDataParserMultipart : public FormDataParser {
// The parsed message can be split into multiple sources which we read
// sequentially.
- re2::StringPiece source_;
+ std::string_view source_;
// Caching the pointer to g_patterns.Get().
raw_ptr<const Patterns> patterns_;
@@ -409,7 +409,7 @@ bool FormDataParserUrlEncoded::SetSource(base::StringPiece source) {
}
// static
-bool FormDataParserMultipart::StartsWithPattern(const re2::StringPiece& input,
+bool FormDataParserMultipart::StartsWithPattern(std::string_view input,
const RE2& pattern) {
return pattern.Match(input, 0, input.size(), RE2::ANCHOR_START, nullptr, 0);
}
@@ -427,7 +427,7 @@ bool FormDataParserMultipart::AllDataReadOK() {
}
bool FormDataParserMultipart::FinishReadingPart(base::StringPiece* data) {
- re2::StringPiece orig = source_;
+ std::string_view orig = source_;
while (!source_.starts_with(dash_boundary_separator_)) {
if (!RE2::Consume(&source_, crlf_free_pattern()) ||
!ConsumePrefix(&source_, kCRLF)) {
@@ -567,12 +567,12 @@ bool FormDataParserMultipart::TryReadHeader(base::StringPiece* name,
// (*) After this point we must return true, because we consumed one header.
// Subtract 2 for the trailing "\r\n".
- re2::StringPiece header(header_start, source_.data() - header_start - 2);
+ std::string_view header(header_start, source_.data() - header_start - 2);
if (!StartsWithPattern(header, content_disposition_pattern()))
return true; // Skip headers that don't describe the content-disposition.
- re2::StringPiece groups[2];
+ std::string_view groups[2];
if (!name_pattern().Match(header,
kContentDispositionLength, header.size(),
diff --git a/gpu/command_buffer/service/program_manager.cc b/gpu/command_buffer/service/program_manager.cc
index 7767c8a5e7ec50b..4fac69fde80476a 100644
--- a/gpu/command_buffer/service/program_manager.cc
+++ b/gpu/command_buffer/service/program_manager.cc
@@ -11,6 +11,7 @@
#include <limits>
#include <memory>
#include <set>
+#include <string_view>
#include <utility>
#include <vector>
@@ -597,7 +598,7 @@ void Program::UpdateBaseInstanceUniformLocation() {
std::string Program::ProcessLogInfo(const std::string& log) {
std::string output;
- re2::StringPiece input(log);
+ std::string_view input(log);
std::string prior_log;
std::string hashed_name;
while (RE2::Consume(&input,
diff --git a/tools/binary_size/libsupersize/viewer/caspian/caspian_web.cc b/tools/binary_size/libsupersize/viewer/caspian/caspian_web.cc
index aa1b867730a5143..dc6b833d471ce88 100644
--- a/tools/binary_size/libsupersize/viewer/caspian/caspian_web.cc
+++ b/tools/binary_size/libsupersize/viewer/caspian/caspian_web.cc
@@ -12,6 +12,7 @@
#include <memory>
#include <sstream>
#include <string>
+#include <string_view>
#include "third_party/jsoncpp/source/include/json/json.h"
#include "third_party/re2/src/re2/re2.h"
@@ -32,7 +33,7 @@ class FilterBuffer {
size_t remaining() { return kFilterBufferSize - (cursor_ - data_); }
void Reset() { cursor_ = data_; }
- re2::StringPiece Get() { return re2::StringPiece(data_, cursor_ - data_); }
+ std::string_view Get() { return std::string_view(data_, cursor_ - data_); }
void Append(char c) {
if (remaining() > 0) {

View File

@@ -0,0 +1,32 @@
From 214859e3567ea9def85305e4f021a5d407e1ccfe Mon Sep 17 00:00:00 2001
From: Jose Dapena Paz <jdapena@igalia.com>
Date: Tue, 23 Jan 2024 10:56:36 +0000
Subject: [PATCH] IWYU: missing include for usage of std::bitset in
resolution_monitor.cc
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Bug: 957519
Change-Id: Ia538bbca63105397963632d2a145886e256efeb6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5190545
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
Reviewed-by: Henrik Boström <hbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1250732}
---
.../renderer/platform/peerconnection/resolution_monitor.cc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/third_party/blink/renderer/platform/peerconnection/resolution_monitor.cc b/third_party/blink/renderer/platform/peerconnection/resolution_monitor.cc
index 5d6a6495045c4..33135a1b22473 100644
--- a/third_party/blink/renderer/platform/peerconnection/resolution_monitor.cc
+++ b/third_party/blink/renderer/platform/peerconnection/resolution_monitor.cc
@@ -4,6 +4,8 @@
#include "third_party/blink/renderer/platform/peerconnection/resolution_monitor.h"
+#include <bitset>
+
#include "base/containers/span.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"

View File

@@ -0,0 +1,115 @@
From 8b293359cafbc741e7742de824b98fbf87a51b51 Mon Sep 17 00:00:00 2001
From: Jose Dapena Paz <jdapena@igalia.com>
Date: Thu, 8 Feb 2024 09:32:57 +0000
Subject: [PATCH] Do not use templates for ScriptPromiseResolver::ToV8
implementation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The usage of templates for reusing the internal implementation of ToV8
is not making the code simpler. So, inline the implementations.
This also fixes a GCC build issue because it was implemented with
template specializations declared in the class scope, and that is
hitting the GCC bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85282
Bug: 819294
Change-Id: I51f5a9e0a6e80ac707b630f270179c29fd84b059
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5223626
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
Reviewed-by: Yuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1257835}
---
.../core/v8/script_promise_resolver.h | 60 +++++--------------
1 file changed, 14 insertions(+), 46 deletions(-)
diff --git a/third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h b/third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h
index 93cecd06c2814..ae0081b735a67 100644
--- a/third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h
+++ b/third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h
@@ -316,70 +316,38 @@ class CORE_EXPORT ScriptPromiseResolver
return V8String(isolate, value);
}
- template <size_t sizeOfValue>
- static v8::Local<v8::Value> ToV8SignedIntegerInternal(int64_t value,
- v8::Isolate*);
-
- template <>
- v8::Local<v8::Value> ToV8SignedIntegerInternal<4>(int64_t value,
- v8::Isolate* isolate) {
- return v8::Integer::New(isolate, static_cast<int32_t>(value));
- }
-
- template <>
- v8::Local<v8::Value> ToV8SignedIntegerInternal<8>(int64_t value,
- v8::Isolate* isolate) {
- int32_t value_in32_bit = static_cast<int32_t>(value);
- if (value_in32_bit == value) {
- return v8::Integer::New(isolate, value_in32_bit);
- }
- // V8 doesn't have a 64-bit integer implementation.
- return v8::Number::New(isolate, value);
- }
-
- template <size_t sizeOfValue>
- static v8::Local<v8::Value> ToV8UnsignedIntegerInternal(uint64_t value,
- v8::Isolate*);
-
- template <>
- v8::Local<v8::Value> ToV8UnsignedIntegerInternal<4>(uint64_t value,
- v8::Isolate* isolate) {
- return v8::Integer::NewFromUnsigned(isolate, static_cast<uint32_t>(value));
- }
-
- template <>
- v8::Local<v8::Value> ToV8UnsignedIntegerInternal<8>(uint64_t value,
- v8::Isolate* isolate) {
- uint32_t value_in32_bit = static_cast<uint32_t>(value);
- if (value_in32_bit == value) {
- return v8::Integer::NewFromUnsigned(isolate, value_in32_bit);
- }
- // V8 doesn't have a 64-bit integer implementation.
- return v8::Number::New(isolate, value);
- }
-
static v8::Local<v8::Value> ToV8(int32_t value,
v8::Local<v8::Object> creation_context,
v8::Isolate* isolate) {
- return ToV8SignedIntegerInternal<sizeof value>(value, isolate);
+ return v8::Integer::New(isolate, value);
}
static v8::Local<v8::Value> ToV8(int64_t value,
v8::Local<v8::Object> creation_context,
v8::Isolate* isolate) {
- return ToV8SignedIntegerInternal<sizeof value>(value, isolate);
+ int32_t value_in32_bit = static_cast<int32_t>(value);
+ if (value_in32_bit == value) {
+ return v8::Integer::New(isolate, value_in32_bit);
+ }
+ // V8 doesn't have a 64-bit integer implementation.
+ return v8::Number::New(isolate, value);
}
static v8::Local<v8::Value> ToV8(uint32_t value,
v8::Local<v8::Object> creation_context,
v8::Isolate* isolate) {
- return ToV8UnsignedIntegerInternal<sizeof value>(value, isolate);
+ return v8::Integer::NewFromUnsigned(isolate, value);
}
static v8::Local<v8::Value> ToV8(uint64_t value,
v8::Local<v8::Object> creation_context,
v8::Isolate* isolate) {
- return ToV8UnsignedIntegerInternal<sizeof value>(value, isolate);
+ uint32_t value_in32_bit = static_cast<uint32_t>(value);
+ if (value_in32_bit == value) {
+ return v8::Integer::NewFromUnsigned(isolate, value_in32_bit);
+ }
+ // V8 doesn't have a 64-bit integer implementation.
+ return v8::Number::New(isolate, value);
}
static v8::Local<v8::Value> ToV8(bool value,

View File

@@ -0,0 +1,32 @@
From 4b48bc4dd6ce9c56d254e552a33a7b7c2d6fc226 Mon Sep 17 00:00:00 2001
From: Jose Dapena Paz <jdapena@igalia.com>
Date: Thu, 1 Feb 2024 17:01:51 +0000
Subject: [PATCH] IWYU: usage of std::optional in
search_engine_choice_service.h requires include
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Bug: 957519
Change-Id: If89767ae4cd261081efda97cde6a296209b68782
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5259337
Reviewed-by: Colin Blundell <blundell@chromium.org>
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1255105}
---
.../search_engine_choice/search_engine_choice_service.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/components/search_engines/search_engine_choice/search_engine_choice_service.h b/components/search_engines/search_engine_choice/search_engine_choice_service.h
index b84ea7ec5fc08..c9dcce4b7c833 100644
--- a/components/search_engines/search_engine_choice/search_engine_choice_service.h
+++ b/components/search_engines/search_engine_choice/search_engine_choice_service.h
@@ -5,6 +5,8 @@
#ifndef COMPONENTS_SEARCH_ENGINES_SEARCH_ENGINE_CHOICE_SEARCH_ENGINE_CHOICE_SERVICE_H_
#define COMPONENTS_SEARCH_ENGINES_SEARCH_ENGINE_CHOICE_SEARCH_ENGINE_CHOICE_SERVICE_H_
+#include <optional>
+
#include "base/memory/raw_ref.h"
#include "base/memory/weak_ptr.h"
#include "components/country_codes/country_codes.h"

18
system-yuv.patch Normal file
View File

@@ -0,0 +1,18 @@
--- src/build/linux/unbundle/libyuv.gn.orig
+++ src/build/linux/unbundle/libyuv.gn
@@ -1,7 +1,7 @@
import("//build/config/linux/pkg_config.gni")
import("//build/shim_headers.gni")
-pkg_config("system_yuv") {
+pkg_config("libyuv_config") {
packages = [ "libyuv" ]
}
@@ -33,5 +33,5 @@ shim_headers("libyuv_shim") {
source_set("libyuv") {
deps = [ ":libyuv_shim" ]
- public_configs = [ ":system_yuv" ]
+ public_configs = [ ":libyuv_config" ]
}

View File

@@ -1,33 +0,0 @@
--- a/base/thread_annotations.h 2022-06-21 21:52:33.363987695 +0200
+++ b/base/thread_annotations.h 2022-06-24 16:18:54.238568316 +0200
@@ -40,6 +40,8 @@
#include "base/dcheck_is_on.h"
#include "build/build_config.h"
+#include <absl/base/internal/thread_annotations.h>
+
#if defined(__clang__)
#define THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x))
#else
@@ -227,21 +229,7 @@
// but the compiler cannot confirm that.
#define TS_UNCHECKED_READ(x) thread_safety_analysis::ts_unchecked_read(x)
-namespace thread_safety_analysis {
-
-// Takes a reference to a guarded data member, and returns an unguarded
-// reference.
-template <typename T>
-inline const T& ts_unchecked_read(const T& v) NO_THREAD_SAFETY_ANALYSIS {
- return v;
-}
-
-template <typename T>
-inline T& ts_unchecked_read(T& v) NO_THREAD_SAFETY_ANALYSIS {
- return v;
-}
-} // namespace thread_safety_analysis
// The above is imported as-is from abseil-cpp. The following Chromium-specific
// synonyms are added for Chromium concepts (SequenceChecker/ThreadChecker).

View File

@@ -1,43 +0,0 @@
Do not export v8 symbols that are used only in unit tests but not exposed in headers.
This reduces the size of the electron binary by 2MB.
--- src/v8/src/base/macros.h.old 2023-09-29 08:54:55.701965801 +0200
+++ src/v8/src/base/macros.h 2023-10-03 11:54:02.305086047 +0200
@@ -399,13 +399,18 @@ bool is_inbounds(float_t v) {
// Setup for Linux shared library export.
#if V8_HAS_ATTRIBUTE_VISIBILITY
+#if defined(HIDE_PRIVATE_SYMBOLS)
+#define V8_EXPORT_PRIVATE __attribute__((visibility("hidden")))
+#define V8_EXPORT_ENUM V8_EXPORT_PRIVATE
+#else
#ifdef BUILDING_V8_SHARED
#define V8_EXPORT_PRIVATE __attribute__((visibility("default")))
#define V8_EXPORT_ENUM V8_EXPORT_PRIVATE
#else
#define V8_EXPORT_PRIVATE
#define V8_EXPORT_ENUM
#endif
+#endif // HIDE_PRIVATE_SYMBOLS
#else
#define V8_EXPORT_PRIVATE
#define V8_EXPORT_ENUM
This should also be hidden, see https://github.com/electron/electron/pull/40624
--- src/v8/src/trap-handler/trap-handler.h.orig 2023-11-22 21:11:42.771625500 +0100
+++ src/v8/src/trap-handler/trap-handler.h 2023-11-30 20:57:23.411956500 +0100
@@ -54,11 +54,11 @@ namespace trap_handler {
#if defined(BUILDING_V8_SHARED) && defined(V8_OS_WIN)
#define TH_EXPORT_PRIVATE __declspec(dllexport)
#elif defined(BUILDING_V8_SHARED)
-#define TH_EXPORT_PRIVATE __attribute__((visibility("default")))
+#define TH_EXPORT_PRIVATE __attribute__((visibility("hidden")))
#elif defined(USING_V8_SHARED) && defined(V8_OS_WIN)
#define TH_EXPORT_PRIVATE __declspec(dllimport)
#else
-#define TH_EXPORT_PRIVATE
+#define TH_EXPORT_PRIVATE __attribute__((visibility("hidden")))
#endif
#define TH_CHECK(condition) \

View File

@@ -0,0 +1,820 @@
From 653716a6838676b6cf257e0d9756eccbf509fabb Mon Sep 17 00:00:00 2001
From: Ilya Bizyaev <ilyabiz@chromium.org>
Date: Fri, 19 Jan 2024 02:02:03 +0000
Subject: [PATCH] Implement cursor-shape-v1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This CL is largely based on the existing support for the custom
zcr-cursor-shapes-v1 protocol used by Lacros.
cursor-shape-v1 is the new upstream protocol for server-side cursor shapes
based on zcr-cursor-shapes-v1. Of compositors, it is currently
implemented in KDE's KWin (in Plasma 6.0) and Sway (not yet released).
The enum mapping is based on
https://source.chromium.org/chromium/chromium/src/+/main:ui/base/cursor/cursor_factory.cc;l=115;drc=67d90538f11c6b232dbfd716075db52aeb34fd15
— despite the seemingly fewer shapes in cursor-shape-v1's list, the
reduction is the same as in Chromium's own FreeDesktop cursor loading code,
so there's no downside in letting the compositor do the work for us
whenever it offers to. Since the compositor — and, by extension, the
desktop environment — are the source of truth for cursor display
settings, this simplifies complying with the user's preferences.
Unlike Lacros, we cannot be sure at compile time that the compositor has
support for this protocol, so the cursor loading code is changed to not
give up on a shape when is has no bitmap and instead let the update
code try the server-side approach.
Exo does not support cursor-shape-v1, so it will keep using the
zcr-cursor-shapes-v1 branch.
I have tested this CL in a Plasma 6 RC1 session with this CSS demo:
https://www.tutorialrepublic.com/codelab.php?topic=css&file=cursor-property
Low-Coverage-Reason: TRIVIAL_CHANGE Not tested are the enum conversion and getters/setters, which is boilerplate.
Bug: 1427111
Cq-Include-Trybots: luci.chromium.try:linux-lacros-rel,linux-wayland-rel
Change-Id: I50567021e6fd80a641bbc906370c517efe16ffb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5196950
Commit-Queue: Ilya Bizyaev <ilyabiz@chromium.org>
Reviewed-by: Henrique Ferreiro <hferreiro@igalia.com>
Reviewed-by: Kramer Ge <fangzhoug@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1249191}
---
third_party/wayland-protocols/BUILD.gn | 4 +
ui/ozone/common/bitmap_cursor_factory.cc | 90 +-------
.../common/bitmap_cursor_factory_unittest.cc | 12 +-
ui/ozone/platform/wayland/BUILD.gn | 5 +
.../platform/wayland/common/wayland_object.cc | 3 +
.../platform/wayland/common/wayland_object.h | 2 +
.../wayland/host/wayland_connection.cc | 3 +
.../wayland/host/wayland_connection.h | 7 +
.../host/wayland_connection_test_api.h | 5 +
.../wayland/host/wayland_cursor_shape.cc | 194 ++++++++++++++++++
.../wayland/host/wayland_cursor_shape.h | 53 +++++
.../platform/wayland/host/wayland_window.cc | 18 +-
.../wayland/host/wayland_window_unittest.cc | 76 +++++++
.../wayland/host/wayland_zcr_cursor_shapes.cc | 2 -
14 files changed, 371 insertions(+), 103 deletions(-)
create mode 100644 ui/ozone/platform/wayland/host/wayland_cursor_shape.cc
create mode 100644 ui/ozone/platform/wayland/host/wayland_cursor_shape.h
diff --git a/third_party/wayland-protocols/BUILD.gn b/third_party/wayland-protocols/BUILD.gn
index b0c0082769055..db15b95e41dd4 100644
--- a/third_party/wayland-protocols/BUILD.gn
+++ b/third_party/wayland-protocols/BUILD.gn
@@ -15,6 +15,10 @@ wayland_protocol("content_type_protocol") {
sources = [ "unstable/content-type/content-type-v1.xml" ]
}
+wayland_protocol("cursor_shape_protocol") {
+ sources = [ "src/staging/cursor-shape/cursor-shape-v1.xml" ]
+}
+
wayland_protocol("cursor_shapes_protocol") {
sources = [ "unstable/cursor-shapes/cursor-shapes-unstable-v1.xml" ]
}
diff --git a/ui/ozone/common/bitmap_cursor_factory.cc b/ui/ozone/common/bitmap_cursor_factory.cc
index cf9bb8655a9cb..fd7274ccd28e4 100644
--- a/ui/ozone/common/bitmap_cursor_factory.cc
+++ b/ui/ozone/common/bitmap_cursor_factory.cc
@@ -8,84 +8,11 @@
#include "base/check_op.h"
#include "base/memory/scoped_refptr.h"
-#include "build/chromeos_buildflags.h"
#include "ui/base/cursor/mojom/cursor_type.mojom-shared.h"
#include "ui/ozone/common/bitmap_cursor.h"
namespace ui {
-namespace {
-
-#if BUILDFLAG(IS_CHROMEOS_LACROS)
-// Returns true if ozone should use the default cursor for |type|, instead of
-// loading and storing bitmaps for it. Used on Lacros to skip client-side bitmap
-// loading for server-side cursors.
-bool UseDefaultCursorForType(mojom::CursorType type) {
- using mojom::CursorType;
- switch (type) {
- case CursorType::kNull:
- case CursorType::kPointer:
- case CursorType::kCross:
- case CursorType::kHand:
- case CursorType::kIBeam:
- case CursorType::kWait:
- case CursorType::kHelp:
- case CursorType::kEastResize:
- case CursorType::kNorthResize:
- case CursorType::kNorthEastResize:
- case CursorType::kNorthWestResize:
- case CursorType::kSouthResize:
- case CursorType::kSouthEastResize:
- case CursorType::kSouthWestResize:
- case CursorType::kWestResize:
- case CursorType::kNorthSouthResize:
- case CursorType::kEastWestResize:
- case CursorType::kNorthEastSouthWestResize:
- case CursorType::kNorthWestSouthEastResize:
- case CursorType::kColumnResize:
- case CursorType::kRowResize:
- case CursorType::kMiddlePanning:
- case CursorType::kEastPanning:
- case CursorType::kNorthPanning:
- case CursorType::kNorthEastPanning:
- case CursorType::kNorthWestPanning:
- case CursorType::kSouthPanning:
- case CursorType::kSouthEastPanning:
- case CursorType::kSouthWestPanning:
- case CursorType::kWestPanning:
- case CursorType::kMove:
- case CursorType::kVerticalText:
- case CursorType::kCell:
- case CursorType::kContextMenu:
- case CursorType::kAlias:
- case CursorType::kProgress:
- case CursorType::kNoDrop:
- case CursorType::kCopy:
- case CursorType::kNotAllowed:
- case CursorType::kZoomIn:
- case CursorType::kZoomOut:
- case CursorType::kGrab:
- case CursorType::kGrabbing:
- case CursorType::kDndNone:
- case CursorType::kDndMove:
- case CursorType::kDndCopy:
- case CursorType::kDndLink:
- return true;
- case CursorType::kNone:
- case CursorType::kMiddlePanningVertical:
- case CursorType::kMiddlePanningHorizontal:
- case CursorType::kCustom:
- case CursorType::kEastWestNoResize:
- case CursorType::kNorthEastSouthWestNoResize:
- case CursorType::kNorthSouthNoResize:
- case CursorType::kNorthWestSouthEastNoResize:
- return false;
- }
-}
-#endif // BUILDFLAG(IS_CHROMEOS_LACROS)
-
-} // namespace
-
BitmapCursorFactory::BitmapCursorFactory() = default;
BitmapCursorFactory::~BitmapCursorFactory() = default;
@@ -93,18 +20,11 @@ BitmapCursorFactory::~BitmapCursorFactory() = default;
scoped_refptr<PlatformCursor> BitmapCursorFactory::GetDefaultCursor(
mojom::CursorType type) {
if (!default_cursors_.count(type)) {
- if (type == mojom::CursorType::kNone
-#if BUILDFLAG(IS_CHROMEOS_LACROS)
- || UseDefaultCursorForType(type)
-#endif
- ) {
- // Lacros uses server-side cursors for most types. These cursors don't
- // need to load bitmap images on the client.
- // Similarly, the hidden cursor doesn't use any bitmap.
- default_cursors_[type] = base::MakeRefCounted<BitmapCursor>(type);
- } else {
- return nullptr;
- }
+ // Return a cursor not backed by a bitmap to preserve the type information.
+ // It can still be used to request the compositor to draw a server-side
+ // cursor for the given type.
+ // kNone is handled separately and does not need a bitmap.
+ default_cursors_[type] = base::MakeRefCounted<BitmapCursor>(type);
}
return default_cursors_[type];
diff --git a/ui/ozone/common/bitmap_cursor_factory_unittest.cc b/ui/ozone/common/bitmap_cursor_factory_unittest.cc
index 905b721d66193..6428821d90c6b 100644
--- a/ui/ozone/common/bitmap_cursor_factory_unittest.cc
+++ b/ui/ozone/common/bitmap_cursor_factory_unittest.cc
@@ -4,7 +4,6 @@
#include "ui/ozone/common/bitmap_cursor_factory.h"
-#include "build/chromeos_buildflags.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/cursor/mojom/cursor_type.mojom-shared.h"
#include "ui/base/cursor/platform_cursor.h"
@@ -24,8 +23,7 @@ TEST(BitmapCursorFactoryTest, InvisibleCursor) {
CursorType::kNone);
}
-#if BUILDFLAG(IS_CHROMEOS_LACROS)
-TEST(BitmapCursorFactoryTest, LacrosUsesDefaultCursorsForCommonTypes) {
+TEST(BitmapCursorFactoryTest, DefaultCursorsHaveTypeInformation) {
BitmapCursorFactory factory;
// Verify some common cursor types.
@@ -45,12 +43,4 @@ TEST(BitmapCursorFactoryTest, LacrosUsesDefaultCursorsForCommonTypes) {
CursorType::kIBeam);
}
-TEST(BitmapCursorFactoryTest, LacrosCustomCursor) {
- BitmapCursorFactory factory;
- auto cursor = factory.GetDefaultCursor(CursorType::kCustom);
- // Custom cursors don't have a default platform cursor.
- EXPECT_EQ(cursor, nullptr);
-}
-#endif // BUILDFLAG(IS_CHROMEOS_LACROS)
-
} // namespace ui
diff --git a/ui/ozone/platform/wayland/BUILD.gn b/ui/ozone/platform/wayland/BUILD.gn
index 8ebc966e1e1c3..d3dc3c736aa3c 100644
--- a/ui/ozone/platform/wayland/BUILD.gn
+++ b/ui/ozone/platform/wayland/BUILD.gn
@@ -103,6 +103,8 @@ source_set("wayland") {
"host/wayland_cursor.h",
"host/wayland_cursor_position.cc",
"host/wayland_cursor_position.h",
+ "host/wayland_cursor_shape.cc",
+ "host/wayland_cursor_shape.h",
"host/wayland_data_device.cc",
"host/wayland_data_device.h",
"host/wayland_data_device_base.cc",
@@ -256,6 +258,7 @@ source_set("wayland") {
"//third_party/wayland:wayland_util",
"//third_party/wayland-protocols:alpha_compositing_protocol",
"//third_party/wayland-protocols:content_type_protocol",
+ "//third_party/wayland-protocols:cursor_shape_protocol",
"//third_party/wayland-protocols:cursor_shapes_protocol",
"//third_party/wayland-protocols:extended_drag",
"//third_party/wayland-protocols:fractional_scale_protocol",
@@ -274,6 +277,7 @@ source_set("wayland") {
"//third_party/wayland-protocols:relative_pointer_protocol",
"//third_party/wayland-protocols:single_pixel_buffer",
"//third_party/wayland-protocols:stylus_protocol",
+ "//third_party/wayland-protocols:tablet_protocol",
"//third_party/wayland-protocols:text_input_extension_protocol",
"//third_party/wayland-protocols:text_input_protocol",
"//third_party/wayland-protocols:touchpad_haptics_protocol",
@@ -623,6 +627,7 @@ source_set("wayland_unittests") {
"//testing/gmock",
"//testing/gtest",
"//third_party/wayland:wayland_server",
+ "//third_party/wayland-protocols:cursor_shape_protocol",
"//third_party/wayland-protocols:cursor_shapes_protocol",
"//third_party/wayland-protocols:keyboard_extension_protocol",
"//third_party/wayland-protocols:linux_dmabuf_protocol",
diff --git a/ui/ozone/platform/wayland/common/wayland_object.cc b/ui/ozone/platform/wayland/common/wayland_object.cc
index bcc48aaeb186e..7f09a9f4f67dd 100644
--- a/ui/ozone/platform/wayland/common/wayland_object.cc
+++ b/ui/ozone/platform/wayland/common/wayland_object.cc
@@ -8,6 +8,7 @@
#include <aura-shell-client-protocol.h>
#include <chrome-color-management-client-protocol.h>
#include <content-type-v1-client-protocol.h>
+#include <cursor-shape-v1-client-protocol.h>
#include <cursor-shapes-unstable-v1-client-protocol.h>
#include <extended-drag-unstable-v1-client-protocol.h>
#include <fractional-scale-v1-client-protocol.h>
@@ -228,6 +229,8 @@ IMPLEMENT_WAYLAND_OBJECT_TRAITS(wp_viewport)
IMPLEMENT_WAYLAND_OBJECT_TRAITS(wp_viewporter)
IMPLEMENT_WAYLAND_OBJECT_TRAITS(wp_content_type_v1)
IMPLEMENT_WAYLAND_OBJECT_TRAITS(wp_content_type_manager_v1)
+IMPLEMENT_WAYLAND_OBJECT_TRAITS(wp_cursor_shape_device_v1)
+IMPLEMENT_WAYLAND_OBJECT_TRAITS(wp_cursor_shape_manager_v1)
IMPLEMENT_WAYLAND_OBJECT_TRAITS(wp_fractional_scale_manager_v1)
IMPLEMENT_WAYLAND_OBJECT_TRAITS(wp_fractional_scale_v1)
IMPLEMENT_WAYLAND_OBJECT_TRAITS(xdg_activation_v1)
diff --git a/ui/ozone/platform/wayland/common/wayland_object.h b/ui/ozone/platform/wayland/common/wayland_object.h
index c84c084841ea9..436e7ff5f3910 100644
--- a/ui/ozone/platform/wayland/common/wayland_object.h
+++ b/ui/ozone/platform/wayland/common/wayland_object.h
@@ -146,6 +146,8 @@ DECLARE_WAYLAND_OBJECT_TRAITS(wp_viewport)
DECLARE_WAYLAND_OBJECT_TRAITS(wp_viewporter)
DECLARE_WAYLAND_OBJECT_TRAITS(wp_content_type_manager_v1)
DECLARE_WAYLAND_OBJECT_TRAITS(wp_content_type_v1)
+DECLARE_WAYLAND_OBJECT_TRAITS(wp_cursor_shape_device_v1)
+DECLARE_WAYLAND_OBJECT_TRAITS(wp_cursor_shape_manager_v1)
DECLARE_WAYLAND_OBJECT_TRAITS(wp_fractional_scale_manager_v1)
DECLARE_WAYLAND_OBJECT_TRAITS(wp_fractional_scale_v1)
DECLARE_WAYLAND_OBJECT_TRAITS(xdg_activation_v1)
diff --git a/ui/ozone/platform/wayland/host/wayland_connection.cc b/ui/ozone/platform/wayland/host/wayland_connection.cc
index 5c62c0ead1497..944c9dd6904cd 100644
--- a/ui/ozone/platform/wayland/host/wayland_connection.cc
+++ b/ui/ozone/platform/wayland/host/wayland_connection.cc
@@ -41,6 +41,7 @@
#include "ui/ozone/platform/wayland/host/wayland_buffer_manager_host.h"
#include "ui/ozone/platform/wayland/host/wayland_cursor.h"
#include "ui/ozone/platform/wayland/host/wayland_cursor_position.h"
+#include "ui/ozone/platform/wayland/host/wayland_cursor_shape.h"
#include "ui/ozone/platform/wayland/host/wayland_data_device_manager.h"
#include "ui/ozone/platform/wayland/host/wayland_drm.h"
#include "ui/ozone/platform/wayland/host/wayland_event_source.h"
@@ -165,6 +166,8 @@ bool WaylandConnection::Initialize(bool use_threaded_polling) {
RegisterGlobalObjectFactory(WaylandZcrColorManager::kInterfaceName,
&WaylandZcrColorManager::Instantiate);
}
+ RegisterGlobalObjectFactory(WaylandCursorShape::kInterfaceName,
+ &WaylandCursorShape::Instantiate);
RegisterGlobalObjectFactory(WaylandZcrCursorShapes::kInterfaceName,
&WaylandZcrCursorShapes::Instantiate);
RegisterGlobalObjectFactory(WaylandZcrTouchpadHaptics::kInterfaceName,
diff --git a/ui/ozone/platform/wayland/host/wayland_connection.h b/ui/ozone/platform/wayland/host/wayland_connection.h
index b0bb930a3de99..13be193482721 100644
--- a/ui/ozone/platform/wayland/host/wayland_connection.h
+++ b/ui/ozone/platform/wayland/host/wayland_connection.h
@@ -62,6 +62,7 @@ class WaylandZwpPointerGestures;
class WaylandZwpRelativePointerManager;
class WaylandDataDeviceManager;
class WaylandCursorPosition;
+class WaylandCursorShape;
class WaylandWindowDragController;
class GtkPrimarySelectionDeviceManager;
class GtkShell1;
@@ -209,6 +210,10 @@ class WaylandConnection {
return zcr_color_manager_.get();
}
+ WaylandCursorShape* wayland_cursor_shape() const {
+ return cursor_shape_.get();
+ }
+
WaylandZcrCursorShapes* zcr_cursor_shapes() const {
return zcr_cursor_shapes_.get();
}
@@ -383,6 +388,7 @@ class WaylandConnection {
friend class WaylandZwpPointerGestures;
friend class WaylandZwpRelativePointerManager;
friend class WaylandZcrColorManager;
+ friend class WaylandCursorShape;
friend class WaylandZcrCursorShapes;
friend class XdgActivation;
friend class XdgForeignWrapper;
@@ -483,6 +489,7 @@ class WaylandConnection {
std::unique_ptr<WaylandZAuraOutputManager> zaura_output_manager_;
std::unique_ptr<WaylandZAuraShell> zaura_shell_;
std::unique_ptr<WaylandZcrColorManager> zcr_color_manager_;
+ std::unique_ptr<WaylandCursorShape> cursor_shape_;
std::unique_ptr<WaylandZcrCursorShapes> zcr_cursor_shapes_;
std::unique_ptr<WaylandZcrTouchpadHaptics> zcr_touchpad_haptics_;
std::unique_ptr<WaylandZwpPointerConstraints> zwp_pointer_constraints_;
diff --git a/ui/ozone/platform/wayland/host/wayland_connection_test_api.h b/ui/ozone/platform/wayland/host/wayland_connection_test_api.h
index 31e61aff6010b..419801f0257a3 100644
--- a/ui/ozone/platform/wayland/host/wayland_connection_test_api.h
+++ b/ui/ozone/platform/wayland/host/wayland_connection_test_api.h
@@ -10,6 +10,7 @@
#include "base/memory/raw_ptr.h"
#include "ui/ozone/platform/wayland/host/wayland_connection.h"
+#include "ui/ozone/platform/wayland/host/wayland_cursor_shape.h"
#include "ui/ozone/platform/wayland/host/wayland_zcr_cursor_shapes.h"
namespace ui {
@@ -22,6 +23,10 @@ class WaylandConnectionTestApi {
WaylandConnectionTestApi& operator=(const WaylandConnectionTestApi&) = delete;
~WaylandConnectionTestApi() = default;
+ void SetCursorShape(std::unique_ptr<WaylandCursorShape> obj) {
+ impl_->cursor_shape_ = std::move(obj);
+ }
+
void SetZcrCursorShapes(std::unique_ptr<WaylandZcrCursorShapes> obj) {
impl_->zcr_cursor_shapes_ = std::move(obj);
}
diff --git a/ui/ozone/platform/wayland/host/wayland_cursor_shape.cc b/ui/ozone/platform/wayland/host/wayland_cursor_shape.cc
new file mode 100644
index 0000000000000..e9b6f0c678c03
--- /dev/null
+++ b/ui/ozone/platform/wayland/host/wayland_cursor_shape.cc
@@ -0,0 +1,194 @@
+// Copyright 2024 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/ozone/platform/wayland/host/wayland_cursor_shape.h"
+
+#include <cursor-shape-v1-client-protocol.h>
+
+#include "base/check.h"
+#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "ui/base/cursor/mojom/cursor_type.mojom-shared.h"
+#include "ui/gfx/native_widget_types.h"
+#include "ui/ozone/platform/wayland/host/wayland_connection.h"
+#include "ui/ozone/platform/wayland/host/wayland_pointer.h"
+#include "ui/ozone/platform/wayland/host/wayland_seat.h"
+
+namespace ui {
+
+namespace {
+constexpr uint32_t kMinVersion = 1;
+}
+
+using mojom::CursorType;
+
+// static
+constexpr char WaylandCursorShape::kInterfaceName[];
+
+// static
+void WaylandCursorShape::Instantiate(WaylandConnection* connection,
+ wl_registry* registry,
+ uint32_t name,
+ const std::string& interface,
+ uint32_t version) {
+ CHECK_EQ(interface, kInterfaceName) << "Expected \"" << kInterfaceName
+ << "\" but got \"" << interface << "\"";
+
+ if (connection->cursor_shape_ ||
+ !wl::CanBind(interface, version, kMinVersion, kMinVersion)) {
+ return;
+ }
+
+ auto cursor_shape_manager =
+ wl::Bind<wp_cursor_shape_manager_v1>(registry, name, kMinVersion);
+ if (!cursor_shape_manager) {
+ LOG(ERROR) << "Failed to bind wp_cursor_shape_manager_v1";
+ return;
+ }
+ connection->cursor_shape_ = std::make_unique<WaylandCursorShape>(
+ cursor_shape_manager.release(), connection);
+}
+
+WaylandCursorShape::WaylandCursorShape(wp_cursor_shape_manager_v1* cursor_shape,
+ WaylandConnection* connection)
+ : wp_cursor_shape_manager_v1_(cursor_shape), connection_(connection) {
+ // |wp_cursor_shape_manager_v1_| and |connection_| may be null in tests.
+}
+
+WaylandCursorShape::~WaylandCursorShape() = default;
+
+wp_cursor_shape_device_v1* WaylandCursorShape::GetShapeDevice() {
+ DCHECK(connection_->seat()->pointer());
+
+ if (!wp_cursor_shape_device_v1_.get()) {
+ wl_pointer* pointer = connection_->seat()->pointer()->wl_object();
+ wp_cursor_shape_device_v1_.reset(wp_cursor_shape_manager_v1_get_pointer(
+ wp_cursor_shape_manager_v1_.get(), pointer));
+ }
+ DCHECK(wp_cursor_shape_device_v1_);
+ return wp_cursor_shape_device_v1_.get();
+}
+
+// static
+absl::optional<uint32_t> WaylandCursorShape::ShapeFromType(CursorType type) {
+ switch (type) {
+ case CursorType::kNull:
+ // kNull is an alias for kPointer. Fall through.
+ case CursorType::kPointer:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_DEFAULT;
+ case CursorType::kCross:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CROSSHAIR;
+ case CursorType::kHand:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_POINTER;
+ case CursorType::kIBeam:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_TEXT;
+ case CursorType::kWait:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_WAIT;
+ case CursorType::kHelp:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_HELP;
+ case CursorType::kEastResize:
+ case CursorType::kEastPanning:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_E_RESIZE;
+ case CursorType::kNorthResize:
+ case CursorType::kNorthPanning:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_N_RESIZE;
+ case CursorType::kNorthEastResize:
+ case CursorType::kNorthEastPanning:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NE_RESIZE;
+ case CursorType::kNorthWestResize:
+ case CursorType::kNorthWestPanning:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NW_RESIZE;
+ case CursorType::kSouthResize:
+ case CursorType::kSouthPanning:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_S_RESIZE;
+ case CursorType::kSouthEastResize:
+ case CursorType::kSouthEastPanning:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_SE_RESIZE;
+ case CursorType::kSouthWestResize:
+ case CursorType::kSouthWestPanning:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_SW_RESIZE;
+ case CursorType::kWestResize:
+ case CursorType::kWestPanning:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_W_RESIZE;
+ case CursorType::kNorthSouthResize:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NS_RESIZE;
+ case CursorType::kEastWestResize:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_EW_RESIZE;
+ case CursorType::kNorthEastSouthWestResize:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NESW_RESIZE;
+ case CursorType::kNorthWestSouthEastResize:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NWSE_RESIZE;
+ case CursorType::kColumnResize:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_COL_RESIZE;
+ case CursorType::kRowResize:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ROW_RESIZE;
+ case CursorType::kMove:
+ // Returning `MOVE` is the correct thing here, but Blink does not make a
+ // distinction between move and all-scroll. Other platforms use a cursor
+ // more consistent with all-scroll, so use that.
+ case CursorType::kMiddlePanning:
+ case CursorType::kMiddlePanningVertical:
+ case CursorType::kMiddlePanningHorizontal:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ALL_SCROLL;
+ case CursorType::kVerticalText:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_VERTICAL_TEXT;
+ case CursorType::kCell:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CELL;
+ case CursorType::kContextMenu:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CONTEXT_MENU;
+ case CursorType::kAlias:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ALIAS;
+ case CursorType::kProgress:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_PROGRESS;
+ case CursorType::kNoDrop:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NO_DROP;
+ case CursorType::kCopy:
+ case CursorType::kDndCopy:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_COPY;
+ case CursorType::kNone:
+ // To be cleared through wl_pointer.set_cursor.
+ return absl::nullopt;
+ case CursorType::kNotAllowed:
+ case CursorType::kNorthSouthNoResize:
+ case CursorType::kEastWestNoResize:
+ case CursorType::kNorthEastSouthWestNoResize:
+ case CursorType::kNorthWestSouthEastNoResize:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_NOT_ALLOWED;
+ case CursorType::kZoomIn:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ZOOM_IN;
+ case CursorType::kZoomOut:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_ZOOM_OUT;
+ case CursorType::kGrab:
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_GRAB;
+ case CursorType::kGrabbing:
+ case CursorType::kDndNone:
+ case CursorType::kDndMove:
+ case CursorType::kDndLink:
+ // For drag-and-drop, the compositor knows the drag type and can use it to
+ // additionally decorate the cursor.
+ return WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_GRABBING;
+ case CursorType::kCustom:
+ // "Custom" means a bitmap cursor, which cannot use the shape API.
+ return absl::nullopt;
+ }
+}
+
+void WaylandCursorShape::SetCursorShape(uint32_t shape) {
+ DCHECK(connection_->seat());
+
+ // Nothing to do if there is no pointer (mouse) connected.
+ if (!connection_->seat()->pointer()) {
+ return;
+ }
+
+ auto pointer_enter_serial =
+ connection_->serial_tracker().GetSerial(wl::SerialType::kMouseEnter);
+ if (!pointer_enter_serial) {
+ VLOG(1) << "Failed to set cursor shape: no mouse enter serial found.";
+ return;
+ }
+ wp_cursor_shape_device_v1_set_shape(GetShapeDevice(),
+ pointer_enter_serial->value, shape);
+}
+
+} // namespace ui
diff --git a/ui/ozone/platform/wayland/host/wayland_cursor_shape.h b/ui/ozone/platform/wayland/host/wayland_cursor_shape.h
new file mode 100644
index 0000000000000..9bb2fab21a539
--- /dev/null
+++ b/ui/ozone/platform/wayland/host/wayland_cursor_shape.h
@@ -0,0 +1,53 @@
+// Copyright 2024 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_CURSOR_SHAPE_H_
+#define UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_CURSOR_SHAPE_H_
+
+#include "base/memory/raw_ptr.h"
+#include "third_party/abseil-cpp/absl/types/optional.h"
+#include "ui/base/cursor/mojom/cursor_type.mojom-forward.h"
+#include "ui/ozone/platform/wayland/common/wayland_object.h"
+
+namespace ui {
+
+class WaylandConnection;
+
+// Wraps the cursor_shape interface for Wayland server-side cursor support.
+class WaylandCursorShape
+ : public wl::GlobalObjectRegistrar<WaylandCursorShape> {
+ public:
+ static constexpr char kInterfaceName[] = "wp_cursor_shape_manager_v1";
+
+ static void Instantiate(WaylandConnection* connection,
+ wl_registry* registry,
+ uint32_t name,
+ const std::string& interface,
+ uint32_t version);
+
+ WaylandCursorShape(wp_cursor_shape_manager_v1* cursor_shape,
+ WaylandConnection* connection);
+ WaylandCursorShape(const WaylandCursorShape&) = delete;
+ WaylandCursorShape& operator=(const WaylandCursorShape&) = delete;
+ virtual ~WaylandCursorShape();
+
+ // Returns the cursor shape value for a cursor |type|, or nullopt if the
+ // type isn't supported by Wayland's cursor shape API.
+ static absl::optional<uint32_t> ShapeFromType(mojom::CursorType type);
+
+ // Calls wp_cursor_shape_device_v1_set_shape(). See interface description
+ // for values for |shape|. Virtual for testing.
+ virtual void SetCursorShape(uint32_t shape);
+
+ private:
+ wp_cursor_shape_device_v1* GetShapeDevice();
+
+ const wl::Object<wp_cursor_shape_manager_v1> wp_cursor_shape_manager_v1_;
+ wl::Object<wp_cursor_shape_device_v1> wp_cursor_shape_device_v1_;
+ const raw_ptr<WaylandConnection> connection_;
+};
+
+} // namespace ui
+
+#endif // UI_OZONE_PLATFORM_WAYLAND_HOST_WAYLAND_CURSOR_SHAPE_H_
diff --git a/ui/ozone/platform/wayland/host/wayland_window.cc b/ui/ozone/platform/wayland/host/wayland_window.cc
index 68f87776ef4f0..f5c36964ad36d 100644
--- a/ui/ozone/platform/wayland/host/wayland_window.cc
+++ b/ui/ozone/platform/wayland/host/wayland_window.cc
@@ -41,6 +41,7 @@
#include "ui/ozone/platform/wayland/common/wayland_overlay_config.h"
#include "ui/ozone/platform/wayland/host/dump_util.h"
#include "ui/ozone/platform/wayland/host/wayland_connection.h"
+#include "ui/ozone/platform/wayland/host/wayland_cursor_shape.h"
#include "ui/ozone/platform/wayland/host/wayland_data_drag_controller.h"
#include "ui/ozone/platform/wayland/host/wayland_event_source.h"
#include "ui/ozone/platform/wayland/host/wayland_frame_manager.h"
@@ -1110,7 +1111,9 @@ void WaylandWindow::UpdateCursorShape(scoped_refptr<BitmapCursor> cursor) {
base::IsValueInRangeForNumericType<int>(
cursor->cursor_image_scale_factor()));
- absl::optional<int32_t> shape =
+ absl::optional<uint32_t> shape =
+ WaylandCursorShape::ShapeFromType(cursor->type());
+ absl::optional<int32_t> zcr_shape =
WaylandZcrCursorShapes::ShapeFromType(cursor->type());
// Round cursor scale factor to ceil as wl_surface.set_buffer_scale accepts
@@ -1118,20 +1121,25 @@ void WaylandWindow::UpdateCursorShape(scoped_refptr<BitmapCursor> cursor) {
if (cursor->type() == CursorType::kNone) { // Hide the cursor.
connection_->SetCursorBitmap(
{}, gfx::Point(), std::ceil(cursor->cursor_image_scale_factor()));
+ } else if (connection_->wayland_cursor_shape() && shape.has_value()) {
+ // Prefer Wayland server-side cursor support, as the compositor knows better
+ // how to draw the cursor.
+ connection_->wayland_cursor_shape()->SetCursorShape(shape.value());
} else if (cursor->platform_data()) { // Check for theme-provided cursor.
connection_->SetPlatformCursor(
reinterpret_cast<wl_cursor*>(cursor->platform_data()),
std::ceil(cursor->cursor_image_scale_factor()));
} else if (connection_->zcr_cursor_shapes() &&
- shape.has_value()) { // Check for Wayland server-side cursor
- // support (e.g. exo for lacros).
+ zcr_shape.has_value()) { // Check for Exo server-side cursor
+ // support.
#if BUILDFLAG(IS_CHROMEOS_LACROS)
// Lacros should not load image assets for default cursors. See
// `BitmapCursorFactory::GetDefaultCursor()`.
DCHECK(cursor->bitmaps().empty());
#endif // BUILDFLAG(IS_CHROMEOS_LACROS)
- connection_->zcr_cursor_shapes()->SetCursorShape(shape.value());
- } else { // Use client-side bitmap cursors as fallback.
+ connection_->zcr_cursor_shapes()->SetCursorShape(zcr_shape.value());
+ } else if (!cursor->bitmaps()
+ .empty()) { // Use client-side bitmap cursors as fallback.
// Translate physical pixels to DIPs.
gfx::Point hotspot_in_dips = gfx::ScaleToRoundedPoint(
cursor->hotspot(), 1.0f / cursor->cursor_image_scale_factor());
diff --git a/ui/ozone/platform/wayland/host/wayland_window_unittest.cc b/ui/ozone/platform/wayland/host/wayland_window_unittest.cc
index 49dcdfed360fe..7a1640bc6f045 100644
--- a/ui/ozone/platform/wayland/host/wayland_window_unittest.cc
+++ b/ui/ozone/platform/wayland/host/wayland_window_unittest.cc
@@ -11,6 +11,7 @@
#include <utility>
#include <vector>
+#include <cursor-shape-v1-client-protocol.h>
#include <cursor-shapes-unstable-v1-client-protocol.h>
#include <linux/input.h>
#include <wayland-server-core.h>
@@ -51,6 +52,7 @@
#include "ui/ozone/platform/wayland/common/wayland_util.h"
#include "ui/ozone/platform/wayland/host/wayland_buffer_manager_host.h"
#include "ui/ozone/platform/wayland/host/wayland_connection_test_api.h"
+#include "ui/ozone/platform/wayland/host/wayland_cursor_shape.h"
#include "ui/ozone/platform/wayland/host/wayland_event_source.h"
#include "ui/ozone/platform/wayland/host/wayland_output.h"
#include "ui/ozone/platform/wayland/host/wayland_output_manager.h"
@@ -146,6 +148,16 @@ wl::ScopedWlArray MakeStateArray(const std::vector<int32_t> states) {
return wl::ScopedWlArray(states);
}
+class MockCursorShape : public WaylandCursorShape {
+ public:
+ MockCursorShape() : WaylandCursorShape(nullptr, nullptr) {}
+ MockCursorShape(const MockCursorShape&) = delete;
+ MockCursorShape& operator=(const MockCursorShape&) = delete;
+ ~MockCursorShape() override = default;
+
+ MOCK_METHOD(void, SetCursorShape, (uint32_t), (override));
+};
+
class MockZcrCursorShapes : public WaylandZcrCursorShapes {
public:
MockZcrCursorShapes() : WaylandZcrCursorShapes(nullptr, nullptr) {}
@@ -264,6 +276,14 @@ class WaylandWindowTest : public WaylandTest {
hit_tests->push_back(static_cast<int>(HTTOPRIGHT));
}
+ MockCursorShape* InstallMockCursorShape() {
+ auto zcr_cursor_shapes = std::make_unique<MockCursorShape>();
+ MockCursorShape* mock_cursor_shapes = zcr_cursor_shapes.get();
+ WaylandConnectionTestApi test_api(connection_.get());
+ test_api.SetCursorShape(std::move(zcr_cursor_shapes));
+ return mock_cursor_shapes;
+ }
+
MockZcrCursorShapes* InstallMockZcrCursorShapes() {
auto zcr_cursor_shapes = std::make_unique<MockZcrCursorShapes>();
MockZcrCursorShapes* mock_cursor_shapes = zcr_cursor_shapes.get();
@@ -1692,6 +1712,62 @@ TEST_P(WaylandWindowTest, CanDispatchMouseEventFocus) {
EXPECT_TRUE(window_->CanDispatchEvent(&test_mouse_event_));
}
+TEST_P(WaylandWindowTest, SetCursorUsesCursorShapeForCommonTypes) {
+ SetPointerFocusedWindow(window_.get());
+ MockCursorShape* mock_cursor_shape = InstallMockCursorShape();
+
+ // Verify some commonly-used cursors.
+ EXPECT_CALL(*mock_cursor_shape,
+ SetCursorShape(WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_DEFAULT));
+ auto pointer_cursor = AsPlatformCursor(
+ base::MakeRefCounted<BitmapCursor>(mojom::CursorType::kPointer));
+ window_->SetCursor(pointer_cursor.get());
+
+ EXPECT_CALL(*mock_cursor_shape,
+ SetCursorShape(WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_POINTER));
+ auto hand_cursor = AsPlatformCursor(
+ base::MakeRefCounted<BitmapCursor>(mojom::CursorType::kHand));
+ window_->SetCursor(hand_cursor.get());
+
+ EXPECT_CALL(*mock_cursor_shape,
+ SetCursorShape(WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_TEXT));
+ auto ibeam_cursor = AsPlatformCursor(
+ base::MakeRefCounted<BitmapCursor>(mojom::CursorType::kIBeam));
+ window_->SetCursor(ibeam_cursor.get());
+}
+
+TEST_P(WaylandWindowTest, SetCursorCallsCursorShapeOncePerCursor) {
+ SetPointerFocusedWindow(window_.get());
+ MockCursorShape* mock_cursor_shape = InstallMockCursorShape();
+ auto hand_cursor = AsPlatformCursor(
+ base::MakeRefCounted<BitmapCursor>(mojom::CursorType::kHand));
+ // Setting the same cursor twice on the client only calls the server once.
+ EXPECT_CALL(*mock_cursor_shape, SetCursorShape(_)).Times(1);
+ window_->SetCursor(hand_cursor.get());
+ window_->SetCursor(hand_cursor.get());
+}
+
+TEST_P(WaylandWindowTest, SetCursorDoesNotUseCursorShapeForNoneCursor) {
+ SetPointerFocusedWindow(window_.get());
+ MockCursorShape* mock_cursor_shape = InstallMockCursorShape();
+ EXPECT_CALL(*mock_cursor_shape, SetCursorShape(_)).Times(0);
+ auto none_cursor = AsPlatformCursor(
+ base::MakeRefCounted<BitmapCursor>(mojom::CursorType::kNone));
+ window_->SetCursor(none_cursor.get());
+}
+
+TEST_P(WaylandWindowTest, SetCursorDoesNotUseCursorShapeForCustomCursors) {
+ SetPointerFocusedWindow(window_.get());
+ MockCursorShape* mock_cursor_shape = InstallMockCursorShape();
+
+ // Custom cursors require bitmaps, so they do not use server-side cursors.
+ EXPECT_CALL(*mock_cursor_shape, SetCursorShape(_)).Times(0);
+ auto custom_cursor = AsPlatformCursor(
+ base::MakeRefCounted<BitmapCursor>(mojom::CursorType::kCustom, SkBitmap(),
+ gfx::Point(), kDefaultCursorScale));
+ window_->SetCursor(custom_cursor.get());
+}
+
TEST_P(WaylandWindowTest, SetCursorUsesZcrCursorShapesForCommonTypes) {
SetPointerFocusedWindow(window_.get());
MockZcrCursorShapes* mock_cursor_shapes = InstallMockZcrCursorShapes();
diff --git a/ui/ozone/platform/wayland/host/wayland_zcr_cursor_shapes.cc b/ui/ozone/platform/wayland/host/wayland_zcr_cursor_shapes.cc
index 9e3243dceea20..297c48e614087 100644
--- a/ui/ozone/platform/wayland/host/wayland_zcr_cursor_shapes.cc
+++ b/ui/ozone/platform/wayland/host/wayland_zcr_cursor_shapes.cc
@@ -168,8 +168,6 @@ absl::optional<int32_t> WaylandZcrCursorShapes::ShapeFromType(CursorType type) {
return ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_DND_COPY;
case CursorType::kDndLink:
return ZCR_CURSOR_SHAPES_V1_CURSOR_SHAPE_TYPE_DND_LINK;
- // NOTE: If you add a new cursor shape, please also update
- // UseDefaultCursorForType() in bitmap_cursor_factory_ozone.cc.
}
}

View File

@@ -1,31 +0,0 @@
From a1062e06b75987cb4cde9186f867d40cb681cd1d Mon Sep 17 00:00:00 2001
From: Jose Dapena Paz <jdapena@igalia.com>
Date: Thu, 2 Nov 2023 15:17:14 +0000
Subject: [PATCH] IWYU: returning nullptr of WebBackgroundResourceFetchAssets
scoped_refptr requires declaration
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Bug: 957519
Change-Id: Ief6471b89bc60812866cdc2d4e76575b32c4c6c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4993184
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
Reviewed-by: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1218823}
---
third_party/blink/public/web/web_local_frame_client.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h
index 714eef7a6809e0..64d8aca52be5e6 100644
--- a/third_party/blink/public/web/web_local_frame_client.h
+++ b/third_party/blink/public/web/web_local_frame_client.h
@@ -69,6 +69,7 @@
#include "third_party/blink/public/platform/modules/service_worker/web_service_worker_provider.h"
#include "third_party/blink/public/platform/resource_load_info_notifier_wrapper.h"
#include "third_party/blink/public/platform/url_loader_throttle_provider.h"
+#include "third_party/blink/public/platform/web_background_resource_fetch_assets.h"
#include "third_party/blink/public/platform/web_common.h"
#include "third_party/blink/public/platform/web_content_security_policy_struct.h"
#include "third_party/blink/public/platform/web_content_settings_client.h"