diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..7e97c2e --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,387 @@ +# Maintainer: Bruno Pagani +# Maintainer: Caleb Maclennan +# Contributor: Pascal Ernster + +_use_suffix=1 +pkgver=22.3.12 +_commit=b07f2f0f42a1483cd2e5ec8fa3c77ebaa0507069 +_chromiumver=108.0.5359.215 +_gcc_patchset=2 +# shellcheck disable=SC2034 +pkgrel=1 + +_major_ver=${pkgver%%.*} +if [[ ${_use_suffix} != 0 ]]; then + pkgname="electron${_major_ver}" +else + pkgname=electron +fi +# shellcheck disable=SC2034 +pkgdesc='Build cross platform desktop apps with web technologies' +# shellcheck disable=SC2034 +arch=('x86_64') +# shellcheck disable=SC2034 +url='https://electronjs.org/' +# shellcheck disable=SC2034 +license=('MIT' 'custom') +# shellcheck disable=SC2034 +depends=('c-ares' 'gtk3' 'libevent' 'nss' 'wayland') +# shellcheck disable=SC2034 +makedepends=('clang' 'git' 'gn' 'gperf' 'harfbuzz-icu' 'http-parser' + 'qt5-base' 'java-runtime-headless' 'libnotify' 'lld' 'llvm' + 'ninja' 'npm' 'pciutils' 'pipewire' 'python' 'python-httplib2' + 'python-pyparsing' 'python-six' 'wget' 'yarn' 'patchutils') +# shellcheck disable=SC2034 +optdepends=('kde-cli-tools: file deletion support (kioclient5)' + 'libappindicator-gtk3: StatusNotifierItem support' + 'pipewire: WebRTC desktop sharing under Wayland' + 'qt5-base: enable Qt5 with --enable-features=AllowQt' + 'trash-cli: file deletion support (trash-put)' + 'xdg-utils: open URLs with desktop’s default (xdg-email, xdg-open)') +if [[ ${_use_suffix} == 0 ]]; then + # shellcheck disable=SC2034 + conflicts=("electron${_major_ver}") + # shellcheck disable=SC2034 + provides=("electron${_major_ver}") +fi +# shellcheck disable=SC2034 +options=('!lto') # Electron adds its own flags for ThinLTO +# shellcheck disable=SC2034 +source=("git+https://github.com/electron/electron.git#commit=$_commit" + 'git+https://chromium.googlesource.com/chromium/tools/depot_tools.git#branch=main' + "chromium::git+https://chromium.googlesource.com/chromium/src.git#tag=$_chromiumver" + "https://github.com/stha09/chromium-patches/releases/download/chromium-${_chromiumver%%.*}-patchset-${_gcc_patchset}/chromium-${_chromiumver%%.*}-patchset-${_gcc_patchset}.tar.xz" + "electron-launcher.sh" + "electron.desktop" + 'default_app-icon.patch' + 'jinja-python-3.10.patch' + 'use-system-libraries-in-node.patch' + 'std-vector-non-const.patch' + 're-fix-TFLite-build-error-on-linux-with-system-zlib.patch' + 'chromium-icu72.patch' + 'v8-enhance-Date-parser-to-take-Unicode-SPACE.patch' + 'swiftshader-add-cstdint-for-uint64_t.patch' + 'dawn-iwyu-add-cstdint-for-uint8_t.patch' + 'iwyu-add-stdint.h-for-various-int-types-in-base.patch' + 'iwyu-add-cstdint-for-uintptr_t-in-device.patch' + 'iwyu-add-stdint.h-for-uint32_t-in-chrome_pdf.patch' + 'iwyu-add-stdint.h-for-uint64_t-in-EncounteredSurface.patch' + 'iwyu-add-stdint.h-for-integer-types-in-ui.patch' + 'openscreen-iwyu-add-stdint.h.patch' + 'pdfium-iwyu-add-stdint.h-for-uint32_t.patch' + 'iwyu-add-stdint.h-for-uint32_t-in-cc.patch' + 'add-missing-includes-causing-build-errors.patch' + 'iwyu-add-stdint.h-for-int-types-in-gpu_feature_info.patch' + 'iwyu-add-stdint.h-for-various-int-types-in-comp.patch' + 'iwyu-add-stdint.h-for-various-integer-types-in-net.patch' + 'iwyu-add-cstdint-for-int-types-in-s2cellid.patch' + 'random-fixes-for-gcc13.patch' + 'more-fixes-for-gcc13.patch' + 'https://github.com/google/angle/commit/5d1ac2e0d5f61913aad62dadb65a7fea6f1b93ae.patch' + 'dawn-tint-add-cstdint.patch' + 'comp-viz-add-cstdint.patch' + 'REVERT-roll-src-third_party-ffmpeg-m102.patch' + 'REVERT-roll-src-third_party-ffmpeg-m106.patch' + 'angle-wayland-include-protocol.patch' + ) +# shellcheck disable=SC2034 +sha256sums=('SKIP' + 'SKIP' + 'SKIP' + '40ef8af65e78901bb8554eddbbb5ebc55c0b8e7927f6ca51b2a353d1c7c50652' + '77817939c9833f8dda74a8c75620c15747170551ffa6f14f7c5b4071599e8831' + '4484200d90b76830b69eea3a471c103999a3ce86bb2c29e6c14c945bf4102bae' + 'dd2d248831dd4944d385ebf008426e66efe61d6fdf66f8932c963a12167947b4' + '55dbe71dbc1f3ab60bf1fa79f7aea7ef1fe76436b1d7df48728a1f8227d2134e' + 'ff588a8a4fd2f79eb8a4f11cf1aa151298ffb895be566c57cc355d47f161f53f' + '893bc04c7fceba2f0a7195ed48551d55f066bbc530ec934c89c55768e6f3949c' + '9015b9d6d5b4c1e7248d6477a4b4b6bd6a3ebdc57225d2d8efcd79fc61790716' + 'dabb5ab204b63be73d3c5c8b7c1fa74053105a285852ba3bbc4fb77646608572' + 'b83406a881d66627757d9cbc05e345cbb2bd395a48b6d4c970e5e1cb3f6ed454' + '208f2ebcef5c690207e6e798ffbf9e92214e9d35f415c2f6b93efebad831b7e2' + '94baaaa6fbec0af6ec2e967f0b7440b4261a927e853e212d84f0aeaf56ae53f0' + '0003e737072f4f1b22ff932221595e85dd9bf65720ccac36f840cccb8000e3e1' + 'ffe499d63c9c1074cbc3995c188c89b748388dbb9dccf975ce28a434c723acf7' + '7af466e4b5985cc9f0b33df2f3cd2e458c7cbfd7190505d105aad4401c9d072b' + '727588a1b42f6cfe54acf4759a0c3ad3778590d5a5cefcdcb54b579ba16b09c8' + '0914be53b2205b34e4da96f5a94505ac2a01e3639ff433535a23be2d0d581fa7' + '8c9662bed23bfd66ae76d044541f316624386ca4b3baef57a47289feb3db58a9' + '890b6836cea4c31513166db720b210da20d20bcd97a713545268cceffd707af5' + 'f6a0e149ef5195883c56a875ae366ed92d9960652f2657bfb65b5408badafc65' + '3255477d02d49ef86d47c727b9369f46dc787319bb648bf267a68f37e2041e50' + '94995b4e37671dcd27968bd5a2ebcf50e67bd22659a4bb4a5d0a4f81ff54f471' + '6b3c296de83c333678bc3d7cac939f33bbadae94c96299566ff2e31121c46256' + '5dfbfd073f78c887bbffca2b644116571cc9b1196867e44e8fc0cbb40afcf1bc' + 'd97dc00f66fa5868584e4b6d5ef817911eab2dc8022a37c75a00d063f4dac483' + '3fb0636e9560760d99e7c9606b1c9b59eef9d91ed3419cc95b43302759f249be' + '9d1f69f668e12fc14b4ccbcf88cb5a3acf666df06dafa8834f037bd8110ca17f' + '48fe31d28bf17b720bb22a42a20e8e2f9a558e8c1b7e2fcc19fd14c7242dfdb8' + 'f41215af1f98d552cdfde7e924ba6d2f77883310aad57ebba7fe73d3883f8668' + 'bfafedebd915e1824562329a3afc8589401342eff87dba53c78502b869023b7e' + '30df59a9e2d95dcb720357ec4a83d9be51e59cc5551365da4c0073e68ccdec44' + '4c12d31d020799d31355faa7d1fe2a5a807f7458e7f0c374adf55edb37032152' + 'cd0d9d2a1d6a522d47c3c0891dabe4ad72eabbebc0fe5642b9e22efa3d5ee572') + +# Possible replacements are listed in build/linux/unbundle/replace_gn_files.py +# Keys are the names in the above script; values are the dependencies in Arch +declare -gA _system_libs=( + [brotli]=brotli + [dav1d]=dav1d + [ffmpeg]=ffmpeg + [flac]=flac + [fontconfig]=fontconfig + [freetype]=freetype2 + [harfbuzz-ng]=harfbuzz + [icu]=icu + [jsoncpp]=jsoncpp + [libaom]=aom + #[libavif]=libavif # https://github.com/AOMediaCodec/libavif/commit/4d2776a3 + [libdrm]= + [libjpeg]=libjpeg + [libpng]=libpng + #[libvpx]=libvpx + [libwebp]=libwebp + [libxml]=libxml2 + [libxslt]=libxslt + [opus]=opus + [re2]=re2 + [snappy]=snappy + [woff2]=woff2 + [zlib]=minizip +) +_unwanted_bundled_libs=( + $(printf "%s\n" ${!_system_libs[@]} | sed 's/^libjpeg$/&_turbo/') +) +depends+=(${_system_libs[@]}) + +prepare() { + sed -i "s|@ELECTRON@|${pkgname}|" electron-launcher.sh + sed -i "s|@ELECTRON@|${pkgname}|" electron.desktop + if [[ ${_use_suffix} != 0 ]]; then + sed -i "s|@ELECTRON_NAME@|Electron ${_major_ver}|" electron.desktop + else + sed -i "s|@ELECTRON_NAME@|Electron|" electron.desktop + fi + +cat >.gclient < +Date: Sat, 2 Apr 2022 05:13:53 +0000 +Subject: [PATCH] Roll src/third_party/ffmpeg/ 574c39cce..32b2d1d526 (1125 + commits) + +https://chromium.googlesource.com/chromium/third_party/ffmpeg.git/+log/574c39cce323..32b2d1d526 + +Created with: + roll-dep src/third_party/ffmpeg + +Fixed: 1293918 +Cq-Include-Trybots: luci.chromium.try:mac_chromium_asan_rel_ng,linux_chromium_asan_rel_ng,linux_chromium_chromeos_asan_rel_ng +Change-Id: I41945d0f963e3d1f65940067bac22f63b68e37d2 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3565647 +Auto-Submit: Dale Curtis +Reviewed-by: Dan Sanders +Commit-Queue: Dale Curtis +Cr-Commit-Position: refs/heads/main@{#988253} +--- + .../clear_key_cdm/ffmpeg_cdm_audio_decoder.cc | 29 ++++++++++--------- + media/ffmpeg/ffmpeg_common.cc | 11 +++---- + media/filters/audio_file_reader.cc | 9 +++--- + media/filters/audio_file_reader_unittest.cc | 6 ++-- + .../filters/audio_video_metadata_extractor.cc | 11 +++++-- + .../filters/ffmpeg_aac_bitstream_converter.cc | 7 +++-- + ...ffmpeg_aac_bitstream_converter_unittest.cc | 2 +- + media/filters/ffmpeg_audio_decoder.cc | 13 +++++---- + 8 files changed, 51 insertions(+), 37 deletions(-) + +diff --git a/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc b/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc +index e4fc3f460e2..9b1ad9f7675 100644 +--- a/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc ++++ b/media/cdm/library_cdm/clear_key_cdm/ffmpeg_cdm_audio_decoder.cc +@@ -74,7 +74,7 @@ void CdmAudioDecoderConfigToAVCodecContext( + codec_context->sample_fmt = AV_SAMPLE_FMT_NONE; + } + +- codec_context->channels = config.channel_count; ++ codec_context->ch_layout.nb_channels = config.channel_count; + codec_context->sample_rate = config.samples_per_second; + + if (config.extra_data) { +@@ -124,8 +124,8 @@ void CopySamples(cdm::AudioFormat cdm_format, + case cdm::kAudioFormatPlanarS16: + case cdm::kAudioFormatPlanarF32: { + const int decoded_size_per_channel = +- decoded_audio_size / av_frame.channels; +- for (int i = 0; i < av_frame.channels; ++i) { ++ decoded_audio_size / av_frame.ch_layout.nb_channels; ++ for (int i = 0; i < av_frame.ch_layout.nb_channels; ++i) { + memcpy(output_buffer, av_frame.extended_data[i], + decoded_size_per_channel); + output_buffer += decoded_size_per_channel; +@@ -185,13 +185,14 @@ bool FFmpegCdmAudioDecoder::Initialize( + // Success! + decoding_loop_ = std::make_unique(codec_context_.get()); + samples_per_second_ = config.samples_per_second; +- bytes_per_frame_ = codec_context_->channels * config.bits_per_channel / 8; ++ bytes_per_frame_ = ++ codec_context_->ch_layout.nb_channels * config.bits_per_channel / 8; + output_timestamp_helper_ = + std::make_unique(config.samples_per_second); + is_initialized_ = true; + + // Store initial values to guard against midstream configuration changes. +- channels_ = codec_context_->channels; ++ channels_ = codec_context_->ch_layout.nb_channels; + av_sample_format_ = codec_context_->sample_fmt; + + return true; +@@ -291,17 +292,19 @@ cdm::Status FFmpegCdmAudioDecoder::DecodeBuffer( + for (auto& frame : audio_frames) { + int decoded_audio_size = 0; + if (frame->sample_rate != samples_per_second_ || +- frame->channels != channels_ || frame->format != av_sample_format_) { ++ frame->ch_layout.nb_channels != channels_ || ++ frame->format != av_sample_format_) { + DLOG(ERROR) << "Unsupported midstream configuration change!" + << " Sample Rate: " << frame->sample_rate << " vs " +- << samples_per_second_ << ", Channels: " << frame->channels +- << " vs " << channels_ << ", Sample Format: " << frame->format +- << " vs " << av_sample_format_; ++ << samples_per_second_ ++ << ", Channels: " << frame->ch_layout.nb_channels << " vs " ++ << channels_ << ", Sample Format: " << frame->format << " vs " ++ << av_sample_format_; + return cdm::kDecodeError; + } + + decoded_audio_size = av_samples_get_buffer_size( +- nullptr, codec_context_->channels, frame->nb_samples, ++ nullptr, codec_context_->ch_layout.nb_channels, frame->nb_samples, + codec_context_->sample_fmt, 1); + if (!decoded_audio_size) + continue; +@@ -320,9 +323,9 @@ bool FFmpegCdmAudioDecoder::OnNewFrame( + size_t* total_size, + std::vector>* audio_frames, + AVFrame* frame) { +- *total_size += av_samples_get_buffer_size(nullptr, codec_context_->channels, +- frame->nb_samples, +- codec_context_->sample_fmt, 1); ++ *total_size += av_samples_get_buffer_size( ++ nullptr, codec_context_->ch_layout.nb_channels, frame->nb_samples, ++ codec_context_->sample_fmt, 1); + audio_frames->emplace_back(av_frame_clone(frame)); + return true; + } +diff --git a/media/ffmpeg/ffmpeg_common.cc b/media/ffmpeg/ffmpeg_common.cc +index 87ca8969626..76f03d6608e 100644 +--- a/media/ffmpeg/ffmpeg_common.cc ++++ b/media/ffmpeg/ffmpeg_common.cc +@@ -345,10 +345,11 @@ bool AVCodecContextToAudioDecoderConfig(const AVCodecContext* codec_context, + codec_context->sample_fmt, codec_context->codec_id); + + ChannelLayout channel_layout = +- codec_context->channels > 8 ++ codec_context->ch_layout.nb_channels > 8 + ? CHANNEL_LAYOUT_DISCRETE +- : ChannelLayoutToChromeChannelLayout(codec_context->channel_layout, +- codec_context->channels); ++ : ChannelLayoutToChromeChannelLayout( ++ codec_context->ch_layout.u.mask, ++ codec_context->ch_layout.nb_channels); + + int sample_rate = codec_context->sample_rate; + switch (codec) { +@@ -401,7 +402,7 @@ bool AVCodecContextToAudioDecoderConfig(const AVCodecContext* codec_context, + extra_data, encryption_scheme, seek_preroll, + codec_context->delay); + if (channel_layout == CHANNEL_LAYOUT_DISCRETE) +- config->SetChannelsForDiscrete(codec_context->channels); ++ config->SetChannelsForDiscrete(codec_context->ch_layout.nb_channels); + + #if BUILDFLAG(ENABLE_PLATFORM_AC3_EAC3_AUDIO) + // These are bitstream formats unknown to ffmpeg, so they don't have +@@ -470,7 +471,7 @@ void AudioDecoderConfigToAVCodecContext(const AudioDecoderConfig& config, + + // TODO(scherkus): should we set |channel_layout|? I'm not sure if FFmpeg uses + // said information to decode. +- codec_context->channels = config.channels(); ++ codec_context->ch_layout.nb_channels = config.channels(); + codec_context->sample_rate = config.samples_per_second(); + + if (config.extra_data().empty()) { +diff --git a/media/filters/audio_file_reader.cc b/media/filters/audio_file_reader.cc +index 5f257bdfaa6..e1be5aa9a5b 100644 +--- a/media/filters/audio_file_reader.cc ++++ b/media/filters/audio_file_reader.cc +@@ -113,14 +113,15 @@ bool AudioFileReader::OpenDecoder() { + + // Verify the channel layout is supported by Chrome. Acts as a sanity check + // against invalid files. See http://crbug.com/171962 +- if (ChannelLayoutToChromeChannelLayout(codec_context_->channel_layout, +- codec_context_->channels) == ++ if (ChannelLayoutToChromeChannelLayout( ++ codec_context_->ch_layout.u.mask, ++ codec_context_->ch_layout.nb_channels) == + CHANNEL_LAYOUT_UNSUPPORTED) { + return false; + } + + // Store initial values to guard against midstream configuration changes. +- channels_ = codec_context_->channels; ++ channels_ = codec_context_->ch_layout.nb_channels; + audio_codec_ = CodecIDToAudioCodec(codec_context_->codec_id); + sample_rate_ = codec_context_->sample_rate; + av_sample_format_ = codec_context_->sample_fmt; +@@ -223,7 +224,7 @@ bool AudioFileReader::OnNewFrame( + if (frames_read < 0) + return false; + +- const int channels = frame->channels; ++ const int channels = frame->ch_layout.nb_channels; + if (frame->sample_rate != sample_rate_ || channels != channels_ || + frame->format != av_sample_format_) { + DLOG(ERROR) << "Unsupported midstream configuration change!" +diff --git a/media/filters/audio_file_reader_unittest.cc b/media/filters/audio_file_reader_unittest.cc +index 2aba7927a31..1f45a50cace 100644 +--- a/media/filters/audio_file_reader_unittest.cc ++++ b/media/filters/audio_file_reader_unittest.cc +@@ -121,11 +121,11 @@ class AudioFileReaderTest : public testing::Test { + EXPECT_FALSE(reader_->Open()); + } + +- void RunTestFailingDecode(const char* fn) { ++ void RunTestFailingDecode(const char* fn, int expect_read = 0) { + Initialize(fn); + EXPECT_TRUE(reader_->Open()); + std::vector> decoded_audio_packets; +- EXPECT_EQ(reader_->Read(&decoded_audio_packets), 0); ++ EXPECT_EQ(reader_->Read(&decoded_audio_packets), expect_read); + } + + void RunTestPartialDecode(const char* fn) { +@@ -219,7 +219,7 @@ TEST_F(AudioFileReaderTest, AAC_ADTS) { + } + + TEST_F(AudioFileReaderTest, MidStreamConfigChangesFail) { +- RunTestFailingDecode("midstream_config_change.mp3"); ++ RunTestFailingDecode("midstream_config_change.mp3", 42624); + } + #endif + +diff --git a/media/filters/audio_video_metadata_extractor.cc b/media/filters/audio_video_metadata_extractor.cc +index 185819eb936..69ff508c221 100644 +--- a/media/filters/audio_video_metadata_extractor.cc ++++ b/media/filters/audio_video_metadata_extractor.cc +@@ -113,6 +113,15 @@ bool AudioVideoMetadataExtractor::Extract(DataSource* source, + if (!stream) + continue; + ++ void* display_matrix = ++ av_stream_get_side_data(stream, AV_PKT_DATA_DISPLAYMATRIX, nullptr); ++ if (display_matrix) { ++ rotation_ = VideoTransformation::FromFFmpegDisplayMatrix( ++ static_cast(display_matrix)) ++ .rotation; ++ info.tags["rotate"] = base::NumberToString(rotation_); ++ } ++ + // Extract dictionary from streams also. Needed for containers that attach + // metadata to contained streams instead the container itself, like OGG. + ExtractDictionary(stream->metadata, &info.tags); +@@ -255,8 +264,6 @@ void AudioVideoMetadataExtractor::ExtractDictionary(AVDictionary* metadata, + if (raw_tags->find(tag->key) == raw_tags->end()) + (*raw_tags)[tag->key] = tag->value; + +- if (ExtractInt(tag, "rotate", &rotation_)) +- continue; + if (ExtractString(tag, "album", &album_)) + continue; + if (ExtractString(tag, "artist", &artist_)) +diff --git a/media/filters/ffmpeg_aac_bitstream_converter.cc b/media/filters/ffmpeg_aac_bitstream_converter.cc +index 6f231c85729..ca5e5fb927d 100644 +--- a/media/filters/ffmpeg_aac_bitstream_converter.cc ++++ b/media/filters/ffmpeg_aac_bitstream_converter.cc +@@ -195,14 +195,15 @@ bool FFmpegAACBitstreamConverter::ConvertPacket(AVPacket* packet) { + if (!header_generated_ || codec_ != stream_codec_parameters_->codec_id || + audio_profile_ != stream_codec_parameters_->profile || + sample_rate_index_ != sample_rate_index || +- channel_configuration_ != stream_codec_parameters_->channels || ++ channel_configuration_ != ++ stream_codec_parameters_->ch_layout.nb_channels || + frame_length_ != header_plus_packet_size) { + header_generated_ = + GenerateAdtsHeader(stream_codec_parameters_->codec_id, + 0, // layer + stream_codec_parameters_->profile, sample_rate_index, + 0, // private stream +- stream_codec_parameters_->channels, ++ stream_codec_parameters_->ch_layout.nb_channels, + 0, // originality + 0, // home + 0, // copyrighted_stream +@@ -214,7 +215,7 @@ bool FFmpegAACBitstreamConverter::ConvertPacket(AVPacket* packet) { + codec_ = stream_codec_parameters_->codec_id; + audio_profile_ = stream_codec_parameters_->profile; + sample_rate_index_ = sample_rate_index; +- channel_configuration_ = stream_codec_parameters_->channels; ++ channel_configuration_ = stream_codec_parameters_->ch_layout.nb_channels; + frame_length_ = header_plus_packet_size; + } + +diff --git a/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc b/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc +index 1fd4c5ccd7d..f59bcd8fdaf 100644 +--- a/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc ++++ b/media/filters/ffmpeg_aac_bitstream_converter_unittest.cc +@@ -34,7 +34,7 @@ class FFmpegAACBitstreamConverterTest : public testing::Test { + memset(&test_parameters_, 0, sizeof(AVCodecParameters)); + test_parameters_.codec_id = AV_CODEC_ID_AAC; + test_parameters_.profile = FF_PROFILE_AAC_MAIN; +- test_parameters_.channels = 2; ++ test_parameters_.ch_layout.nb_channels = 2; + test_parameters_.extradata = extradata_header_; + test_parameters_.extradata_size = sizeof(extradata_header_); + } +diff --git a/media/filters/ffmpeg_audio_decoder.cc b/media/filters/ffmpeg_audio_decoder.cc +index 6a56c675f7d..4615fdeb3fb 100644 +--- a/media/filters/ffmpeg_audio_decoder.cc ++++ b/media/filters/ffmpeg_audio_decoder.cc +@@ -28,7 +28,7 @@ namespace media { + + // Return the number of channels from the data in |frame|. + static inline int DetermineChannels(AVFrame* frame) { +- return frame->channels; ++ return frame->ch_layout.nb_channels; + } + + // Called by FFmpeg's allocation routine to allocate a buffer. Uses +@@ -231,7 +231,7 @@ bool FFmpegAudioDecoder::OnNewFrame(const DecoderBuffer& buffer, + // Translate unsupported into discrete layouts for discrete configurations; + // ffmpeg does not have a labeled discrete configuration internally. + ChannelLayout channel_layout = ChannelLayoutToChromeChannelLayout( +- codec_context_->channel_layout, codec_context_->channels); ++ codec_context_->ch_layout.u.mask, codec_context_->ch_layout.nb_channels); + if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED && + config_.channel_layout() == CHANNEL_LAYOUT_DISCRETE) { + channel_layout = CHANNEL_LAYOUT_DISCRETE; +@@ -348,11 +348,11 @@ bool FFmpegAudioDecoder::ConfigureDecoder(const AudioDecoderConfig& config) { + // Success! + av_sample_format_ = codec_context_->sample_fmt; + +- if (codec_context_->channels != config.channels()) { ++ if (codec_context_->ch_layout.nb_channels != config.channels()) { + MEDIA_LOG(ERROR, media_log_) + << "Audio configuration specified " << config.channels() + << " channels, but FFmpeg thinks the file contains " +- << codec_context_->channels << " channels"; ++ << codec_context_->ch_layout.nb_channels << " channels"; + ReleaseFFmpegResources(); + state_ = DecoderState::kUninitialized; + return false; +@@ -403,7 +403,7 @@ int FFmpegAudioDecoder::GetAudioBuffer(struct AVCodecContext* s, + if (frame->nb_samples <= 0) + return AVERROR(EINVAL); + +- if (s->channels != channels) { ++ if (s->ch_layout.nb_channels != channels) { + DLOG(ERROR) << "AVCodecContext and AVFrame disagree on channel count."; + return AVERROR(EINVAL); + } +@@ -436,7 +436,8 @@ int FFmpegAudioDecoder::GetAudioBuffer(struct AVCodecContext* s, + ChannelLayout channel_layout = + config_.channel_layout() == CHANNEL_LAYOUT_DISCRETE + ? CHANNEL_LAYOUT_DISCRETE +- : ChannelLayoutToChromeChannelLayout(s->channel_layout, s->channels); ++ : ChannelLayoutToChromeChannelLayout(s->ch_layout.u.mask, ++ s->ch_layout.nb_channels); + + if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED) { + DLOG(ERROR) << "Unsupported channel layout."; diff --git a/REVERT-roll-src-third_party-ffmpeg-m106.patch b/REVERT-roll-src-third_party-ffmpeg-m106.patch new file mode 100644 index 0000000..b2a1137 --- /dev/null +++ b/REVERT-roll-src-third_party-ffmpeg-m106.patch @@ -0,0 +1,55 @@ +From ded379824f5de39357b6b1894578101aba5cdf05 Mon Sep 17 00:00:00 2001 +From: Eugene Zemtsov +Date: Fri, 29 Jul 2022 04:41:04 +0000 +Subject: [PATCH] Roll src/third_party/ffmpeg/ 880df5ede..b71ecd02b (279 + commits) + +https://chromium.googlesource.com/chromium/third_party/ffmpeg.git/+log/880df5ede50a..b71ecd02b479 + +$ git log 880df5ede..b71ecd02b --date=short --no-merges --format='%ad %ae %s' +2022-07-27 eugene Roll for M106 +2022-07-25 andreas.rheinhardt avcodec/x86/pngdsp: Remove obsolete ff_add_bytes_l2_mmx() +2022-07-22 andreas.rheinhardt avcodec/hevcdec: Output MD5-message in one piece +2022-07-24 epirat07 configure: properly require libx264 if enabled +2022-07-24 zane avformat/argo_cvg: expose loop/reverb/checksum via metadata +(...) +2022-05-03 leo.izen avcodec/libjxldec: properly tag output colorspace +2022-06-25 ffmpeg avfilter/Makefile: always make colorspace.o +2022-03-02 brad avutil/ppc/cpu: Use proper header for OpenBSD PPC CPU detection +2022-06-24 jamrial avformat/http: include version.h +2022-05-16 mbonda-at-nvidia.com AV1 VDPAU hwaccel Decode support + +Created with: + roll-dep src/third_party/ffmpeg + +ffmpeg usage fix: + Switch from AVFrame::pkt_duration to AVFrame::duration, + AVFrame::pkt_duration is deprecated + +Bug: 1344646 +Change-Id: Iaa3abf48ef81dae6d282bca8f0fa2a8dffeeba25 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3788638 +Reviewed-by: Will Cassella +Commit-Queue: Eugene Zemtsov +Cr-Commit-Position: refs/heads/main@{#1029623} +--- + media/filters/audio_file_reader.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/media/filters/audio_file_reader.cc b/media/filters/audio_file_reader.cc +index e1be5aa9a5b..951c003956f 100644 +--- a/media/filters/audio_file_reader.cc ++++ b/media/filters/audio_file_reader.cc +@@ -243,10 +243,10 @@ bool AudioFileReader::OnNewFrame( + // silence from being output. In the case where we are also discarding some + // portion of the packet (as indicated by a negative pts), we further want to + // adjust the duration downward by however much exists before zero. +- if (audio_codec_ == AudioCodec::kAAC && frame->pkt_duration) { ++ if (audio_codec_ == AudioCodec::kAAC && frame->duration) { + const base::TimeDelta pkt_duration = ConvertFromTimeBase( + glue_->format_context()->streams[stream_index_]->time_base, +- frame->pkt_duration + std::min(static_cast(0), frame->pts)); ++ frame->duration + std::min(static_cast(0), frame->pts)); + const base::TimeDelta frame_duration = + base::Seconds(frames_read / static_cast(sample_rate_)); + diff --git a/add-missing-includes-causing-build-errors.patch b/add-missing-includes-causing-build-errors.patch new file mode 100644 index 0000000..3e308ba --- /dev/null +++ b/add-missing-includes-causing-build-errors.patch @@ -0,0 +1,193 @@ +From 6bbf6b001e085025cf33412b15eb79d46e2e670c Mon Sep 17 00:00:00 2001 +From: Bruno Pitrus +Date: Tue, 11 Apr 2023 19:32:13 +0000 +Subject: [PATCH] Add missing includes causing build errors with GCC/libstdc++ + 13 + +Bug: 957519 +Change-Id: If09ae682695714a19e37f3830013a003caba025a +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4330267 +Reviewed-by: Ken Rockot +Auto-Submit: Bruno Pitrus +Reviewed-by: Reilly Grant +Commit-Queue: Ken Rockot +Reviewed-by: Robert Kaplow +Cr-Commit-Position: refs/heads/main@{#1128822} +--- + components/metrics/psi_memory_parser.h | 1 + + components/services/app_service/public/cpp/capability_access.h | 1 + + components/soda/constants.h | 1 + + device/base/synchronization/one_writer_seqlock.h | 1 + + device/bluetooth/public/cpp/bluetooth_uuid.h | 1 + + extensions/common/constants.h | 3 +++ + extensions/renderer/bindings/api_invocation_errors.h | 1 + + net/base/parse_number.h | 2 ++ + net/cookies/cookie_inclusion_status.h | 1 + + sandbox/linux/syscall_broker/broker_file_permission.h | 1 + + .../blink/public/common/bluetooth/web_bluetooth_device_id.h | 3 +++ + .../public/common/origin_trials/origin_trial_public_key.h | 1 + + ui/gfx/geometry/linear_gradient.h | 2 ++ + 13 files changed, 19 insertions(+) + +diff --git a/components/metrics/psi_memory_parser.h b/components/metrics/psi_memory_parser.h +index b8b22f4ab74..bf02be5074e 100644 +--- a/components/metrics/psi_memory_parser.h ++++ b/components/metrics/psi_memory_parser.h +@@ -5,6 +5,7 @@ + #ifndef COMPONENTS_METRICS_PSI_MEMORY_PARSER_H_ + #define COMPONENTS_METRICS_PSI_MEMORY_PARSER_H_ + ++#include + #include + + #include "base/gtest_prod_util.h" +diff --git a/components/services/app_service/public/cpp/capability_access.h b/components/services/app_service/public/cpp/capability_access.h +index 991a993ba99..8050a888d81 100644 +--- a/components/services/app_service/public/cpp/capability_access.h ++++ b/components/services/app_service/public/cpp/capability_access.h +@@ -5,6 +5,7 @@ + #ifndef COMPONENTS_SERVICES_APP_SERVICE_PUBLIC_CPP_CAPABILITY_ACCESS_H_ + #define COMPONENTS_SERVICES_APP_SERVICE_PUBLIC_CPP_CAPABILITY_ACCESS_H_ + ++#include + #include + #include + +diff --git a/components/soda/constants.h b/components/soda/constants.h +index 82b2b98b2fa..b455e2a97da 100644 +--- a/components/soda/constants.h ++++ b/components/soda/constants.h +@@ -5,6 +5,7 @@ + #ifndef COMPONENTS_SODA_CONSTANTS_H_ + #define COMPONENTS_SODA_CONSTANTS_H_ + ++#include + #include + + #include "base/files/file_path.h" +diff --git a/device/base/synchronization/one_writer_seqlock.h b/device/base/synchronization/one_writer_seqlock.h +index e37a16b81be..b93f14140c6 100644 +--- a/device/base/synchronization/one_writer_seqlock.h ++++ b/device/base/synchronization/one_writer_seqlock.h +@@ -6,6 +6,7 @@ + #define DEVICE_BASE_SYNCHRONIZATION_ONE_WRITER_SEQLOCK_H_ + + #include ++#include + #include + #include + +diff --git a/device/bluetooth/public/cpp/bluetooth_uuid.h b/device/bluetooth/public/cpp/bluetooth_uuid.h +index b4bedf01570..d636ba62e2f 100644 +--- a/device/bluetooth/public/cpp/bluetooth_uuid.h ++++ b/device/bluetooth/public/cpp/bluetooth_uuid.h +@@ -5,6 +5,7 @@ + #ifndef DEVICE_BLUETOOTH_PUBLIC_CPP_BLUETOOTH_UUID_H_ + #define DEVICE_BLUETOOTH_PUBLIC_CPP_BLUETOOTH_UUID_H_ + ++#include + #include + #include + #include +diff --git a/extensions/common/constants.h b/extensions/common/constants.h +index 0f7db327206..284cc878ff8 100644 +--- a/extensions/common/constants.h ++++ b/extensions/common/constants.h +@@ -5,6 +5,9 @@ + #ifndef EXTENSIONS_COMMON_CONSTANTS_H_ + #define EXTENSIONS_COMMON_CONSTANTS_H_ + ++#include ++#include ++ + #include "base/files/file_path.h" + #include "base/strings/string_piece_forward.h" + #include "build/chromeos_buildflags.h" +diff --git a/extensions/renderer/bindings/api_invocation_errors.h b/extensions/renderer/bindings/api_invocation_errors.h +index e21700ecfc4..3b704e83b06 100644 +--- a/extensions/renderer/bindings/api_invocation_errors.h ++++ b/extensions/renderer/bindings/api_invocation_errors.h +@@ -5,6 +5,7 @@ + #ifndef EXTENSIONS_RENDERER_BINDINGS_API_INVOCATION_ERRORS_H_ + #define EXTENSIONS_RENDERER_BINDINGS_API_INVOCATION_ERRORS_H_ + ++#include + #include + #include + +diff --git a/net/base/parse_number.h b/net/base/parse_number.h +index f4827f7a7da..f923b18a7f4 100644 +--- a/net/base/parse_number.h ++++ b/net/base/parse_number.h +@@ -5,6 +5,8 @@ + #ifndef NET_BASE_PARSE_NUMBER_H_ + #define NET_BASE_PARSE_NUMBER_H_ + ++#include ++ + #include "base/strings/string_piece.h" + #include "net/base/net_export.h" + +diff --git a/net/cookies/cookie_inclusion_status.h b/net/cookies/cookie_inclusion_status.h +index 51fb970be72..e8dd6d8d9fa 100644 +--- a/net/cookies/cookie_inclusion_status.h ++++ b/net/cookies/cookie_inclusion_status.h +@@ -6,6 +6,7 @@ + #define NET_COOKIES_COOKIE_INCLUSION_STATUS_H_ + + #include ++#include + #include + #include + #include +diff --git a/sandbox/linux/syscall_broker/broker_file_permission.h b/sandbox/linux/syscall_broker/broker_file_permission.h +index 3538da53ca9..e8e32cccd60 100644 +--- a/sandbox/linux/syscall_broker/broker_file_permission.h ++++ b/sandbox/linux/syscall_broker/broker_file_permission.h +@@ -6,6 +6,7 @@ + #define SANDBOX_LINUX_SYSCALL_BROKER_BROKER_FILE_PERMISSION_H_ + + #include ++#include + #include + + #include "base/strings/string_piece.h" +diff --git a/third_party/blink/public/common/bluetooth/web_bluetooth_device_id.h b/third_party/blink/public/common/bluetooth/web_bluetooth_device_id.h +index 8ab06791464..329c8333cdd 100644 +--- a/third_party/blink/public/common/bluetooth/web_bluetooth_device_id.h ++++ b/third_party/blink/public/common/bluetooth/web_bluetooth_device_id.h +@@ -8,6 +8,9 @@ + #include + + #include ++#include ++#include ++#include + #include + + #include "third_party/blink/public/common/common_export.h" +diff --git a/third_party/blink/public/common/origin_trials/origin_trial_public_key.h b/third_party/blink/public/common/origin_trials/origin_trial_public_key.h +index c1b5f59f57e..246200991a5 100644 +--- a/third_party/blink/public/common/origin_trials/origin_trial_public_key.h ++++ b/third_party/blink/public/common/origin_trials/origin_trial_public_key.h +@@ -6,6 +6,7 @@ + #define THIRD_PARTY_BLINK_PUBLIC_COMMON_ORIGIN_TRIALS_ORIGIN_TRIAL_PUBLIC_KEY_H_ + + #include ++#include + + namespace blink { + +diff --git a/ui/gfx/geometry/linear_gradient.h b/ui/gfx/geometry/linear_gradient.h +index d337a7de29b..d327662833f 100644 +--- a/ui/gfx/geometry/linear_gradient.h ++++ b/ui/gfx/geometry/linear_gradient.h +@@ -8,6 +8,8 @@ + #include + + #include ++#include ++#include + #include + + #include "ui/gfx/geometry/geometry_skia_export.h" diff --git a/angle-wayland-include-protocol.patch b/angle-wayland-include-protocol.patch new file mode 100644 index 0000000..1245b17 --- /dev/null +++ b/angle-wayland-include-protocol.patch @@ -0,0 +1,38 @@ +diff -upr third_party/angle.orig/BUILD.gn third_party/angle/BUILD.gn +--- third_party/angle.orig/BUILD.gn 2022-08-17 19:38:11.000000000 +0000 ++++ third_party/angle/BUILD.gn 2022-08-18 11:04:09.061751111 +0000 +@@ -489,6 +489,12 @@ config("angle_vulkan_wayland_config") { + if (angle_enable_vulkan && angle_use_wayland && + defined(vulkan_wayland_include_dirs)) { + include_dirs = vulkan_wayland_include_dirs ++ } else if (angle_enable_vulkan && angle_use_wayland) { ++ include_dirs = [ ++ "$wayland_gn_dir/src/src", ++ "$wayland_gn_dir/include/src", ++ "$wayland_gn_dir/include/protocol", ++ ] + } + } + +@@ -1073,6 +1079,7 @@ if (angle_use_wayland) { + include_dirs = [ + "$wayland_dir/egl", + "$wayland_dir/src", ++ "$wayland_gn_dir/include/protocol", + ] + } + +diff -upr third_party/angle.orig/src/third_party/volk/BUILD.gn third_party/angle/src/third_party/volk/BUILD.gn +--- third_party/angle.orig/src/third_party/volk/BUILD.gn 2022-08-17 19:38:12.000000000 +0000 ++++ third_party/angle/src/third_party/volk/BUILD.gn 2022-08-18 11:04:36.499828006 +0000 +@@ -21,6 +21,9 @@ source_set("volk") { + configs += [ "$angle_root:angle_no_cfi_icall" ] + public_deps = [ "$angle_vulkan_headers_dir:vulkan_headers" ] + if (angle_use_wayland) { +- include_dirs = [ "$wayland_dir/src" ] ++ include_dirs = [ ++ "$wayland_dir/src", ++ "$wayland_gn_dir/include/protocol", ++ ] + } + } diff --git a/chromium-icu72.patch b/chromium-icu72.patch new file mode 100644 index 0000000..b8ebcd3 --- /dev/null +++ b/chromium-icu72.patch @@ -0,0 +1,114 @@ +From 2c4d3c61aa33f3169e7923ea3433c71e3df0952f Mon Sep 17 00:00:00 2001 +From: Frank Tang +Date: Mon, 7 Nov 2022 22:08:05 +0000 +Subject: [PATCH 1/2] Prepare for ICU72 landing + +The date format may output U+202F Narrow SPACE between time +and AM/PM. So switch to use UTF8 and not restrict to ASCII which +will break when the output is not only ASCII. + +Bug: 1371208 +Change-Id: I05f9daadfba5c45d618f15ae23340da373f2f36a +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4007076 +Reviewed-by: Daniel Rubery +Commit-Queue: Frank Tang +Cr-Commit-Position: refs/heads/main@{#1068343} + +(cherry picked from commit ce2ffed84b95e2b7c068d6f066d86cd034212425) +--- + .../safe_browsing/content/browser/web_ui/safe_browsing_ui.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/components/safe_browsing/content/browser/web_ui/safe_browsing_ui.cc b/components/safe_browsing/content/browser/web_ui/safe_browsing_ui.cc +index 92597a9d3a4..e6e7514a082 100644 +--- a/components/safe_browsing/content/browser/web_ui/safe_browsing_ui.cc ++++ b/components/safe_browsing/content/browser/web_ui/safe_browsing_ui.cc +@@ -457,7 +457,7 @@ namespace { + std::string UserReadableTimeFromMillisSinceEpoch(int64_t time_in_milliseconds) { + base::Time time = + base::Time::UnixEpoch() + base::Milliseconds(time_in_milliseconds); +- return base::UTF16ToASCII(base::TimeFormatShortDateAndTime(time)); ++ return base::UTF16ToUTF8(base::TimeFormatShortDateAndTime(time)); + } + + void AddStoreInfo(const DatabaseManagerInfo::DatabaseInfo::StoreInfo store_info, + +From 8ba9d96da703978655cddf07d58b0a15f0a43a10 Mon Sep 17 00:00:00 2001 +From: Frank Tang +Date: Tue, 8 Nov 2022 00:13:16 +0000 +Subject: [PATCH 2/2] Prepare the landing of ICU72/Unicode 15 + +See +https://www.unicode.org/emoji/charts-15.0/emoji-released.html +https://www.unicode.org/charts/PDF/U1F680.pdf +https://www.unicode.org/charts/PDF/U1FA70.pdf +for the newly added emoji to +Transport and Map Symbols +Symbols and Pictographs Extended-A blocks. + +Update the kIsCJKIdeographOrSymbolRanges to Unicode 15 +Needed to avoid test breakage of +CharacterTest.HammerEmojiVsCJKIdeographOrSymbol + +Bug: 1371208 +Change-Id: Ic7b319ba18f3aded46b252d8b484e3b1bc43eff4 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4007098 +Reviewed-by: Stephen Chenney +Commit-Queue: Frank Tang +Cr-Commit-Position: refs/heads/main@{#1068422} + +(cherry picked from commit d93a774bf6fac8ddaaa1041ea6ad2dd8e5ff4539) +--- + .../platform/text/character_property_data.h | 24 +++++++++---------- + 1 file changed, 12 insertions(+), 12 deletions(-) + +diff --git a/third_party/blink/renderer/platform/text/character_property_data.h b/third_party/blink/renderer/platform/text/character_property_data.h +index 9005c20a379..ee690563c28 100644 +--- a/third_party/blink/renderer/platform/text/character_property_data.h ++++ b/third_party/blink/renderer/platform/text/character_property_data.h +@@ -107,7 +107,7 @@ static const UChar32 kIsCJKIdeographOrSymbolRanges[] = { + 0x1F3FB, 0x1F3FF, + + // Transport +- 0x1F6DD, 0x1F6DF, ++ 0x1F6DC, 0x1F6DF, + + // Colored circles and squares for use with emoji. + 0x1F7E0, 0x1F7EB, +@@ -118,25 +118,25 @@ static const UChar32 kIsCJKIdeographOrSymbolRanges[] = { + 0x1F900, 0x1F90F, + // ZIPPER-MOUTH FACE...SIGN OF THE HORNS + 0x1F910, 0x1F918, 0x1F919, 0x1F97F, 0x1F980, 0x1F9BF, 0x1F9C0, 0x1F9FF, +- // Clothing +- 0x1FA70, 0x1FA74, +- // Medical symbols +- 0x1FA78, 0x1FA7C, ++ // Clothing, heart and Medical symbols ++ 0x1FA70, 0x1FA7C, + // Toys and sport symbols +- 0x1FA80, 0x1FA86, ++ 0x1FA80, 0x1FA88, + // Miscellaneous objects +- 0x1FA90, 0x1FAAC, + // Animals and nature +- 0x1FAB0, 0x1FABA, ++ 0x1FA90, 0x1FABD, ++ // Animal + // Body parts + // People +- 0x1FAC0, 0x1FAC5, ++ 0x1FABF, 0x1FAC5, ++ // animal-mammal ++ 0x1FACE, 0x1FACF, + // Food and drink +- 0x1FAD0, 0x1FAD9, ++ 0x1FAD0, 0x1FADB, + // Face +- 0x1FAE0, 0x1FAE7, ++ 0x1FAE0, 0x1FAE8, + // Hand +- 0x1FAF0, 0x1FAF6, ++ 0x1FAF0, 0x1FAF8, + }; + + // https://html.spec.whatwg.org/C/#prod-potentialcustomelementname diff --git a/comp-viz-add-cstdint.patch b/comp-viz-add-cstdint.patch new file mode 100644 index 0000000..2de8e49 --- /dev/null +++ b/comp-viz-add-cstdint.patch @@ -0,0 +1,12 @@ +diff --git a/components/viz/common/shared_element_resource_id.h b/components/viz/common/shared_element_resource_id.h +index b39a2d3dc1..8d27a1bda1 100644 +--- a/components/viz/common/shared_element_resource_id.h ++++ b/components/viz/common/shared_element_resource_id.h +@@ -7,6 +7,7 @@ + + #include + #include ++#include + + #include "components/viz/common/viz_common_export.h" + diff --git a/dawn-iwyu-add-cstdint-for-uint8_t.patch b/dawn-iwyu-add-cstdint-for-uint8_t.patch new file mode 100644 index 0000000..9ca7362 --- /dev/null +++ b/dawn-iwyu-add-cstdint-for-uint8_t.patch @@ -0,0 +1,28 @@ +From a7423b3d8367a706c50ab787df2fe5eedb6c3c9f Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Mon, 3 Apr 2023 13:51:27 +0000 +Subject: [PATCH] IWYU: add cstdint for uint8_t + dawn::native::stream::ByteVectorSink + +Bug: chromium:957519 +Change-Id: I48436db0e203d793e47d717bfb75977c67145e94 +Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/126120 +Reviewed-by: Corentin Wallez +Commit-Queue: Stephan Hartmann +Kokoro: Kokoro +--- + src/dawn/native/stream/ByteVectorSink.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/dawn/native/stream/ByteVectorSink.h b/src/dawn/native/stream/ByteVectorSink.h +index 3b6016c082..5537820b1a 100644 +--- a/src/dawn/native/stream/ByteVectorSink.h ++++ b/src/dawn/native/stream/ByteVectorSink.h +@@ -15,6 +15,7 @@ + #ifndef SRC_DAWN_NATIVE_STREAM_BYTEVECTORSINK_H_ + #define SRC_DAWN_NATIVE_STREAM_BYTEVECTORSINK_H_ + ++#include + #include + #include + diff --git a/dawn-tint-add-cstdint.patch b/dawn-tint-add-cstdint.patch new file mode 100644 index 0000000..09801ed --- /dev/null +++ b/dawn-tint-add-cstdint.patch @@ -0,0 +1,12 @@ +diff --git a/src/tint/reader/spirv/namer.h b/src/tint/reader/spirv/namer.h +index 7a20e8738b..655f69ce36 100644 +--- a/src/tint/reader/spirv/namer.h ++++ b/src/tint/reader/spirv/namer.h +@@ -15,6 +15,7 @@ + #ifndef SRC_TINT_READER_SPIRV_NAMER_H_ + #define SRC_TINT_READER_SPIRV_NAMER_H_ + ++#include + #include + #include + #include diff --git a/default_app-icon.patch b/default_app-icon.patch new file mode 100644 index 0000000..b2a8770 --- /dev/null +++ b/default_app-icon.patch @@ -0,0 +1,21 @@ +--- a/electron/default_app/default_app.ts ++++ b/electron/default_app/default_app.ts +@@ -60,7 +60,7 @@ + }; + + if (process.platform === 'linux') { +- options.icon = path.join(__dirname, 'icon.png'); ++ options.icon = '/usr/share/pixmaps/electron.png'; + } + + mainWindow = new BrowserWindow(options); +--- a/electron/filenames.gni ++++ b/electron/filenames.gni +@@ -6,7 +6,6 @@ + ] + + default_app_static_sources = [ +- "default_app/icon.png", + "default_app/index.html", + "default_app/package.json", + "default_app/styles.css", diff --git a/electron-launcher.sh b/electron-launcher.sh new file mode 100644 index 0000000..ccb9101 --- /dev/null +++ b/electron-launcher.sh @@ -0,0 +1,20 @@ +#!/usr/bin/bash + +set -euo pipefail + +name=@ELECTRON@ +flags_file="${XDG_CONFIG_HOME:-$HOME/.config}/${name}-flags.conf" + +declare -a flags + +if [[ -f "${flags_file}" ]]; then + mapfile -t < "${flags_file}" +fi + +for line in "${MAPFILE[@]}"; do + if [[ ! "${line}" =~ ^[[:space:]]*#.* ]]; then + flags+=("${line}") + fi +done + +exec /usr/lib/${name}/electron "${flags[@]}" "$@" diff --git a/electron.desktop b/electron.desktop new file mode 100644 index 0000000..700a4d9 --- /dev/null +++ b/electron.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Application +Name=@ELECTRON_NAME@ +Icon=@ELECTRON@ +Exec=@ELECTRON@ %u +Categories=Development;GTK; +StartupNotify=true diff --git a/iwyu-add-cstdint-for-int-types-in-s2cellid.patch b/iwyu-add-cstdint-for-int-types-in-s2cellid.patch new file mode 100644 index 0000000..4941b56 --- /dev/null +++ b/iwyu-add-cstdint-for-int-types-in-s2cellid.patch @@ -0,0 +1,40 @@ +From dbb0a49610aa491c5eaa1461342485721c37354c Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Fri, 14 Apr 2023 05:29:45 +0000 +Subject: [PATCH] IWYU: add cstdint for int types in s2cellid + +Bug: 957519 +Change-Id: I65ad411c605baeaeda3addfd07ea9b565179368b +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4418467 +Commit-Queue: Stephan Hartmann +Reviewed-by: Andrew Moylan +Cr-Commit-Position: refs/heads/main@{#1130286} +--- + third_party/s2cellid/README.chromium | 1 + + third_party/s2cellid/src/s2/util/math/vector.h | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/third_party/s2cellid/README.chromium b/third_party/s2cellid/README.chromium +index 53c42f7342d..25044e85135 100644 +--- a/third_party/s2cellid/README.chromium ++++ b/third_party/s2cellid/README.chromium +@@ -18,6 +18,7 @@ Local Modifications: + - mathutil.h mathutil.cc + - vector.h + - Change comparison operator implementations to be C++20-compliant ++ - add missing cstdint include + - _fpcontractoff.h + - r1interval.h + - r2.h +diff --git a/third_party/s2cellid/src/s2/util/math/vector.h b/third_party/s2cellid/src/s2/util/math/vector.h +index ded669c1d71..487edc3f93b 100644 +--- a/third_party/s2cellid/src/s2/util/math/vector.h ++++ b/third_party/s2cellid/src/s2/util/math/vector.h +@@ -22,6 +22,7 @@ + + #include + #include ++#include + #include + #include + #include // NOLINT(readability/streams) diff --git a/iwyu-add-cstdint-for-uintptr_t-in-device.patch b/iwyu-add-cstdint-for-uintptr_t-in-device.patch new file mode 100644 index 0000000..79605c8 --- /dev/null +++ b/iwyu-add-cstdint-for-uintptr_t-in-device.patch @@ -0,0 +1,28 @@ +From 83de2fa6806fc337e61fef0bd156dc2602542db3 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Tue, 4 Apr 2023 16:10:03 +0000 +Subject: [PATCH] IWYU: add cstdint for uintptr_t in device::OneWriterSeqLock + +Bug: 957519 +Change-Id: I283f5b0cc34a268bea5dcb03c34726cbec905ea7 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4394541 +Reviewed-by: Ken Rockot +Commit-Queue: Ken Rockot +Commit-Queue: Stephan Hartmann +Cr-Commit-Position: refs/heads/main@{#1126023} +--- + device/base/synchronization/one_writer_seqlock.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/device/base/synchronization/one_writer_seqlock.h b/device/base/synchronization/one_writer_seqlock.h +index 528b6683ca2..e37a16b81be 100644 +--- a/device/base/synchronization/one_writer_seqlock.h ++++ b/device/base/synchronization/one_writer_seqlock.h +@@ -6,6 +6,7 @@ + #define DEVICE_BASE_SYNCHRONIZATION_ONE_WRITER_SEQLOCK_H_ + + #include ++#include + #include + + #include "base/atomicops.h" diff --git a/iwyu-add-stdint.h-for-int-types-in-gpu_feature_info.patch b/iwyu-add-stdint.h-for-int-types-in-gpu_feature_info.patch new file mode 100644 index 0000000..16beef6 --- /dev/null +++ b/iwyu-add-stdint.h-for-int-types-in-gpu_feature_info.patch @@ -0,0 +1,28 @@ +From 2a7bf74bdb6348781dd4f3fbe9897969c4e7b819 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Tue, 11 Apr 2023 16:09:29 +0000 +Subject: [PATCH] IWYU: add stdint.h for int types in gpu_feature_info + +Bug: 957519 +Change-Id: Ic3bebb43bcbb3a04876e5fc35767af39b01afdd2 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4401097 +Commit-Queue: Stephan Hartmann +Reviewed-by: vikas soni +Cr-Commit-Position: refs/heads/main@{#1128679} +--- + gpu/config/gpu_feature_info.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/gpu/config/gpu_feature_info.h b/gpu/config/gpu_feature_info.h +index d269ce2d825..45edc112dbc 100644 +--- a/gpu/config/gpu_feature_info.h ++++ b/gpu/config/gpu_feature_info.h +@@ -5,6 +5,8 @@ + #ifndef GPU_CONFIG_GPU_FEATURE_INFO_H_ + #define GPU_CONFIG_GPU_FEATURE_INFO_H_ + ++#include ++ + #include + #include + diff --git a/iwyu-add-stdint.h-for-integer-types-in-ui.patch b/iwyu-add-stdint.h-for-integer-types-in-ui.patch new file mode 100644 index 0000000..d493ee9 --- /dev/null +++ b/iwyu-add-stdint.h-for-integer-types-in-ui.patch @@ -0,0 +1,56 @@ +From 7815db39abc8ccf64305c5fbac7e0f88bcc8b371 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Wed, 5 Apr 2023 21:14:20 +0000 +Subject: [PATCH] IWYU: add stdint.h for integer types in //ui + +Bug: 957519 +Change-Id: I33698e997a32c36db19775f0cf4b22fb13cee349 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4400997 +Commit-Queue: Stephan Hartmann +Reviewed-by: Scott Violet +Cr-Commit-Position: refs/heads/main@{#1126829} +--- + ui/base/prediction/kalman_filter.h | 2 ++ + ui/events/types/scroll_types.h | 2 ++ + ui/gfx/geometry/linear_gradient.h | 2 ++ + 3 files changed, 6 insertions(+) + +diff --git a/ui/base/prediction/kalman_filter.h b/ui/base/prediction/kalman_filter.h +index bee3f946e9c..88a3eb5e95c 100644 +--- a/ui/base/prediction/kalman_filter.h ++++ b/ui/base/prediction/kalman_filter.h +@@ -5,6 +5,8 @@ + #ifndef UI_BASE_PREDICTION_KALMAN_FILTER_H_ + #define UI_BASE_PREDICTION_KALMAN_FILTER_H_ + ++#include ++ + #include "base/component_export.h" + #include "ui/gfx/geometry/matrix3_f.h" + +diff --git a/ui/events/types/scroll_types.h b/ui/events/types/scroll_types.h +index be6b2779f41..aac53c4bea7 100644 +--- a/ui/events/types/scroll_types.h ++++ b/ui/events/types/scroll_types.h +@@ -5,6 +5,8 @@ + #ifndef UI_EVENTS_TYPES_SCROLL_TYPES_H_ + #define UI_EVENTS_TYPES_SCROLL_TYPES_H_ + ++#include ++ + namespace ui { + + enum class ScrollGranularity : uint8_t { +diff --git a/ui/gfx/geometry/linear_gradient.h b/ui/gfx/geometry/linear_gradient.h +index 65cd4cb07c7..d337a7de29b 100644 +--- a/ui/gfx/geometry/linear_gradient.h ++++ b/ui/gfx/geometry/linear_gradient.h +@@ -5,6 +5,8 @@ + #ifndef UI_GFX_LINEAR_GRADIENT_H_ + #define UI_GFX_LINEAR_GRADIENT_H_ + ++#include ++ + #include + #include + diff --git a/iwyu-add-stdint.h-for-uint32_t-in-cc.patch b/iwyu-add-stdint.h-for-uint32_t-in-cc.patch new file mode 100644 index 0000000..0d5232d --- /dev/null +++ b/iwyu-add-stdint.h-for-uint32_t-in-cc.patch @@ -0,0 +1,28 @@ +From e80fc92c8ac9f727486bddeb964206fe7a52fac5 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Mon, 10 Apr 2023 15:44:41 +0000 +Subject: [PATCH] IWYU: add stdint.h for uint32_t in cc::TargetProperty + +Change-Id: If8b3a9cdf0d310391aeed3abf303e2ea054697b1 +Bug: 957519 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4406545 +Reviewed-by: Stefan Zager +Commit-Queue: Stephan Hartmann +Cr-Commit-Position: refs/heads/main@{#1128159} +--- + cc/trees/target_property.cc | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/cc/trees/target_property.cc b/cc/trees/target_property.cc +index f6e873a01a1..7d73467a92f 100644 +--- a/cc/trees/target_property.cc ++++ b/cc/trees/target_property.cc +@@ -4,6 +4,8 @@ + + #include "cc/trees/target_property.h" + ++#include ++ + #include "ui/gfx/animation/keyframe/target_property.h" + + namespace cc { diff --git a/iwyu-add-stdint.h-for-uint32_t-in-chrome_pdf.patch b/iwyu-add-stdint.h-for-uint32_t-in-chrome_pdf.patch new file mode 100644 index 0000000..59cf7b9 --- /dev/null +++ b/iwyu-add-stdint.h-for-uint32_t-in-chrome_pdf.patch @@ -0,0 +1,29 @@ +From 5ec376a5f7170cbd30727f21bb8185ec915a9893 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Tue, 4 Apr 2023 17:30:49 +0000 +Subject: [PATCH] IWYU: add stdint.h for uint32_t in + chrome_pdf::DocumentAttachmentInfo + +Bug: 957519 +Change-Id: I8efc538b2ae901c7d5076fdf692a31250c16cbbe +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4395997 +Reviewed-by: Lei Zhang +Commit-Queue: Lei Zhang +Cr-Commit-Position: refs/heads/main@{#1126091} +--- + pdf/document_attachment_info.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/pdf/document_attachment_info.h b/pdf/document_attachment_info.h +index e0fffc2ca4e..ad106fdf5e0 100644 +--- a/pdf/document_attachment_info.h ++++ b/pdf/document_attachment_info.h +@@ -5,6 +5,8 @@ + #ifndef PDF_DOCUMENT_ATTACHMENT_INFO_H_ + #define PDF_DOCUMENT_ATTACHMENT_INFO_H_ + ++#include ++ + #include + + diff --git a/iwyu-add-stdint.h-for-uint64_t-in-EncounteredSurface.patch b/iwyu-add-stdint.h-for-uint64_t-in-EncounteredSurface.patch new file mode 100644 index 0000000..010e22a --- /dev/null +++ b/iwyu-add-stdint.h-for-uint64_t-in-EncounteredSurface.patch @@ -0,0 +1,28 @@ +From e920736d83fe9138c72569985fce37d9e0543c91 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Tue, 4 Apr 2023 14:51:19 +0000 +Subject: [PATCH] IWYU: add stdint.h for uint64_t in EncounteredSurfaceTracker + +Bug: 957519 +Change-Id: Id454f688c3067c4755c2c1353f22e0f75643aed9 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4396357 +Commit-Queue: Stephan Hartmann +Reviewed-by: Antonio Sartori +Cr-Commit-Position: refs/heads/main@{#1125978} +--- + chrome/browser/privacy_budget/encountered_surface_tracker.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/chrome/browser/privacy_budget/encountered_surface_tracker.h b/chrome/browser/privacy_budget/encountered_surface_tracker.h +index 012ca2c5952..32d0ac6629e 100644 +--- a/chrome/browser/privacy_budget/encountered_surface_tracker.h ++++ b/chrome/browser/privacy_budget/encountered_surface_tracker.h +@@ -5,6 +5,8 @@ + #ifndef CHROME_BROWSER_PRIVACY_BUDGET_ENCOUNTERED_SURFACE_TRACKER_H_ + #define CHROME_BROWSER_PRIVACY_BUDGET_ENCOUNTERED_SURFACE_TRACKER_H_ + ++#include ++ + #include + + #include "base/containers/flat_set.h" diff --git a/iwyu-add-stdint.h-for-various-int-types-in-base.patch b/iwyu-add-stdint.h-for-various-int-types-in-base.patch new file mode 100644 index 0000000..3c3e0d7 --- /dev/null +++ b/iwyu-add-stdint.h-for-various-int-types-in-base.patch @@ -0,0 +1,40 @@ +From afbe6c6ee713519263305d7e2d91cc9f1379afe2 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Mon, 3 Apr 2023 20:41:40 +0000 +Subject: [PATCH] IWYU: add stdint.h for various int types in //base + +Bug: 957519 +Change-Id: I750de80f0d27d93ef3383052ddb4eefd5ee13abe +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4394430 +Reviewed-by: Daniel Cheng +Commit-Queue: Stephan Hartmann +Cr-Commit-Position: refs/heads/main@{#1125558} +--- + base/debug/profiler.h | 1 + + base/strings/string_piece.h | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/base/debug/profiler.h b/base/debug/profiler.h +index 5f0deadd5d3..035affc7c4d 100644 +--- a/base/debug/profiler.h ++++ b/base/debug/profiler.h +@@ -6,6 +6,7 @@ + #define BASE_DEBUG_PROFILER_H_ + + #include ++#include + + #include + +diff --git a/base/strings/string_piece.h b/base/strings/string_piece.h +index 899b654cbe8..9dde6ec29bb 100644 +--- a/base/strings/string_piece.h ++++ b/base/strings/string_piece.h +@@ -22,6 +22,7 @@ + #define BASE_STRINGS_STRING_PIECE_H_ + + #include ++#include + + #include + #include diff --git a/iwyu-add-stdint.h-for-various-int-types-in-comp.patch b/iwyu-add-stdint.h-for-various-int-types-in-comp.patch new file mode 100644 index 0000000..913ec7a --- /dev/null +++ b/iwyu-add-stdint.h-for-various-int-types-in-comp.patch @@ -0,0 +1,110 @@ +From 81b275691c28e2a8ae91514305a0e213461fcda4 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Tue, 11 Apr 2023 13:30:43 +0000 +Subject: [PATCH] IWYU: add stdint.h for various integer types in //components + +Bug: 957519 +Change-Id: I920fc7c442b05c3522a6533c4b0ec83b403fd0f0 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4406547 +Reviewed-by: Colin Blundell +Commit-Queue: Stephan Hartmann +Cr-Commit-Position: refs/heads/main@{#1128605} +--- + components/autofill/core/browser/autofill_ablation_study.h | 2 ++ + components/crash/core/app/crash_reporter_client.h | 2 ++ + .../feature_engagement/internal/event_storage_validator.h | 2 ++ + components/omnibox/browser/on_device_head_model.h | 2 ++ + .../core/browser/generation/password_generator.h | 2 ++ + components/payments/content/utility/fingerprint_parser.h | 1 + + components/viz/common/view_transition_element_resource_id.h | 2 ++ + 8 files changed, 15 insertions(+) + +diff --git a/components/autofill/core/browser/autofill_ablation_study.h b/components/autofill/core/browser/autofill_ablation_study.h +index ada8121982e..4ddec085621 100644 +--- a/components/autofill/core/browser/autofill_ablation_study.h ++++ b/components/autofill/core/browser/autofill_ablation_study.h +@@ -5,6 +5,8 @@ + #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_ABLATION_STUDY_H_ + #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_ABLATION_STUDY_H_ + ++#include ++ + #include + + class GURL; +diff --git a/components/crash/core/app/crash_reporter_client.h b/components/crash/core/app/crash_reporter_client.h +index 9b45c727..a696fcfa 100644 +--- a/components/crash/core/app/crash_reporter_client.h ++++ b/components/crash/core/app/crash_reporter_client.h +@@ -5,6 +5,7 @@ + #ifndef COMPONENTS_CRASH_CORE_APP_CRASH_REPORTER_CLIENT_H_ + #define COMPONENTS_CRASH_CORE_APP_CRASH_REPORTER_CLIENT_H_ + ++#include + #include + #include + +diff --git a/components/feature_engagement/internal/event_storage_validator.h b/components/feature_engagement/internal/event_storage_validator.h +index 647a359ee24..f3f792205af 100644 +--- a/components/feature_engagement/internal/event_storage_validator.h ++++ b/components/feature_engagement/internal/event_storage_validator.h +@@ -5,6 +5,8 @@ + #ifndef COMPONENTS_FEATURE_ENGAGEMENT_INTERNAL_EVENT_STORAGE_VALIDATOR_H_ + #define COMPONENTS_FEATURE_ENGAGEMENT_INTERNAL_EVENT_STORAGE_VALIDATOR_H_ + ++#include ++ + #include + + namespace feature_engagement { +diff --git a/components/omnibox/browser/on_device_head_model.h b/components/omnibox/browser/on_device_head_model.h +index d51277918cf..3a6039ffd33 100644 +--- a/components/omnibox/browser/on_device_head_model.h ++++ b/components/omnibox/browser/on_device_head_model.h +@@ -5,6 +5,8 @@ + #ifndef COMPONENTS_OMNIBOX_BROWSER_ON_DEVICE_HEAD_MODEL_H_ + #define COMPONENTS_OMNIBOX_BROWSER_ON_DEVICE_HEAD_MODEL_H_ + ++#include ++ + #include + #include + #include +diff --git a/components/password_manager/core/browser/generation/password_generator.h b/components/password_manager/core/browser/generation/password_generator.h +index b0d621ce35f..683dd668888 100644 +--- a/components/password_manager/core/browser/generation/password_generator.h ++++ b/components/password_manager/core/browser/generation/password_generator.h +@@ -5,6 +5,8 @@ + #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_GENERATION_PASSWORD_GENERATOR_H_ + #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_GENERATION_PASSWORD_GENERATOR_H_ + ++#include ++ + #include + + +diff --git a/components/payments/content/utility/fingerprint_parser.h b/components/payments/content/utility/fingerprint_parser.h +index e7983056517..3c3f8308700 100644 +--- a/components/payments/content/utility/fingerprint_parser.h ++++ b/components/payments/content/utility/fingerprint_parser.h +@@ -6,6 +6,7 @@ + #define COMPONENTS_PAYMENTS_CONTENT_UTILITY_FINGERPRINT_PARSER_H_ + + #include ++#include + + #include + #include +diff --git a/components/viz/common/view_transition_element_resource_id.h b/components/viz/common/view_transition_element_resource_id.h +index fd0d06b16d6..17ae5688877 100644 +--- a/components/viz/common/view_transition_element_resource_id.h ++++ b/components/viz/common/view_transition_element_resource_id.h +@@ -5,6 +5,8 @@ + #ifndef COMPONENTS_VIZ_COMMON_VIEW_TRANSITION_ELEMENT_RESOURCE_ID_H_ + #define COMPONENTS_VIZ_COMMON_VIEW_TRANSITION_ELEMENT_RESOURCE_ID_H_ + ++#include ++ + #include + #include + diff --git a/iwyu-add-stdint.h-for-various-integer-types-in-net.patch b/iwyu-add-stdint.h-for-various-integer-types-in-net.patch new file mode 100644 index 0000000..ff31bbb --- /dev/null +++ b/iwyu-add-stdint.h-for-various-integer-types-in-net.patch @@ -0,0 +1,43 @@ +From 78e8aa30665d0344a64a98c092612ea6064dbe60 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Wed, 12 Apr 2023 08:42:20 +0000 +Subject: [PATCH] IWYU: add stdint.h for various integer types in //net + +Bug: 957519 +Change-Id: I7161bc8f5974a4d241c12d618d954db0787ab84c +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4394856 +Commit-Queue: Stephan Hartmann +Reviewed-by: Steven Bingler +Reviewed-by: Matt Mueller +Cr-Commit-Position: refs/heads/main@{#1129139} +--- + net/cert/pki/string_util.h | 2 ++ + net/cookies/cookie_inclusion_status.h | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/net/cert/pki/string_util.h b/net/cert/pki/string_util.h +index 1687b088606..b18f716f4b2 100644 +--- a/net/cert/pki/string_util.h ++++ b/net/cert/pki/string_util.h +@@ -7,6 +7,8 @@ + + #include "net/base/net_export.h" + ++#include ++ + #include + #include + +diff --git a/net/cookies/cookie_inclusion_status.h b/net/cookies/cookie_inclusion_status.h +index e8dd6d8d9fa..129b13ab7ba 100644 +--- a/net/cookies/cookie_inclusion_status.h ++++ b/net/cookies/cookie_inclusion_status.h +@@ -5,6 +5,8 @@ + #ifndef NET_COOKIES_COOKIE_INCLUSION_STATUS_H_ + #define NET_COOKIES_COOKIE_INCLUSION_STATUS_H_ + ++#include ++ + #include + #include + #include diff --git a/jinja-python-3.10.patch b/jinja-python-3.10.patch new file mode 100644 index 0000000..647fe5b --- /dev/null +++ b/jinja-python-3.10.patch @@ -0,0 +1,22 @@ +--- a/runtime.py ++++ b/runtime.py +@@ -315,7 +315,7 @@ class Context(with_metaclass(ContextMeta + + # register the context as mapping if possible + try: +- from collections import Mapping ++ from collections.abc import Mapping + Mapping.register(Context) + except ImportError: + pass +--- a/sandbox.py ++++ b/sandbox.py +@@ -14,7 +14,7 @@ + """ + import types + import operator +-from collections import Mapping ++from collections.abc import Mapping + from jinja2.environment import Environment + from jinja2.exceptions import SecurityError + from jinja2._compat import string_types, PY2 diff --git a/more-fixes-for-gcc13.patch b/more-fixes-for-gcc13.patch new file mode 100644 index 0000000..9224719 --- /dev/null +++ b/more-fixes-for-gcc13.patch @@ -0,0 +1,48 @@ +diff --git a/third_party/perfetto/include/perfetto/ext/base/uuid.h b/third_party/perfetto/include/perfetto/ext/base/uuid.h +index a23be40a..c62390cc 100644 +--- a/third_party/perfetto/include/perfetto/ext/base/uuid.h ++++ b/third_party/perfetto/include/perfetto/ext/base/uuid.h +@@ -19,6 +19,7 @@ + + #include + #include ++#include + + #include "perfetto/ext/base/optional.h" + +diff --git a/net/third_party/quiche/src/quiche/quic/core/crypto/quic_hkdf.h b/net/third_party/quiche/src/quiche/quic/core/crypto/quic_hkdf.h +index 6a300ed0..af6c0120 100644 +--- a/net/third_party/quiche/src/quiche/quic/core/crypto/quic_hkdf.h ++++ b/net/third_party/quiche/src/quiche/quic/core/crypto/quic_hkdf.h +@@ -6,6 +6,7 @@ + #define QUICHE_QUIC_CORE_CRYPTO_QUIC_HKDF_H_ + + #include ++#include + + #include "absl/strings/string_view.h" + #include "quiche/quic/platform/api/quic_export.h" +diff --git a/net/third_party/quiche/src/quiche/quic/core/quic_connection_id.h b/net/third_party/quiche/src/quiche/quic/core/quic_connection_id.h +index 49943495..b4e25fec 100644 +--- a/net/third_party/quiche/src/quiche/quic/core/quic_connection_id.h ++++ b/net/third_party/quiche/src/quiche/quic/core/quic_connection_id.h +@@ -5,6 +5,7 @@ + #ifndef QUICHE_QUIC_CORE_QUIC_CONNECTION_ID_H_ + #define QUICHE_QUIC_CORE_QUIC_CONNECTION_ID_H_ + ++#include + #include + #include + +diff --git a/third_party/webrtc/rtc_base/third_party/base64/base64.h b/third_party/webrtc/rtc_base/third_party/base64/base64.h +index 4190a79d..e224ffd0 100644 +--- a/third_party/webrtc/rtc_base/third_party/base64/base64.h ++++ b/third_party/webrtc/rtc_base/third_party/base64/base64.h +@@ -14,6 +14,7 @@ + + #include + #include ++#include + + #include "absl/strings/string_view.h" + #include "rtc_base/system/rtc_export.h" diff --git a/openscreen-iwyu-add-stdint.h.patch b/openscreen-iwyu-add-stdint.h.patch new file mode 100644 index 0000000..5ab7bcb --- /dev/null +++ b/openscreen-iwyu-add-stdint.h.patch @@ -0,0 +1,51 @@ +From f8d65c61edd2ba483f1f6167c8a5fe5ad53254ea Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Wed, 5 Apr 2023 18:53:56 +0200 +Subject: [PATCH] IWYU: add stdint.h for various integer types + +Bug: chromium:957519 +Change-Id: If28a50f5b1c68fffd1ba546dea18b4d906a42bbf +Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/4403253 +Reviewed-by: Mark Foltz +Commit-Queue: Mark Foltz +--- + AUTHORS | 1 + + discovery/dnssd/public/dns_sd_txt_record.h | 2 ++ + util/base64.h | 2 ++ + 3 files changed, 5 insertions(+) + +diff --git a/AUTHORS b/AUTHORS +index 768523fc..4e9e5667 100644 +--- a/AUTHORS ++++ b/AUTHORS +@@ -5,3 +5,4 @@ Peter Thatcher + Jordan Bayles + Max Yakimakha + Ryan Keane ++Stephan Hartmann +diff --git a/discovery/dnssd/public/dns_sd_txt_record.h b/discovery/dnssd/public/dns_sd_txt_record.h +index edf2c782..c9b5c436 100644 +--- a/discovery/dnssd/public/dns_sd_txt_record.h ++++ b/discovery/dnssd/public/dns_sd_txt_record.h +@@ -5,6 +5,8 @@ + #ifndef DISCOVERY_DNSSD_PUBLIC_DNS_SD_TXT_RECORD_H_ + #define DISCOVERY_DNSSD_PUBLIC_DNS_SD_TXT_RECORD_H_ + ++#include ++ + #include + #include + #include +diff --git a/util/base64.h b/util/base64.h +index a7af9eca..86261936 100644 +--- a/util/base64.h ++++ b/util/base64.h +@@ -5,6 +5,8 @@ + #ifndef UTIL_BASE64_H_ + #define UTIL_BASE64_H_ + ++#include ++ + #include + #include + diff --git a/pdfium-iwyu-add-stdint.h-for-uint32_t.patch b/pdfium-iwyu-add-stdint.h-for-uint32_t.patch new file mode 100644 index 0000000..a4dd838 --- /dev/null +++ b/pdfium-iwyu-add-stdint.h-for-uint32_t.patch @@ -0,0 +1,27 @@ +From 5d9acaac1abbbe45558f2bd6cbd3b3e9efde4414 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Wed, 5 Apr 2023 16:10:25 +0000 +Subject: [PATCH] IWYU: add stdint.h for uint32_t pdfium::annotation_flags + +Bug: chromium:957519 +Change-Id: Id10921a5fdf93a3b92c76c84266696e92d901bd5 +Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/105890 +Reviewed-by: Lei Zhang +Commit-Queue: Lei Zhang +--- + constants/annotation_flags.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/constants/annotation_flags.h b/constants/annotation_flags.h +index 2ac244e06..d44a0c13c 100644 +--- a/constants/annotation_flags.h ++++ b/constants/annotation_flags.h +@@ -5,6 +5,8 @@ + #ifndef CONSTANTS_ANNOTATION_FLAGS_H_ + #define CONSTANTS_ANNOTATION_FLAGS_H_ + ++#include ++ + namespace pdfium { + namespace annotation_flags { + diff --git a/random-fixes-for-gcc13.patch b/random-fixes-for-gcc13.patch new file mode 100644 index 0000000..d9ec684 --- /dev/null +++ b/random-fixes-for-gcc13.patch @@ -0,0 +1,75 @@ +diff -upr chromium-113.0.5672.63.orig/gin/time_clamper.h chromium-113.0.5672.63/gin/time_clamper.h +--- chromium-113.0.5672.63.orig/gin/time_clamper.h 2023-04-26 21:43:06.707860200 +0000 ++++ chromium-113.0.5672.63/gin/time_clamper.h 2023-05-09 00:14:09.744221610 +0000 +@@ -6,6 +6,7 @@ + #define GIN_TIME_CLAMPER_H_ + + #include ++#include + + #include "base/rand_util.h" + #include "base/time/time.h" +@@ -48,7 +49,7 @@ class GIN_EXPORT TimeClamper { + const int64_t micros = now_micros % 1000; + // abs() is necessary for devices with times before unix-epoch (most likely + // configured incorrectly). +- if (abs(micros) + kResolutionMicros < 1000) { ++ if (std::abs(micros) + kResolutionMicros < 1000) { + return now_micros / 1000; + } + return ClampTimeResolution(now_micros) / 1000; +diff -upr chromium-113.0.5672.63.orig/third_party/maldoca/src/maldoca/ole/header.h chromium-113.0.5672.63/third_party/maldoca/src/maldoca/ole/header.h +--- chromium-113.0.5672.63.orig/third_party/maldoca/src/maldoca/ole/header.h 2023-04-26 21:43:58.708449600 +0000 ++++ chromium-113.0.5672.63/third_party/maldoca/src/maldoca/ole/header.h 2023-05-09 00:14:09.744221610 +0000 +@@ -43,6 +43,7 @@ + #ifndef MALDOCA_OLE_HEADER_H_ + #define MALDOCA_OLE_HEADER_H_ + ++#include + #include "absl/strings/string_view.h" + + namespace maldoca { +diff -upr chromium-113.0.5672.63.orig/third_party/ruy/src/ruy/profiler/instrumentation.h chromium-113.0.5672.63/third_party/ruy/src/ruy/profiler/instrumentation.h +--- chromium-113.0.5672.63.orig/third_party/ruy/src/ruy/profiler/instrumentation.h 2023-04-26 21:47:36.527673200 +0000 ++++ chromium-113.0.5672.63/third_party/ruy/src/ruy/profiler/instrumentation.h 2023-05-09 00:14:09.744221610 +0000 +@@ -19,6 +19,7 @@ limitations under the License. + #ifdef RUY_PROFILER + #include + #include ++#include + #include + #endif + +diff -upr chromium-113.0.5672.63.orig/third_party/tflite/src/tensorflow/lite/kernels/internal/spectrogram.cc chromium-113.0.5672.63/third_party/tflite/src/tensorflow/lite/kernels/internal/spectrogram.cc +--- chromium-113.0.5672.63.orig/third_party/tflite/src/tensorflow/lite/kernels/internal/spectrogram.cc 2023-04-26 21:47:39.531938300 +0000 ++++ chromium-113.0.5672.63/third_party/tflite/src/tensorflow/lite/kernels/internal/spectrogram.cc 2023-05-09 00:14:09.747555160 +0000 +@@ -17,6 +17,7 @@ limitations under the License. + + #include + #include ++#include + + #include "third_party/fft2d/fft.h" + +diff -upr chromium-113.0.5672.63.orig/third_party/vulkan-deps/vulkan-validation-layers/src/layers/vk_mem_alloc.h chromium-113.0.5672.63/third_party/vulkan-deps/vulkan-validation-layers/src/layers/vk_mem_alloc.h +--- chromium-113.0.5672.63.orig/third_party/vulkan-deps/vulkan-validation-layers/src/layers/vk_mem_alloc.h 2023-04-26 21:47:38.323831800 +0000 ++++ chromium-113.0.5672.63/third_party/vulkan-deps/vulkan-validation-layers/src/layers/vk_mem_alloc.h 2023-05-09 00:14:09.757555808 +0000 +@@ -2579,6 +2579,7 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString( + #undef VMA_IMPLEMENTATION + + #include ++#include + #include + #include + #include +diff -upr chromium-113.0.5672.63.orig/third_party/vulkan_memory_allocator/include/vk_mem_alloc.h chromium-113.0.5672.63/third_party/vulkan_memory_allocator/include/vk_mem_alloc.h +--- chromium-113.0.5672.63.orig/third_party/vulkan_memory_allocator/include/vk_mem_alloc.h 2023-04-26 21:47:36.679686500 +0000 ++++ chromium-113.0.5672.63/third_party/vulkan_memory_allocator/include/vk_mem_alloc.h 2023-05-09 00:14:41.046248921 +0000 +@@ -2389,6 +2389,7 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeV + #undef VMA_IMPLEMENTATION + + #include ++#include + #include + #include + #include diff --git a/re-fix-TFLite-build-error-on-linux-with-system-zlib.patch b/re-fix-TFLite-build-error-on-linux-with-system-zlib.patch new file mode 100644 index 0000000..13d504d --- /dev/null +++ b/re-fix-TFLite-build-error-on-linux-with-system-zlib.patch @@ -0,0 +1,41 @@ +From dda01a706453ded8c01c41775707cb5ef4e316f8 Mon Sep 17 00:00:00 2001 +From: Andres Salomon +Date: Tue, 25 Oct 2022 21:11:46 +0000 +Subject: [PATCH] Re-fix TFLite build error on linux when using the system zlib + +In commit ae0f9adb7e14c0d19ca695ef6ad40b321a8cb64c, I fixed some build +errors related to minizip patch inclusion in TFLite. However, after that +when TFLite Support was rolled to HEAD, a small part of that patch got +dropped. The result is the following build error with 107.0.5304.62: + +../../third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc:22:10: fatal error: 'contrib/minizip/ioapi.h' file not found + ^~~~~~~~~~~~~~~~~~~~~~~~~ +1 error generated. + +This commit re-adds the lost fix. + +R=junzou@chromium.org + +Change-Id: Ie96c3571894b5100a1e2a2771da29699eff0beb3 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3972087 +Reviewed-by: Robert Ogden +Commit-Queue: Robert Ogden +Auto-Submit: Andres Salomon +Cr-Commit-Position: refs/heads/main@{#1063478} +--- + .../metadata/cc/utils/zip_readonly_mem_file.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc +index 392b6b411fe..525ae4a2b45 100644 +--- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc ++++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc +@@ -19,7 +19,7 @@ limitations under the License. + #include + + #include "absl/strings/string_view.h" // from @com_google_absl +-#include "contrib/minizip/ioapi.h" ++#include "third_party/zlib/contrib/minizip/ioapi.h" + + namespace tflite { + namespace metadata { diff --git a/std-vector-non-const.patch b/std-vector-non-const.patch new file mode 100644 index 0000000..416ba72 --- /dev/null +++ b/std-vector-non-const.patch @@ -0,0 +1,109 @@ +--- a/patches/chromium/feat_add_data_parameter_to_processsingleton.patch ++++ b/patches/chromium/feat_add_data_parameter_to_processsingleton.patch +@@ -32,7 +32,7 @@ index 5a64220aaf1309832dc0ad543e353de67fe0a779..e75c4f0d7cf1cac2e5862eb858800359 + - const base::FilePath& current_directory)>; + + base::RepeatingCallback additional_data)>; +++ const std::vector additional_data)>; + + #if BUILDFLAG(IS_WIN) + ProcessSingleton(const std::string& program_name, +@@ -72,7 +72,7 @@ index 7d3a441bdb64268ed5fbfa7bf589fb35a2fd1b75..a3e45e9baa09bfc87be5b7ff589ac768 + // |reader| is for sending back ACK message. + void HandleMessage(const std::string& current_dir, + const std::vector& argv, +-+ const std::vector additional_data, +++ const std::vector additional_data, + SocketReader* reader); + + private: +@@ -83,7 +83,7 @@ index 7d3a441bdb64268ed5fbfa7bf589fb35a2fd1b75..a3e45e9baa09bfc87be5b7ff589ac768 + - const std::string& current_dir, const std::vector& argv, + + const std::string& current_dir, + + const std::vector& argv, +-+ const std::vector additional_data, +++ const std::vector additional_data, + SocketReader* reader) { + DCHECK(ui_task_runner_->BelongsToCurrentThread()); + DCHECK(reader); +@@ -113,7 +113,7 @@ index 7d3a441bdb64268ed5fbfa7bf589fb35a2fd1b75..a3e45e9baa09bfc87be5b7ff589ac768 + + base::StringToSizeT(tokens[0], &num_args); + + std::vector command_line(tokens.begin() + 1, tokens.begin() + 1 + num_args); + + +-+ std::vector additional_data; +++ std::vector additional_data; + + if (tokens.size() >= 3 + num_args) { + + size_t additional_data_size; + + base::StringToSizeT(tokens[1 + num_args], &additional_data_size); +@@ -122,7 +122,7 @@ index 7d3a441bdb64268ed5fbfa7bf589fb35a2fd1b75..a3e45e9baa09bfc87be5b7ff589ac768 + + std::string(1, kTokenDelimiter)); + + const uint8_t* additional_data_bits = + + reinterpret_cast(remaining_args.c_str()); +-+ additional_data = std::vector( +++ additional_data = std::vector( + + additional_data_bits, additional_data_bits + additional_data_size); + + } + + +@@ -188,7 +188,7 @@ index 0ea5eb3e3cf055d981ab73486115bac53287f2d7..fe68beb4b2522d27e07dbbb3341f100f + base::CommandLine* parsed_command_line, + - base::FilePath* current_directory) { + + base::FilePath* current_directory, +-+ std::vector* parsed_additional_data) { +++ std::vector* parsed_additional_data) { + // We should have enough room for the shortest command (min_message_size) + // and also be a multiple of wchar_t bytes. The shortest command + - // possible is L"START\0\0" (empty current directory and command line). +@@ -229,7 +229,7 @@ index 0ea5eb3e3cf055d981ab73486115bac53287f2d7..fe68beb4b2522d27e07dbbb3341f100f + + msg.substr(fourth_null + 1, fifth_null - fourth_null); + + const uint8_t* additional_data_bytes = + + reinterpret_cast(additional_data.c_str()); +-+ *parsed_additional_data = std::vector(additional_data_bytes, +++ *parsed_additional_data = std::vector(additional_data_bytes, + + additional_data_bytes + additional_data_length); + + + return true; +@@ -240,7 +240,7 @@ index 0ea5eb3e3cf055d981ab73486115bac53287f2d7..fe68beb4b2522d27e07dbbb3341f100f + base::CommandLine parsed_command_line(base::CommandLine::NO_PROGRAM); + base::FilePath current_directory; + - if (!ParseCommandLine(cds, &parsed_command_line, ¤t_directory)) { +-+ std::vector additional_data; +++ std::vector additional_data; + + if (!ParseCommandLine(cds, &parsed_command_line, ¤t_directory, &additional_data)) { + *result = TRUE; + return true; +--- a/shell/browser/api/electron_api_app.cc ++++ b/shell/browser/api/electron_api_app.cc +@@ -523,10 +523,10 @@ bool NotificationCallbackWrapper( + const base::RepeatingCallback< + void(const base::CommandLine& command_line, + const base::FilePath& current_directory, +- const std::vector additional_data)>& callback, ++ const std::vector additional_data)>& callback, + const base::CommandLine& cmd, + const base::FilePath& cwd, +- const std::vector additional_data) { ++ const std::vector additional_data) { + // Make sure the callback is called after app gets ready. + if (Browser::Get()->is_ready()) { + callback.Run(cmd, cwd, std::move(additional_data)); +@@ -1102,7 +1102,7 @@ std::string App::GetLocaleCountryCode() { + + void App::OnSecondInstance(const base::CommandLine& cmd, + const base::FilePath& cwd, +- const std::vector additional_data) { ++ const std::vector additional_data) { + v8::Isolate* isolate = JavascriptEnvironment::GetIsolate(); + v8::HandleScope handle_scope(isolate); + v8::Local data_value = +--- a/shell/browser/api/electron_api_app.h ++++ b/shell/browser/api/electron_api_app.h +@@ -194,7 +194,7 @@ class App : public ElectronBrowserClient::Delegate, + std::string GetSystemLocale(gin_helper::ErrorThrower thrower) const; + void OnSecondInstance(const base::CommandLine& cmd, + const base::FilePath& cwd, +- const std::vector additional_data); ++ const std::vector additional_data); + bool HasSingleInstanceLock() const; + bool RequestSingleInstanceLock(gin::Arguments* args); + void ReleaseSingleInstanceLock(); diff --git a/swiftshader-add-cstdint-for-uint64_t.patch b/swiftshader-add-cstdint-for-uint64_t.patch new file mode 100644 index 0000000..2b1d1b0 --- /dev/null +++ b/swiftshader-add-cstdint-for-uint64_t.patch @@ -0,0 +1,28 @@ +From 3ecab9c1aa60d548d8efeae3a231f4df7cca6cc7 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Sun, 2 Apr 2023 20:53:20 +0200 +Subject: [PATCH] IWYU: add cstdint for uint64_t in sw::LRUCache + +Bug: chromium:957519 +Change-Id: I70970ceda50dfc38f3d149fea03e8a6a79a35934 +Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/71268 +Commit-Queue: Shahbaz Youssefi +Reviewed-by: Shahbaz Youssefi +Kokoro-Result: kokoro +Tested-by: Shahbaz Youssefi +--- + src/System/LRUCache.hpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/System/LRUCache.hpp b/src/System/LRUCache.hpp +index 1c244906441..a04cdfafbc0 100644 +--- a/src/System/LRUCache.hpp ++++ b/src/System/LRUCache.hpp +@@ -18,6 +18,7 @@ + #include "System/Debug.hpp" + + #include ++#include + #include + #include + #include diff --git a/use-system-libraries-in-node.patch b/use-system-libraries-in-node.patch new file mode 100644 index 0000000..096a6ff --- /dev/null +++ b/use-system-libraries-in-node.patch @@ -0,0 +1,13 @@ +--- a/third_party/electron_node/BUILD.gn ++++ b/third_party/electron_node/BUILD.gn +@@ -42,8 +42,8 @@ declare_args() { + node_module_version = "" + + # Allows downstream packagers (eg. Linux distributions) to build Electron against system shared libraries. +- use_system_cares = false +- use_system_nghttp2 = false ++ use_system_cares = true ++ use_system_nghttp2 = true + use_system_llhttp = false + use_system_histogram = false + } diff --git a/v8-enhance-Date-parser-to-take-Unicode-SPACE.patch b/v8-enhance-Date-parser-to-take-Unicode-SPACE.patch new file mode 100644 index 0000000..7458834 --- /dev/null +++ b/v8-enhance-Date-parser-to-take-Unicode-SPACE.patch @@ -0,0 +1,58 @@ +From 81dd64c3705f89653859a5d0001dd0ca983a92e2 Mon Sep 17 00:00:00 2001 +From: Frank Tang +Date: Wed, 16 Nov 2022 09:18:45 -0800 +Subject: [PATCH] [intl] Enhance Date parser to take Unicode SPACE + +This is needed to prepare for the landing of ICU72. +Allow U+202F in the Date String, which the toLocaleString("en-US") +will generate w/ ICU72. + +Bug: v8:13494 +Change-Id: I41b83c4094ce3d0737a72dcd6310b52c68fdcdca +Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4027341 +Reviewed-by: Yang Guo +Reviewed-by: Jungshik Shin +Commit-Queue: Frank Tang +Cr-Commit-Position: refs/heads/main@{#84308} + +(cherry picked from commit 2ada52cffbff11074abfaac18938bf02d85454f5) +--- + src/date/dateparser-inl.h | 2 +- + src/date/dateparser.h | 4 +++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/date/dateparser-inl.h b/src/date/dateparser-inl.h +index 623986d2b1..b45479dc51 100644 +--- a/src/date/dateparser-inl.h ++++ b/src/date/dateparser-inl.h +@@ -192,7 +192,7 @@ DateParser::DateToken DateParser::DateStringTokenizer::Scan() { + if (in_->Skip('+')) return DateToken::Symbol('+'); + if (in_->Skip('.')) return DateToken::Symbol('.'); + if (in_->Skip(')')) return DateToken::Symbol(')'); +- if (in_->IsAsciiAlphaOrAbove()) { ++ if (in_->IsAsciiAlphaOrAbove() && !in_->IsWhiteSpaceChar()) { + DCHECK_EQ(KeywordTable::kPrefixLength, 3); + uint32_t buffer[3] = {0, 0, 0}; + int length = in_->ReadWord(buffer, 3); +diff --git a/src/date/dateparser.h b/src/date/dateparser.h +index 1a0a0b15ab..59b2f3c9fd 100644 +--- a/src/date/dateparser.h ++++ b/src/date/dateparser.h +@@ -91,7 +91,8 @@ class DateParser : public AllStatic { + // Return word length. + int ReadWord(uint32_t* prefix, int prefix_size) { + int len; +- for (len = 0; IsAsciiAlphaOrAbove(); Next(), len++) { ++ for (len = 0; IsAsciiAlphaOrAbove() && !IsWhiteSpaceChar(); ++ Next(), len++) { + if (len < prefix_size) prefix[len] = AsciiAlphaToLower(ch_); + } + for (int i = len; i < prefix_size; i++) prefix[i] = 0; +@@ -115,6 +116,7 @@ class DateParser : public AllStatic { + bool IsEnd() const { return ch_ == 0; } + bool IsAsciiDigit() const { return IsDecimalDigit(ch_); } + bool IsAsciiAlphaOrAbove() const { return ch_ >= 'A'; } ++ bool IsWhiteSpaceChar() const { return IsWhiteSpace(ch_); } + bool IsAsciiSign() const { return ch_ == '+' || ch_ == '-'; } + + // Return 1 for '+' and -1 for '-'. diff --git a/v8-move-the-Stack-object-from-ThreadLocalTop.patch b/v8-move-the-Stack-object-from-ThreadLocalTop.patch new file mode 100644 index 0000000..a060448 --- /dev/null +++ b/v8-move-the-Stack-object-from-ThreadLocalTop.patch @@ -0,0 +1,205 @@ +From 7b6fbcd0a6700db498ad55db046ecda92c8ee8c1 Mon Sep 17 00:00:00 2001 +From: Nikolaos Papaspyrou +Date: Sun, 29 Jan 2023 17:18:08 +0100 +Subject: [PATCH] Merge: [heap] Move the Stack object from ThreadLocalTop to + Isolate + +This is just for nodejs, do not backmerge to 11.0. +(cherry picked from commit 1e4b71d99fea5ea6bb4bf6420585a7819872bb0f) + +> Change-Id: I026a35af3bc6999a09b21f277756d4454c086343 +> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4152476 +> Reviewed-by: Michael Lippautz +> Reviewed-by: Omer Katz +> Commit-Queue: Nikolaos Papaspyrou +> Cr-Commit-Position: refs/heads/main@{#85445} + +Stack information is thread-specific and, until now, it was stored in a +field in ThreadLocalTop. This CL moves stack information to the isolate +and makes sure to update the stack start whenever a main thread enters +the isolate. At the same time, the Stack object is refactored and +simplified. + +As a side effect, after removing the Stack object, ThreadLocalTop +satisfies the std::standard_layout trait; this fixes some issues +observed with different C++ compilers. + +Bug: v8:13630 +Bug: v8:13257 +Change-Id: I4be1f04fe90699e1a6e456dad3e0dd623851acce +--- + src/execution/isolate.cc | 36 +++++++++++++++---------------- + src/execution/isolate.h | 6 ++++++ + src/execution/thread-local-top.cc | 2 -- + src/execution/thread-local-top.h | 6 +----- + src/heap/heap.cc | 4 +--- + 5 files changed, 25 insertions(+), 29 deletions(-) + +diff --git a/src/execution/isolate.cc b/src/execution/isolate.cc +index 4edf364e0a..be4fd400d2 100644 +--- a/src/execution/isolate.cc ++++ b/src/execution/isolate.cc +@@ -3074,22 +3074,23 @@ void Isolate::AddSharedWasmMemory(Handle memory_object) { + void Isolate::RecordStackSwitchForScanning() { + Object current = root(RootIndex::kActiveContinuation); + DCHECK(!current.IsUndefined()); +- thread_local_top()->stack_.ClearStackSegments(); +- wasm::StackMemory* stack = Managed::cast( +- WasmContinuationObject::cast(current).stack()) +- .get() +- .get(); ++ stack().ClearStackSegments(); ++ wasm::StackMemory* wasm_stack = ++ Managed::cast( ++ WasmContinuationObject::cast(current).stack()) ++ .get() ++ .get(); + current = WasmContinuationObject::cast(current).parent(); +- thread_local_top()->stack_.SetStackStart( +- reinterpret_cast(stack->base())); ++ heap()->SetStackStart(reinterpret_cast(wasm_stack->base())); + // We don't need to add all inactive stacks. Only the ones in the active chain + // may contain cpp heap pointers. + while (!current.IsUndefined()) { + auto cont = WasmContinuationObject::cast(current); +- auto* stack = Managed::cast(cont.stack()).get().get(); +- thread_local_top()->stack_.AddStackSegment( +- reinterpret_cast(stack->base()), +- reinterpret_cast(stack->jmpbuf()->sp)); ++ auto* wasm_stack = ++ Managed::cast(cont.stack()).get().get(); ++ stack().AddStackSegment( ++ reinterpret_cast(wasm_stack->base()), ++ reinterpret_cast(wasm_stack->jmpbuf()->sp)); + current = cont.parent(); + } + } +@@ -3377,20 +3378,13 @@ void Isolate::Delete(Isolate* isolate) { + Isolate* saved_isolate = isolate->TryGetCurrent(); + SetIsolateThreadLocals(isolate, nullptr); + isolate->set_thread_id(ThreadId::Current()); +- isolate->thread_local_top()->stack_ = +- saved_isolate ? std::move(saved_isolate->thread_local_top()->stack_) +- : ::heap::base::Stack(base::Stack::GetStackStart()); ++ isolate->heap()->SetStackStart(base::Stack::GetStackStart()); + + bool owns_shared_isolate = isolate->owns_shared_isolate_; + Isolate* maybe_shared_isolate = isolate->shared_isolate_; + + isolate->Deinit(); + +- // Restore the saved isolate's stack. +- if (saved_isolate) +- saved_isolate->thread_local_top()->stack_ = +- std::move(isolate->thread_local_top()->stack_); +- + #ifdef DEBUG + non_disposed_isolates_--; + #endif // DEBUG +@@ -4647,6 +4641,10 @@ bool Isolate::Init(SnapshotData* startup_snapshot_data, + void Isolate::Enter() { + Isolate* current_isolate = nullptr; + PerIsolateThreadData* current_data = CurrentPerIsolateThreadData(); ++ ++ // Set the stack start for the main thread that enters the isolate. ++ heap()->SetStackStart(base::Stack::GetStackStart()); ++ + if (current_data != nullptr) { + current_isolate = current_data->isolate_; + DCHECK_NOT_NULL(current_isolate); +diff --git a/src/execution/isolate.h b/src/execution/isolate.h +index a32f999fe5..1cb6e10661 100644 +--- a/src/execution/isolate.h ++++ b/src/execution/isolate.h +@@ -32,6 +32,7 @@ + #include "src/execution/stack-guard.h" + #include "src/handles/handles.h" + #include "src/handles/traced-handles.h" ++#include "src/heap/base/stack.h" + #include "src/heap/factory.h" + #include "src/heap/heap.h" + #include "src/heap/read-only-heap.h" +@@ -2022,6 +2023,8 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory { + SimulatorData* simulator_data() { return simulator_data_; } + #endif + ++ ::heap::base::Stack& stack() { return stack_; } ++ + #ifdef V8_ENABLE_WEBASSEMBLY + wasm::StackMemory*& wasm_stacks() { return wasm_stacks_; } + // Update the thread local's Stack object so that it is aware of the new stack +@@ -2520,6 +2523,9 @@ class V8_EXPORT_PRIVATE Isolate final : private HiddenFactory { + // The mutex only guards adding pages, the retrieval is signal safe. + base::Mutex code_pages_mutex_; + ++ // Stack information for the main thread. ++ ::heap::base::Stack stack_; ++ + #ifdef V8_ENABLE_WEBASSEMBLY + wasm::StackMemory* wasm_stacks_; + #endif +diff --git a/src/execution/thread-local-top.cc b/src/execution/thread-local-top.cc +index 0d7071ddda..05cc20b8e4 100644 +--- a/src/execution/thread-local-top.cc ++++ b/src/execution/thread-local-top.cc +@@ -37,14 +37,12 @@ void ThreadLocalTop::Clear() { + current_embedder_state_ = nullptr; + failed_access_check_callback_ = nullptr; + thread_in_wasm_flag_address_ = kNullAddress; +- stack_ = ::heap::base::Stack(); + } + + void ThreadLocalTop::Initialize(Isolate* isolate) { + Clear(); + isolate_ = isolate; + thread_id_ = ThreadId::Current(); +- stack_.SetStackStart(base::Stack::GetStackStart()); + #if V8_ENABLE_WEBASSEMBLY + thread_in_wasm_flag_address_ = reinterpret_cast
( + trap_handler::GetThreadInWasmThreadLocalAddress()); +diff --git a/src/execution/thread-local-top.h b/src/execution/thread-local-top.h +index 43fec0a7df..989c817f31 100644 +--- a/src/execution/thread-local-top.h ++++ b/src/execution/thread-local-top.h +@@ -10,7 +10,6 @@ + #include "include/v8-unwinder.h" + #include "src/common/globals.h" + #include "src/execution/thread-id.h" +-#include "src/heap/base/stack.h" + #include "src/objects/contexts.h" + #include "src/utils/utils.h" + +@@ -30,7 +29,7 @@ class ThreadLocalTop { + // TODO(all): This is not particularly beautiful. We should probably + // refactor this to really consist of just Addresses and 32-bit + // integer fields. +- static constexpr uint32_t kSizeInBytes = 30 * kSystemPointerSize; ++ static constexpr uint32_t kSizeInBytes = 25 * kSystemPointerSize; + + // Does early low-level initialization that does not depend on the + // isolate being present. +@@ -147,9 +146,6 @@ class ThreadLocalTop { + + // Address of the thread-local "thread in wasm" flag. + Address thread_in_wasm_flag_address_; +- +- // Stack information. +- ::heap::base::Stack stack_; + }; + + } // namespace internal +diff --git a/src/heap/heap.cc b/src/heap/heap.cc +index 51a90ddcab..b5722ab6ec 100644 +--- a/src/heap/heap.cc ++++ b/src/heap/heap.cc +@@ -5851,9 +5851,7 @@ void Heap::SetStackStart(void* stack_start) { + stack().SetStackStart(stack_start); + } + +-::heap::base::Stack& Heap::stack() { +- return isolate_->thread_local_top()->stack_; +-} ++::heap::base::Stack& Heap::stack() { return isolate_->stack(); } + + void Heap::RegisterExternallyReferencedObject(Address* location) { + Object object = TracedHandles::Mark(location, TracedHandles::MarkMode::kAll);