Files
sousa-gecko/third_party/libwebrtc/moz-patch-stack/s0087.patch
T
Nico Grunbaum 8e56325cbc Bug 2047265 - Vendor libwebrtc from 34505048c0
Upstream commit: https://webrtc.googlesource.com/src/+/34505048c030ee72ad6ee99f46534861ebb0e365
    Cap RTCConfiguration certificates and enforce 32-bit overflow checks

    1. Bounded the maximum number of certificates in RTCConfiguration to
       1000 to prevent reference counter overflow while maintaining ample
       headroom for legitimate multi-algorithm DTLS interoperability.
    2. Updated webrtc_impl::RefCounter to declare IncRef() out-of-line
       unconditionally across all architectures.
    3. Implemented RefCounter::IncRef() out-of-line in ref_counter.cc with
       an explicit RTC_CHECK_LT(prev, INT_MAX) guard on all architectures,
       preventing 32-bit integer overflow and Use-After-Free vulnerabilities
       unconditionally without causing inlined binary bloat.

    Bug: chromium:513154132
    Fixed: chromium:513154132
    Change-Id: I9894ef08519423b24139b0250cc9da0f9737827a
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/472722
    Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
    Reviewed-by: Harald Alvestrand <hta@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#47722}
2026-06-19 13:50:28 +00:00

74 lines
3.0 KiB
Diff

From: Michael Froman <mfroman@mozilla.com>
Date: Fri, 21 Jun 2024 16:28:00 -0500
Subject: Bug 1903098 - (fix-cd09858f4a) disable perfetto usage to avoid new
third_party library.
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/b050c455caa1d24a0cfa4933ac8cd82c9cd3c347
---
BUILD.gn | 2 +-
modules/video_coding/generic_decoder.cc | 10 +++++-----
rtc_base/BUILD.gn | 2 ++
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/BUILD.gn b/BUILD.gn
index 5b12f95346..0bd2576bc3 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -641,7 +641,7 @@ if (!build_with_chromium) {
if (rtc_include_internal_audio_device) {
deps += [ "api/audio:create_audio_device_module" ]
}
- if (!build_with_chromium) {
+ if (!build_with_chromium && !build_with_mozilla) {
if (is_android) {
deps += [ "sdk/android" ]
}
diff --git a/modules/video_coding/generic_decoder.cc b/modules/video_coding/generic_decoder.cc
index 2e0f27e193..7233550daf 100644
--- a/modules/video_coding/generic_decoder.cc
+++ b/modules/video_coding/generic_decoder.cc
@@ -119,9 +119,9 @@ void VCMDecodedFrameCallback::Decoded(VideoFrame& decodedImage,
std::optional<int32_t> decode_time_ms,
std::optional<uint8_t> qp) {
RTC_DCHECK(receive_callback_) << "Callback must not be null at this point";
- TRACE_EVENT(
- "webrtc", "VCMDecodedFrameCallback::Decoded",
- perfetto::TerminatingFlow::ProcessScoped(decodedImage.rtp_timestamp()));
+ TRACE_EVENT_INSTANT1("webrtc", "VCMDecodedFrameCallback::Decoded",
+ TRACE_EVENT_SCOPE_GLOBAL, "timestamp",
+ decodedImage.rtp_timestamp());
// TODO(holmer): We should improve this so that we can handle multiple
// callbacks from one call to Decode().
std::optional<FrameInfo> frame_info;
@@ -326,8 +326,8 @@ int32_t VCMGenericDecoder::Decode(
Timestamp now,
int64_t render_time_ms,
const std::optional<FrameInstrumentationData>& frame_instrumentation_data) {
- TRACE_EVENT("webrtc", "VCMGenericDecoder::Decode",
- perfetto::Flow::ProcessScoped(frame.RtpTimestamp()));
+ TRACE_EVENT1("webrtc", "VCMGenericDecoder::Decode", "timestamp",
+ frame.RtpTimestamp());
FrameInfo frame_info;
frame_info.rtp_timestamp = frame.RtpTimestamp();
frame_info.decode_start = now;
diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn
index 8b0fc52990..fafa40d0f9 100644
--- a/rtc_base/BUILD.gn
+++ b/rtc_base/BUILD.gn
@@ -240,6 +240,7 @@ rtc_library("event_tracer") {
"//third_party/abseil-cpp/absl/base:nullability",
"//third_party/abseil-cpp/absl/strings:string_view",
]
+ if (!build_with_mozilla) {
all_dependent_configs = [ "//third_party/perfetto/gn:public_config" ]
if (rtc_use_perfetto) {
if (build_with_chromium) {
@@ -254,6 +255,7 @@ rtc_library("event_tracer") {
} else {
deps += [ "//third_party/perfetto/include/perfetto/tracing" ]
}
+ }
}
rtc_library("histogram_percentile_counter") {