commit cc1d60c3604fcbe529f2c8d5e3c607dc854793cd parent d00bc1ffde28c73bb89ca543269db64ac701b1ed Author: Michael Froman <mfroman@mozilla.com> Date: Thu, 9 Oct 2025 13:28:17 -0500 Bug 1993083 - Vendor libwebrtc from 5782b72f52 Upstream commit: https://webrtc.googlesource.com/src/+/5782b72f52d8a3ce650710f57b367be833f32490 IWYU remainder of rtc_base a holdout of platform specific code Bug: webrtc:42226242 Change-Id: I7f5cbad7ae95e9e9a1b6003c9db8b85cf7930c58 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/399980 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Philipp Hancke <phancke@meta.com> Cr-Commit-Position: refs/heads/main@{#45138} Diffstat:
19 files changed, 82 insertions(+), 76 deletions(-)
diff --git a/third_party/libwebrtc/README.mozilla.last-vendor b/third_party/libwebrtc/README.mozilla.last-vendor @@ -1,4 +1,4 @@ # ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc -libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-09T18:15:50.589993+00:00. +libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-09T18:28:09.753566+00:00. # base of lastest vendoring -dda01caff2 +5782b72f52 diff --git a/third_party/libwebrtc/moz-patch-stack/s0001.patch b/third_party/libwebrtc/moz-patch-stack/s0001.patch @@ -1383,7 +1383,7 @@ index d5ce6105a3..8bfd24de2b 100644 const bool enable_svc_for_simulcast_; std::optional<SimulcastToSvcConverter> simulcast_to_svc_converter_; diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn -index 00bda50b1b..a0bf02c014 100644 +index fc3180f82b..8dd7e93651 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -450,6 +450,12 @@ rtc_library("logging") { diff --git a/third_party/libwebrtc/moz-patch-stack/s0009.patch b/third_party/libwebrtc/moz-patch-stack/s0009.patch @@ -68,11 +68,11 @@ index 56aba5ee63..0923e7aca7 100644 if (number_of_cores <= 0) { RTC_LOG(LS_ERROR) << "Failed to get number of cores"; diff --git a/rtc_base/physical_socket_server.cc b/rtc_base/physical_socket_server.cc -index fa03f59cdc..798034a846 100644 +index 8a2f3f2185..ae982fcc08 100644 --- a/rtc_base/physical_socket_server.cc +++ b/rtc_base/physical_socket_server.cc -@@ -84,7 +84,10 @@ typedef void* SockOptArg; - +@@ -80,7 +80,10 @@ + typedef void* SockOptArg; #endif // WEBRTC_POSIX -#if defined(WEBRTC_POSIX) && !defined(WEBRTC_MAC) && !defined(__native_client__) @@ -80,10 +80,10 @@ index fa03f59cdc..798034a846 100644 +#if defined(WEBRTC_LINUX) +#include <linux/sockios.h> +#endif - int64_t GetSocketRecvTimestamp(int socket) { struct timeval tv_ioctl; -@@ -706,7 +709,7 @@ int PhysicalSocket::TranslateOption(Option opt, int* slevel, int* sopt) { + int ret = ioctl(socket, SIOCGSTAMP, &tv_ioctl); +@@ -700,7 +703,7 @@ int PhysicalSocket::TranslateOption(Option opt, int* slevel, int* sopt) { *slevel = IPPROTO_IP; *sopt = IP_DONTFRAGMENT; break; diff --git a/third_party/libwebrtc/moz-patch-stack/s0010.patch b/third_party/libwebrtc/moz-patch-stack/s0010.patch @@ -15,10 +15,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/2b079067648bfe0d0 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtc_base/physical_socket_server.cc b/rtc_base/physical_socket_server.cc -index 798034a846..68b3a97f77 100644 +index ae982fcc08..b40fe158df 100644 --- a/rtc_base/physical_socket_server.cc +++ b/rtc_base/physical_socket_server.cc -@@ -1556,7 +1556,7 @@ bool PhysicalSocketServer::WaitSelect(int cmsWait, bool process_io) { +@@ -1550,7 +1550,7 @@ bool PhysicalSocketServer::WaitSelect(int cmsWait, bool process_io) { int fd = pdispatcher->GetDescriptor(); // "select"ing a file descriptor that is equal to or larger than // FD_SETSIZE will result in undefined behavior. diff --git a/third_party/libwebrtc/moz-patch-stack/s0027.patch b/third_party/libwebrtc/moz-patch-stack/s0027.patch @@ -1013,7 +1013,7 @@ index 39aa39a41c..b26e30e8bb 100644 "/config/external/nspr", "/nsprpub/lib/ds", diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn -index a0bf02c014..4a24d15362 100644 +index 8dd7e93651..2cc45cee06 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -326,6 +326,7 @@ rtc_library("sample_counter") { @@ -1176,7 +1176,7 @@ index a0bf02c014..4a24d15362 100644 rtc_library("ssl_adapter") { visibility = [ "*" ] -@@ -2341,7 +2365,7 @@ if (rtc_include_tests) { +@@ -2342,7 +2366,7 @@ if (rtc_include_tests) { } } diff --git a/third_party/libwebrtc/moz-patch-stack/s0045.patch b/third_party/libwebrtc/moz-patch-stack/s0045.patch @@ -59,10 +59,10 @@ index 7d2b5416da..74dd7e5818 100644 struct v4l2_capability; diff --git a/rtc_base/platform_thread_types.cc b/rtc_base/platform_thread_types.cc -index f057d4b7c3..61d8af14c2 100644 +index 20bf4afc44..697bedadb9 100644 --- a/rtc_base/platform_thread_types.cc +++ b/rtc_base/platform_thread_types.cc -@@ -52,7 +52,9 @@ PlatformThreadId CurrentThreadId() { +@@ -56,7 +56,9 @@ PlatformThreadId CurrentThreadId() { return static_cast<PlatformThreadId>(pthread_self()); #else // Default implementation for nacl and solaris. diff --git a/third_party/libwebrtc/moz-patch-stack/s0053.patch b/third_party/libwebrtc/moz-patch-stack/s0053.patch @@ -29,7 +29,7 @@ index 7db75d5fd3..d0feb5007c 100644 rtc_library("task_queue_test") { visibility = [ "*" ] diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn -index 4a24d15362..dafb1ef7d9 100644 +index 2cc45cee06..32fc15b51d 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -665,10 +665,14 @@ if (is_mac || is_ios) { diff --git a/third_party/libwebrtc/moz-patch-stack/s0091.patch b/third_party/libwebrtc/moz-patch-stack/s0091.patch @@ -13,7 +13,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/4e7b3c485e549e7e3 1 file changed, 6 insertions(+) diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn -index dafb1ef7d9..3bb1a5e383 100644 +index 32fc15b51d..520e69d413 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -992,6 +992,12 @@ rtc_library("threading") { diff --git a/third_party/libwebrtc/moz-patch-stack/s0092.patch b/third_party/libwebrtc/moz-patch-stack/s0092.patch @@ -7,8 +7,7 @@ Differential Revision: https://phabricator.services.mozilla.com/D211095 Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/0993ae41fb7db1624dedc5cf2278cd5a505f18f5 --- rtc_base/internal/default_socket_server.cc | 4 ++-- - rtc_base/virtual_socket_server.cc | 2 ++ - 2 files changed, 4 insertions(+), 2 deletions(-) + 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtc_base/internal/default_socket_server.cc b/rtc_base/internal/default_socket_server.cc index 1ebe391a2c..8483ca89c7 100644 @@ -32,17 +31,3 @@ index 1ebe391a2c..8483ca89c7 100644 return std::unique_ptr<SocketServer>(new NullSocketServer); #else return std::unique_ptr<SocketServer>(new PhysicalSocketServer); -diff --git a/rtc_base/virtual_socket_server.cc b/rtc_base/virtual_socket_server.cc -index 20ae7890c4..2448679337 100644 ---- a/rtc_base/virtual_socket_server.cc -+++ b/rtc_base/virtual_socket_server.cc -@@ -24,7 +24,9 @@ - #include "rtc_base/event.h" - #include "rtc_base/fake_clock.h" - #include "rtc_base/logging.h" -+#if !defined(WEBRTC_BSD) - #include "rtc_base/physical_socket_server.h" -+#endif - #include "rtc_base/socket_address_pair.h" - #include "rtc_base/thread.h" - #include "rtc_base/time_utils.h" diff --git a/third_party/libwebrtc/moz-patch-stack/s0094.patch b/third_party/libwebrtc/moz-patch-stack/s0094.patch @@ -9,7 +9,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/ee2f06666bcc6d22c 1 file changed, 2 insertions(+) diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn -index 3bb1a5e383..17cfaad615 100644 +index 520e69d413..dfdcef1096 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -1655,6 +1655,7 @@ if (!build_with_mozilla) { diff --git a/third_party/libwebrtc/moz-patch-stack/s0103.patch b/third_party/libwebrtc/moz-patch-stack/s0103.patch @@ -616,7 +616,7 @@ index 605b9bb84a..278e312c85 100644 if (rtc_build_libsrtp) { diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn -index 17cfaad615..c41565c1b8 100644 +index dfdcef1096..fa479fa1ce 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -9,8 +9,8 @@ @@ -630,7 +630,7 @@ index 17cfaad615..c41565c1b8 100644 } rtc_source_set("protobuf_utils") { -@@ -1894,8 +1894,8 @@ if (!rtc_rusty_base64) { +@@ -1895,8 +1895,8 @@ if (!rtc_rusty_base64) { ] } } else { diff --git a/third_party/libwebrtc/moz-patch-stack/s0108.patch b/third_party/libwebrtc/moz-patch-stack/s0108.patch @@ -116,7 +116,7 @@ index b58cb6ba9a..4299453d22 100644 public_configs = [] if (!build_with_chromium) { diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn -index c41565c1b8..36908c4288 100644 +index fa479fa1ce..98f0b3ddbc 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -1534,6 +1534,7 @@ rtc_source_set("ssl_header") { diff --git a/third_party/libwebrtc/rtc_base/BUILD.gn b/third_party/libwebrtc/rtc_base/BUILD.gn @@ -1800,6 +1800,7 @@ rtc_library("rtc_base_tests_utils") { ":async_udp_socket", ":buffer", ":byte_buffer", + ":byte_order", ":checks", ":digest", ":ip_address", diff --git a/third_party/libwebrtc/rtc_base/ifaddrs_android.cc b/third_party/libwebrtc/rtc_base/ifaddrs_android.cc @@ -11,21 +11,26 @@ #if defined(WEBRTC_ANDROID) #include "rtc_base/ifaddrs_android.h" -#include <errno.h> +#include <linux/if.h> +#include <linux/if_addr.h> +#include <linux/in.h> +#include <linux/in6.h> #include <linux/netlink.h> #include <linux/rtnetlink.h> +#include <linux/sockios.h> #include <net/if.h> -#include <netinet/in.h> // no-presubmit-check -#include <stdlib.h> -#include <string.h> -#include <sys/ioctl.h> #include <sys/socket.h> // no-presubmit-check #include <sys/types.h> -#include <sys/utsname.h> #include <unistd.h> +#include <cstdlib> +#include <cstring> +#include <utility> + #include "absl/cleanup/cleanup.h" +namespace webrtc { + namespace { struct netlinkrequest { @@ -33,12 +38,10 @@ struct netlinkrequest { ifaddrmsg msg; }; -const int kMaxReadSize = 4096; +constexpr int kMaxReadSize = 4096; } // namespace -namespace webrtc { - int set_ifname(struct ifaddrs* ifaddr, int interface) { char buf[IFNAMSIZ] = {0}; char* name = if_indextoname(interface, buf); diff --git a/third_party/libwebrtc/rtc_base/physical_socket_server.cc b/third_party/libwebrtc/rtc_base/physical_socket_server.cc @@ -10,6 +10,7 @@ #include "rtc_base/physical_socket_server.h" #include <array> +#include <cerrno> #include <cstdint> #include <cstring> #include <memory> @@ -19,14 +20,19 @@ #include "api/transport/ecn_marking.h" #include "api/units/time_delta.h" #include "api/units/timestamp.h" +#include "rtc_base/async_dns_resolver.h" +#include "rtc_base/checks.h" #include "rtc_base/deprecated/recursive_critical_section.h" +#include "rtc_base/event.h" +#include "rtc_base/ip_address.h" +#include "rtc_base/logging.h" +#include "rtc_base/net_helpers.h" +#include "rtc_base/network_monitor.h" #include "rtc_base/socket.h" #include "rtc_base/socket_address.h" +#include "rtc_base/synchronization/mutex.h" #include "rtc_base/thread_annotations.h" - -#if defined(_MSC_VER) && _MSC_VER < 1300 -#pragma warning(disable : 4786) -#endif +#include "rtc_base/time_utils.h" #ifdef MEMORY_SANITIZER #include <sanitizer/msan_interface.h> @@ -34,9 +40,11 @@ #if defined(WEBRTC_POSIX) #include <fcntl.h> +#include <netinet/tcp.h> // for TCP_NODELAY #if defined(WEBRTC_USE_EPOLL) // "poll" will be used to wait for the signal dispatcher. #include <poll.h> +#include <sys/poll.h> #elif defined(WEBRTC_USE_POLL) #include <poll.h> #endif @@ -53,19 +61,10 @@ #undef SetPort #endif -#include <errno.h> - -#include "rtc_base/async_dns_resolver.h" -#include "rtc_base/checks.h" -#include "rtc_base/event.h" -#include "rtc_base/ip_address.h" -#include "rtc_base/logging.h" -#include "rtc_base/network_monitor.h" -#include "rtc_base/synchronization/mutex.h" -#include "rtc_base/time_utils.h" - #if defined(WEBRTC_LINUX) +#include <asm-generic/socket.h> #include <linux/sockios.h> +#include <sys/epoll.h> #endif #if defined(WEBRTC_WIN) @@ -77,18 +76,14 @@ #endif // WEBRTC_WIN #if defined(WEBRTC_POSIX) -#include <netinet/tcp.h> // for TCP_NODELAY - #define IP_MTU 14 // Until this is integrated from linux/in.h to netinet/in.h typedef void* SockOptArg; - #endif // WEBRTC_POSIX #if defined(WEBRTC_POSIX) && !defined(WEBRTC_MAC) && !defined(WEBRTC_BSD) && !defined(__native_client__) #if defined(WEBRTC_LINUX) #include <linux/sockios.h> #endif - int64_t GetSocketRecvTimestamp(int socket) { struct timeval tv_ioctl; int ret = ioctl(socket, SIOCGSTAMP, &tv_ioctl); @@ -101,7 +96,6 @@ int64_t GetSocketRecvTimestamp(int socket) { } #else - int64_t GetSocketRecvTimestamp(int /* socket */) { return -1; } diff --git a/third_party/libwebrtc/rtc_base/platform_thread_types.cc b/third_party/libwebrtc/rtc_base/platform_thread_types.cc @@ -12,8 +12,13 @@ // IWYU pragma: begin_keep #if defined(WEBRTC_LINUX) +#include <linux/prctl.h> #include <sys/prctl.h> #include <sys/syscall.h> + +#if !defined(WEBRTC_ARCH_ARM) && !defined(WEBRTC_ARCH_ARM64) +#include <asm/unistd_64.h> +#endif #endif #if defined(WEBRTC_WIN) @@ -27,7 +32,6 @@ typedef HRESULT(WINAPI* RTC_SetThreadDescription)(HANDLE hThread, #endif #if defined(WEBRTC_FUCHSIA) -#include <string.h> #include <zircon/syscalls.h> #include "rtc_base/checks.h" diff --git a/third_party/libwebrtc/rtc_base/protobuf_utils.h b/third_party/libwebrtc/rtc_base/protobuf_utils.h @@ -8,7 +8,6 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include <string> #ifndef RTC_BASE_PROTOBUF_UTILS_H_ #define RTC_BASE_PROTOBUF_UTILS_H_ @@ -16,7 +15,9 @@ #if WEBRTC_ENABLE_PROTOBUF #include "third_party/protobuf/src/google/protobuf/message_lite.h" // nogncheck +// IWYU pragma: begin_keep #include "third_party/protobuf/src/google/protobuf/repeated_field.h" // nogncheck +// IWYU pragma: end_keep namespace webrtc { diff --git a/third_party/libwebrtc/rtc_base/virtual_socket_server.cc b/third_party/libwebrtc/rtc_base/virtual_socket_server.cc @@ -10,30 +10,39 @@ #include "rtc_base/virtual_socket_server.h" -#include <errno.h> -#include <math.h> - +#include <algorithm> +#include <cerrno> +#include <cmath> +#include <cstddef> +#include <cstdint> +#include <cstdlib> +#include <cstring> #include <map> #include <memory> +#include <optional> +#include <utility> #include <vector> #include "absl/algorithm/container.h" +#include "api/scoped_refptr.h" #include "api/sequence_checker.h" #include "api/units/time_delta.h" +#include "rtc_base/byte_order.h" #include "rtc_base/checks.h" #include "rtc_base/event.h" #include "rtc_base/fake_clock.h" +#include "rtc_base/ip_address.h" #include "rtc_base/logging.h" -#if !defined(WEBRTC_BSD) -#include "rtc_base/physical_socket_server.h" -#endif +#include "rtc_base/net_helpers.h" +#include "rtc_base/socket.h" +#include "rtc_base/socket_address.h" #include "rtc_base/socket_address_pair.h" +#include "rtc_base/synchronization/mutex.h" #include "rtc_base/thread.h" #include "rtc_base/time_utils.h" namespace webrtc { - #if defined(WEBRTC_WIN) const in_addr kInitialNextIPv4 = {{{0x01, 0, 0, 0}}}; #else diff --git a/third_party/libwebrtc/rtc_base/virtual_socket_server.h b/third_party/libwebrtc/rtc_base/virtual_socket_server.h @@ -11,21 +11,30 @@ #ifndef RTC_BASE_VIRTUAL_SOCKET_SERVER_H_ #define RTC_BASE_VIRTUAL_SOCKET_SERVER_H_ +#include <cstddef> +#include <cstdint> #include <deque> +#include <list> #include <map> +#include <memory> #include <optional> +#include <utility> #include <vector> #include "api/make_ref_counted.h" #include "api/ref_counted_base.h" #include "api/scoped_refptr.h" -#include "api/task_queue/task_queue_base.h" -#include "rtc_base/checks.h" +#include "api/units/time_delta.h" #include "rtc_base/event.h" #include "rtc_base/fake_clock.h" +#include "rtc_base/ip_address.h" +#include "rtc_base/socket.h" +#include "rtc_base/socket_address.h" #include "rtc_base/socket_address_pair.h" #include "rtc_base/socket_server.h" #include "rtc_base/synchronization/mutex.h" +#include "rtc_base/third_party/sigslot/sigslot.h" +#include "rtc_base/thread_annotations.h" namespace webrtc {