tor-browser

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

commit 82c86cf43b5be8299f2f2985c97c9284799ebcc5
parent 77deeee95332aa784f0772c8fa7c06182582d25d
Author: Michael Froman <mfroman@mozilla.com>
Date:   Wed,  8 Oct 2025 23:23:33 -0500

Bug 1993083 - Vendor libwebrtc from 896e528596

Upstream commit: https://webrtc.googlesource.com/src/+/896e528596938535aae0bbb56dd59087fa8ff5ca
    IWYU rtc_base (threading-related)

    using the usual
      find rtc_base -name "*.h" -o -name "*.cc" | xargs tools_webrtc/iwyu/apply-include-cleaner
    followed by
      tools_webrtc/gn_check_autofix.py -C out/Default
    followed by
      git cl format

    and manual resolution or reverts of files that require a more
    focused review.

    pthread <bits/*.h> was added to the IWYU scripts gnore list.

    Split from
      https://webrtc-review.googlesource.com/c/src/+/398903

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

Diffstat:
Mthird_party/libwebrtc/README.mozilla.last-vendor | 4++--
Mthird_party/libwebrtc/moz-patch-stack/s0103.patch | 2+-
Mthird_party/libwebrtc/rtc_base/event.cc | 20++++++++++++--------
Mthird_party/libwebrtc/rtc_base/event.h | 6+++---
Mthird_party/libwebrtc/rtc_base/event_unittest.cc | 1+
Mthird_party/libwebrtc/rtc_base/platform_thread.h | 7+------
Mthird_party/libwebrtc/rtc_base/platform_thread_types.h | 5+++++
Mthird_party/libwebrtc/rtc_base/platform_thread_unittest.cc | 4+++-
Mthird_party/libwebrtc/rtc_base/synchronization/BUILD.gn | 2++
Mthird_party/libwebrtc/rtc_base/synchronization/mutex.h | 3---
Mthird_party/libwebrtc/rtc_base/synchronization/mutex_benchmark.cc | 2++
Mthird_party/libwebrtc/rtc_base/synchronization/mutex_pthread.h | 8+++++---
Mthird_party/libwebrtc/rtc_base/synchronization/mutex_unittest.cc | 11+++--------
Mthird_party/libwebrtc/rtc_base/synchronization/sequence_checker_internal.h | 1+
Mthird_party/libwebrtc/rtc_base/synchronization/yield_policy.cc | 1-
Mthird_party/libwebrtc/rtc_base/thread.h | 19+++++++++----------
Mthird_party/libwebrtc/tools_webrtc/iwyu/apply_include_cleaner.py | 15++++++++-------
17 files changed, 58 insertions(+), 53 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-09T04:22:20.369232+00:00. +libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-09T04:23:24.044634+00:00. # base of lastest vendoring -2a2119e895 +896e528596 diff --git a/third_party/libwebrtc/moz-patch-stack/s0103.patch b/third_party/libwebrtc/moz-patch-stack/s0103.patch @@ -657,7 +657,7 @@ index 9a55af3ea9..3d272ba975 100644 rtc_library("aligned_malloc") { diff --git a/rtc_base/synchronization/BUILD.gn b/rtc_base/synchronization/BUILD.gn -index 934f71d31d..e359df920a 100644 +index 2a197152b9..4d5008874e 100644 --- a/rtc_base/synchronization/BUILD.gn +++ b/rtc_base/synchronization/BUILD.gn @@ -8,8 +8,8 @@ diff --git a/third_party/libwebrtc/rtc_base/event.cc b/third_party/libwebrtc/rtc_base/event.cc @@ -10,24 +10,28 @@ #include "rtc_base/event.h" +#include <cstdint> +#include <optional> + +#include "api/units/time_delta.h" +#include "rtc_base/checks.h" +#include "rtc_base/synchronization/yield_policy.h" +#include "rtc_base/system/warn_current_thread_is_deadlocked.h" +#include "rtc_base/time_utils.h" + #if defined(WEBRTC_WIN) #include <windows.h> #elif defined(WEBRTC_POSIX) #include <errno.h> #include <pthread.h> -#include <sys/time.h> #include <time.h> +#if defined(WEBRTC_MAC) +#include <sys/time.h> +#endif #else #error "Must define either WEBRTC_WIN or WEBRTC_POSIX." #endif -#include <optional> - -#include "rtc_base/checks.h" -#include "rtc_base/synchronization/yield_policy.h" -#include "rtc_base/system/warn_current_thread_is_deadlocked.h" -#include "rtc_base/time_utils.h" - namespace webrtc { Event::Event() : Event(false, false) {} diff --git a/third_party/libwebrtc/rtc_base/event.h b/third_party/libwebrtc/rtc_base/event.h @@ -12,17 +12,17 @@ #define RTC_BASE_EVENT_H_ #include "api/units/time_delta.h" +#include "rtc_base/checks.h" +#include "rtc_base/synchronization/yield_policy.h" #if defined(WEBRTC_WIN) #include <windows.h> #elif defined(WEBRTC_POSIX) -#include <pthread.h> +#include <pthread.h> // IWYU pragma: keep #else #error "Must define either WEBRTC_WIN or WEBRTC_POSIX." #endif -#include "rtc_base/synchronization/yield_policy.h" - namespace webrtc { // RTC_DISALLOW_WAIT() utility diff --git a/third_party/libwebrtc/rtc_base/event_unittest.cc b/third_party/libwebrtc/rtc_base/event_unittest.cc @@ -11,6 +11,7 @@ #include "rtc_base/event.h" #include "api/units/time_delta.h" +#include "rtc_base/checks.h" #include "rtc_base/platform_thread.h" #include "system_wrappers/include/clock.h" #include "test/gtest.h" diff --git a/third_party/libwebrtc/rtc_base/platform_thread.h b/third_party/libwebrtc/rtc_base/platform_thread.h @@ -12,15 +12,10 @@ #define RTC_BASE_PLATFORM_THREAD_H_ #include <functional> -#include <string> -#if !defined(WEBRTC_WIN) -#include <pthread.h> -#endif - #include <optional> #include "absl/strings/string_view.h" -#include "rtc_base/platform_thread_types.h" +#include "rtc_base/platform_thread_types.h" // IWYU pragma: keep namespace webrtc { diff --git a/third_party/libwebrtc/rtc_base/platform_thread_types.h b/third_party/libwebrtc/rtc_base/platform_thread_types.h @@ -21,6 +21,7 @@ #include <winsock2.h> #include <windows.h> #elif defined(WEBRTC_FUCHSIA) +#include <pthread.h> #include <zircon/types.h> #include <zircon/process.h> #elif defined(WEBRTC_POSIX) @@ -33,6 +34,10 @@ // clang-format on // IWYU pragma: end_exports +#if !defined(WEBRTC_WIN) +#include <sched.h> +#endif + namespace webrtc { #if defined(WEBRTC_WIN) typedef DWORD PlatformThreadId; diff --git a/third_party/libwebrtc/rtc_base/platform_thread_unittest.cc b/third_party/libwebrtc/rtc_base/platform_thread_unittest.cc @@ -11,9 +11,11 @@ #include "rtc_base/platform_thread.h" #include <optional> +#include <utility> +#include "api/units/time_delta.h" #include "rtc_base/event.h" -#include "test/gmock.h" +#include "test/gtest.h" namespace webrtc { diff --git a/third_party/libwebrtc/rtc_base/synchronization/BUILD.gn b/third_party/libwebrtc/rtc_base/synchronization/BUILD.gn @@ -87,9 +87,11 @@ if (rtc_include_tests && rtc_enable_google_benchmarks) { ":yield", ":yield_policy", "..:checks", + "..:macromagic", "..:platform_thread", "..:rtc_event", "..:threading", + "../../api/units:time_delta", "../../test:test_support", "//third_party/google_benchmark", ] diff --git a/third_party/libwebrtc/rtc_base/synchronization/mutex.h b/third_party/libwebrtc/rtc_base/synchronization/mutex.h @@ -11,10 +11,7 @@ #ifndef RTC_BASE_SYNCHRONIZATION_MUTEX_H_ #define RTC_BASE_SYNCHRONIZATION_MUTEX_H_ -#include <atomic> - #include "absl/base/attributes.h" -#include "rtc_base/checks.h" #include "rtc_base/thread_annotations.h" #if defined(WEBRTC_ABSL_MUTEX) diff --git a/third_party/libwebrtc/rtc_base/synchronization/mutex_benchmark.cc b/third_party/libwebrtc/rtc_base/synchronization/mutex_benchmark.cc @@ -8,6 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ +#include <cstdint> + #include "benchmark/benchmark.h" #include "rtc_base/synchronization/mutex.h" #include "rtc_base/system/unused.h" diff --git a/third_party/libwebrtc/rtc_base/synchronization/mutex_pthread.h b/third_party/libwebrtc/rtc_base/synchronization/mutex_pthread.h @@ -14,14 +14,16 @@ #if defined(WEBRTC_POSIX) #include <pthread.h> -#if defined(WEBRTC_MAC) -#include <pthread_spis.h> -#endif #include "absl/base/attributes.h" +#include "rtc_base/checks.h" #include "rtc_base/system/no_unique_address.h" #include "rtc_base/thread_annotations.h" +#if defined(WEBRTC_MAC) +#include <pthread_spis.h> +#endif + namespace webrtc { class RTC_LOCKABLE MutexImpl final { diff --git a/third_party/libwebrtc/rtc_base/synchronization/mutex_unittest.cc b/third_party/libwebrtc/rtc_base/synchronization/mutex_unittest.cc @@ -10,27 +10,22 @@ #include "rtc_base/synchronization/mutex.h" -#include <stddef.h> -#include <stdint.h> - #include <atomic> +#include <cstddef> #include <memory> -#include <type_traits> #include <utility> #include <vector> +#include "api/units/time_delta.h" #include "benchmark/benchmark.h" -#include "rtc_base/checks.h" #include "rtc_base/event.h" -#include "rtc_base/platform_thread.h" #include "rtc_base/synchronization/yield.h" #include "rtc_base/thread.h" +#include "rtc_base/thread_annotations.h" #include "test/gtest.h" namespace webrtc { namespace { - - constexpr int kNumThreads = 16; template <class MutexType> diff --git a/third_party/libwebrtc/rtc_base/synchronization/sequence_checker_internal.h b/third_party/libwebrtc/rtc_base/synchronization/sequence_checker_internal.h @@ -14,6 +14,7 @@ #include <type_traits> #include "api/task_queue/task_queue_base.h" +#include "rtc_base/checks.h" #include "rtc_base/platform_thread_types.h" #include "rtc_base/synchronization/mutex.h" #include "rtc_base/system/rtc_export.h" diff --git a/third_party/libwebrtc/rtc_base/synchronization/yield_policy.cc b/third_party/libwebrtc/rtc_base/synchronization/yield_policy.cc @@ -11,7 +11,6 @@ #include "absl/base/attributes.h" #include "absl/base/config.h" -#include "rtc_base/checks.h" #if !defined(ABSL_HAVE_THREAD_LOCAL) && defined(WEBRTC_POSIX) #include <pthread.h> #endif diff --git a/third_party/libwebrtc/rtc_base/thread.h b/third_party/libwebrtc/rtc_base/thread.h @@ -11,9 +11,10 @@ #ifndef RTC_BASE_THREAD_H_ #define RTC_BASE_THREAD_H_ -#include <stdint.h> - -#include <list> +#include <atomic> +#include <cstddef> +#include <cstdint> +#include <functional> #include <map> #include <memory> #include <queue> @@ -23,24 +24,22 @@ #include <utility> #include <vector> -#include "absl/strings/string_view.h" - -#if defined(WEBRTC_POSIX) -#include <pthread.h> -#endif -#include "absl/base/attributes.h" #include "absl/functional/any_invocable.h" +#include "absl/strings/string_view.h" #include "api/function_view.h" #include "api/location.h" #include "api/task_queue/task_queue_base.h" #include "api/units/time_delta.h" #include "rtc_base/checks.h" -#include "rtc_base/platform_thread_types.h" #include "rtc_base/socket_server.h" #include "rtc_base/synchronization/mutex.h" #include "rtc_base/system/rtc_export.h" #include "rtc_base/thread_annotations.h" +#if defined(WEBRTC_POSIX) +#include <pthread.h> // IWYU pragma: keep +#endif + #if defined(WEBRTC_WIN) #include "rtc_base/win32.h" #endif diff --git a/third_party/libwebrtc/tools_webrtc/iwyu/apply_include_cleaner.py b/third_party/libwebrtc/tools_webrtc/iwyu/apply_include_cleaner.py @@ -68,14 +68,15 @@ _IWYU_MAPPING = { # Supported file suffices. _SUFFICES = [".cc", ".h"] -# Ignored headers, used with `clang-include-cleaner --ignore-headers=` +# Ignored headers, regexps used with `clang-include-cleaner --ignore-headers=` _IGNORED_HEADERS = [ - ".pb.h", # generated protobuf files. - "pipewire/.*.h", # pipewire. - "spa/.*.h", # pipewire. - "openssl/.*.h", # openssl/boringssl. - "alsa/.*.h", # ALSA. - "pulse/.*.h", # PulseAudio. + "\\.pb\\.h", # generated protobuf files. + "pipewire\\/.*\\.h", # pipewire. + "spa\\/.*\\.h", # pipewire. + "openssl\\/.*\\.h", # openssl/boringssl. + "alsa\\/.*\\.h", # ALSA. + "pulse\\/.*\\.h", # PulseAudio. + "bits\\/.*\\.h", # pthreads. ] _SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))