tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit a8df7413aca37c2371b775f6c1d189bf4b6c44c3
parent 8c2df7df005f63109c905256d5a48d231458fc0e
Author: Michael Froman <mfroman@mozilla.com>
Date:   Thu,  9 Oct 2025 13:08:17 -0500

Bug 1993083 - Vendor libwebrtc from 59489f589b

Upstream commit: https://webrtc.googlesource.com/src/+/59489f589b69ef3e8765ced25ecd5806e2891f2e
    IWYU rtc_base even more

    IP addresses + threads.

    Bug: webrtc:42226242
    Change-Id: Ic96cc66867bd1a41bb73d9ee91aa0fede179cf90
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/399680
    Reviewed-by: Harald Alvestrand <hta@webrtc.org>
    Commit-Queue: Philipp Hancke <phancke@meta.com>
    Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#45131}

Diffstat:
Mthird_party/libwebrtc/README.mozilla.last-vendor | 4++--
Mthird_party/libwebrtc/moz-patch-stack/s0001.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0009.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0027.patch | 4++--
Mthird_party/libwebrtc/moz-patch-stack/s0053.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0091.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0094.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0103.patch | 2+-
Mthird_party/libwebrtc/moz-patch-stack/s0108.patch | 2+-
Mthird_party/libwebrtc/rtc_base/BUILD.gn | 1+
Mthird_party/libwebrtc/rtc_base/async_dns_resolver.cc | 4++++
Mthird_party/libwebrtc/rtc_base/byte_order.h | 10+++++-----
Mthird_party/libwebrtc/rtc_base/event.cc | 4++--
Mthird_party/libwebrtc/rtc_base/ip_address.cc | 14++++++++------
Mthird_party/libwebrtc/rtc_base/ip_address.h | 21++++++++++-----------
Mthird_party/libwebrtc/rtc_base/ip_address_unittest.cc | 9+++++++++
Mthird_party/libwebrtc/rtc_base/platform_thread.h | 4++++
Mthird_party/libwebrtc/rtc_base/synchronization/yield.cc | 1-
Mthird_party/libwebrtc/rtc_base/third_party/sigslot/sigslot.cc | 9+++++----
Mthird_party/libwebrtc/tools_webrtc/iwyu/apply_include_cleaner.py | 10+++++++++-
Mthird_party/libwebrtc/tools_webrtc/iwyu/apply_include_cleaner_test.py | 11+++++++++++
21 files changed, 79 insertions(+), 41 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-09T17:52:54.252329+00:00. +libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-09T18:08:08.046225+00:00. # base of lastest vendoring -4ea937a55c +59489f589b 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 cfbdae4c23..e2481ce813 100644 +index 6e903964a6..97f4bb2289 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 @@ -42,7 +42,7 @@ index 6452a3c235..9f7f3ea508 100644 int32_t DeviceInfoV4l2::Init() { return 0; diff --git a/rtc_base/byte_order.h b/rtc_base/byte_order.h -index cd4fd421ca..c8efa9ac83 100644 +index ba58571aca..dddaf9600b 100644 --- a/rtc_base/byte_order.h +++ b/rtc_base/byte_order.h @@ -90,6 +90,8 @@ 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 e2481ce813..5d98f2c0be 100644 +index 97f4bb2289..e9240a6ba0 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -326,6 +326,7 @@ rtc_library("sample_counter") { @@ -1176,7 +1176,7 @@ index e2481ce813..5d98f2c0be 100644 rtc_library("ssl_adapter") { visibility = [ "*" ] -@@ -2328,7 +2352,7 @@ if (rtc_include_tests) { +@@ -2329,7 +2353,7 @@ if (rtc_include_tests) { } } 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 5d98f2c0be..956aac290d 100644 +index e9240a6ba0..14d4b43f5d 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 956aac290d..c731d0d0c3 100644 +index 14d4b43f5d..0f341c91e2 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/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 c731d0d0c3..73b8c89fb1 100644 +index 0f341c91e2..57818dce97 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -1643,6 +1643,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 73b8c89fb1..28fd1f0e90 100644 +index 57818dce97..6a36625b00 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -9,8 +9,8 @@ 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 6f2dc22e00..e3ee0fe861 100644 public_configs = [] if (!build_with_chromium) { diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn -index 28fd1f0e90..b4451f9ffe 100644 +index 6a36625b00..a6fa96e1d5 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -1522,6 +1522,7 @@ rtc_source_set("ssl_header") { diff --git a/third_party/libwebrtc/rtc_base/BUILD.gn b/third_party/libwebrtc/rtc_base/BUILD.gn @@ -2264,6 +2264,7 @@ if (rtc_include_tests) { ":async_udp_socket", ":buffer", ":buffer_queue", + ":byte_order", ":checks", ":crc32", ":crypto_random", diff --git a/third_party/libwebrtc/rtc_base/async_dns_resolver.cc b/third_party/libwebrtc/rtc_base/async_dns_resolver.cc @@ -31,6 +31,10 @@ #include "rtc_base/synchronization/mutex.h" #include "rtc_base/thread_annotations.h" +#if defined(WEBRTC_POSIX) +#include <netdb.h> +#endif + #if defined(WEBRTC_MAC) || defined(WEBRTC_IOS) #include <dispatch/dispatch.h> #endif diff --git a/third_party/libwebrtc/rtc_base/byte_order.h b/third_party/libwebrtc/rtc_base/byte_order.h @@ -11,15 +11,16 @@ #ifndef RTC_BASE_BYTE_ORDER_H_ #define RTC_BASE_BYTE_ORDER_H_ -#include <stdint.h> - +#include <cstdint> +#include <cstdlib> #include <cstring> +#include "rtc_base/system/arch.h" // IWYU pragma: keep + #if defined(WEBRTC_POSIX) && !defined(__native_client__) -#include <arpa/inet.h> +#include <arpa/inet.h> // IWYU pragma: keep #endif -#include "rtc_base/system/arch.h" #if defined(WEBRTC_MAC) #include <libkern/OSByteOrder.h> @@ -41,7 +42,6 @@ #elif defined(WEBRTC_WIN) || defined(__native_client__) #if defined(WEBRTC_WIN) -#include <stdlib.h> #include <winsock2.h> #else #include <netinet/in.h> // no-presubmit-check diff --git a/third_party/libwebrtc/rtc_base/event.cc b/third_party/libwebrtc/rtc_base/event.cc @@ -24,10 +24,10 @@ #elif defined(WEBRTC_POSIX) #include <errno.h> #include <pthread.h> -#include <time.h> -#if defined(WEBRTC_MAC) +#ifdef WEBRTC_MAC #include <sys/time.h> #endif +#include <time.h> #else #error "Must define either WEBRTC_WIN or WEBRTC_POSIX." #endif diff --git a/third_party/libwebrtc/rtc_base/ip_address.cc b/third_party/libwebrtc/rtc_base/ip_address.cc @@ -8,11 +8,19 @@ * be found in the AUTHORS file in the root of the source tree. */ +#include "rtc_base/ip_address.h" + #include <cstddef> #include <cstdint> #include <cstdio> #include <cstring> #include <string> + +#include "absl/strings/string_view.h" +#include "rtc_base/byte_order.h" +#include "rtc_base/net_helpers.h" +#include "rtc_base/string_utils.h" + #if defined(WEBRTC_POSIX) #ifdef OPENBSD #include <netinet/in_systm.h> @@ -22,12 +30,6 @@ #include <netdb.h> #endif -#include "absl/strings/string_view.h" -#include "rtc_base/byte_order.h" -#include "rtc_base/ip_address.h" -#include "rtc_base/net_helpers.h" -#include "rtc_base/string_utils.h" - namespace webrtc { // Prefixes used for categorizing IPv6 addresses. diff --git a/third_party/libwebrtc/rtc_base/ip_address.h b/third_party/libwebrtc/rtc_base/ip_address.h @@ -12,27 +12,26 @@ #define RTC_BASE_IP_ADDRESS_H_ #include <cstdint> +#include <cstring> +#include <string> + +#include "absl/strings/string_view.h" +#include "rtc_base/byte_order.h" +#include "rtc_base/net_helpers.h" +#include "rtc_base/system/rtc_export.h" + #if defined(WEBRTC_POSIX) #include <arpa/inet.h> // IWYU pragma: keep #include <netdb.h> #include <netinet/in.h> // IWYU pragma: export - -#include "absl/strings/string_view.h" #endif + #if defined(WEBRTC_WIN) #include <ws2tcpip.h> -#endif -#include <string.h> - -#include <string> -#include "rtc_base/byte_order.h" -#if defined(WEBRTC_WIN) #include "rtc_base/win32.h" #endif -#include "absl/strings/string_view.h" -#include "rtc_base/net_helpers.h" -#include "rtc_base/system/rtc_export.h" + namespace webrtc { enum IPv6AddressFlag { diff --git a/third_party/libwebrtc/rtc_base/ip_address_unittest.cc b/third_party/libwebrtc/rtc_base/ip_address_unittest.cc @@ -10,9 +10,18 @@ #include "rtc_base/ip_address.h" +#include <cstring> +#include <string> + #include "absl/strings/string_view.h" +#include "rtc_base/byte_order.h" +#include "rtc_base/net_helpers.h" #include "test/gtest.h" +#if defined(WEBRTC_POSIX) +#include <netdb.h> +#endif + namespace webrtc { static const unsigned int kIPv4AddrSize = 4; diff --git a/third_party/libwebrtc/rtc_base/platform_thread.h b/third_party/libwebrtc/rtc_base/platform_thread.h @@ -17,6 +17,10 @@ #include "absl/strings/string_view.h" #include "rtc_base/platform_thread_types.h" // IWYU pragma: keep +#if !defined(WEBRTC_WIN) +#include <pthread.h> // IWYU pragma: keep +#endif + namespace webrtc { enum class ThreadPriority { diff --git a/third_party/libwebrtc/rtc_base/synchronization/yield.cc b/third_party/libwebrtc/rtc_base/synchronization/yield.cc @@ -13,7 +13,6 @@ #if defined(WEBRTC_WIN) #include <windows.h> #else -#include <sched.h> #include <time.h> #endif diff --git a/third_party/libwebrtc/rtc_base/third_party/sigslot/sigslot.cc b/third_party/libwebrtc/rtc_base/third_party/sigslot/sigslot.cc @@ -8,15 +8,16 @@ #include "rtc_base/third_party/sigslot/sigslot.h" -namespace sigslot { - #ifdef _SIGSLOT_HAS_POSIX_THREADS +#include <pthread.h> + +namespace sigslot { pthread_mutex_t* multi_threaded_global::get_mutex() { static pthread_mutex_t g_mutex = PTHREAD_MUTEX_INITIALIZER; return &g_mutex; } -#endif // _SIGSLOT_HAS_POSIX_THREADS - } // namespace sigslot + +#endif // _SIGSLOT_HAS_POSIX_THREADS diff --git a/third_party/libwebrtc/tools_webrtc/iwyu/apply_include_cleaner.py b/third_party/libwebrtc/tools_webrtc/iwyu/apply_include_cleaner.py @@ -55,10 +55,12 @@ _EXTRA_ARGS = [ _GTEST_KEY = '"gtest/gtest.h"' _GTEST_VALUE = '"test/gtest.h"' _IWYU_MAPPING = { + # Literal matches not followed e.g. by IWYU pragma. '"gmock/gmock.h"': '"test/gmock.h"', _GTEST_KEY: _GTEST_VALUE, '<sys/socket.h>': '"rtc_base/net_helpers.h"', - +} +_IWYU_THIRD_PARTY = { # IWYU does not refer to the complete third_party/ path. '"libyuv/': '"third_party/libyuv/include/libyuv/', '"aom/': '"third_party/libaom/source/libaom/aom/', @@ -205,6 +207,12 @@ def _modified_content(content: str) -> str: modified_content, flags=re.MULTILINE) for key, value in _IWYU_MAPPING.items(): + # These must be exact matches, e.g. not having a trailing IWYU pragma. + modified_content = re.sub(rf'^#include {re.escape(key)}$', + f'#include {value}', + modified_content, + flags=re.MULTILINE) + for key, value in _IWYU_THIRD_PARTY.items(): modified_content = re.sub(rf'^#include {re.escape(key)}', f'#include {value}', modified_content, diff --git a/third_party/libwebrtc/tools_webrtc/iwyu/apply_include_cleaner_test.py b/third_party/libwebrtc/tools_webrtc/iwyu/apply_include_cleaner_test.py @@ -45,6 +45,17 @@ class ApplyIncludeCleanerTest(unittest.TestCase): '#include "third_party/libyuv/include/libyuv/something.h"') @mock.patch('subprocess.run', + return_value=mock.Mock(stdout=_OUTPUT, returncode=0)) + def test_pragma_no_modification(self, mock_subprocess): + file = mock.Mock() + file.read_text.return_value = '#include <sys/socket.h> // IWYU' + output = apply_include_cleaner.apply_include_cleaner_to_file( + file, should_modify=True, cmd=[]) + self.assertEqual(output, self._OUTPUT) + mock_subprocess.assert_called_once() + file.write_text.assert_not_called() + + @mock.patch('subprocess.run', return_value=mock.Mock(stdout=f'+ {_GTEST_KEY}\n', returncode=0)) def test_gtest_output_modification(self, mock_subprocess):