tor-browser

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

commit 1a6dca1987e5a794f8f2607f37b86b67bacae2d7
parent 79aedd9fd0a6fb98c03dc176c742a7503e62363d
Author: Dan Baker <dbaker@mozilla.com>
Date:   Mon, 27 Oct 2025 16:57:12 -0600

Bug 1995393 - Vendor libwebrtc from efe93a0eac

Upstream commit: https://webrtc.googlesource.com/src/+/efe93a0eac197ca41ce91d925cc0313328e91b21
    Avoid logging duplicate timestamps in CrossMediaMetricsReporter

    The report was sometimes used twice resulting in a duplicate entry. Use
    the current time instead, as was the previous behaviour.

    Bug: webrtc:42223992, b/440762901
    Change-Id: I8b5739a11e6860d220fdaacbf884f0127519202e
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/407401
    Reviewed-by: Jeremy Leconte <jleconte@google.com>
    Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
    Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#45507}

Diffstat:
Mthird_party/libwebrtc/README.mozilla.last-vendor | 4++--
Mthird_party/libwebrtc/test/pc/e2e/BUILD.gn | 1+
Mthird_party/libwebrtc/test/pc/e2e/cross_media_metrics_reporter.cc | 16+++++++++-------
Mthird_party/libwebrtc/test/pc/e2e/cross_media_metrics_reporter.h | 7++++++-
Mthird_party/libwebrtc/test/pc/e2e/peer_connection_quality_test.cc | 3++-
5 files changed, 20 insertions(+), 11 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-27T22:54:56.212160+00:00. +libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-27T22:57:01.228053+00:00. # base of lastest vendoring -be8699e963 +efe93a0eac diff --git a/third_party/libwebrtc/test/pc/e2e/BUILD.gn b/third_party/libwebrtc/test/pc/e2e/BUILD.gn @@ -621,6 +621,7 @@ if (!build_with_chromium) { "../../../rtc_base:rtc_event", "../../../rtc_base:rtc_numerics", "../../../rtc_base/synchronization:mutex", + "../../../system_wrappers", "../../../system_wrappers:field_trial", "//third_party/abseil-cpp/absl/flags:flag", "//third_party/abseil-cpp/absl/strings:string_view", diff --git a/third_party/libwebrtc/test/pc/e2e/cross_media_metrics_reporter.cc b/third_party/libwebrtc/test/pc/e2e/cross_media_metrics_reporter.cc @@ -23,20 +23,22 @@ #include "api/test/metrics/metric.h" #include "api/test/metrics/metrics_logger.h" #include "api/test/track_id_stream_info_map.h" +#include "api/units/timestamp.h" #include "rtc_base/checks.h" #include "rtc_base/synchronization/mutex.h" +#include "system_wrappers/include/clock.h" #include "test/pc/e2e/metric_metadata_keys.h" #include "test/test_flags.h" namespace webrtc { namespace webrtc_pc_e2e { -using test::ImprovementDirection; using test::Unit; CrossMediaMetricsReporter::CrossMediaMetricsReporter( + webrtc::Clock& clock, test::MetricsLogger* metrics_logger) - : metrics_logger_(metrics_logger) { + : clock_(clock), metrics_logger_(metrics_logger) { RTC_CHECK(metrics_logger_); } @@ -63,6 +65,7 @@ void CrossMediaMetricsReporter::OnStatsReports( } } + webrtc::Timestamp now = clock_.CurrentTime(); MutexLock lock(&mutex_); for (const auto& pair : sync_group_stats) { // If there is less than two streams, it is not a sync group. @@ -98,15 +101,14 @@ void CrossMediaMetricsReporter::OnStatsReports( *video_stat->estimated_playout_timestamp; if (audio_video_playout_diff > 0) { stats_info_[sync_group].audio_ahead_ms.AddSample( - {.value = audio_video_playout_diff, .time = report->timestamp()}); + {.value = audio_video_playout_diff, .time = now}); stats_info_[sync_group].video_ahead_ms.AddSample( - {.value = 0., .time = report->timestamp()}); + {.value = 0., .time = now}); } else { stats_info_[sync_group].audio_ahead_ms.AddSample( - {.value = 0., .time = report->timestamp()}); + {.value = 0., .time = now}); stats_info_[sync_group].video_ahead_ms.AddSample( - {.value = std::abs(audio_video_playout_diff), - .time = report->timestamp()}); + {.value = std::abs(audio_video_playout_diff), .time = now}); } } } diff --git a/third_party/libwebrtc/test/pc/e2e/cross_media_metrics_reporter.h b/third_party/libwebrtc/test/pc/e2e/cross_media_metrics_reporter.h @@ -23,6 +23,7 @@ #include "api/test/track_id_stream_info_map.h" #include "rtc_base/synchronization/mutex.h" #include "rtc_base/thread_annotations.h" +#include "system_wrappers/include/clock.h" namespace webrtc { namespace webrtc_pc_e2e { @@ -30,7 +31,10 @@ namespace webrtc_pc_e2e { class CrossMediaMetricsReporter : public PeerConnectionE2EQualityTestFixture::QualityMetricsReporter { public: - explicit CrossMediaMetricsReporter(test::MetricsLogger* metrics_logger); + [[deprecated("Use constructor with the injected clock")]] + explicit CrossMediaMetricsReporter(test::MetricsLogger* metrics_logger) + : CrossMediaMetricsReporter(*Clock::GetRealTimeClock(), metrics_logger) {} + CrossMediaMetricsReporter(Clock& clock, test::MetricsLogger* metrics_logger); ~CrossMediaMetricsReporter() override = default; void Start(absl::string_view test_case_name, @@ -54,6 +58,7 @@ class CrossMediaMetricsReporter std::string GetTestCaseName(const std::string& stream_label, const std::string& sync_group) const; + Clock& clock_; test::MetricsLogger* const metrics_logger_; std::string test_case_name_; diff --git a/third_party/libwebrtc/test/pc/e2e/peer_connection_quality_test.cc b/third_party/libwebrtc/test/pc/e2e/peer_connection_quality_test.cc @@ -323,7 +323,8 @@ void PeerConnectionE2EQualityTest::Run(RunParams run_params) { std::make_unique<VideoQualityMetricsReporter>(time_controller_.GetClock(), metrics_logger_)); quality_metrics_reporters_.push_back( - std::make_unique<CrossMediaMetricsReporter>(metrics_logger_)); + std::make_unique<CrossMediaMetricsReporter>(*time_controller_.GetClock(), + metrics_logger_)); video_quality_analyzer_injection_helper_->Start( test_case_name_,