update to 117.0.5938.88 [release 117.0.5938.88-1mamba;Mon Sep 18 2023]

This commit is contained in:
Silvan Calarco 2024-01-05 21:17:03 +01:00
parent b884240616
commit f51c51d59e
42 changed files with 151 additions and 4541 deletions

View File

@ -1,10 +0,0 @@
--- a/build/linux/unbundle/libxml.gn
+++ b/build/linux/unbundle/libxml.gn
@@ -19,6 +19,7 @@ static_library("libxml_utils") {
":xml_reader",
":xml_writer",
"//base/test:test_support",
+ "//services/data_decoder:lib",
"//services/data_decoder:xml_parser_fuzzer_deps",
]
sources = [

View File

@ -1,27 +0,0 @@
From 9dd0503835dc875807ab63efb1f477bffed2a852 Mon Sep 17 00:00:00 2001
From: Stephan Hartmann <stha09@googlemail.com>
Date: Mon, 25 Apr 2022 23:18:30 +0000
Subject: [PATCH] IWYU: add utility for std::exchange
Bug: 957519
Change-Id: I307d520fdc34d2452018ed32a505e7e519739410
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3604643
Reviewed-by: Wez <wez@chromium.org>
Commit-Queue: Stephan Hartmann <stha09@googlemail.com>
Cr-Commit-Position: refs/heads/main@{#995855}
---
base/third_party/symbolize/symbolize.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/base/third_party/symbolize/symbolize.h b/base/third_party/symbolize/symbolize.h
index 99029a968d5..278078f6071 100644
--- a/base/third_party/symbolize/symbolize.h
+++ b/base/third_party/symbolize/symbolize.h
@@ -61,6 +61,7 @@
#ifdef HAVE_SYMBOLIZE
#include <algorithm>
+#include <utility>
#if defined(__ELF__) // defined by gcc
#if defined(__OpenBSD__)

View File

@ -1,18 +0,0 @@
--- chromium-102.0.5005.61/build/config/compiler/BUILD.gn.orig 2022-05-19 10:35:52.991415777 +0000
+++ chromium-102.0.5005.61/build/config/compiler/BUILD.gn 2022-05-19 10:36:11.102017131 +0000
@@ -1538,15 +1538,6 @@ config("default_warnings") {
cflags += [ "-Wno-deprecated-non-prototype" ]
}
- if (!is_nacl && !(is_chromeos ||
- default_toolchain == "//build/toolchain/cros:target")) {
- # TODO(https://crbug.com/1316298): Re-enable once test failure is figured out
- cflags += [
- "-Xclang",
- "-no-opaque-pointers",
- ]
- }
-
if (is_fuchsia) {
# TODO(https://bugs.chromium.org/p/fuchsia/issues/detail?id=77383)
cflags += [ "-Wno-deprecated-copy" ]

View File

@ -1,18 +0,0 @@
--- chromium-104.0.5112.57/build/config/compiler/BUILD.gn.orig 2022-07-26 08:11:54.192788877 +0000
+++ chromium-104.0.5112.57/build/config/compiler/BUILD.gn 2022-07-26 08:12:10.019328155 +0000
@@ -1540,15 +1540,6 @@ config("default_warnings") {
cflags += [ "-Wno-unqualified-std-cast-call" ]
}
- if (!is_nacl && !(is_chromeos ||
- default_toolchain == "//build/toolchain/cros:target")) {
- # TODO(https://crbug.com/1322823): Remove flags once potential miscompile is investigated.
- cflags += [
- "-Xclang",
- "-no-opaque-pointers",
- ]
- }
-
if (is_fuchsia) {
# TODO(https://bugs.chromium.org/p/fuchsia/issues/detail?id=77383)
cflags += [ "-Wno-deprecated-copy" ]

View File

@ -1,333 +0,0 @@
From 6e554a30893150793c2638e3689cf208ffc8e375 Mon Sep 17 00:00:00 2001
From: Dale Curtis <dalecurtis@chromium.org>
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 <dalecurtis@chromium.org>
Reviewed-by: Dan Sanders <sandersd@chromium.org>
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
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<FFmpegDecodingLoop>(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<AudioTimestampHelper>(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<std::unique_ptr<AVFrame, ScopedPtrAVFreeFrame>>* 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<std::unique_ptr<AudioBus>> 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<int32_t*>(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.";

View File

@ -1,70 +0,0 @@
--- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc
+++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_extractor.cc
@@ -21,8 +21,8 @@ limitations under the License.
#include "absl/status/status.h" // from @com_google_absl
#include "absl/strings/str_format.h" // from @com_google_absl
#include "absl/strings/string_view.h" // from @com_google_absl
-#include "contrib/minizip/ioapi.h"
-#include "contrib/minizip/unzip.h"
+#include "third_party/zlib/contrib/minizip/ioapi.h"
+#include "third_party/zlib/contrib/minizip/unzip.h"
#include "flatbuffers/flatbuffers.h" // from @flatbuffers
#include "tensorflow/lite/schema/schema_generated.h"
#include "tensorflow_lite_support/cc/common.h"
--- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc
+++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/metadata_populator.cc
@@ -19,8 +19,8 @@ limitations under the License.
#include <cstring>
#include <functional>
-#include "contrib/minizip/ioapi.h"
-#include "contrib/minizip/zip.h"
+#include "third_party/zlib/contrib/minizip/ioapi.h"
+#include "third_party/zlib/contrib/minizip/zip.h"
#include "flatbuffers/flatbuffers.h" // from @flatbuffers
#include "tensorflow/lite/schema/schema_generated.h"
#include "tensorflow_lite_support/cc/common.h"
--- 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 <cstdio>
#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 {
--- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h
+++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.h
@@ -19,7 +19,7 @@ limitations under the License.
#include <cstdlib>
#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 {
--- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc
+++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.cc
@@ -19,7 +19,7 @@ limitations under the License.
#include <cstdio>
#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 {
--- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h
+++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_writable_mem_file.h
@@ -19,7 +19,7 @@ limitations under the License.
#include <cstdlib>
#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 {

View File

@ -1,38 +0,0 @@
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",
+ ]
}
}

View File

@ -1,55 +0,0 @@
From ded379824f5de39357b6b1894578101aba5cdf05 Mon Sep 17 00:00:00 2001
From: Eugene Zemtsov <eugene@chromium.org>
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 <cassew@chromium.org>
Commit-Queue: Eugene Zemtsov <eugene@chromium.org>
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<int64_t>(0), frame->pts));
+ frame->duration + std::min(static_cast<int64_t>(0), frame->pts));
const base::TimeDelta frame_duration =
base::Seconds(frames_read / static_cast<double>(sample_rate_));

View File

@ -1,205 +0,0 @@
From 7b6fbcd0a6700db498ad55db046ecda92c8ee8c1 Mon Sep 17 00:00:00 2001
From: Nikolaos Papaspyrou <nikolaos@chromium.org>
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 <mlippautz@chromium.org>
> Reviewed-by: Omer Katz <omerkatz@chromium.org>
> Commit-Queue: Nikolaos Papaspyrou <nikolaos@chromium.org>
> 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<WasmMemoryObject> memory_object) {
void Isolate::RecordStackSwitchForScanning() {
Object current = root(RootIndex::kActiveContinuation);
DCHECK(!current.IsUndefined());
- thread_local_top()->stack_.ClearStackSegments();
- wasm::StackMemory* stack = Managed<wasm::StackMemory>::cast(
- WasmContinuationObject::cast(current).stack())
- .get()
- .get();
+ stack().ClearStackSegments();
+ wasm::StackMemory* wasm_stack =
+ Managed<wasm::StackMemory>::cast(
+ WasmContinuationObject::cast(current).stack())
+ .get()
+ .get();
current = WasmContinuationObject::cast(current).parent();
- thread_local_top()->stack_.SetStackStart(
- reinterpret_cast<void*>(stack->base()));
+ heap()->SetStackStart(reinterpret_cast<void*>(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<wasm::StackMemory>::cast(cont.stack()).get().get();
- thread_local_top()->stack_.AddStackSegment(
- reinterpret_cast<const void*>(stack->base()),
- reinterpret_cast<const void*>(stack->jmpbuf()->sp));
+ auto* wasm_stack =
+ Managed<wasm::StackMemory>::cast(cont.stack()).get().get();
+ stack().AddStackSegment(
+ reinterpret_cast<const void*>(wasm_stack->base()),
+ reinterpret_cast<const void*>(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<Address>(
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);

View File

@ -1,48 +0,0 @@
From 7d1394bd639e3bcf68082ac3fc33eeed6a00d2e6 Mon Sep 17 00:00:00 2001
From: Elly Fong-Jones <ellyjones@chromium.org>
Date: Thu, 2 Mar 2023 00:15:11 +0000
Subject: [PATCH] sql: relax constraints on VirtualCursor layout
VirtualCursor::FromSqliteCursor required that VirtualCursor had a
standard layout, but in fact VirtualCursor shouldn't have a standard
layout, and the fact that it does with libc++ is a deviation from the
C++ standard. This change:
1. Relaxes the requirement that VirtualCursor has a standard layout, and
2. Relaxes the requirement that the sqlite_cursor_ field has to be at
offset 0
by use of offsetof() and pointer subtraction. This change both improves
standards compliance and makes this code build with libstdc++.
Bug: 1380656
Change-Id: I9c47abd9197b187da0360ca5619ccf7dadab4f33
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4292313
Reviewed-by: Austin Sullivan <asully@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1111925}
---
sql/recover_module/cursor.h | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/sql/recover_module/cursor.h b/sql/recover_module/cursor.h
index 1970bdca8c6..4cb06557009 100644
--- a/sql/recover_module/cursor.h
+++ b/sql/recover_module/cursor.h
@@ -63,12 +63,10 @@ class VirtualCursor {
// |sqlite_cursor| must have been returned by VirtualTable::SqliteCursor().
static inline VirtualCursor* FromSqliteCursor(
sqlite3_vtab_cursor* sqlite_cursor) {
- static_assert(std::is_standard_layout<VirtualCursor>::value,
- "needed for the reinterpret_cast below");
- static_assert(offsetof(VirtualCursor, sqlite_cursor_) == 0,
- "sqlite_cursor_ must be the first member of the class");
- VirtualCursor* result = reinterpret_cast<VirtualCursor*>(sqlite_cursor);
- DCHECK_EQ(sqlite_cursor, &result->sqlite_cursor_);
+ VirtualCursor* result = reinterpret_cast<VirtualCursor*>(
+ (reinterpret_cast<char*>(sqlite_cursor) -
+ offsetof(VirtualCursor, sqlite_cursor_)));
+ CHECK_EQ(sqlite_cursor, &result->sqlite_cursor_);
return result;
}

View File

@ -0,0 +1,11 @@
--- third_party/material_color_utilities/src/cpp/palettes/tones.cc.orig 2023-08-30 22:58:42.101555407 +0000
+++ third_party/material_color_utilities/src/cpp/palettes/tones.cc 2023-08-30 22:58:54.082340977 +0000
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+#include <cmath>
+
#include "cpp/palettes/tones.h"
#include "cpp/cam/cam.h"

View File

@ -0,0 +1,27 @@
From 5a8dfcaf84b5af5aeb738702651e98bfc43d6d45 Mon Sep 17 00:00:00 2001
From: Stephan Hartmann <stha09@googlemail.com>
Date: Wed, 9 Aug 2023 15:36:26 +0000
Subject: [PATCH] IWYU: add memory for std::unique_ptr in //third_party/ipcz
Bug: 957519
Change-Id: I600f415a59206da283046b638a4f68eda0892ac7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4754274
Commit-Queue: Stephan Hartmann <stha09@googlemail.com>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1181503}
---
third_party/ipcz/src/ipcz/router_link.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/third_party/ipcz/src/ipcz/router_link.h b/third_party/ipcz/src/ipcz/router_link.h
index 09bc5626d99..619638cc7f1 100644
--- a/third_party/ipcz/src/ipcz/router_link.h
+++ b/third_party/ipcz/src/ipcz/router_link.h
@@ -7,6 +7,7 @@
#include <cstddef>
#include <functional>
+#include <memory>
#include <string>
#include <utility>

View File

@ -0,0 +1,11 @@
--- chromium-117.0.5938.88/third_party/blink/renderer/core/BUILD.gn.orig 2023-09-18 19:35:09.929200617 +0200
+++ chromium-117.0.5938.88/third_party/blink/renderer/core/BUILD.gn 2023-09-18 19:35:31.372292159 +0200
@@ -1694,8 +1694,6 @@
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,70 @@
From 21d7cf44b1cd83bb0d847515e28ca550404b0033 Mon Sep 17 00:00:00 2001
From: Wan-Teh Chang <wtc@google.com>
Date: Tue, 22 Aug 2023 19:39:04 +0000
Subject: [PATCH] Roll src/third_party/libavif/src/ b33d9ebfc..676aded35 (3
commits)
https://chromium.googlesource.com/external/github.com/AOMediaCodec/libavif.git/+log/b33d9ebfc961..676aded3501f
$ git log b33d9ebfc..676aded35 --date=short --no-merges --format='%ad %ae %s'
2023-08-22 wtc Change imir.mode back to imir.axis
2023-08-22 wtc Don't use Identity matrix coefficients with 4:0:0
2023-08-21 yguyon Increase test values in avifstreamtest
Created with:
roll-dep src/third_party/libavif/src
R=dalecurtis@chromium.org,jzern@google.com
Note that imir.mode is renamed imir.axis.
Change-Id: Ie13972640969f123b7e4580f36d6d6bab913c0f8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4803347
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Wan-Teh Chang <wtc@google.com>
Cr-Commit-Position: refs/heads/main@{#1186746}
---
.../image-decoders/avif/avif_image_decoder.cc | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc b/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc
index deb3e66d66f..c9f1b185417 100644
--- a/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc
+++ b/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc
@@ -1005,22 +1005,22 @@ bool AVIFImageDecoder::UpdateDemuxer() {
angle = container->irot.angle;
CHECK_LT(angle, 4);
}
- // |mode| specifies how the mirroring is performed.
+ // |axis| specifies how the mirroring is performed.
// -1: No mirroring.
// 0: The top and bottom parts of the image are exchanged.
// 1: The left and right parts of the image are exchanged.
- int mode = -1;
+ int axis = -1;
if (container->transformFlags & AVIF_TRANSFORM_IMIR) {
- mode = container->imir.mode;
- CHECK_LT(mode, 2);
+ axis = container->imir.axis;
+ CHECK_LT(axis, 2);
}
// MIAF Section 7.3.6.7 (Clean aperture, rotation and mirror) says:
// These properties, if used, shall be indicated to be applied in the
// following order: clean aperture first, then rotation, then mirror.
//
- // In the kModeAngleToOrientation array, the first dimension is mode (with an
+ // In the kAxisAngleToOrientation array, the first dimension is axis (with an
// offset of 1). The second dimension is angle.
- constexpr ImageOrientationEnum kModeAngleToOrientation[3][4] = {
+ constexpr ImageOrientationEnum kAxisAngleToOrientation[3][4] = {
// No mirroring.
{ImageOrientationEnum::kOriginTopLeft,
ImageOrientationEnum::kOriginLeftBottom,
@@ -1037,7 +1037,7 @@ bool AVIFImageDecoder::UpdateDemuxer() {
ImageOrientationEnum::kOriginBottomLeft,
ImageOrientationEnum::kOriginLeftTop},
};
- orientation_ = kModeAngleToOrientation[mode + 1][angle];
+ orientation_ = kAxisAngleToOrientation[axis + 1][angle];
// Determine whether the image can be decoded to YUV.
// * Alpha channel is not supported.

View File

@ -1,14 +0,0 @@
--- chromium-37.0.2062.120/chrome/tools/build/linux/chrome-wrapper.orig 2014-09-10 01:29:21.000000000 +0200
+++ chromium-37.0.2062.120/chrome/tools/build/linux/chrome-wrapper 2014-09-19 21:35:12.045745151 +0200
@@ -160,4 +160,10 @@
done
set -- "${ARGS[@]}" "$@"
-exec $CMD_PREFIX "$HERE/chrome" "$@"
+if [ -r /opt/chromium/PepperFlash/manifest.json ]; then
+ PEPPER_FLASH_VERSION="$(grep '"version":' /opt/chromium/PepperFlash/manifest.json | grep -Po '(?<=version": ")(?:\d|\.)*')"
+ exec $CMD_PREFIX "$HERE/chrome" \
+ --ppapi-flash-path=/opt/chromium/PepperFlash/libpepflashplayer.so --ppapi-flash-version=${PEPPER_FLASH_VERSION} "$@"
+else
+ exec $CMD_PREFIX "$HERE/chrome" "$@"
+fi

View File

@ -1,10 +0,0 @@
--- chromium-76.0.3809.100/third_party/openh264/BUILD.gn.orig 2019-08-28 14:25:04.319139430 +0200
+++ chromium-76.0.3809.100/third_party/openh264/BUILD.gn 2019-08-28 14:25:23.371231239 +0200
@@ -24,6 +24,7 @@
# GCC and clang flags. MSVS (is_win && !is_clang) does not use cflags.
if (!is_win || is_clang) {
cflags += [
+ "-fPIC",
"-Wno-format",
"-Wno-format-security",
"-Wno-header-hygiene",

View File

@ -1,13 +0,0 @@
diff --git a/third_party/widevine/cdm/BUILD.gn b/third_party/widevine/cdm/BUILD.gn
index ed0e2f5208b..5b431a030d5 100644
--- a/third_party/widevine/cdm/BUILD.gn
+++ b/third_party/widevine/cdm/BUILD.gn
@@ -14,7 +14,7 @@ buildflag_header("buildflags") {
flags = [
"ENABLE_WIDEVINE=$enable_widevine",
- "BUNDLE_WIDEVINE_CDM=$bundle_widevine_cdm",
+ "BUNDLE_WIDEVINE_CDM=true",
"ENABLE_WIDEVINE_CDM_COMPONENT=$enable_widevine_cdm_component",
]
}

View File

@ -1,25 +0,0 @@
--- chromium-80.0.3987.122/tools/v8_context_snapshot/BUILD.gn.orig 2020-03-07 00:31:35.460144549 +0100
+++ chromium-80.0.3987.122/tools/v8_context_snapshot/BUILD.gn 2020-03-07 02:22:49.245058034 +0100
@@ -97,7 +97,10 @@
if (is_win) {
ldflags = [ "/OPT:NOICF" ] # link.exe, but also lld-link.exe.
} else if (use_gold || use_lld) {
- ldflags = [ "-Wl,--icf=none" ]
+ ldflags = [
+ "-Wl,--icf=none",
+ "-Wl,-z,notext",
+ ]
}
}
--- chromium-80.0.3987.122/chrome/BUILD.gn.orig 2020-03-07 02:32:07.805071147 +0100
+++ chromium-80.0.3987.122/chrome/BUILD.gn 2020-03-07 02:33:11.886219915 +0100
@@ -306,7 +306,7 @@
"//chrome/common:buildflags",
]
- ldflags = []
+ ldflags = [ "-Wl,-z,notext" ]
# Chrome OS debug builds for arm need to pass --long-plt to the linker.
# See https://bugs.chromium.org/p/chromium/issues/detail?id=583532

View File

@ -1,144 +0,0 @@
# Patch made by Kevin Kofler <Kevin@tigcc.ticalc.org>
# https://bugzilla.redhat.com/show_bug.cgi?id=1904652
diff -up chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc.fstatfix chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
--- chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc.fstatfix 2021-01-25 10:11:45.427436398 -0500
+++ chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc 2021-01-25 10:12:51.337699003 -0500
@@ -257,6 +257,18 @@ ResultExpr EvaluateSyscallImpl(int fs_de
return RestrictKillTarget(current_pid, sysno);
}
+#if defined(__NR_newfstatat)
+ if (sysno == __NR_newfstatat) {
+ return RewriteFstatatSIGSYS();
+ }
+#endif
+
+#if defined(__NR_fstatat64)
+ if (sysno == __NR_fstatat64) {
+ return RewriteFstatatSIGSYS();
+ }
+#endif
+
if (SyscallSets::IsFileSystem(sysno) ||
SyscallSets::IsCurrentDirectory(sysno)) {
return Error(fs_denied_errno);
diff -up chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc.fstatfix chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc
--- chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc.fstatfix 2021-01-25 10:13:10.179774081 -0500
+++ chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc 2021-01-25 10:16:18.790525746 -0500
@@ -6,6 +6,8 @@
#include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h"
+#include <errno.h>
+#include <fcntl.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
@@ -355,6 +357,35 @@ intptr_t SIGSYSSchedHandler(const struct
return -ENOSYS;
}
+intptr_t SIGSYSFstatatHandler(const struct arch_seccomp_data& args,
+ void* aux) {
+ switch (args.nr) {
+#if defined(__NR_newfstatat)
+ case __NR_newfstatat:
+#endif
+#if defined(__NR_fstatat64)
+ case __NR_fstatat64:
+#endif
+#if defined(__NR_newfstatat) || defined(__NR_fstatat64)
+ if (*reinterpret_cast<const char *>(args.args[1]) == '\0'
+ && args.args[3] == static_cast<uint64_t>(AT_EMPTY_PATH)) {
+ return sandbox::sys_fstat64(static_cast<int>(args.args[0]),
+ reinterpret_cast<struct stat64 *>(args.args[2]));
+ } else {
+ errno = EACCES;
+ return -1;
+ }
+ break;
+#endif
+ }
+
+ CrashSIGSYS_Handler(args, aux);
+
+ // Should never be reached.
+ RAW_CHECK(false);
+ return -ENOSYS;
+}
+
bpf_dsl::ResultExpr CrashSIGSYS() {
return bpf_dsl::Trap(CrashSIGSYS_Handler, NULL);
}
@@ -387,6 +418,10 @@ bpf_dsl::ResultExpr RewriteSchedSIGSYS()
return bpf_dsl::Trap(SIGSYSSchedHandler, NULL);
}
+bpf_dsl::ResultExpr RewriteFstatatSIGSYS() {
+ return bpf_dsl::Trap(SIGSYSFstatatHandler, NULL);
+}
+
void AllocateCrashKeys() {
#if !defined(OS_NACL_NONSFI)
if (seccomp_crash_key)
diff -up chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h.fstatfix chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h
--- chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h.fstatfix 2021-01-25 10:16:36.982598236 -0500
+++ chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h 2021-01-25 10:18:45.705111027 -0500
@@ -62,6 +62,10 @@ SANDBOX_EXPORT intptr_t SIGSYSPtraceFail
// sched_setparam(), sched_setscheduler()
SANDBOX_EXPORT intptr_t SIGSYSSchedHandler(const arch_seccomp_data& args,
void* aux);
+// If the fstatat syscall is actually a disguised fstat, calls the regular fstat
+// syscall, otherwise, crashes in the same way as CrashSIGSYS_Handler.
+SANDBOX_EXPORT intptr_t SIGSYSFstatatHandler(const struct arch_seccomp_data& args,
+ void* aux);
// Variants of the above functions for use with bpf_dsl.
SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYS();
@@ -72,6 +76,7 @@ SANDBOX_EXPORT bpf_dsl::ResultExpr Crash
SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSFutex();
SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSPtrace();
SANDBOX_EXPORT bpf_dsl::ResultExpr RewriteSchedSIGSYS();
+SANDBOX_EXPORT bpf_dsl::ResultExpr RewriteFstatatSIGSYS();
// Allocates a crash key so that Seccomp information can be recorded.
void AllocateCrashKeys();
diff -up chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc.fstatfix chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc
--- chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc.fstatfix 2021-01-25 10:18:53.307141311 -0500
+++ chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc 2021-01-25 10:19:46.982355293 -0500
@@ -261,4 +261,13 @@ int sys_sigaction(int signum,
#endif // defined(MEMORY_SANITIZER)
+SANDBOX_EXPORT int sys_fstat64(int fd, struct stat64 *buf)
+{
+#if defined(__NR_fstat64)
+ return syscall(__NR_fstat64, fd, buf);
+#else
+ return syscall(__NR_fstat, fd, buf);
+#endif
+}
+
} // namespace sandbox
diff -up chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h.fstatfix chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h
--- chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h.fstatfix 2021-01-25 10:19:53.115379741 -0500
+++ chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h 2021-01-25 10:20:45.485588421 -0500
@@ -17,6 +17,7 @@ struct sock_fprog;
struct rlimit64;
struct cap_hdr;
struct cap_data;
+struct stat64;
namespace sandbox {
@@ -84,6 +85,9 @@ SANDBOX_EXPORT int sys_sigaction(int sig
const struct sigaction* act,
struct sigaction* oldact);
+// Recent glibc rewrites fstat to fstatat.
+SANDBOX_EXPORT int sys_fstat64(int fd, struct stat64 *buf);
+
} // namespace sandbox
#endif // SANDBOX_LINUX_SERVICES_SYSCALL_WRAPPERS_H_

View File

@ -1,11 +0,0 @@
--- chromium-92.0.4515.107/base/compiler_specific.h.orig 2021-07-25 22:15:52.001031942 +0200
+++ chromium-92.0.4515.107/base/compiler_specific.h 2021-07-25 22:16:50.264104515 +0200
@@ -340,7 +340,7 @@
#endif // defined(__clang_analyzer__)
// Use nomerge attribute to disable optimization of merging multiple same calls.
-#if defined(__clang__) && __has_attribute(nomerge)
+#if defined(__clang__) && (__clang_major__ >= 12) && __has_attribute(nomerge)
#define NOMERGE [[clang::nomerge]]
#else
#define NOMERGE

View File

@ -1,35 +0,0 @@
From e48f18eba0eae199ba7bc8a6a09ebf39799447c1 Mon Sep 17 00:00:00 2001
From: Ted Meyer <tmathmeyer@chromium.org>
Date: Wed, 2 Jun 2021 05:35:22 +0000
Subject: [PATCH] Extend enable-accelerated-video-decode flag for linux to m93
It appears that there is insistence that the flag be totally removed or
have its end-milestone increased, I can't just let it wait until the
feature is working again and then re-enable it. So i've moved it to 93.
R=dalecurtis
Fixed: 1207478
Change-Id: I26a5e790cd390825516b4a4b6af88e89b2d4f4eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2918478
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Ted Meyer <tmathmeyer@chromium.org>
Commit-Queue: Ted Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#888312}
---
chrome/browser/flag-metadata.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
index 67e0330436..34542671f2 100644
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -1193,7 +1193,7 @@
{
"name": "enable-accelerated-video-decode",
"owners": [ "media-dev@chromium.org" ],
- "expiry_milestone": 90
+ "expiry_milestone": 93
},
{
"name": "enable-accessibility-live-caption",

View File

@ -1,348 +0,0 @@
From 60d5e803ef2a4874d29799b638754152285e0ed9 Mon Sep 17 00:00:00 2001
From: Matthew Denton <mpdenton@chromium.org>
Date: Wed, 21 Jul 2021 12:55:11 +0000
Subject: [PATCH] Linux sandbox: fix fstatat() crash
This is a reland of https://crrev.com/c/2801873.
Glibc has started rewriting fstat(fd, stat_buf) to
fstatat(fd, "", stat_buf, AT_EMPTY_PATH). This works because when
AT_EMPTY_PATH is specified, and the second argument is an empty string,
then fstatat just performs an fstat on fd like normal.
Unfortunately, fstatat() also allows stat-ing arbitrary pathnames like
with fstatat(AT_FDCWD, "/i/am/a/file", stat_buf, 0);
The baseline policy needs to prevent this usage of fstatat() since it
doesn't allow access to arbitrary pathnames.
Sadly, if the second argument is not an empty string, AT_EMPTY_PATH is
simply ignored by current kernels.
This means fstatat() is completely unsandboxable with seccomp, since
we *need* to verify that the second argument is the empty string, but
we can't dereference pointers in seccomp (due to limitations of BPF,
and the difficulty of addressing these limitations due to TOCTOU
issues).
So, this CL Traps (raises a SIGSYS via seccomp) on any fstatat syscall.
The signal handler, which runs in the sandboxed process, checks for
AT_EMPTY_PATH and the empty string, and then rewrites any applicable
fstatat() back into the old-style fstat().
Bug: 1164975
Change-Id: I3df6c04c0d781eb1f181d707ccaaead779337291
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3042179
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#903873}
---
.../seccomp-bpf-helpers/baseline_policy.cc | 8 ++++++
.../baseline_policy_unittest.cc | 17 ++++++++++++-
.../seccomp-bpf-helpers/sigsys_handlers.cc | 25 +++++++++++++++++++
.../seccomp-bpf-helpers/sigsys_handlers.h | 14 +++++++++++
.../linux/syscall_broker/broker_process.cc | 21 ++++++++++------
.../syscall_broker/broker_process_unittest.cc | 18 ++++++-------
sandbox/linux/system_headers/linux_stat.h | 4 +++
7 files changed, 89 insertions(+), 18 deletions(-)
diff --git a/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc b/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
index f2a60bb4d7..9df0d2dbd3 100644
--- a/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
+++ b/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
@@ -20,6 +20,7 @@
#include "sandbox/linux/seccomp-bpf-helpers/syscall_sets.h"
#include "sandbox/linux/seccomp-bpf/sandbox_bpf.h"
#include "sandbox/linux/services/syscall_wrappers.h"
+#include "sandbox/linux/system_headers/linux_stat.h"
#include "sandbox/linux/system_headers/linux_syscalls.h"
#if !defined(SO_PEEK_OFF)
@@ -304,6 +305,13 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
return Allow();
}
+ // The fstatat syscalls are file system syscalls, which will be denied below
+ // with fs_denied_errno. However some allowed fstat syscalls are rewritten by
+ // libc implementations to fstatat syscalls, and we need to rewrite them back.
+ if (sysno == __NR_fstatat_default) {
+ return RewriteFstatatSIGSYS(fs_denied_errno);
+ }
+
if (SyscallSets::IsFileSystem(sysno) ||
SyscallSets::IsCurrentDirectory(sysno)) {
return Error(fs_denied_errno);
diff --git a/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc b/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
index 68c29b564b..57d307e09d 100644
--- a/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
+++ b/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
@@ -51,7 +51,8 @@ namespace sandbox {
namespace {
-// This also tests that read(), write() and fstat() are allowed.
+// This also tests that read(), write(), fstat(), and fstatat(.., "", ..,
+// AT_EMPTY_PATH) are allowed.
void TestPipeOrSocketPair(base::ScopedFD read_end, base::ScopedFD write_end) {
BPF_ASSERT_LE(0, read_end.get());
BPF_ASSERT_LE(0, write_end.get());
@@ -60,6 +61,20 @@ void TestPipeOrSocketPair(base::ScopedFD read_end, base::ScopedFD write_end) {
BPF_ASSERT_EQ(0, sys_ret);
BPF_ASSERT(S_ISFIFO(stat_buf.st_mode) || S_ISSOCK(stat_buf.st_mode));
+ sys_ret = fstatat(read_end.get(), "", &stat_buf, AT_EMPTY_PATH);
+ BPF_ASSERT_EQ(0, sys_ret);
+ BPF_ASSERT(S_ISFIFO(stat_buf.st_mode) || S_ISSOCK(stat_buf.st_mode));
+
+ // Make sure fstatat with anything other than an empty string is denied.
+ sys_ret = fstatat(read_end.get(), "/", &stat_buf, AT_EMPTY_PATH);
+ BPF_ASSERT_EQ(sys_ret, -1);
+ BPF_ASSERT_EQ(EPERM, errno);
+
+ // Make sure fstatat without AT_EMPTY_PATH is denied.
+ sys_ret = fstatat(read_end.get(), "", &stat_buf, 0);
+ BPF_ASSERT_EQ(sys_ret, -1);
+ BPF_ASSERT_EQ(EPERM, errno);
+
const ssize_t kTestTransferSize = 4;
static const char kTestString[kTestTransferSize] = {'T', 'E', 'S', 'T'};
ssize_t transfered = 0;
diff --git a/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc b/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc
index 64edbd68bd..71068a0452 100644
--- a/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc
+++ b/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc
@@ -6,6 +6,7 @@
#include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h"
+#include <fcntl.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
@@ -22,6 +23,7 @@
#include "sandbox/linux/seccomp-bpf/syscall.h"
#include "sandbox/linux/services/syscall_wrappers.h"
#include "sandbox/linux/system_headers/linux_seccomp.h"
+#include "sandbox/linux/system_headers/linux_stat.h"
#include "sandbox/linux/system_headers/linux_syscalls.h"
#if defined(__mips__)
@@ -355,6 +357,24 @@ intptr_t SIGSYSSchedHandler(const struct arch_seccomp_data& args,
return -ENOSYS;
}
+intptr_t SIGSYSFstatatHandler(const struct arch_seccomp_data& args,
+ void* fs_denied_errno) {
+ if (args.nr == __NR_fstatat_default) {
+ if (*reinterpret_cast<const char*>(args.args[1]) == '\0' &&
+ args.args[3] == static_cast<uint64_t>(AT_EMPTY_PATH)) {
+ return syscall(__NR_fstat_default, static_cast<int>(args.args[0]),
+ reinterpret_cast<default_stat_struct*>(args.args[2]));
+ }
+ return -reinterpret_cast<intptr_t>(fs_denied_errno);
+ }
+
+ CrashSIGSYS_Handler(args, fs_denied_errno);
+
+ // Should never be reached.
+ RAW_CHECK(false);
+ return -ENOSYS;
+}
+
bpf_dsl::ResultExpr CrashSIGSYS() {
return bpf_dsl::Trap(CrashSIGSYS_Handler, NULL);
}
@@ -387,6 +407,11 @@ bpf_dsl::ResultExpr RewriteSchedSIGSYS() {
return bpf_dsl::Trap(SIGSYSSchedHandler, NULL);
}
+bpf_dsl::ResultExpr RewriteFstatatSIGSYS(int fs_denied_errno) {
+ return bpf_dsl::Trap(SIGSYSFstatatHandler,
+ reinterpret_cast<void*>(fs_denied_errno));
+}
+
void AllocateCrashKeys() {
#if !defined(OS_NACL_NONSFI)
if (seccomp_crash_key)
diff --git a/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h b/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h
index 7a958b93b2..8cd735ce15 100644
--- a/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h
+++ b/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h
@@ -62,6 +62,19 @@ SANDBOX_EXPORT intptr_t SIGSYSPtraceFailure(const arch_seccomp_data& args,
// sched_setparam(), sched_setscheduler()
SANDBOX_EXPORT intptr_t SIGSYSSchedHandler(const arch_seccomp_data& args,
void* aux);
+// If the fstatat() syscall is functionally equivalent to an fstat() syscall,
+// then rewrite the syscall to the equivalent fstat() syscall which can be
+// adequately sandboxed.
+// If the fstatat() is not functionally equivalent to an fstat() syscall, we
+// fail with -fs_denied_errno.
+// If the syscall is not an fstatat() at all, crash in the same way as
+// CrashSIGSYS_Handler.
+// This is necessary because glibc and musl have started rewriting fstat(fd,
+// stat_buf) as fstatat(fd, "", stat_buf, AT_EMPTY_PATH). We rewrite the latter
+// back to the former, which is actually sandboxable.
+SANDBOX_EXPORT intptr_t
+SIGSYSFstatatHandler(const struct arch_seccomp_data& args,
+ void* fs_denied_errno);
// Variants of the above functions for use with bpf_dsl.
SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYS();
@@ -72,6 +85,7 @@ SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSKill();
SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSFutex();
SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSPtrace();
SANDBOX_EXPORT bpf_dsl::ResultExpr RewriteSchedSIGSYS();
+SANDBOX_EXPORT bpf_dsl::ResultExpr RewriteFstatatSIGSYS(int fs_denied_errno);
// Allocates a crash key so that Seccomp information can be recorded.
void AllocateCrashKeys();
diff --git a/sandbox/linux/syscall_broker/broker_process.cc b/sandbox/linux/syscall_broker/broker_process.cc
index c2176eb785..e9dad37485 100644
--- a/sandbox/linux/syscall_broker/broker_process.cc
+++ b/sandbox/linux/syscall_broker/broker_process.cc
@@ -113,44 +113,49 @@ bool BrokerProcess::IsSyscallAllowed(int sysno) const {
}
bool BrokerProcess::IsSyscallBrokerable(int sysno, bool fast_check) const {
+ // The syscalls unavailable on aarch64 are all blocked by Android's default
+ // seccomp policy, even on non-aarch64 architectures. I.e., the syscalls XX()
+ // with a corresponding XXat() versions are typically unavailable in aarch64
+ // and are default disabled in Android. So, we should refuse to broker them
+ // to be consistent with the platform's restrictions.
switch (sysno) {
-#if !defined(__aarch64__)
+#if !defined(__aarch64__) && !defined(OS_ANDROID)
case __NR_access:
#endif
case __NR_faccessat:
return !fast_check || allowed_command_set_.test(COMMAND_ACCESS);
-#if !defined(__aarch64__)
+#if !defined(__aarch64__) && !defined(OS_ANDROID)
case __NR_mkdir:
#endif
case __NR_mkdirat:
return !fast_check || allowed_command_set_.test(COMMAND_MKDIR);
-#if !defined(__aarch64__)
+#if !defined(__aarch64__) && !defined(OS_ANDROID)
case __NR_open:
#endif
case __NR_openat:
return !fast_check || allowed_command_set_.test(COMMAND_OPEN);
-#if !defined(__aarch64__)
+#if !defined(__aarch64__) && !defined(OS_ANDROID)
case __NR_readlink:
#endif
case __NR_readlinkat:
return !fast_check || allowed_command_set_.test(COMMAND_READLINK);
-#if !defined(__aarch64__)
+#if !defined(__aarch64__) && !defined(OS_ANDROID)
case __NR_rename:
#endif
case __NR_renameat:
case __NR_renameat2:
return !fast_check || allowed_command_set_.test(COMMAND_RENAME);
-#if !defined(__aarch64__)
+#if !defined(__aarch64__) && !defined(OS_ANDROID)
case __NR_rmdir:
return !fast_check || allowed_command_set_.test(COMMAND_RMDIR);
#endif
-#if !defined(__aarch64__)
+#if !defined(__aarch64__) && !defined(OS_ANDROID)
case __NR_stat:
case __NR_lstat:
#endif
@@ -175,7 +180,7 @@ bool BrokerProcess::IsSyscallBrokerable(int sysno, bool fast_check) const {
return !fast_check || allowed_command_set_.test(COMMAND_STAT);
#endif
-#if !defined(__aarch64__)
+#if !defined(__aarch64__) && !defined(OS_ANDROID)
case __NR_unlink:
return !fast_check || allowed_command_set_.test(COMMAND_UNLINK);
#endif
diff --git a/sandbox/linux/syscall_broker/broker_process_unittest.cc b/sandbox/linux/syscall_broker/broker_process_unittest.cc
index c65f25a78a..f0db08d84e 100644
--- a/sandbox/linux/syscall_broker/broker_process_unittest.cc
+++ b/sandbox/linux/syscall_broker/broker_process_unittest.cc
@@ -1596,52 +1596,52 @@ TEST(BrokerProcess, IsSyscallAllowed) {
const base::flat_map<BrokerCommand, base::flat_set<int>> kSysnosForCommand = {
{COMMAND_ACCESS,
{__NR_faccessat,
-#if defined(__NR_access)
+#if defined(__NR_access) && !defined(OS_ANDROID)
__NR_access
#endif
}},
{COMMAND_MKDIR,
{__NR_mkdirat,
-#if defined(__NR_mkdir)
+#if defined(__NR_mkdir) && !defined(OS_ANDROID)
__NR_mkdir
#endif
}},
{COMMAND_OPEN,
{__NR_openat,
-#if defined(__NR_open)
+#if defined(__NR_open) && !defined(OS_ANDROID)
__NR_open
#endif
}},
{COMMAND_READLINK,
{__NR_readlinkat,
-#if defined(__NR_readlink)
+#if defined(__NR_readlink) && !defined(OS_ANDROID)
__NR_readlink
#endif
}},
{COMMAND_RENAME,
{__NR_renameat,
-#if defined(__NR_rename)
+#if defined(__NR_rename) && !defined(OS_ANDROID)
__NR_rename
#endif
}},
{COMMAND_UNLINK,
{__NR_unlinkat,
-#if defined(__NR_unlink)
+#if defined(__NR_unlink) && !defined(OS_ANDROID)
__NR_unlink
#endif
}},
{COMMAND_RMDIR,
{__NR_unlinkat,
-#if defined(__NR_rmdir)
+#if defined(__NR_rmdir) && !defined(OS_ANDROID)
__NR_rmdir
#endif
}},
{COMMAND_STAT,
{
-#if defined(__NR_stat)
+#if defined(__NR_stat) && !defined(OS_ANDROID)
__NR_stat,
#endif
-#if defined(__NR_lstat)
+#if defined(__NR_lstat) && !defined(OS_ANDROID)
__NR_lstat,
#endif
#if defined(__NR_fstatat)
diff --git a/sandbox/linux/system_headers/linux_stat.h b/sandbox/linux/system_headers/linux_stat.h
index 35788eb22a..83b89efc75 100644
--- a/sandbox/linux/system_headers/linux_stat.h
+++ b/sandbox/linux/system_headers/linux_stat.h
@@ -157,6 +157,10 @@ struct kernel_stat {
};
#endif
+#if !defined(AT_EMPTY_PATH)
+#define AT_EMPTY_PATH 0x1000
+#endif
+
// On 32-bit systems, we default to the 64-bit stat struct like libc
// implementations do. Otherwise we default to the normal stat struct which is
// already 64-bit.

View File

@ -1,49 +0,0 @@
From 61e16c92ff24bb71b9b7309a9d6d470ee91738bc Mon Sep 17 00:00:00 2001
From: Bartek Nowierski <bartekn@chromium.org>
Date: Wed, 21 Jul 2021 15:01:38 +0000
Subject: [PATCH] [PA] Make GetUsableSize() handle nullptr gracefully
malloc_usable_size() is expected to not crush on NULL and return 0.
Bug: 1221442
Change-Id: I6a3b90dcf3a8ad18114c206d87b98f60d5f50eb1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3042177
Commit-Queue: Bartek Nowierski <bartekn@chromium.org>
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Bartek Nowierski <bartekn@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#903900}
---
.../allocator/partition_allocator/partition_alloc_unittest.cc | 4 ++++
base/allocator/partition_allocator/partition_root.h | 3 +++
2 files changed, 7 insertions(+)
diff --git a/base/allocator/partition_allocator/partition_alloc_unittest.cc b/base/allocator/partition_allocator/partition_alloc_unittest.cc
index c12120114aa7..8863984cd805 100644
--- a/base/allocator/partition_allocator/partition_alloc_unittest.cc
+++ b/base/allocator/partition_allocator/partition_alloc_unittest.cc
@@ -2838,6 +2838,10 @@ TEST_F(PartitionAllocTest, OptimizedGetSlotNumber) {
}
}
+TEST_F(PartitionAllocTest, GetUsableSizeNull) {
+ EXPECT_EQ(0ULL, PartitionRoot<ThreadSafe>::GetUsableSize(nullptr));
+}
+
TEST_F(PartitionAllocTest, GetUsableSize) {
size_t delta = SystemPageSize() + 1;
for (size_t size = 1; size <= kMinDirectMappedDownsize; size += delta) {
diff --git a/base/allocator/partition_allocator/partition_root.h b/base/allocator/partition_allocator/partition_root.h
index b72a1d94a4e4..baac952597d1 100644
--- a/base/allocator/partition_allocator/partition_root.h
+++ b/base/allocator/partition_allocator/partition_root.h
@@ -1220,6 +1220,9 @@ ALWAYS_INLINE bool PartitionRoot<thread_safe>::TryRecommitSystemPagesForData(
// PartitionAlloc's internal data. Used as malloc_usable_size.
template <bool thread_safe>
ALWAYS_INLINE size_t PartitionRoot<thread_safe>::GetUsableSize(void* ptr) {
+ // malloc_usable_size() is expected to handle NULL gracefully and return 0.
+ if (!ptr)
+ return 0;
auto* slot_span = SlotSpan::FromSlotInnerPtr(ptr);
auto* root = FromSlotSpan(slot_span);
return slot_span->GetUsableSize(root);

View File

@ -1,238 +0,0 @@
From 80368f8ba7a8bab13440463a254888311efe3986 Mon Sep 17 00:00:00 2001
From: Stephan Hartmann <stha09@googlemail.com>
Date: Tue, 4 May 2021 15:00:19 +0000
Subject: [PATCH] sql: make VirtualCursor standard layout type
sql::recover::VirtualCursor needs to be a standard layout type, but
has members of type std::unique_ptr. However, std::unique_ptr is not
guaranteed to be standard layout. Compiling with clang combined with
gcc-11 libstdc++ fails because of this. Replace std::unique_ptr with
raw pointers.
Bug: 1189788
Change-Id: Ia6dc388cc5ef1c0f2afc75f8ca45b9f12687ca9c
---
sql/recover_module/btree.cc | 21 +++++++++++++++------
sql/recover_module/btree.h | 17 +++++++++++++----
sql/recover_module/cursor.cc | 24 ++++++++++++------------
sql/recover_module/cursor.h | 2 +-
sql/recover_module/pager.cc | 7 +++----
sql/recover_module/pager.h | 5 +++--
6 files changed, 47 insertions(+), 29 deletions(-)
diff --git a/sql/recover_module/btree.cc b/sql/recover_module/btree.cc
index 9ecaafe8a3..839318abf9 100644
--- a/sql/recover_module/btree.cc
+++ b/sql/recover_module/btree.cc
@@ -135,16 +135,25 @@ static_assert(std::is_trivially_destructible<LeafPageDecoder>::value,
"Move the destructor to the .cc file if it's non-trival");
#endif // !DCHECK_IS_ON()
-LeafPageDecoder::LeafPageDecoder(DatabasePageReader* db_reader) noexcept
- : page_id_(db_reader->page_id()),
- db_reader_(db_reader),
- cell_count_(ComputeCellCount(db_reader)),
- next_read_index_(0),
- last_record_size_(0) {
+void LeafPageDecoder::Initialize(DatabasePageReader* db_reader) {
+ DCHECK(db_reader);
DCHECK(IsOnValidPage(db_reader));
+ page_id_ = db_reader->page_id();
+ db_reader_ = db_reader;
+ cell_count_ = ComputeCellCount(db_reader);
+ next_read_index_ = 0;
+ last_record_size_ = 0;
DCHECK(DatabasePageReader::IsValidPageId(page_id_));
}
+void LeafPageDecoder::Reset() {
+ db_reader_ = nullptr;
+ page_id_ = 0;
+ cell_count_ = 0;
+ next_read_index_ = 0;
+ last_record_size_ = 0;
+}
+
bool LeafPageDecoder::TryAdvance() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(CanAdvance());
diff --git a/sql/recover_module/btree.h b/sql/recover_module/btree.h
index d76d076bf6..33114b01fa 100644
--- a/sql/recover_module/btree.h
+++ b/sql/recover_module/btree.h
@@ -102,7 +102,7 @@ class LeafPageDecoder {
//
// |db_reader| must have been used to read an inner page of a table B-tree.
// |db_reader| must outlive this instance.
- explicit LeafPageDecoder(DatabasePageReader* db_reader) noexcept;
+ explicit LeafPageDecoder() noexcept = default;
~LeafPageDecoder() noexcept = default;
LeafPageDecoder(const LeafPageDecoder&) = delete;
@@ -150,6 +150,15 @@ class LeafPageDecoder {
// read as long as CanAdvance() returns true.
bool TryAdvance();
+ // Initialize with DatabasePageReader
+ void Initialize(DatabasePageReader* db_reader);
+
+ // Reset internal DatabasePageReader
+ void Reset();
+
+ // True if DatabasePageReader is valid
+ bool IsValid() { return (db_reader_ != nullptr); }
+
// True if the given reader may point to an inner page in a table B-tree.
//
// The last ReadPage() call on |db_reader| must have succeeded.
@@ -163,14 +172,14 @@ class LeafPageDecoder {
static int ComputeCellCount(DatabasePageReader* db_reader);
// The number of the B-tree page this reader is reading.
- const int64_t page_id_;
+ int64_t page_id_;
// Used to read the tree page.
//
// Raw pointer usage is acceptable because this instance's owner is expected
// to ensure that the DatabasePageReader outlives this.
- DatabasePageReader* const db_reader_;
+ DatabasePageReader* db_reader_;
// Caches the ComputeCellCount() value for this reader's page.
- const int cell_count_ = ComputeCellCount(db_reader_);
+ int cell_count_;
// The reader's cursor state.
//
diff --git a/sql/recover_module/cursor.cc b/sql/recover_module/cursor.cc
index 0029ff9295..42548bc4b5 100644
--- a/sql/recover_module/cursor.cc
+++ b/sql/recover_module/cursor.cc
@@ -26,7 +26,7 @@ VirtualCursor::~VirtualCursor() {
int VirtualCursor::First() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
inner_decoders_.clear();
- leaf_decoder_ = nullptr;
+ leaf_decoder_.Reset();
AppendPageDecoder(table_->root_page_id());
return Next();
@@ -36,18 +36,18 @@ int VirtualCursor::Next() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
record_reader_.Reset();
- while (!inner_decoders_.empty() || leaf_decoder_.get()) {
- if (leaf_decoder_.get()) {
- if (!leaf_decoder_->CanAdvance()) {
+ while (!inner_decoders_.empty() || leaf_decoder_.IsValid()) {
+ if (leaf_decoder_.IsValid()) {
+ if (!leaf_decoder_.CanAdvance()) {
// The leaf has been exhausted. Remove it from the DFS stack.
- leaf_decoder_ = nullptr;
+ leaf_decoder_.Reset();
continue;
}
- if (!leaf_decoder_->TryAdvance())
+ if (!leaf_decoder_.TryAdvance())
continue;
- if (!payload_reader_.Initialize(leaf_decoder_->last_record_size(),
- leaf_decoder_->last_record_offset())) {
+ if (!payload_reader_.Initialize(leaf_decoder_.last_record_size(),
+ leaf_decoder_.last_record_offset())) {
continue;
}
if (!record_reader_.Initialize())
@@ -99,13 +99,13 @@ int VirtualCursor::ReadColumn(int column_index,
int64_t VirtualCursor::RowId() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(record_reader_.IsInitialized());
- DCHECK(leaf_decoder_.get());
- return leaf_decoder_->last_record_rowid();
+ DCHECK(leaf_decoder_.IsValid());
+ return leaf_decoder_.last_record_rowid();
}
void VirtualCursor::AppendPageDecoder(int page_id) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- DCHECK(leaf_decoder_.get() == nullptr)
+ DCHECK(!leaf_decoder_.IsValid())
<< __func__
<< " must only be called when the current path has no leaf decoder";
@@ -113,7 +113,7 @@ void VirtualCursor::AppendPageDecoder(int page_id) {
return;
if (LeafPageDecoder::IsOnValidPage(&db_reader_)) {
- leaf_decoder_ = std::make_unique<LeafPageDecoder>(&db_reader_);
+ leaf_decoder_.Initialize(&db_reader_);
return;
}
diff --git a/sql/recover_module/cursor.h b/sql/recover_module/cursor.h
index afcd6900e1..b15c31d425 100644
--- a/sql/recover_module/cursor.h
+++ b/sql/recover_module/cursor.h
@@ -129,7 +129,7 @@ class VirtualCursor {
std::vector<std::unique_ptr<InnerPageDecoder>> inner_decoders_;
// Decodes the leaf page containing records.
- std::unique_ptr<LeafPageDecoder> leaf_decoder_;
+ LeafPageDecoder leaf_decoder_;
SEQUENCE_CHECKER(sequence_checker_);
};
diff --git a/sql/recover_module/pager.cc b/sql/recover_module/pager.cc
index 58e75de270..5fe96204e5 100644
--- a/sql/recover_module/pager.cc
+++ b/sql/recover_module/pager.cc
@@ -23,8 +23,7 @@ static_assert(DatabasePageReader::kMaxPageId <= std::numeric_limits<int>::max(),
"ints are not appropriate for representing page IDs");
DatabasePageReader::DatabasePageReader(VirtualTable* table)
- : page_data_(std::make_unique<uint8_t[]>(table->page_size())),
- table_(table) {
+ : page_data_(), table_(table) {
DCHECK(table != nullptr);
DCHECK(IsValidPageSize(table->page_size()));
}
@@ -57,8 +56,8 @@ int DatabasePageReader::ReadPage(int page_id) {
std::numeric_limits<int64_t>::max(),
"The |read_offset| computation above may overflow");
- int sqlite_status =
- RawRead(sqlite_file, read_size, read_offset, page_data_.get());
+ int sqlite_status = RawRead(sqlite_file, read_size, read_offset,
+ const_cast<uint8_t*>(page_data_.data()));
// |page_id_| needs to be set to kInvalidPageId if the read failed.
// Otherwise, future ReadPage() calls with the previous |page_id_| value
diff --git a/sql/recover_module/pager.h b/sql/recover_module/pager.h
index 0e388ddc3b..99314e30ff 100644
--- a/sql/recover_module/pager.h
+++ b/sql/recover_module/pager.h
@@ -5,6 +5,7 @@
#ifndef SQL_RECOVER_MODULE_PAGER_H_
#define SQL_RECOVER_MODULE_PAGER_H_
+#include <array>
#include <cstdint>
#include <memory>
@@ -70,7 +71,7 @@ class DatabasePageReader {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK_NE(page_id_, kInvalidPageId)
<< "Successful ReadPage() required before accessing pager state";
- return page_data_.get();
+ return page_data_.data();
}
// The number of bytes in the page read by the last ReadPage() call.
@@ -137,7 +138,7 @@ class DatabasePageReader {
int page_id_ = kInvalidPageId;
// Stores the bytes of the last page successfully read by ReadPage().
// The content is undefined if the last call to ReadPage() did not succeed.
- const std::unique_ptr<uint8_t[]> page_data_;
+ const std::array<uint8_t, kMaxPageSize> page_data_;
// Raw pointer usage is acceptable because this instance's owner is expected
// to ensure that the VirtualTable outlives this.
VirtualTable* const table_;

View File

@ -1,50 +0,0 @@
--- a/third_party/skia/src/ports/SkFontHost_FreeType_common.cpp
+++ b/third_party/skia/src/ports/SkFontHost_FreeType_common.cpp
@@ -712,7 +712,11 @@ void colrv1_draw_paint(SkCanvas* canvas,
canvas->drawPaint(colrPaint);
break;
}
+#if FREETYPE_MAJOR == 2 && FREETYPE_MINOR >= 11
+ case FT_COLR_PAINTFORMAT_TRANSFORM:
+#else
case FT_COLR_PAINTFORMAT_TRANSFORMED:
+#endif
case FT_COLR_PAINTFORMAT_TRANSLATE:
case FT_COLR_PAINTFORMAT_ROTATE:
case FT_COLR_PAINTFORMAT_SKEW:
@@ -759,10 +763,17 @@ void colrv1_transform(SkCanvas* canvas, FT_Face face, FT_COLR_Paint colrv1_paint
SkMatrix transform;
switch (colrv1_paint.format) {
+#if FREETYPE_MAJOR == 2 && FREETYPE_MINOR >= 11
+ case FT_COLR_PAINTFORMAT_TRANSFORM: {
+ transform = ToSkMatrix(colrv1_paint.u.transform.affine);
+ break;
+ }
+#else
case FT_COLR_PAINTFORMAT_TRANSFORMED: {
transform = ToSkMatrix(colrv1_paint.u.transformed.affine);
break;
}
+#endif
case FT_COLR_PAINTFORMAT_TRANSLATE: {
transform = SkMatrix::Translate(
SkFixedToScalar(colrv1_paint.u.translate.dx),
@@ -880,10 +891,17 @@ bool colrv1_traverse_paint(SkCanvas* canvas,
traverse_result = colrv1_start_glyph(canvas, palette, face, paint.u.colr_glyph.glyphID,
FT_COLOR_NO_ROOT_TRANSFORM);
break;
+#if FREETYPE_MAJOR == 2 && FREETYPE_MINOR >= 11
+ case FT_COLR_PAINTFORMAT_TRANSFORM:
+ colrv1_transform(canvas, face, paint);
+ traverse_result = colrv1_traverse_paint(canvas, palette, face,
+ paint.u.transform.paint, visited_set);
+#else
case FT_COLR_PAINTFORMAT_TRANSFORMED:
colrv1_transform(canvas, face, paint);
traverse_result = colrv1_traverse_paint(canvas, palette, face,
paint.u.transformed.paint, visited_set);
+#endif
break;
case FT_COLR_PAINTFORMAT_TRANSLATE:
colrv1_transform(canvas, face, paint);

View File

@ -1,26 +0,0 @@
diff -up chromium-88.0.4324.182/third_party/swiftshader/src/OpenGL/libEGL/BUILD.gn.gcc-swiftshader-visibility chromium-88.0.4324.182/third_party/swiftshader/src/OpenGL/libEGL/BUILD.gn
--- chromium-88.0.4324.182/third_party/swiftshader/src/OpenGL/libEGL/BUILD.gn.gcc-swiftshader-visibility 2021-02-25 16:31:51.929335783 +0000
+++ chromium-88.0.4324.182/third_party/swiftshader/src/OpenGL/libEGL/BUILD.gn 2021-02-25 16:31:51.929335783 +0000
@@ -42,7 +42,8 @@ config("swiftshader_libEGL_private_confi
} else if (is_clang) {
defines += [ "EGLAPI=__attribute__((visibility(\"protected\"))) __attribute__((no_sanitize(\"function\")))" ]
} else {
- defines += [ "EGLAPI= " ]
+ cflags += [ "-fvisibility=protected" ]
+ defines += [ "EGLAPI=__attribute__((visibility(\"protected\")))" ]
}
}
}
diff -up chromium-88.0.4324.182/third_party/swiftshader/src/OpenGL/libGLESv2/BUILD.gn.gcc-swiftshader-visibility chromium-88.0.4324.182/third_party/swiftshader/src/OpenGL/libGLESv2/BUILD.gn
--- chromium-88.0.4324.182/third_party/swiftshader/src/OpenGL/libGLESv2/BUILD.gn.gcc-swiftshader-visibility 2021-02-25 18:16:28.576901417 +0000
+++ chromium-88.0.4324.182/third_party/swiftshader/src/OpenGL/libGLESv2/BUILD.gn 2021-02-25 18:17:50.356567690 +0000
@@ -57,7 +57,8 @@ config("swiftshader_libGLESv2_private_co
} else if (is_clang) {
defines += [ "GL_APICALL=__attribute__((visibility(\"protected\"))) __attribute__((no_sanitize(\"function\")))" ]
} else {
- defines += [ "GL_APICALL= " ]
+ cflags += [ "-fvisibility=protected" ]
+ defines += [ "GL_APICALL=__attribute__((visibility(\"protected\")))" ]
}
}
}

View File

@ -1,196 +0,0 @@
From 9d080c0934b848ee4a05013c78641e612fcc1e03 Mon Sep 17 00:00:00 2001
From: Dylan Cutler <dylancutler@google.com>
Date: Wed, 26 May 2021 16:39:52 +0000
Subject: [PATCH] Reland "Replace 'blacklist' with 'ignorelist' in
./tools/msan/."
This is a reland of 3b6263f2eece1264b052dfdcbc03b851d5abfb48
Relanding now that https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/2897974 is merged
Original change's description:
> Replace 'blacklist' with 'ignorelist' in ./tools/msan/.
>
> Bug: 1097272, 1097268
> Change-Id: Id5c8227a5bfb1ffaec82d3168b609085b10c8297
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2867730
> Commit-Queue: Dylan Cutler <dylancutler@google.com>
> Reviewed-by: Nico Weber <thakis@chromium.org>
> Reviewed-by: Jonathan Metzman <metzman@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#883035}
Bug: 1097272
Bug: 1097268
Change-Id: I11a5bc8972680c95fb1dab95ed3b707ed76f4667
Cq-Include-Trybots: luci.chromium.try:chromeos-amd64-generic-cfi-thin-lto-rel
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2911096
Commit-Queue: Dylan Cutler <dylancutler@google.com>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#886773}
---
build/config/sanitizers/BUILD.gn | 44 ++++++++++----------
build_overrides/build.gni | 14 +++----
tools/msan/{blacklist.txt => ignorelist.txt} | 0
3 files changed, 29 insertions(+), 29 deletions(-)
rename tools/msan/{blacklist.txt => ignorelist.txt} (100%)
diff --git a/build/config/sanitizers/BUILD.gn b/build/config/sanitizers/BUILD.gn
index aaaad023474d..55b388a43743 100644
--- a/build/config/sanitizers/BUILD.gn
+++ b/build/config/sanitizers/BUILD.gn
@@ -272,11 +272,11 @@ config("asan_flags") {
if (is_asan) {
cflags += [ "-fsanitize=address" ]
if (is_win) {
- if (!defined(asan_win_blacklist_path)) {
- asan_win_blacklist_path =
+ if (!defined(asan_win_blocklist_path)) {
+ asan_win_blocklist_path =
rebase_path("//tools/memory/asan/blocklist_win.txt", root_build_dir)
}
- cflags += [ "-fsanitize-blacklist=$asan_win_blacklist_path" ]
+ cflags += [ "-fsanitize-ignorelist=$asan_win_blocklist_path" ]
}
}
}
@@ -306,13 +306,13 @@ config("link_shared_library") {
config("cfi_flags") {
cflags = []
if (is_cfi && current_toolchain == default_toolchain) {
- if (!defined(cfi_blacklist_path)) {
- cfi_blacklist_path =
+ if (!defined(cfi_ignorelist_path)) {
+ cfi_ignorelist_path =
rebase_path("//tools/cfi/ignores.txt", root_build_dir)
}
cflags += [
"-fsanitize=cfi-vcall",
- "-fsanitize-blacklist=$cfi_blacklist_path",
+ "-fsanitize-ignorelist=$cfi_ignorelist_path",
]
if (use_cfi_cast) {
@@ -409,14 +409,14 @@ config("msan_flags") {
if (is_msan) {
assert(is_linux || is_chromeos,
"msan only supported on linux x86_64/ChromeOS")
- if (!defined(msan_blacklist_path)) {
- msan_blacklist_path =
- rebase_path("//tools/msan/blacklist.txt", root_build_dir)
+ if (!defined(msan_ignorelist_path)) {
+ msan_ignorelist_path =
+ rebase_path("//tools/msan/ignorelist.txt", root_build_dir)
}
cflags = [
"-fsanitize=memory",
"-fsanitize-memory-track-origins=$msan_track_origins",
- "-fsanitize-blacklist=$msan_blacklist_path",
+ "-fsanitize-ignorelist=$msan_ignorelist_path",
]
}
}
@@ -424,13 +424,13 @@ config("msan_flags") {
config("tsan_flags") {
if (is_tsan) {
assert(is_linux || is_chromeos, "tsan only supported on linux x86_64")
- if (!defined(tsan_blacklist_path)) {
- tsan_blacklist_path =
+ if (!defined(tsan_ignorelist_path)) {
+ tsan_ignorelist_path =
rebase_path("//tools/memory/tsan_v2/ignores.txt", root_build_dir)
}
cflags = [
"-fsanitize=thread",
- "-fsanitize-blacklist=$tsan_blacklist_path",
+ "-fsanitize-ignorelist=$tsan_ignorelist_path",
]
}
}
@@ -438,8 +438,8 @@ config("tsan_flags") {
config("ubsan_flags") {
cflags = []
if (is_ubsan) {
- if (!defined(ubsan_blacklist_path)) {
- ubsan_blacklist_path =
+ if (!defined(ubsan_ignorelist_path)) {
+ ubsan_ignorelist_path =
rebase_path("//tools/ubsan/ignorelist.txt", root_build_dir)
}
cflags += [
@@ -456,7 +456,7 @@ config("ubsan_flags") {
"-fsanitize=signed-integer-overflow",
"-fsanitize=unreachable",
"-fsanitize=vla-bound",
- "-fsanitize-blacklist=$ubsan_blacklist_path",
+ "-fsanitize-ignorelist=$ubsan_ignorelist_path",
]
# Chromecast ubsan builds fail to compile with these
@@ -486,8 +486,8 @@ config("ubsan_no_recover") {
config("ubsan_security_flags") {
if (is_ubsan_security) {
- if (!defined(ubsan_security_blacklist_path)) {
- ubsan_security_blacklist_path =
+ if (!defined(ubsan_security_ignorelist_path)) {
+ ubsan_security_ignorelist_path =
rebase_path("//tools/ubsan/security_ignorelist.txt", root_build_dir)
}
cflags = [
@@ -495,7 +495,7 @@ config("ubsan_security_flags") {
"-fsanitize=shift",
"-fsanitize=signed-integer-overflow",
"-fsanitize=vla-bound",
- "-fsanitize-blacklist=$ubsan_security_blacklist_path",
+ "-fsanitize-ignorelist=$ubsan_security_ignorelist_path",
]
}
}
@@ -508,13 +508,13 @@ config("ubsan_null_flags") {
config("ubsan_vptr_flags") {
if (is_ubsan_vptr) {
- if (!defined(ubsan_vptr_blacklist_path)) {
- ubsan_vptr_blacklist_path =
+ if (!defined(ubsan_vptr_ignorelist_path)) {
+ ubsan_vptr_ignorelist_path =
rebase_path("//tools/ubsan/vptr_ignorelist.txt", root_build_dir)
}
cflags = [
"-fsanitize=vptr",
- "-fsanitize-blacklist=$ubsan_vptr_blacklist_path",
+ "-fsanitize-ignorelist=$ubsan_vptr_ignorelist_path",
]
}
}
diff --git a/build_overrides/build.gni b/build_overrides/build.gni
index 82627b03653f..f3e563ab701b 100644
--- a/build_overrides/build.gni
+++ b/build_overrides/build.gni
@@ -42,15 +42,15 @@ declare_args() {
# Allows different projects to specify their own suppression/ignore lists for
# sanitizer tools.
# asan_suppressions_file = "path/to/asan_suppressions.cc"
-# asan_win_blacklist_path = "path/to/asan/blocklist_win.txt"
+# asan_win_ignorelist_path = "path/to/asan/blocklist_win.txt"
# lsan_suppressions_file = "path/to/lsan_suppressions.cc"
# tsan_suppressions_file = "path/to/tsan_suppressions.cc"
-# tsan_blacklist_path = "path/to/tsan/ignores.txt"
-# msan_blacklist_path = "path/to/msan/blacklist.txt"
-# ubsan_blacklist_path = "path/to/ubsan/blacklist.txt"
-# ubsan_vptr_blacklist_path = "path/to/ubsan/vptr_blacklist.txt"
-# ubsan_security_blacklist_path = "path/to/ubsan/security_blacklist.txt"
-# cfi_blacklist_path = "path/to/cfi/ignores.txt"
+# tsan_ignorelist_path = "path/to/tsan/ignores.txt"
+# msan_ignorelist_path = "path/to/msan/ignorelist.txt"
+# ubsan_ignorelist_path = "path/to/ubsan/ignorelist.txt"
+# ubsan_vptr_ignorelist_path = "path/to/ubsan/vptr_ignorelist.txt"
+# ubsan_security_ignorelist_path = "path/to/ubsan/security_ignorelist.txt"
+# cfi_ignorelist_path = "path/to/cfi/ignores.txt"
declare_args() {
# Android 32-bit non-component, non-clang builds cannot have symbol_level=2
diff --git a/tools/msan/blacklist.txt b/tools/msan/ignorelist.txt
similarity index 100%
rename from tools/msan/blacklist.txt
rename to tools/msan/ignorelist.txt

View File

@ -1,28 +0,0 @@
From 7a23987acb698c2934958cb42a5e7b1cd73fe142 Mon Sep 17 00:00:00 2001
From: Nico Weber <thakis@chromium.org>
Date: Tue, 20 Jul 2021 21:54:09 +0000
Subject: [PATCH] build: Add a TODO about a missing pnacl flag
Change-Id: I1700d185a23afe4120e14c755782450b1bf89289
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3041785
Commit-Queue: Nico Weber <thakis@chromium.org>
Commit-Queue: Hans Wennborg <hans@chromium.org>
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#903659}
---
build/config/compiler/BUILD.gn | 1 +
1 file changed, 1 insertion(+)
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index b6e095b705..ef6d1dfc12 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -1217,6 +1217,7 @@ config("compiler_deterministic") {
# we build same files with same compile flag.
# Other paths are already given in relative, no need to normalize them.
if (is_nacl) {
+ # TODO(https://crbug.com/1231236): Use -ffile-compilation-dir= here.
cflags += [
"-Xclang",
"-fdebug-compilation-dir",

View File

@ -1,36 +0,0 @@
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
index ac4713b07268..492a9a37d096 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -427,11 +427,11 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
scoped_refptr<DecoderBuffer> buffer;
if (type() == DemuxerStream::TEXT) {
- size_t id_size = 0;
+ int id_size = 0;
uint8_t* id_data = av_packet_get_side_data(
packet.get(), AV_PKT_DATA_WEBVTT_IDENTIFIER, &id_size);
- size_t settings_size = 0;
+ int settings_size = 0;
uint8_t* settings_data = av_packet_get_side_data(
packet.get(), AV_PKT_DATA_WEBVTT_SETTINGS, &settings_size);
@@ -443,7 +443,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
buffer = DecoderBuffer::CopyFrom(packet->data, packet->size,
side_data.data(), side_data.size());
} else {
- size_t side_data_size = 0;
+ int side_data_size = 0;
uint8_t* side_data = av_packet_get_side_data(
packet.get(), AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, &side_data_size);
@@ -504,7 +504,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
packet->size - data_offset);
}
- size_t skip_samples_size = 0;
+ int skip_samples_size = 0;
const uint32_t* skip_samples_ptr =
reinterpret_cast<const uint32_t*>(av_packet_get_side_data(
packet.get(), AV_PKT_DATA_SKIP_SAMPLES, &skip_samples_size));

View File

@ -1,49 +0,0 @@
From b94755e4633045be96ab5e0bdde0db7e16a804bd Mon Sep 17 00:00:00 2001
From: "liberato@chromium.org" <liberato@chromium.org>
Date: Fri, 6 Aug 2021 04:25:31 +0000
Subject: [PATCH] FFmpeg M94 roll.
Contains DEPS update + chromium-side fixes.
Bug: 1227259
Change-Id: I61c5eaa789ea12c17d0cbcbf837435b9cf32479b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3011889
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Commit-Queue: Frank Liberato <liberato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#909174}
---
media/ffmpeg/ffmpeg_common.h | 1 +
media/filters/ffmpeg_demuxer.cc | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/media/ffmpeg/ffmpeg_common.h b/media/ffmpeg/ffmpeg_common.h
index cede8ac5a7..97d6307e28 100644
--- a/media/ffmpeg/ffmpeg_common.h
+++ b/media/ffmpeg/ffmpeg_common.h
@@ -29,6 +29,7 @@ extern "C" {
#include <libavformat/avformat.h>
#include <libavformat/avio.h>
#include <libavutil/avutil.h>
+#include <libavutil/channel_layout.h>
#include <libavutil/imgutils.h>
#include <libavutil/log.h>
#include <libavutil/mastering_display_metadata.h>
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
index ac4713b072..605001d935 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -106,12 +106,12 @@ static base::TimeDelta ExtractStartTime(AVStream* stream) {
// Next try to use the first DTS value, for codecs where we know PTS == DTS
// (excludes all H26x codecs). The start time must be returned in PTS.
- if (stream->first_dts != kNoFFmpegTimestamp &&
+ if (av_stream_get_first_dts(stream) != kNoFFmpegTimestamp &&
stream->codecpar->codec_id != AV_CODEC_ID_HEVC &&
stream->codecpar->codec_id != AV_CODEC_ID_H264 &&
stream->codecpar->codec_id != AV_CODEC_ID_MPEG4) {
const base::TimeDelta first_pts =
- ConvertFromTimeBase(stream->time_base, stream->first_dts);
+ ConvertFromTimeBase(stream->time_base, av_stream_get_first_dts(stream));
if (first_pts < start_time)
start_time = first_pts;
}

View File

@ -1,11 +0,0 @@
--- chrome/browser/flag-metadata.json.orig 2021-09-21 18:34:38.740426608 +0000
+++ chrome/browser/flag-metadata.json 2021-09-21 18:35:09.392000797 +0000
@@ -1285,7 +1285,7 @@
{
"name": "enable-accelerated-video-decode",
"owners": [ "media-dev@chromium.org" ],
- "expiry_milestone": 93
+ "expiry_milestone": 99
},
{
"name": "enable-accessibility-live-caption",

View File

@ -1,47 +0,0 @@
From 34a955823630096f5b01c2b01d51c1ea59d22763 Mon Sep 17 00:00:00 2001
From: Zequan Wu <zequanwu@google.com>
Date: Tue, 20 Jul 2021 14:13:50 +0000
Subject: [PATCH] Use -ffile-compilation-dir= instead of
-fdebug-compilation-dir=
Bug: 1010267
Change-Id: If2b4ead8535a76490eb466a38e3d8fed6ea91079
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2770738
Auto-Submit: Zequan Wu <zequanwu@google.com>
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#903456}
---
build/config/compiler/BUILD.gn | 18 ++++++++++++------
build/config/compiler/compiler.gni | 7 ++-----
2 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index ede07d111c..6db16c1cdd 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -1216,12 +1216,18 @@ config("compiler_deterministic") {
# different build directory like "out/feature_a" and "out/feature_b" if
# we build same files with same compile flag.
# Other paths are already given in relative, no need to normalize them.
- cflags += [
- "-Xclang",
- "-fdebug-compilation-dir",
- "-Xclang",
- ".",
- ]
+ if (is_nacl) {
+ cflags += [
+ "-Xclang",
+ "-fdebug-compilation-dir",
+ "-Xclang",
+ ".",
+ ]
+ } else {
+ # -ffile-compilation-dir is an alias for both -fdebug-compilation-dir=
+ # and -fcoverage-compilation-dir=.
+ cflags += [ "-ffile-compilation-dir=." ]
+ }
if (!is_win) {
# We don't use clang -cc1as on Windows (yet? https://crbug.com/762167)
asmflags = [ "-Wa,-fdebug-compilation-dir,." ]

View File

@ -1,31 +0,0 @@
From 9e00e702633c47c590a869bc66b5c2ceec09da50 Mon Sep 17 00:00:00 2001
From: Dominik Röttsches <drott@chromium.org>
Date: Tue, 28 Sep 2021 15:31:50 +0000
Subject: [PATCH] Roll src/third_party/harfbuzz-ng/src/ 6602cbb70..a52c6df38 (80 commits)
Fixed: 1252284
Change-Id: Ie2ff99da5e41ca97b8881e1bd3e158881f4d5a8e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3190252
Commit-Queue: Dominik Röttsches <drott@chromium.org>
Commit-Queue: Calder Kitagawa <ckitagawa@chromium.org>
Auto-Submit: Dominik Röttsches <drott@chromium.org>
Reviewed-by: Calder Kitagawa <ckitagawa@chromium.org>
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/main@{#925776}
(only components/paint_preview/common/subset_font.cc)
---
diff --git a/components/paint_preview/common/subset_font.cc b/components/paint_preview/common/subset_font.cc
index 45daea7b1..43a448e 100644
--- a/components/paint_preview/common/subset_font.cc
+++ b/components/paint_preview/common/subset_font.cc
@@ -79,7 +79,7 @@
// Retain all variation information for OpenType variation fonts. See:
// https://docs.microsoft.com/en-us/typography/opentype/spec/otvaroverview
hb_set_t* skip_subset =
- hb_subset_input_no_subset_tables_set(input.get()); // Owned by |input|.
+ hb_subset_input_set(input.get(), HB_SUBSET_SETS_NO_SUBSET_TABLE_TAG);
hb_set_add(skip_subset, HB_TAG('a', 'v', 'a', 'r'));
hb_set_add(skip_subset, HB_TAG('c', 'v', 'a', 'r'));
hb_set_add(skip_subset, HB_TAG('f', 'v', 'a', 'r'));

View File

@ -1,31 +0,0 @@
From 0aa878b7839141077071db97ba1cd30edf486827 Mon Sep 17 00:00:00 2001
From: Stephan Hartmann <stha09@googlemail.com>
Date: Wed, 15 Sep 2021 17:14:14 +0000
Subject: [PATCH] maldoca: depend on zlib instead of headers only
There is no zlib_common_headers target for unbundled zlib
and in the end code links against zlib static library anyways.
Bug: None
Change-Id: I50b8bb5b480770b637904de00aecc3a629f09471
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3162976
Reviewed-by: Daniel Rubery <drubery@chromium.org>
Commit-Queue: Stephan Hartmann <stha09@googlemail.com>
Cr-Commit-Position: refs/heads/main@{#921717}
---
third_party/maldoca/BUILD.gn | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/third_party/maldoca/BUILD.gn b/third_party/maldoca/BUILD.gn
index eeab2056b5..29a0a2ca49 100644
--- a/third_party/maldoca/BUILD.gn
+++ b/third_party/maldoca/BUILD.gn
@@ -224,7 +224,7 @@ source_set("maldoca-ole") {
"//third_party/libxml",
"//third_party/protobuf:protobuf_lite",
"//third_party/re2",
- "//third_party/zlib:zlib_common_headers",
+ "//third_party/zlib:zlib",
"//third_party/zlib/google:zip",
]

View File

@ -1,671 +0,0 @@
From a4de986102a45e29c3ef596f22704bdca244c26c Mon Sep 17 00:00:00 2001
From: Maksim Sisov <msisov@igalia.com>
Date: Fri, 17 Sep 2021 08:45:55 +0000
Subject: [PATCH] ozone/x11: fix VA-API.
This patch fixes VA-API usage with Ozone/X11 backend (which
is our default backend now as X11 has been deprecated -
crrev.com/c/3114071)).
non-Ozone X11 is disabled now and Ozone is always used
on Linux. However, VA-API implementation is not Ozone friendly
yet and requires major refactoring. But given that VA-API
implementation on Linux worked only with X11, it's fine for
now to change USE_X11 and !IsUsingOzonePlatform to
BUILDFLAG(OZONE_PLATFORM_X11) and fail VA-API initialization
in VADisplayState::Initialize for Ozone/Linux other than
non-X11 backends.
Bug: 1121948
Change-Id: If85d289235e6d358103d9fa2bbe0f741fb599a26
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3141878
Commit-Queue: Maksim Sisov <msisov@igalia.com>
Reviewed-by: Andres Calderon Jaramillo <andrescj@chromium.org>
Reviewed-by: Robert Kroeger <rjkroege@chromium.org>
Reviewed-by: Xiaohan Wang <xhwang@chromium.org>
Reviewed-by: Alexander Dunaev <adunaev@igalia.com>
Cr-Commit-Position: refs/heads/main@{#922466}
---
media/BUILD.gn | 3 -
media/gpu/BUILD.gn | 5 +-
media/gpu/args.gni | 13 +++-
media/gpu/vaapi/BUILD.gn | 8 +-
media/gpu/vaapi/va_stub_header.fragment | 6 +-
media/gpu/vaapi/vaapi_picture_factory.cc | 72 ++++++++----------
.../vaapi_picture_native_pixmap_angle.cc | 2 -
media/gpu/vaapi/vaapi_picture_tfp.cc | 2 -
.../vaapi/vaapi_video_decode_accelerator.cc | 9 +--
...vaapi_video_decode_accelerator_unittest.cc | 11 +--
media/gpu/vaapi/vaapi_wrapper.cc | 76 +++++++++----------
media/gpu/vaapi/vaapi_wrapper.h | 8 +-
ui/ozone/platform/x11/ozone_platform_x11.cc | 3 +
ui/ozone/public/ozone_platform.h | 10 +++
14 files changed, 108 insertions(+), 120 deletions(-)
diff --git a/media/BUILD.gn b/media/BUILD.gn
index dbee1d4338..d5c158c08f 100644
--- a/media/BUILD.gn
+++ b/media/BUILD.gn
@@ -130,9 +130,6 @@ component("media") {
public_deps += [ "//media/base/mac" ]
}
- if (use_x11) {
- deps += [ "//ui/base/x" ]
- }
if (use_ozone) {
deps += [ "//ui/ozone" ]
}
diff --git a/media/gpu/BUILD.gn b/media/gpu/BUILD.gn
index c7499485ac..3fedc78948 100644
--- a/media/gpu/BUILD.gn
+++ b/media/gpu/BUILD.gn
@@ -20,6 +20,7 @@ buildflag_header("buildflags") {
"USE_VAAPI_IMAGE_CODECS=$use_vaapi_image_codecs",
"USE_V4L2_CODEC=$use_v4l2_codec",
"USE_LIBV4L2=$use_v4lplugin",
+ "USE_VAAPI_X11=$use_vaapi_x11",
]
}
@@ -215,9 +216,7 @@ component("gpu") {
"windows/supported_profile_helpers.cc",
"windows/supported_profile_helpers.h",
]
- configs += [
- "//third_party/khronos:khronos_headers",
- ]
+ configs += [ "//third_party/khronos:khronos_headers" ]
public_deps += [ "//media/base/win:media_foundation_util" ]
deps += [
"//gpu/ipc/common:common",
diff --git a/media/gpu/args.gni b/media/gpu/args.gni
index 4004937949..2f53843918 100644
--- a/media/gpu/args.gni
+++ b/media/gpu/args.gni
@@ -3,7 +3,15 @@
# found in the LICENSE file.
import("//build/config/chromeos/ui_mode.gni")
-import("//build/config/ui.gni")
+import("//build/config/ozone.gni")
+
+declare_args() {
+ # Indicates if X11 VA-API-based hardware acceleration is to be used.
+ # See also the comment near the |use_vaapi| arg.
+ use_vaapi_x11 =
+ is_linux && ozone_platform_x11 && !is_chromecast && !is_chromeos_lacros &&
+ (target_cpu == "x86" || target_cpu == "x64")
+}
declare_args() {
# Indicates if V4L plugin is used.
@@ -21,8 +29,7 @@ declare_args() {
# is typically the case on x86-based ChromeOS devices.
# VA-API should also be compiled by default on x11-using linux devices
# using x86/x64.
- use_vaapi =
- is_linux && use_x11 && (target_cpu == "x86" || target_cpu == "x64")
+ use_vaapi = use_vaapi_x11
# Indicates if ChromeOS protected media support exists. This is used
# to enable the CDM daemon in Chrome OS as well as support for
diff --git a/media/gpu/vaapi/BUILD.gn b/media/gpu/vaapi/BUILD.gn
index b11d2c60fa..0c2520dd6b 100644
--- a/media/gpu/vaapi/BUILD.gn
+++ b/media/gpu/vaapi/BUILD.gn
@@ -17,7 +17,7 @@ assert(use_vaapi)
generate_stubs("libva_stubs") {
extra_header = "va_stub_header.fragment"
sigs = [ "va.sigs" ]
- if (use_x11) {
+ if (use_vaapi_x11) {
sigs += [ "va_x11.sigs" ]
}
if (is_chromeos_ash) {
@@ -131,14 +131,14 @@ source_set("vaapi") {
]
}
- if (use_x11 || use_ozone || use_egl) {
+ if (use_ozone || use_egl) {
sources += [
"vaapi_picture_native_pixmap.cc",
"vaapi_picture_native_pixmap.h",
]
}
- if (use_x11) {
+ if (use_vaapi_x11) {
deps += [ "//ui/gfx/x" ]
sources += [
"vaapi_picture_native_pixmap_angle.cc",
@@ -197,7 +197,7 @@ source_set("common") {
deps += [ "//ui/ozone" ]
}
- if (use_x11) {
+ if (use_vaapi_x11) {
deps += [ "//ui/gfx/x" ]
}
diff --git a/media/gpu/vaapi/va_stub_header.fragment b/media/gpu/vaapi/va_stub_header.fragment
index bed198484d..e8c46c5e81 100644
--- a/media/gpu/vaapi/va_stub_header.fragment
+++ b/media/gpu/vaapi/va_stub_header.fragment
@@ -1,12 +1,14 @@
// The extra include header needed in the generated stub file for defining
// various libva types.
+#include "media/gpu/buildflags.h"
+
extern "C" {
#include <va/va_drm.h>
#include <va/va.h>
-#if defined(USE_X11)
+#if BUILDFLAG(USE_VAAPI_X11)
#include <va/va_x11.h>
-#endif
+#endif // BUILDFLAG(USE_VAAPI_X11)
}
diff --git a/media/gpu/vaapi/vaapi_picture_factory.cc b/media/gpu/vaapi/vaapi_picture_factory.cc
index 719035b87c..9c7d7387d2 100644
--- a/media/gpu/vaapi/vaapi_picture_factory.cc
+++ b/media/gpu/vaapi/vaapi_picture_factory.cc
@@ -10,13 +10,13 @@
#include "ui/base/ui_base_features.h"
#include "ui/gl/gl_bindings.h"
-#if defined(USE_X11)
-#include "media/gpu/vaapi/vaapi_picture_native_pixmap_angle.h"
-#include "media/gpu/vaapi/vaapi_picture_tfp.h"
-#endif
#if defined(USE_OZONE)
#include "media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.h"
-#endif
+#endif // defined(USE_OZONE)
+#if BUILDFLAG(USE_VAAPI_X11)
+#include "media/gpu/vaapi/vaapi_picture_native_pixmap_angle.h"
+#include "media/gpu/vaapi/vaapi_picture_tfp.h"
+#endif // BUILDFLAG(USE_VAAPI_X11)
#if defined(USE_EGL)
#include "media/gpu/vaapi/vaapi_picture_native_pixmap_egl.h"
#endif
@@ -46,15 +46,13 @@ VaapiPictureFactory::VaapiPictureFactory() {
vaapi_impl_pairs_.insert(
std::make_pair(gl::kGLImplementationEGLGLES2,
VaapiPictureFactory::kVaapiImplementationDrm));
-#if defined(USE_X11)
+#if BUILDFLAG(USE_VAAPI_X11)
vaapi_impl_pairs_.insert(
std::make_pair(gl::kGLImplementationEGLANGLE,
VaapiPictureFactory::kVaapiImplementationAngle));
- if (!features::IsUsingOzonePlatform()) {
- vaapi_impl_pairs_.insert(
- std::make_pair(gl::kGLImplementationDesktopGL,
- VaapiPictureFactory::kVaapiImplementationX11));
- }
+ vaapi_impl_pairs_.insert(
+ std::make_pair(gl::kGLImplementationDesktopGL,
+ VaapiPictureFactory::kVaapiImplementationX11));
#endif
DeterminePictureCreationAndDownloadingMechanism();
@@ -96,19 +94,19 @@ VaapiPictureFactory::GetVaapiImplementation(gl::GLImplementation gl_impl) {
}
uint32_t VaapiPictureFactory::GetGLTextureTarget() {
-#if defined(USE_OZONE)
- if (features::IsUsingOzonePlatform())
- return GL_TEXTURE_EXTERNAL_OES;
-#endif
+#if BUILDFLAG(USE_VAAPI_X11)
return GL_TEXTURE_2D;
+#else
+ return GL_TEXTURE_EXTERNAL_OES;
+#endif
}
gfx::BufferFormat VaapiPictureFactory::GetBufferFormat() {
-#if defined(USE_OZONE)
- if (features::IsUsingOzonePlatform())
- return gfx::BufferFormat::YUV_420_BIPLANAR;
-#endif
+#if BUILDFLAG(USE_VAAPI_X11)
return gfx::BufferFormat::RGBX_8888;
+#else
+ return gfx::BufferFormat::YUV_420_BIPLANAR;
+#endif
}
void VaapiPictureFactory::DeterminePictureCreationAndDownloadingMechanism() {
@@ -116,51 +114,43 @@ void VaapiPictureFactory::DeterminePictureCreationAndDownloadingMechanism() {
#if defined(USE_OZONE)
// We can be called without GL initialized, which is valid if we use Ozone.
case kVaapiImplementationNone:
- if (features::IsUsingOzonePlatform()) {
- create_picture_cb_ = base::BindRepeating(
- &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
- needs_vpp_for_downloading_ = true;
- }
-
- // This is reached by unit tests which don't require create_picture_cb_
- // to be initialized or called.
+ create_picture_cb_ = base::BindRepeating(
+ &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
+ needs_vpp_for_downloading_ = true;
break;
#endif // defined(USE_OZONE)
-#if defined(USE_X11)
+#if BUILDFLAG(USE_VAAPI_X11)
case kVaapiImplementationX11:
- DCHECK(!features::IsUsingOzonePlatform());
create_picture_cb_ =
base::BindRepeating(&CreateVaapiPictureNativeImpl<VaapiTFPPicture>);
// Neither VaapiTFPPicture or VaapiPictureNativePixmapAngle needs the VPP.
needs_vpp_for_downloading_ = false;
break;
case kVaapiImplementationAngle:
- DCHECK(!features::IsUsingOzonePlatform());
create_picture_cb_ = base::BindRepeating(
&CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapAngle>);
// Neither VaapiTFPPicture or VaapiPictureNativePixmapAngle needs the VPP.
needs_vpp_for_downloading_ = false;
break;
-#endif // defined(USE_X11)
+#endif // BUILDFLAG(USE_VAAPI_X11)
case kVaapiImplementationDrm:
#if defined(USE_OZONE)
- if (features::IsUsingOzonePlatform()) {
- create_picture_cb_ = base::BindRepeating(
- &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
- needs_vpp_for_downloading_ = true;
- break;
- }
-#endif // defined(USE_OZONE)
-#if defined(USE_EGL)
+ create_picture_cb_ = base::BindRepeating(
+ &CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapOzone>);
+ needs_vpp_for_downloading_ = true;
+ break;
+#elif defined(USE_EGL)
create_picture_cb_ = base::BindRepeating(
&CreateVaapiPictureNativeImpl<VaapiPictureNativePixmapEgl>);
needs_vpp_for_downloading_ = true;
break;
-#endif // defined(USE_EGL)
+#else
// ozone or egl must be used to use the DRM implementation.
- NOTREACHED();
+ FALLTHROUGH;
+#endif
default:
NOTREACHED();
+ break;
}
}
diff --git a/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc b/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc
index 9de0c93b44..e5b9908490 100644
--- a/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc
+++ b/media/gpu/vaapi/vaapi_picture_native_pixmap_angle.cc
@@ -6,7 +6,6 @@
#include "media/gpu/vaapi/va_surface.h"
#include "media/gpu/vaapi/vaapi_wrapper.h"
-#include "ui/base/ui_base_features.h"
#include "ui/gfx/x/connection.h"
#include "ui/gfx/x/future.h"
#include "ui/gfx/x/xproto.h"
@@ -92,7 +91,6 @@ Status VaapiPictureNativePixmapAngle::Allocate(gfx::BufferFormat format) {
if (!make_context_current_cb_ || !make_context_current_cb_.Run())
return StatusCode::kVaapiBadContext;
- DCHECK(!features::IsUsingOzonePlatform());
auto image =
base::MakeRefCounted<gl::GLImageEGLPixmap>(visible_size_, format);
if (!image)
diff --git a/media/gpu/vaapi/vaapi_picture_tfp.cc b/media/gpu/vaapi/vaapi_picture_tfp.cc
index 3f7e221d8a..11914e3640 100644
--- a/media/gpu/vaapi/vaapi_picture_tfp.cc
+++ b/media/gpu/vaapi/vaapi_picture_tfp.cc
@@ -6,7 +6,6 @@
#include "media/gpu/vaapi/va_surface.h"
#include "media/gpu/vaapi/vaapi_wrapper.h"
-#include "ui/base/ui_base_features.h"
#include "ui/gfx/x/connection.h"
#include "ui/gfx/x/future.h"
#include "ui/gl/gl_bindings.h"
@@ -37,7 +36,6 @@ VaapiTFPPicture::VaapiTFPPicture(
connection_(x11::Connection::Get()),
x_pixmap_(x11::Pixmap::None) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- DCHECK(!features::IsUsingOzonePlatform());
DCHECK(texture_id);
DCHECK(client_texture_id);
}
diff --git a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
index 7514fe4fdd..e4cd7c8d89 100644
--- a/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
+++ b/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
@@ -184,12 +184,6 @@ bool VaapiVideoDecodeAccelerator::Initialize(const Config& config,
Client* client) {
DCHECK(task_runner_->BelongsToCurrentThread());
-#if defined(USE_X11)
- // TODO(crbug/1116701): implement decode acceleration when running with Ozone.
- if (features::IsUsingOzonePlatform())
- return false;
-#endif
-
vaapi_picture_factory_ = std::make_unique<VaapiPictureFactory>();
if (config.is_encrypted()) {
@@ -1213,12 +1207,11 @@ VaapiVideoDecodeAccelerator::GetSupportedProfiles() {
VaapiVideoDecodeAccelerator::BufferAllocationMode
VaapiVideoDecodeAccelerator::DecideBufferAllocationMode() {
-#if defined(USE_X11)
+#if BUILDFLAG(USE_VAAPI_X11)
// The IMPORT mode is used for Android on Chrome OS, so this doesn't apply
// here.
DCHECK_NE(output_mode_, VideoDecodeAccelerator::Config::OutputMode::IMPORT);
// TODO(crbug/1116701): get video decode acceleration working with ozone.
- DCHECK(!features::IsUsingOzonePlatform());
// For H.264 on older devices, another +1 is experimentally needed for
// high-to-high resolution changes.
// TODO(mcasas): Figure out why and why only H264, see crbug.com/912295 and
diff --git a/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc b/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
index 5b9a543386..826bb103b1 100644
--- a/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
+++ b/media/gpu/vaapi/vaapi_video_decode_accelerator_unittest.cc
@@ -17,7 +17,6 @@
#include "media/gpu/vaapi/vaapi_wrapper.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "ui/base/ui_base_features.h"
using base::test::RunClosure;
using ::testing::_;
@@ -416,12 +415,10 @@ TEST_P(VaapiVideoDecodeAcceleratorTest, SupportedPlatforms) {
mock_vaapi_picture_factory_->GetVaapiImplementation(
gl::kGLImplementationEGLGLES2));
-#if defined(USE_X11)
- if (!features::IsUsingOzonePlatform()) {
- EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationX11,
- mock_vaapi_picture_factory_->GetVaapiImplementation(
- gl::kGLImplementationDesktopGL));
- }
+#if BUILDFLAG(USE_VAAPI_X11)
+ EXPECT_EQ(VaapiPictureFactory::kVaapiImplementationX11,
+ mock_vaapi_picture_factory_->GetVaapiImplementation(
+ gl::kGLImplementationDesktopGL));
#endif
}
diff --git a/media/gpu/vaapi/vaapi_wrapper.cc b/media/gpu/vaapi/vaapi_wrapper.cc
index 754d258848..e528b0f84d 100644
--- a/media/gpu/vaapi/vaapi_wrapper.cc
+++ b/media/gpu/vaapi/vaapi_wrapper.cc
@@ -65,7 +65,7 @@
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_implementation.h"
-#if defined(USE_X11)
+#if BUILDFLAG(USE_VAAPI_X11)
typedef XID Drawable;
extern "C" {
@@ -73,7 +73,7 @@ extern "C" {
}
#include "ui/gfx/x/connection.h" // nogncheck
-#endif
+#endif // BUILDFLAG(USE_VAAPI_X11)
#if defined(USE_OZONE)
#include "ui/ozone/public/ozone_platform.h"
@@ -87,14 +87,14 @@ using media_gpu_vaapi::kModuleVa_prot;
using media_gpu_vaapi::kModuleVa;
using media_gpu_vaapi::kModuleVa_drm;
-#if defined(USE_X11)
+#if BUILDFLAG(USE_VAAPI_X11)
using media_gpu_vaapi::kModuleVa_x11;
-#endif
+#endif // BUILDFLAG(USE_VAAPI_X11)
using media_gpu_vaapi::InitializeStubs;
using media_gpu_vaapi::IsVaInitialized;
-#if defined(USE_X11)
+#if BUILDFLAG(USE_VAAPI_X11)
using media_gpu_vaapi::IsVa_x11Initialized;
-#endif
+#endif // BUILDFLAG(USE_VAAPI_X11)
using media_gpu_vaapi::IsVa_drmInitialized;
using media_gpu_vaapi::StubPathMap;
@@ -559,10 +559,20 @@ VADisplayState::VADisplayState()
bool VADisplayState::Initialize() {
base::AutoLock auto_lock(va_lock_);
+#if defined(USE_OZONE) && defined(OS_LINUX)
+ // TODO(crbug.com/1116701): add vaapi support for other Ozone platforms on
+ // Linux. See comment in OzonePlatform::PlatformProperties::supports_vaapi
+ // for more details. This will also require revisiting everything that's
+ // guarded by USE_VAAPI_X11. For example, if USE_VAAPI_X11 is true, but the
+ // user chooses the Wayland backend for Ozone at runtime, then many things (if
+ // not all) that we do for X11 won't apply.
+ if (!ui::OzonePlatform::GetInstance()->GetPlatformProperties().supports_vaapi)
+ return false;
+#endif
+
bool libraries_initialized = IsVaInitialized() && IsVa_drmInitialized();
-#if defined(USE_X11)
- if (!features::IsUsingOzonePlatform())
- libraries_initialized = libraries_initialized && IsVa_x11Initialized();
+#if BUILDFLAG(USE_VAAPI_X11)
+ libraries_initialized = libraries_initialized && IsVa_x11Initialized();
#endif
if (!libraries_initialized)
return false;
@@ -577,34 +587,25 @@ bool VADisplayState::Initialize() {
return success;
}
-#if defined(USE_X11)
+#if BUILDFLAG(USE_VAAPI_X11)
absl::optional<VADisplay> GetVADisplayStateX11(const base::ScopedFD& drm_fd) {
- bool use_drm_as_fallback = false;
switch (gl::GetGLImplementation()) {
case gl::kGLImplementationEGLGLES2:
return vaGetDisplayDRM(drm_fd.get());
case gl::kGLImplementationNone:
- use_drm_as_fallback = true;
- FALLTHROUGH;
case gl::kGLImplementationDesktopGL: {
- if (!features::IsUsingOzonePlatform()) {
- VADisplay display =
- vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
- if (vaDisplayIsValid(display))
- return display;
- return vaGetDisplayDRM(drm_fd.get());
- }
- break;
+ VADisplay display =
+ vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
+ if (vaDisplayIsValid(display))
+ return display;
+ return vaGetDisplayDRM(drm_fd.get());
}
- case gl::kGLImplementationEGLANGLE: {
- if (!features::IsUsingOzonePlatform())
- return vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
- break;
- }
+ case gl::kGLImplementationEGLANGLE:
+ return vaGetDisplay(x11::Connection::Get()->GetXlibDisplay());
default:
LOG(WARNING) << "VAAPI video acceleration not available for "
@@ -612,10 +613,6 @@ absl::optional<VADisplay> GetVADisplayStateX11(const base::ScopedFD& drm_fd) {
gl::GetGLImplementationParts());
return absl::nullopt;
}
-
- if (use_drm_as_fallback)
- return vaGetDisplayDRM(drm_fd.get());
- return absl::nullopt;
}
#else
@@ -633,11 +630,11 @@ absl::optional<VADisplay> GetVADisplayState(const base::ScopedFD& drm_fd) {
}
}
-#endif // defined(USE_X11)
+#endif // BUILDFLAG(USE_VAAPI_X11)
bool VADisplayState::InitializeVaDisplay_Locked() {
absl::optional<VADisplay> display =
-#if defined(USE_X11)
+#if BUILDFLAG(USE_VAAPI_X11)
GetVADisplayStateX11(drm_fd_);
#else
GetVADisplayState(drm_fd_);
@@ -702,10 +699,9 @@ bool VADisplayState::InitializeOnce() {
if (!InitializeVaDisplay_Locked() || !InitializeVaDriver_Locked())
return false;
-#if defined(USE_X11)
+#if BUILDFLAG(USE_VAAPI_X11)
if (gl::GetGLImplementation() == gl::kGLImplementationEGLANGLE &&
implementation_type_ == VAImplementation::kIntelIHD) {
- DCHECK(!features::IsUsingOzonePlatform());
constexpr char libva_driver_impl_env[] = "LIBVA_DRIVER_NAME";
// TODO(crbug/1116703) The libva intel-media driver has a known segfault in
// vaPutSurface, so until this is fixed, fall back to the i965 driver. There
@@ -722,7 +718,7 @@ bool VADisplayState::InitializeOnce() {
if (!InitializeVaDisplay_Locked() || !InitializeVaDriver_Locked())
return false;
}
-#endif // USE_X11
+#endif // BUILDFLAG(USE_VAAPI_X11)
return true;
}
@@ -2452,11 +2448,10 @@ bool VaapiWrapper::MapAndCopyAndExecute(
return Execute_Locked(va_surface_id, va_buffer_ids);
}
-#if defined(USE_X11)
+#if BUILDFLAG(USE_VAAPI_X11)
bool VaapiWrapper::PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
x11::Pixmap x_pixmap,
gfx::Size dest_size) {
- DCHECK(!features::IsUsingOzonePlatform());
base::AutoLock auto_lock(*va_lock_);
VAStatus va_res = vaSyncSurface(va_display_, va_surface_id);
@@ -2470,7 +2465,7 @@ bool VaapiWrapper::PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
VA_SUCCESS_OR_RETURN(va_res, VaapiFunctions::kVAPutSurface, false);
return true;
}
-#endif // USE_X11
+#endif // BUILDFLAG(USE_VAAPI_X11)
std::unique_ptr<ScopedVAImage> VaapiWrapper::CreateVaImage(
VASurfaceID va_surface_id,
@@ -2844,9 +2839,8 @@ void VaapiWrapper::PreSandboxInitialization() {
paths[kModuleVa].push_back(std::string("libva.so.") + va_suffix);
paths[kModuleVa_drm].push_back(std::string("libva-drm.so.") + va_suffix);
-#if defined(USE_X11)
- if (!features::IsUsingOzonePlatform())
- paths[kModuleVa_x11].push_back(std::string("libva-x11.so.") + va_suffix);
+#if BUILDFLAG(USE_VAAPI_X11)
+ paths[kModuleVa_x11].push_back(std::string("libva-x11.so.") + va_suffix);
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
paths[kModuleVa_prot].push_back(std::string("libva.so.") + va_suffix);
diff --git a/media/gpu/vaapi/vaapi_wrapper.h b/media/gpu/vaapi/vaapi_wrapper.h
index 0e3da53624..88ffcd0799 100644
--- a/media/gpu/vaapi/vaapi_wrapper.h
+++ b/media/gpu/vaapi/vaapi_wrapper.h
@@ -36,9 +36,9 @@
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "ui/gfx/geometry/size.h"
-#if defined(USE_X11)
+#if BUILDFLAG(USE_VAAPI_X11)
#include "ui/gfx/x/xproto.h" // nogncheck
-#endif // USE_X11
+#endif // BUILDFLAG(USE_VAAPI_X11)
namespace gfx {
enum class BufferFormat;
@@ -426,13 +426,13 @@ class MEDIA_GPU_EXPORT VaapiWrapper
const std::vector<std::pair<VABufferID, VABufferDescriptor>>& va_buffers)
WARN_UNUSED_RESULT;
-#if defined(USE_X11)
+#if BUILDFLAG(USE_VAAPI_X11)
// Put data from |va_surface_id| into |x_pixmap| of size
// |dest_size|, converting/scaling to it.
bool PutSurfaceIntoPixmap(VASurfaceID va_surface_id,
x11::Pixmap x_pixmap,
gfx::Size dest_size) WARN_UNUSED_RESULT;
-#endif // USE_X11
+#endif // BUILDFLAG(USE_VAAPI_X11)
// Creates a ScopedVAImage from a VASurface |va_surface_id| and map it into
// memory with the given |format| and |size|. If |format| is not equal to the
diff --git a/ui/ozone/platform/x11/ozone_platform_x11.cc b/ui/ozone/platform/x11/ozone_platform_x11.cc
index 8889828e0f..963dc7a0cd 100644
--- a/ui/ozone/platform/x11/ozone_platform_x11.cc
+++ b/ui/ozone/platform/x11/ozone_platform_x11.cc
@@ -208,6 +208,9 @@ class OzonePlatformX11 : public OzonePlatform,
properties->supports_global_application_menus = true;
properties->app_modal_dialogs_use_event_blocker = true;
properties->fetch_buffer_formats_for_gmb_on_gpu = true;
+#if defined(OS_LINUX)
+ properties->supports_vaapi = true;
+#endif
initialised = true;
}
diff --git a/ui/ozone/public/ozone_platform.h b/ui/ozone/public/ozone_platform.h
index df95f07486..2d7f44bbfa 100644
--- a/ui/ozone/public/ozone_platform.h
+++ b/ui/ozone/public/ozone_platform.h
@@ -15,6 +15,7 @@
#include "base/macros.h"
#include "base/message_loop/message_pump_type.h"
#include "base/single_thread_task_runner.h"
+#include "build/build_config.h"
#include "mojo/public/cpp/bindings/binder_map.h"
#include "ui/gfx/buffer_types.h"
#include "ui/gfx/native_widget_types.h"
@@ -154,6 +155,15 @@ class COMPONENT_EXPORT(OZONE) OzonePlatform {
// Determines whether buffer formats should be fetched on GPU and passed
// back via gpu extra info.
bool fetch_buffer_formats_for_gmb_on_gpu = false;
+
+#if defined(OS_LINUX)
+ // TODO(crbug.com/1116701): add vaapi support for other Ozone platforms on
+ // Linux. At the moment, VA-API Linux implementation supports only X11
+ // backend. This implementation must be refactored to support Ozone
+ // properly. As a temporary solution, VA-API on Linux checks if vaapi is
+ // supported (which implicitly means that it is Ozone/X11).
+ bool supports_vaapi = false;
+#endif
};
// Groups platform properties that can only be known at run time.

View File

@ -1,50 +0,0 @@
From 600d63c2c59a9892dbc5423d7d8bb1565a9f91e7 Mon Sep 17 00:00:00 2001
From: Michel Salim <michel@fb.com>
Date: Thu, 04 Nov 2021 14:22:40 -0700
Subject: [PATCH] Handle long SIGSTKSZ in glibc > 2.33
`SIGSTKSZ` is no longer constant in glibc > 2.33 but a function
returning a long. Cast before taking `max`.
See https://sourceware.org/git/?p=glibc.git;a=blob;f=NEWS;h=85e84fe53699fe9e392edffa993612ce08b2954a;hb=HEAD
Signed-off-by: Michel Salim <michel@fb.com>
Change-Id: I197f8ff3053eede80d6aed096be4f0113dd43241
(relocated to chromium repo, removed static)
---
diff --git a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
index ca353c4..5cdabcf 100644
--- a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+++ b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
@@ -138,7 +138,7 @@
// SIGSTKSZ may be too small to prevent the signal handlers from overrunning
// the alternative stack. Ensure that the size of the alternative stack is
// large enough.
- static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ);
+ const unsigned kSigStackSize = std::max(16384U, (unsigned)SIGSTKSZ);
// Only set an alternative stack if there isn't already one, or if the current
// one is too small.
diff --git a/sandbox/linux/services/credentials.cc b/sandbox/linux/services/credentials.cc
index ca6b595..1c1ee42 100644
--- a/sandbox/linux/services/credentials.cc
+++ b/sandbox/linux/services/credentials.cc
@@ -11,6 +11,7 @@
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
+#include <string.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/wait.h>
@@ -100,7 +101,8 @@ bool ChrootToSafeEmptyDir() {
// TODO(crbug.com/1247458) Broken in MSan builds after LLVM f1bb30a4956f.
clone_flags |= CLONE_VM | CLONE_VFORK | CLONE_SETTLS;
- char tls_buf[PTHREAD_STACK_MIN] = {0};
+ char tls_buf[PTHREAD_STACK_MIN];
+ memset(tls_buf, 0, PTHREAD_STACK_MIN);
tls = tls_buf;
#endif

View File

@ -1,35 +0,0 @@
From 52d0ad25ea695da44195e49f36e69fa81b55e670 Mon Sep 17 00:00:00 2001
From: Tom Anderson <thomasanderson@chromium.org>
Date: Wed, 5 Jan 2022 21:11:03 +0000
Subject: [PATCH] [X11] Fix tag dragging in KWin
R=sky
Bug: 1279532
Change-Id: Iac166803e2149eef234045d922b630f0019c8073
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3355376
Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#955869}
---
ui/platform_window/x11/x11_topmost_window_finder.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ui/platform_window/x11/x11_topmost_window_finder.cc b/ui/platform_window/x11/x11_topmost_window_finder.cc
index 50e75e17f0a..2e16393487b 100644
--- a/ui/platform_window/x11/x11_topmost_window_finder.cc
+++ b/ui/platform_window/x11/x11_topmost_window_finder.cc
@@ -68,9 +68,9 @@ bool EnumerateAllWindows(ShouldStopIteratingCallback should_stop_iterating,
void EnumerateTopLevelWindows(
ui::ShouldStopIteratingCallback should_stop_iterating) {
- // Some WMs parent 'top-level' windows in unnamed actual top-level windows
- // (ion WM), so extend the search depth to all children of top-level windows.
- const int kMaxSearchDepth = 1;
+ // WMs may reparent toplevel windows inside their own containers, so extend
+ // the search to all grandchildren of all toplevel windows.
+ const int kMaxSearchDepth = 2;
ui::EnumerateAllWindows(should_stop_iterating, kMaxSearchDepth);
}

View File

@ -1,46 +0,0 @@
From 3806f28918ea23291749ff4775339075a5f394e8 Mon Sep 17 00:00:00 2001
From: Tom Anderson <thomasanderson@chromium.org>
Date: Thu, 6 Jan 2022 00:59:40 +0000
Subject: [PATCH] [X11] Fix tag dragging in Mutter
We used to use a BFS to find the target window for tag dragging, but
this causes windows underneath (like the window for the desktop
wallpaper) to take precedence over nested windows.
This CL switches to a DFS.
R=sky
Bug: 1279532
Change-Id: Ib569e9270be60bcb4fff088517dfe295697608b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3355470
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#955976}
---
ui/platform_window/x11/x11_topmost_window_finder.cc | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/ui/platform_window/x11/x11_topmost_window_finder.cc b/ui/platform_window/x11/x11_topmost_window_finder.cc
index 2e16393487b..e20bf0abf0e 100644
--- a/ui/platform_window/x11/x11_topmost_window_finder.cc
+++ b/ui/platform_window/x11/x11_topmost_window_finder.cc
@@ -44,15 +44,8 @@ bool EnumerateChildren(ShouldStopIteratingCallback should_stop_iterating,
for (iter = windows.rbegin(); iter != windows.rend(); iter++) {
if (IsWindowNamed(*iter) && should_stop_iterating.Run(*iter))
return true;
- }
-
- // If we're at this point, we didn't find the window we're looking for at the
- // current level, so we need to recurse to the next level. We use a second
- // loop because the recursion and call to XQueryTree are expensive and is only
- // needed for a small number of cases.
- if (++depth <= max_depth) {
- for (iter = windows.rbegin(); iter != windows.rend(); iter++) {
- if (EnumerateChildren(should_stop_iterating, *iter, max_depth, depth))
+ if (depth < max_depth) {
+ if (EnumerateChildren(should_stop_iterating, *iter, max_depth, depth + 1))
return true;
}
}

View File

@ -1,12 +0,0 @@
diff --git a/build/linux/unbundle/ffmpeg.gn b/build/linux/unbundle/ffmpeg.gn
index 16e20744706..6a079b32221 100644
--- a/build/linux/unbundle/ffmpeg.gn
+++ b/build/linux/unbundle/ffmpeg.gn
@@ -12,6 +12,7 @@ pkg_config("system_ffmpeg") {
"libavformat",
"libavutil",
]
+ defines = [ "av_stream_get_first_dts(stream)=stream->first_dts" ]
}
buildflag_header("ffmpeg_features") {

View File

@ -1,62 +0,0 @@
From 5b287e0be8d8d8475ec6ef81b16eaa61e19db078 Mon Sep 17 00:00:00 2001
From: "Steinar H. Gunderson" <sesse@chromium.org>
Date: Tue, 25 Jan 2022 19:14:53 +0000
Subject: [PATCH] Fix build break with system libdrm.
This patch is submitted on behalf of Andres Salomon
<dilinger@queued.net> (on Cc). Also adding him to src/AUTHORS
per policy, as he has signed the CLA.
Original patch:
https://salsa.debian.org/dilinger/chromium/-/commit/2333c2fb985ac1ef3d7331776a7833d965c63302
Change-Id: I18bd60e2e80f2b9181e74ee7972c3f457ab33b10
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3401704
Reviewed-by: Andres Calderon Jaramillo <andrescj@chromium.org>
Commit-Queue: Steinar H Gunderson <sesse@chromium.org>
Auto-Submit: Steinar H Gunderson <sesse@chromium.org>
Cr-Commit-Position: refs/heads/main@{#963119}
---
AUTHORS | 1 +
media/gpu/chromeos/BUILD.gn | 1 +
media/gpu/chromeos/video_decoder_pipeline.cc | 2 +-
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/AUTHORS b/AUTHORS
index 0eba3de5065..50edd3f6b38 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -93,6 +93,7 @@ Andreas Papacharalampous <andreas@apap04.com>
Andrei Borza <andrei.borza@gmail.com>
Andrei Parvu <andrei.prv@gmail.com>
Andrei Parvu <parvu@adobe.com>
+Andres Salomon <dilinger@queued.net>
Andreu Botella <andreu@andreubotella.com>
Andrew Boyarshin <andrew.boyarshin@gmail.com>
Andrew Brampton <me@bramp.net>
diff --git a/media/gpu/chromeos/BUILD.gn b/media/gpu/chromeos/BUILD.gn
index 7cb4c3ea39a..6fe21c15ecc 100644
--- a/media/gpu/chromeos/BUILD.gn
+++ b/media/gpu/chromeos/BUILD.gn
@@ -25,6 +25,7 @@ source_set("chromeos") {
deps = [
"//base",
+ "//build/config/linux/libdrm",
"//media",
"//media/gpu:buildflags",
"//media/gpu:command_buffer_helper",
diff --git a/media/gpu/chromeos/video_decoder_pipeline.cc b/media/gpu/chromeos/video_decoder_pipeline.cc
index d2f154ea0d8..416b9434a8d 100644
--- a/media/gpu/chromeos/video_decoder_pipeline.cc
+++ b/media/gpu/chromeos/video_decoder_pipeline.cc
@@ -28,8 +28,8 @@
#include "third_party/abseil-cpp/absl/types/optional.h"
#if BUILDFLAG(USE_VAAPI)
+#include <drm_fourcc.h>
#include "media/gpu/vaapi/vaapi_video_decoder.h"
-#include "third_party/libdrm/src/include/drm/drm_fourcc.h"
#elif BUILDFLAG(USE_V4L2_CODEC)
#include "media/gpu/v4l2/v4l2_video_decoder.h"
#else

View File

@ -1,8 +1,8 @@
%define MAJver %(echo %version | cut -d. -f1) %define MAJver %(echo %version | cut -d. -f1)
%define gcc_patchset 2 %define gcc_patchset 116-patchset-2
Name: chromium Name: chromium
Epoch: 3 Epoch: 3
Version: 116.0.5845.163 Version: 117.0.5938.88
Release: 1mamba Release: 1mamba
Summary: An open-source browser project that aims to build a safer, faster, and more stable way to experience the web Summary: An open-source browser project that aims to build a safer, faster, and more stable way to experience the web
Group: Graphical Desktop/Applications/Internet Group: Graphical Desktop/Applications/Internet
@ -18,48 +18,15 @@ URL: https://www.chromium.org
Source: https://commondatastorage.googleapis.com/chromium-browser-official/chromium-%{version}.tar.xz Source: https://commondatastorage.googleapis.com/chromium-browser-official/chromium-%{version}.tar.xz
#Source: http://gsdview.appspot.com/chromium-browser-official/chromium-%{version}.tar.xz #Source: http://gsdview.appspot.com/chromium-browser-official/chromium-%{version}.tar.xz
Source1: %{name}-master_preferences Source1: %{name}-master_preferences
Source2: https://github.com/stha09/chromium-patches/releases/download/chromium-%{MAJver}-patchset-%{gcc_patchset}/chromium-%{MAJver}-patchset-%{gcc_patchset}.tar.xz Source2: https://github.com/stha09/chromium-patches/releases/download/chromium-%{gcc_patchset}/chromium-%{gcc_patchset}.tar.xz
Patch1: chromium-37.0.2062.120-chrome-wrapper-pepper-flash.patch Patch10: chromium-90.0.4430.212-use-oauth2-client-switches-as-default.patch
Patch2: chromium-79.0.3945.79-widevine.patch Patch11: chromium-115.0.5790.170-REVERT-disable-autoupgrading-debug-info.patch
Patch3: chromium-76.0.3809.100-x86-openh264-add-fPIC.patch Patch12: chromium-116.0.5845.96-randrom-build-fixes.patch
Patch4: chromium-80.0.3987.122-x86-v8_context_snapsht-pic-error.patch Patch13: chromium-116-0.5845.110-aarch64-include-limits.patch
Patch5: chromium-90.0.4430.212-glibc-2.33.patch Patch14: chromium-117.0.5938.62-material-color-utilities-cmath.patch
Patch6: chromium-92.0.4515.107-clang-11-nomerge.patch Patch15: chromium-117.0.5938.88-blink-remove-unused-mnemonic.patch
Patch7: chromium-90.0.4430.212-use-oauth2-client-switches-as-default.patch Patch16: chromium-117.0.5938.88-add-memory-for-std-unique_ptr-in-third_party-ip.patch
Patch8: chromium-92.0.4515.107-extend-enable-accelerated-video-decode-flag.patch Patch17: chromium-117.0.5938.88-roll-src-third_party-libavif-src-b33d9ebfc.676aded35.patch
Patch9: chromium-92.0.4515.107-linux-sandbox-syscall-broker-use-struct-kernel_stat.patch
Patch10: chromium-92.0.4515.107-linux-sandbox-fix-fstatat-crash.patch
Patch11: chromium-92.0.4515.107-make-GetUsableSize-handle-nullptr-gracefully.patch
Patch12: chromium-92.0.4515.107-sql-make-VirtualCursor-standard-layout-type.patch
Patch15: chromium-92.0.4515.131-freetype-2.11.patch
Patch16: chromium-92.0.4515.131-gcc-fix-swiftshader-libEGL-visibility.patch
Patch17: chromium-93.0.4577.63-replace-blacklist-with-ignorelist.patch
Patch18: chromium-94.0.4606.71-use-ffile-compilation-dir.patch
Patch19: chromium-94.0.4606.71-ffmpeg-4.4.patch
Patch20: chromium-94.0.4606.71-ffmpeg-roll.patch
Patch21: chromium-94.0.4606.71-unexpire-accelerated-video-decode-flag.patch
Patch22: chromium-94.0.4606.71-add-a-TODO-about-a-missing-pnacl-flag.patch
Patch23: chromium-95.0.4638.54-maldoca-depend-on-zlib-instead-of-headers-only.patch
Patch24: chromium-95.0.4638.54-harfbuzz-3.patch
Patch25: chromium-95.0.4638.54-ozone-x11-fix-VA-API.patch
Patch26: chromium-96.0.4664.45-gcc-2.34.patch
Patch27: chromium-97.0.4692.71-unbundle-ffmpeg-av_stream_get_first_dts.patch
Patch28: chromium-97.0.4692.71-fix-tag-dragging-in-KWin.patch
Patch29: chromium-97.0.4692.71-fix-tag-dragging-in-Mutter.patch
Patch30: chromium-98.0.4758.102-libdrm-2.4.110.patch
Patch31: chromium-101.0.4951.41-libxml-unbundle.patch
Patch32: chromium-102.0.5005.61-remove-no-opaque-pointers-flag.patch
Patch33: chromium-104.0.5112.79-roll-src-third_party-ffmpeg.patch
Patch34: chromium-102.0.5005.61-iwyu-add-utility-for-std-exchange.patch
Patch35: chromium-104.0.5112.79-remove-no-opaque-pointers-flag.patch
Patch36: chromium-104.0.5112.79-tflite-system-zlib.patch
Patch37: chromium-105.0.5195.102-angle-wayland-include-protocol.patch
Patch38: chromium-109.0.5414.119-REVERT-roll-src-third_party-ffmpeg-m106.patch
Patch39: chromium-110.0.5481.177-v8-move-the-Stack-object-from-ThreadLocalTop.patch
Patch40: chromium-111.0.5563.110-sql-relax-constraints-on-VirtualCursor-layout.patch
Patch41: chromium-115.0.5790.170-REVERT-disable-autoupgrading-debug-info.patch
Patch42: chromium-116.0.5845.96-randrom-build-fixes.patch
Patch43: chromium-116-0.5845.110-aarch64-include-limits.patch
License: BSD License: BSD
## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel BuildRequires: glibc-devel
@ -74,6 +41,7 @@ BuildRequires: libat-spi2-core-devel
BuildRequires: libatomic-devel BuildRequires: libatomic-devel
BuildRequires: libavcodec-ffmpeg-devel BuildRequires: libavcodec-ffmpeg-devel
BuildRequires: libavformat-ffmpeg-devel BuildRequires: libavformat-ffmpeg-devel
BuildRequires: libavif-devel
BuildRequires: libavutil-ffmpeg-devel BuildRequires: libavutil-ffmpeg-devel
BuildRequires: libcairo-devel BuildRequires: libcairo-devel
BuildRequires: libcups-devel BuildRequires: libcups-devel
@ -168,26 +136,19 @@ Chromium is an open-source browser project that aims to build a safer, faster, a
sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \ sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
tools/generate_shim_headers/generate_shim_headers.py tools/generate_shim_headers/generate_shim_headers.py
%ifarch %{ix86} %patch 10 -p1 -b .use-oauth2-client-switches-as-default
%patch 3 -p1 %patch 11 -Rp1 -b .REVERT-disable-autoupgrading-debug-info
%endif %patch 12 -p1 -b .randrom-build-fixes
%patch 7 -p1 -b .use-oauth2-client-switches-as-default %patch 13 -p1 -b .aarch64-include-limits
#%patch 33 -Rp1 -b .roll-src-third_party-ffmpeg %patch 14 -p0 -b .material-color-utilities-cmath
#%patch12 -p1 -b .sql-make-VirtualCursor-standard-layout-type %patch 15 -p1 -b .blink-remove-unused-mnemonic
#%patch 37 -p0 -b .angle-wayland-include-protocol %patch 16 -p1 -b .add-memory-for-std-unique_ptr-in-third_party-ip
#%patch 38 -Rp1 -b .REVERT-roll-src-third_party-ffmpeg-m106 %patch 17 -p1 -b .roll-src-third_party-libavif-src-b33d9ebfc.676aded35
#%patch 39 -p1 -d v8 -b .v8-move-the-Stack-object-from-ThreadLocalTop
#%patch 40 -p1 -b .sql-relax-constraints-on-VirtualCursor-layout
%patch 41 -Rp1 -b .REVERT-disable-autoupgrading-debug-info
%patch 42 -p1 -b .randrom-build-fixes
%patch 43 -p1
# Fixes for building with libstdc++ instead of libc++ # Fixes for building with libstdc++ instead of libc++
patch -Np1 -i patches/chromium-114-maldoca-include.patch patch -Np1 -i patches/chromium-114-maldoca-include.patch
patch -Np1 -i patches/chromium-114-ruy-include.patch patch -Np1 -i patches/chromium-114-ruy-include.patch
patch -Np1 -i patches/chromium-114-vk_mem_alloc-include.patch patch -Np1 -i patches/chromium-114-vk_mem_alloc-include.patch
patch -Np1 -i patches/chromium-116-object_paint_properties_sparse-include.patch
patch -Np1 -i patches/chromium-116-profile_view_utils-include.patch
# Force script incompatible with Python 3 to use /usr/bin/python2 # Force script incompatible with Python 3 to use /usr/bin/python2
sed -i '1s|python$|&2|' third_party/dom_distiller_js/protoc_plugins/*.py sed -i '1s|python$|&2|' third_party/dom_distiller_js/protoc_plugins/*.py
@ -202,9 +163,10 @@ sed -i \
# https://crbug.com/893950 # https://crbug.com/893950
sed -i -e 's/\<xmlMalloc\>/malloc/' -e 's/\<xmlFree\>/free/' \ sed -i -e 's/\<xmlMalloc\>/malloc/' -e 's/\<xmlFree\>/free/' \
third_party/blink/renderer/core/xml/*.cc \ third_party/blink/renderer/core/xml/*.cc \
third_party/blink/renderer/core/xml/parser/xml_document_parser.cc \ third_party/blink/renderer/core/xml/parser/xml_document_parser.cc \
third_party/libxml/chromium/libxml_utils.cc third_party/libxml/chromium/*.cc \
third_party/maldoca/src/maldoca/ole/oss_utils.h
## There are still a lot of relative calls which need a workaround ## There are still a lot of relative calls which need a workaround
#mkdir -p python2-path #mkdir -p python2-path
@ -223,7 +185,7 @@ declare -rgA _system_libs=(
[icu]=icu [icu]=icu
[jsoncpp]=jsoncpp [jsoncpp]=jsoncpp
#[libaom]=aom #[libaom]=aom
#[libavif]=libavif [libavif]=libavif
[libdrm]= [libdrm]=
[libjpeg]=libjpeg [libjpeg]=libjpeg
[libpng]=libpng [libpng]=libpng
@ -317,11 +279,8 @@ chromium_conf=(
'rtc_use_pipewire=true' 'rtc_use_pipewire=true'
'link_pulseaudio=true' 'link_pulseaudio=true'
'use_custom_libcxx=false' 'use_custom_libcxx=false'
'use_gnome_keyring=false'
'use_sysroot=false' 'use_sysroot=false'
'use_system_libffi=true' 'use_system_libffi=true'
'use_system_libwayland=true'
'use_system_wayland_scanner=true'
'enable_hangout_services_extension=true' 'enable_hangout_services_extension=true'
'enable_widevine=true' 'enable_widevine=true'
'enable_nacl=false' 'enable_nacl=false'
@ -331,7 +290,10 @@ chromium_conf=(
'icu_use_data_file=false' 'icu_use_data_file=false'
) )
# 'use_vaapi=true' # 'use_system_wayland_scanner=true'
# 'use_system_libwayland=true'
# 'use_gnome_keyring=false'
# 'use_vaapi=true'
# 'fieldtrial_testing_like_official_build=true' # 'fieldtrial_testing_like_official_build=true'
# 'chrome_pgo_phase=0' # pgo incompatible with llvm 11 # 'chrome_pgo_phase=0' # pgo incompatible with llvm 11
# 'google_default_client_id="72870267994-r1bkll5bq0v275nnsa66d21h3t6ne10s.apps.googleusercontent.com"' # 'google_default_client_id="72870267994-r1bkll5bq0v275nnsa66d21h3t6ne10s.apps.googleusercontent.com"'
@ -467,6 +429,9 @@ ln -s %{_libdir}/chromium/chromedriver %{buildroot}%{_bindir}/chromedriver
%{_mandir}/man1/chromium.1* %{_mandir}/man1/chromium.1*
%changelog %changelog
* Mon Sep 18 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 117.0.5938.88-1mamba
- update to 117.0.5938.88
* Fri Sep 01 2023 Automatic Build System <autodist@mambasoft.it> 116.0.5845.163-1mamba * Fri Sep 01 2023 Automatic Build System <autodist@mambasoft.it> 116.0.5845.163-1mamba
- automatic version update by autodist - automatic version update by autodist