commit 77deeee95332aa784f0772c8fa7c06182582d25d parent 7a2ee012715e41f722b35ca3397d430c839f9c9a Author: Michael Froman <mfroman@mozilla.com> Date: Wed, 8 Oct 2025 23:22:29 -0500 Bug 1993083 - Vendor libwebrtc from 2a2119e895 Upstream commit: https://webrtc.googlesource.com/src/+/2a2119e89549a3e5267768868534b69c7c651b66 Add histogram to track when FullScreenDetector heuristic is not used The histogram 'WebRTC.Screenshare.FullScreenHeuristicNotUsedInSameTitleWindows' will track when the FullScreenDetector heuristic is not used to find a slide show for an editor window. This happens in situations when multiple editor window with the same title exist. Bug: chromium:409473386 Change-Id: I3a4533f5b9486aa19d52ec545bf92c0e74ab9c00 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/398920 Reviewed-by: Alexander Cooper <alcooper@chromium.org> Commit-Queue: Palak Agarwal <agpalak@google.com> Cr-Commit-Position: refs/heads/main@{#45114} Diffstat:
3 files changed, 29 insertions(+), 3 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:21:16.462311+00:00. +libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-09T04:22:20.369232+00:00. # base of lastest vendoring -b01ae85f9a +2a2119e895 diff --git a/third_party/libwebrtc/modules/desktop_capture/win/full_screen_win_application_handler.cc b/third_party/libwebrtc/modules/desktop_capture/win/full_screen_win_application_handler.cc @@ -27,6 +27,13 @@ #include "modules/desktop_capture/full_screen_application_handler.h" #include "rtc_base/logging.h" // For RTC_LOG_GLE #include "rtc_base/string_utils.h" +#include "system_wrappers/include/metrics.h" + +void RecordFullScreenDetectorResult(FullScreenDetectorResult result) { + RTC_HISTOGRAM_ENUMERATION( + "WebRTC.Screenshare.FullscreenDetectorResult", static_cast<int>(result), + static_cast<int>(FullScreenDetectorResult::kMaxValue)); +} namespace webrtc { namespace { @@ -101,7 +108,8 @@ DesktopCapturer::SourceList GetProcessWindows( FullScreenPowerPointHandler::FullScreenPowerPointHandler( DesktopCapturer::SourceId sourceId) - : FullScreenApplicationHandler(sourceId) {} + : FullScreenApplicationHandler(sourceId), + full_screen_detector_result_(FullScreenDetectorResult::kUnknown) {} DesktopCapturer::SourceId FullScreenPowerPointHandler::FindFullScreenWindow( const DesktopCapturer::SourceList& window_list, @@ -127,6 +135,7 @@ DesktopCapturer::SourceId FullScreenPowerPointHandler::FindFullScreenWindow( DesktopCapturer::SourceId full_screen_slide_show_id = 0; const std::string original_document_title = GetDocumentTitleFromEditor(original_window); + auto result = FullScreenDetectorResult::kUnknown; for (const auto& source : powerpoint_windows) { HWND window = reinterpret_cast<HWND>(source.id); @@ -135,6 +144,7 @@ DesktopCapturer::SourceId FullScreenPowerPointHandler::FindFullScreenWindow( // slide show. if (GetWindowType(window) == WindowType::kEditor && GetDocumentTitleFromEditor(window) == original_document_title) { + result = FullScreenDetectorResult::kFailureDueToSameTitleWindows; return 0; } @@ -142,9 +152,14 @@ DesktopCapturer::SourceId FullScreenPowerPointHandler::FindFullScreenWindow( // document. if (GetWindowType(window) == WindowType::kSlideShow && GetDocumentTitleFromSlideShow(window) == original_document_title) { + result = FullScreenDetectorResult::kSuccess; full_screen_slide_show_id = source.id; } } + if (full_screen_detector_result_ != result) { + full_screen_detector_result_ = result; + RecordFullScreenDetectorResult(result); + } return full_screen_slide_show_id; } diff --git a/third_party/libwebrtc/modules/desktop_capture/win/full_screen_win_application_handler.h b/third_party/libwebrtc/modules/desktop_capture/win/full_screen_win_application_handler.h @@ -20,6 +20,15 @@ #include "modules/desktop_capture/desktop_capturer.h" #include "modules/desktop_capture/full_screen_application_handler.h" +// Used for metrics; Entries should not be renumbered and numeric values should +// never be reused. +enum class FullScreenDetectorResult { + kUnknown = 0, + kSuccess = 1, + kFailureDueToSameTitleWindows = 2, + kMaxValue = kFailureDueToSameTitleWindows +}; + namespace webrtc { class FullScreenPowerPointHandler : public FullScreenApplicationHandler { @@ -52,6 +61,8 @@ class FullScreenPowerPointHandler : public FullScreenApplicationHandler { bool IsEditorWindow(HWND window) const; bool IsSlideShowWindow(HWND window) const; + + mutable FullScreenDetectorResult full_screen_detector_result_; }; std::unique_ptr<FullScreenApplicationHandler>