tor-browser

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

commit a4faf1dcdbfae2be142aa0be6a159cf6eb920052
parent 03f3899874a5e4a92c7682f94435775fbaf5c7ab
Author: Dan Baker <dbaker@mozilla.com>
Date:   Mon, 27 Oct 2025 17:33:53 -0600

Bug 1995393 - Vendor libwebrtc from d2eaa5570f

Upstream commit: https://webrtc.googlesource.com/src/+/d2eaa5570fc9959f8dbde32912a16366b8ee75f4
    [M141] Add logging while creating {Window|Screen}Capturer

    (cherry picked from commit 6908505ae0eba5d530ad0bb4b37d4654a4f36c95)

    Fixed: chromium:450184498
    Bug: chromium:448881311
    Change-Id: I0f043f58bf831e6822451cac99a8972a054ffdf7
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/414800
    Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
    Reviewed-by: Harald Alvestrand <hta@webrtc.org>
    Commit-Queue: Palak Agarwal <agpalak@google.com>
    Cr-Original-Commit-Position: refs/heads/main@{#45856}
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/415420
    Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
    Cr-Commit-Position: refs/branch-heads/7390@{#3}
    Cr-Branched-From: 2f553bf8d573c90176d51559b76dfc836996c8f5-refs/heads/main@{#45520}

Diffstat:
Mthird_party/libwebrtc/README.mozilla.last-vendor | 4++--
Mthird_party/libwebrtc/modules/desktop_capture/desktop_capturer.cc | 15+++++++++++++++
Mthird_party/libwebrtc/modules/desktop_capture/linux/x11/screen_capturer_x11.cc | 6++++++
Mthird_party/libwebrtc/modules/desktop_capture/linux/x11/window_capturer_x11.cc | 4++++
Mthird_party/libwebrtc/modules/desktop_capture/screen_capturer_darwin.mm | 7+++++++
Mthird_party/libwebrtc/modules/desktop_capture/screen_capturer_fuchsia.cc | 3+++
Mthird_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc | 4++++
Mthird_party/libwebrtc/modules/desktop_capture/screen_capturer_null.cc | 4++++
Mthird_party/libwebrtc/modules/desktop_capture/screen_capturer_win.cc | 6++++++
Mthird_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc | 4++++
Mthird_party/libwebrtc/modules/desktop_capture/window_capturer_mac.mm | 2++
Mthird_party/libwebrtc/modules/desktop_capture/window_capturer_null.cc | 3+++
Mthird_party/libwebrtc/modules/desktop_capture/window_capturer_win.cc | 7+++++++
Mthird_party/libwebrtc/moz-patch-stack/s0001.patch | 4++--
Mthird_party/libwebrtc/moz-patch-stack/s0041.patch | 2+-
15 files changed, 70 insertions(+), 5 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 /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc -libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-27T23:31:33.809715+00:00. +libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-27T23:33:42.628359+00:00. # base of lastest vendoring -bc7452c444 +d2eaa5570f diff --git a/third_party/libwebrtc/modules/desktop_capture/desktop_capturer.cc b/third_party/libwebrtc/modules/desktop_capture/desktop_capturer.cc @@ -21,6 +21,7 @@ #include "modules/desktop_capture/desktop_capturer_differ_wrapper.h" #include "modules/desktop_capture/desktop_geometry.h" #include "modules/desktop_capture/shared_memory.h" +#include "rtc_base/logging.h" #include "system_wrappers/include/metrics.h" #if defined(WEBRTC_WIN) @@ -81,18 +82,26 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateWindowCapturer( #if defined(RTC_ENABLE_WIN_WGC) if (options.allow_wgc_window_capturer() && IsWgcSupported(CaptureType::kWindow)) { + RTC_LOG(LS_INFO) << "video capture: DesktopCapturer::CreateWindowCapturer " + "creates DesktopCapturer of type WgcCapturerWin"; return WgcCapturerWin::CreateRawWindowCapturer(options); } #endif // defined(RTC_ENABLE_WIN_WGC) #if defined(WEBRTC_WIN) if (options.allow_cropping_window_capturer()) { + RTC_LOG(LS_INFO) + << "video capture: DesktopCapturer::CreateWindowCapturer " + "creates DesktopCapturer of type CroppingWindowCapturerWin"; return CroppingWindowCapturer::CreateCapturer(options); } #endif // defined(WEBRTC_WIN) std::unique_ptr<DesktopCapturer> capturer = CreateRawWindowCapturer(options); if (capturer && options.detect_updated_region()) { + RTC_LOG(LS_INFO) << "video capture: DesktopCapturer::CreateWindowCapturer " + "creates DesktopCapturer of type " + "DesktopCapturerDifferWrapper over a base capturer"; capturer.reset(new DesktopCapturerDifferWrapper(std::move(capturer))); } @@ -105,12 +114,18 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateScreenCapturer( #if defined(RTC_ENABLE_WIN_WGC) if (options.allow_wgc_screen_capturer() && IsWgcSupported(CaptureType::kScreen)) { + RTC_LOG(LS_INFO) << "video capture: DesktopCapturer::CreateScreenCapturer " + "creates DesktopCapturer of type WgcCapturerWin"; return WgcCapturerWin::CreateRawScreenCapturer(options); } #endif // defined(RTC_ENABLE_WIN_WGC) std::unique_ptr<DesktopCapturer> capturer = CreateRawScreenCapturer(options); if (capturer && options.detect_updated_region()) { + RTC_LOG(LS_INFO) + << "video capture: DesktopCapturer::CreateScreenCapturer creates " + "DesktopCapturer of type DesktopCapturerDifferWrapper over a base " + "capturer"; capturer.reset(new DesktopCapturerDifferWrapper(std::move(capturer))); } diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/x11/screen_capturer_x11.cc b/third_party/libwebrtc/modules/desktop_capture/linux/x11/screen_capturer_x11.cc @@ -511,8 +511,14 @@ std::unique_ptr<DesktopCapturer> ScreenCapturerX11::CreateRawScreenCapturer( if (!options.x_display()) return nullptr; + RTC_LOG(LS_INFO) + << "video capture: ScreenCapturerX11::CreateRawScreenCapturer creates " + "DesktopCapturer of type ScreenCapturerX11"; std::unique_ptr<ScreenCapturerX11> capturer(new ScreenCapturerX11()); if (!capturer->Init(options)) { + RTC_LOG(LS_INFO) + << "video capture: ScreenCapturerX11::CreateRawScreenCapturer " + "DesktopCapturer is null because it can not be initiated"; return nullptr; } diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_capturer_x11.cc b/third_party/libwebrtc/modules/desktop_capture/linux/x11/window_capturer_x11.cc @@ -256,6 +256,10 @@ std::unique_ptr<DesktopCapturer> WindowCapturerX11::CreateRawWindowCapturer( const DesktopCaptureOptions& options) { if (!options.x_display()) return nullptr; + + RTC_LOG(LS_INFO) + << "video capture: WindowCapturerX11::CreateRawWindowCapturer creates " + "DesktopCapturer of type WindowCapturerX11"; return std::unique_ptr<DesktopCapturer>(new WindowCapturerX11(options)); } diff --git a/third_party/libwebrtc/modules/desktop_capture/screen_capturer_darwin.mm b/third_party/libwebrtc/modules/desktop_capture/screen_capturer_darwin.mm @@ -12,6 +12,7 @@ #include "modules/desktop_capture/mac/screen_capturer_mac.h" #include "modules/desktop_capture/mac/screen_capturer_sck.h" +#include "rtc_base/logging.h" namespace webrtc { @@ -27,10 +28,16 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawScreenCapturer( std::unique_ptr<DesktopCapturer> sck_capturer = CreateScreenCapturerSck(options); if (sck_capturer) { + RTC_LOG(LS_INFO) + << "video capture: DesktopCapturer::CreateRawScreenCapturer creates " + "DesktopCapturer of type ScreenCapturerSck"; return sck_capturer; } } + RTC_LOG(LS_INFO) + << "video capture: DesktopCapturer::CreateRawScreenCapturer creates " + "DesktopCapturer of type ScreenCapturerMac"; auto capturer = std::make_unique<ScreenCapturerMac>(options.configuration_monitor(), options.detect_updated_region(), diff --git a/third_party/libwebrtc/modules/desktop_capture/screen_capturer_fuchsia.cc b/third_party/libwebrtc/modules/desktop_capture/screen_capturer_fuchsia.cc @@ -56,6 +56,9 @@ size_t RoundUpToMultiple(size_t value, size_t multiple) { std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawScreenCapturer( const DesktopCaptureOptions& options) { + RTC_LOG(LS_INFO) + << "video capture: DesktopCapturer::CreateRawScreenCapturer creates " + "DesktopCapturer of type ScreenCapturerFuchsia"; std::unique_ptr<ScreenCapturerFuchsia> capturer(new ScreenCapturerFuchsia()); return capturer; } diff --git a/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc b/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc @@ -13,6 +13,7 @@ #include "modules/desktop_capture/desktop_capture_options.h" #include "modules/desktop_capture/desktop_capture_types.h" #include "modules/desktop_capture/desktop_capturer.h" +#include "rtc_base/logging.h" #if defined(WEBRTC_USE_PIPEWIRE) #include "modules/desktop_capture/linux/wayland/base_capturer_pipewire.h" @@ -29,6 +30,9 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawScreenCapturer( const DesktopCaptureOptions& options) { #if defined(WEBRTC_USE_PIPEWIRE) if (options.allow_pipewire() && BaseCapturerPipeWire::IsSupported()) { + RTC_LOG(LS_INFO) + << "video capture: DesktopCapturer::CreateRawScreenCapturer creates " + "DesktopCapturer of type BaseCapturerPipeWire"; return std::make_unique<BaseCapturerPipeWire>(options, CaptureType::kScreen); } diff --git a/third_party/libwebrtc/modules/desktop_capture/screen_capturer_null.cc b/third_party/libwebrtc/modules/desktop_capture/screen_capturer_null.cc @@ -11,12 +11,16 @@ #include <memory> #include "modules/desktop_capture/desktop_capturer.h" +#include "rtc_base/logging.h" namespace webrtc { // static std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawScreenCapturer( const DesktopCaptureOptions& options) { + RTC_LOG(LS_INFO) + << "video capture: DesktopCapturer::CreateRawScreenCapturer creates null " + "DesktopCapturer"; return nullptr; } diff --git a/third_party/libwebrtc/modules/desktop_capture/screen_capturer_win.cc b/third_party/libwebrtc/modules/desktop_capture/screen_capturer_win.cc @@ -19,6 +19,7 @@ #include "modules/desktop_capture/win/dxgi_duplicator_controller.h" #include "modules/desktop_capture/win/screen_capturer_win_directx.h" #include "modules/desktop_capture/win/screen_capturer_win_gdi.h" +#include "rtc_base/logging.h" namespace webrtc { @@ -26,6 +27,9 @@ namespace { std::unique_ptr<DesktopCapturer> CreateScreenCapturerWinDirectx( const DesktopCaptureOptions& options) { + RTC_LOG(LS_INFO) + << "video capture: DesktopCapturer::CreateRawScreenCapturer creates " + "DesktopCapturer of type ScreenCapturerWinDirectx"; std::unique_ptr<DesktopCapturer> capturer( new ScreenCapturerWinDirectx(options)); capturer.reset(new BlankDetectorDesktopCapturerWrapper( @@ -39,6 +43,8 @@ std::unique_ptr<DesktopCapturer> CreateScreenCapturerWinDirectx( std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawScreenCapturer( const DesktopCaptureOptions& options) { // Default capturer if no options are enabled is GDI. + RTC_LOG(LS_INFO) << "video capture: DesktopCapturer::CreateRawScreenCapturer " + "creates DesktopCapturer of type ScreenCapturerWinGdi"; std::unique_ptr<DesktopCapturer> capturer(new ScreenCapturerWinGdi(options)); // If DirectX is enabled use it as main capturer with GDI as fallback. diff --git a/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc b/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc @@ -13,6 +13,7 @@ #include "modules/desktop_capture/desktop_capture_options.h" #include "modules/desktop_capture/desktop_capture_types.h" #include "modules/desktop_capture/desktop_capturer.h" +#include "rtc_base/logging.h" #if defined(WEBRTC_USE_PIPEWIRE) #include "modules/desktop_capture/linux/wayland/base_capturer_pipewire.h" @@ -29,6 +30,9 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawWindowCapturer( const DesktopCaptureOptions& options) { #if defined(WEBRTC_USE_PIPEWIRE) if (options.allow_pipewire() && BaseCapturerPipeWire::IsSupported()) { + RTC_LOG(LS_INFO) + << "video capture: DesktopCapturer::CreateRawWindowCapturer creates " + "DesktopCapturer of type BaseCapturerPipeWire"; return std::make_unique<BaseCapturerPipeWire>(options, CaptureType::kWindow); } diff --git a/third_party/libwebrtc/modules/desktop_capture/window_capturer_mac.mm b/third_party/libwebrtc/modules/desktop_capture/window_capturer_mac.mm @@ -218,6 +218,8 @@ void WindowCapturerMac::CaptureFrame() { // static std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawWindowCapturer( const DesktopCaptureOptions& options) { + RTC_LOG(LS_INFO) << "video capture: DesktopCapturer::CreateRawWindowCapturer " + "creates DesktopCapturer of type WindowCapturerMac"; return std::unique_ptr<DesktopCapturer>(new WindowCapturerMac( options.full_screen_window_detector(), options.configuration_monitor())); } diff --git a/third_party/libwebrtc/modules/desktop_capture/window_capturer_null.cc b/third_party/libwebrtc/modules/desktop_capture/window_capturer_null.cc @@ -12,6 +12,7 @@ #include "modules/desktop_capture/desktop_capturer.h" #include "rtc_base/checks.h" +#include "rtc_base/logging.h" namespace webrtc { @@ -65,6 +66,8 @@ void WindowCapturerNull::CaptureFrame() { // static std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawWindowCapturer( const DesktopCaptureOptions& options) { + RTC_LOG(LS_INFO) << "video capture: DesktopCapturer::CreateRawWindowCapturer " + "creates DesktopCapturer of type WindowCapturerNull"; return std::unique_ptr<DesktopCapturer>(new WindowCapturerNull()); } diff --git a/third_party/libwebrtc/modules/desktop_capture/window_capturer_win.cc b/third_party/libwebrtc/modules/desktop_capture/window_capturer_win.cc @@ -15,6 +15,7 @@ #include "modules/desktop_capture/desktop_capturer.h" #include "modules/desktop_capture/rgba_color.h" #include "modules/desktop_capture/win/window_capturer_win_gdi.h" +#include "rtc_base/logging.h" #if defined(RTC_ENABLE_WIN_WGC) #include "modules/desktop_capture/blank_detector_desktop_capturer_wrapper.h" @@ -28,6 +29,8 @@ namespace webrtc { // static std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawWindowCapturer( const DesktopCaptureOptions& options) { + RTC_LOG(LS_INFO) << "video capture: DesktopCapturer::CreateRawWindowCapturer " + "creates DesktopCapturer of type WindowCapturerWinGdi"; std::unique_ptr<DesktopCapturer> capturer( WindowCapturerWinGdi::CreateRawWindowCapturer(options)); #if defined(RTC_ENABLE_WIN_WGC) @@ -36,6 +39,10 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawWindowCapturer( // BlankDectector capturer will send an error when it detects a failed // GDI rendering, then Fallback capturer will try to capture it again with // WGC. + RTC_LOG(LS_INFO) + << "video capture: DesktopCapturer::CreateRawWindowCapturer creates " + "DesktopCapturer of type FallbackDesktopCapturerWrapper which has a " + "fallback capturer of type WgcCapturerWin"; capturer = std::make_unique<BlankDetectorDesktopCapturerWrapper>( std::move(capturer), RgbaColor(0, 0, 0, 0), /*check_per_capture*/ true); diff --git a/third_party/libwebrtc/moz-patch-stack/s0001.patch b/third_party/libwebrtc/moz-patch-stack/s0001.patch @@ -521,7 +521,7 @@ index 732aa4d29d..50a3147b31 100644 x_display_->AddEventHandler(xfixes_event_base_ + XFixesCursorNotify, this); diff --git a/modules/desktop_capture/linux/x11/screen_capturer_x11.cc b/modules/desktop_capture/linux/x11/screen_capturer_x11.cc -index 90dd797cb3..158e2cc90a 100644 +index f10dcabc7e..3a60fa935f 100644 --- a/modules/desktop_capture/linux/x11/screen_capturer_x11.cc +++ b/modules/desktop_capture/linux/x11/screen_capturer_x11.cc @@ -307,7 +307,7 @@ bool ScreenCapturerX11::GetSourceList(SourceList* sources) { @@ -534,7 +534,7 @@ index 90dd797cb3..158e2cc90a 100644 } diff --git a/modules/desktop_capture/linux/x11/window_capturer_x11.cc b/modules/desktop_capture/linux/x11/window_capturer_x11.cc -index 8e592ff2d9..d39a3a2361 100644 +index 9505205b76..9e5a4dc337 100644 --- a/modules/desktop_capture/linux/x11/window_capturer_x11.cc +++ b/modules/desktop_capture/linux/x11/window_capturer_x11.cc @@ -62,6 +62,7 @@ bool WindowCapturerX11::GetSourceList(SourceList* sources) { diff --git a/third_party/libwebrtc/moz-patch-stack/s0041.patch b/third_party/libwebrtc/moz-patch-stack/s0041.patch @@ -10,7 +10,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/1495ca5ef535f8ad6 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/desktop_capture/window_capturer_mac.mm b/modules/desktop_capture/window_capturer_mac.mm -index a1e6157b87..6dd310682b 100644 +index 731090d3fb..dbfac7fa28 100644 --- a/modules/desktop_capture/window_capturer_mac.mm +++ b/modules/desktop_capture/window_capturer_mac.mm @@ -169,9 +169,10 @@ void WindowCapturerMac::CaptureFrame() {