commit 5038fc8fbda1615a41fcc48c0d3c044b09c406c0 parent 2c9a0905821b6bd11754c0390bfa4684b544166e Author: Dan Baker <dbaker@mozilla.com> Date: Mon, 1 Dec 2025 20:11:54 -0700 Bug 2000941 - Vendor libwebrtc from edaebd69e7 Upstream commit: https://webrtc.googlesource.com/src/+/edaebd69e7a16228c99d8c4c00d3fba85183e30a Use injected clock instead of global clock when Environment available Bug: webrtc:42223992 Change-Id: Ia5e72c34bf64998870e120a0f45ceac1adb284d5 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/409120 Auto-Submit: Evan Shrubsole <eshr@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Evan Shrubsole <eshr@webrtc.org> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/main@{#45639} Diffstat:
7 files changed, 19 insertions(+), 18 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-12-02T03:09:17.078024+00:00. +libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-12-02T03:11:42.226815+00:00. # base of lastest vendoring -2fa3469ae2 +edaebd69e7 diff --git a/third_party/libwebrtc/modules/video_coding/codecs/vp8/screenshare_layers_unittest.cc b/third_party/libwebrtc/modules/video_coding/codecs/vp8/screenshare_layers_unittest.cc @@ -21,6 +21,7 @@ #include "api/environment/environment.h" #include "api/units/time_delta.h" +#include "api/units/timestamp.h" #include "api/video_codecs/vp8_frame_buffer_controller.h" #include "api/video_codecs/vp8_frame_config.h" #include "modules/video_coding/codecs/interface/common_constants.h" @@ -28,7 +29,6 @@ #include "modules/video_coding/include/video_codec_interface.h" #include "rtc_base/checks.h" #include "rtc_base/fake_clock.h" -#include "rtc_base/time_utils.h" #include "system_wrappers/include/metrics.h" #include "test/create_test_environment.h" #include "test/gmock.h" @@ -120,7 +120,7 @@ class ScreenshareLayerTest : public ::testing::Test { Vp8FrameConfig NextFrameConfig(size_t stream_index, uint32_t timestamp) { int64_t timestamp_ms = timestamp / 90; - clock_.AdvanceTime(TimeDelta::Millis(timestamp_ms - TimeMillis())); + clock_.SetTime(Timestamp::Millis(timestamp_ms)); return layers_->NextFrameConfig(stream_index, timestamp); } @@ -618,7 +618,9 @@ TEST_F(ScreenshareLayerTest, UpdatesHistograms) { kDefaultTl1BitrateKbps)); } -TEST_F(ScreenshareLayerTest, RespectsConfiguredFramerate) { +// TODO(https://issues.webrtc.org/444656962): Re-enable when the test no longer +// rewinds time. +TEST_F(ScreenshareLayerTest, DISABLED_RespectsConfiguredFramerate) { int64_t kTestSpanMs = 2000; int64_t kFrameIntervalsMs = 1000 / kFrameRate; diff --git a/third_party/libwebrtc/moz-patch-stack/s0102.patch b/third_party/libwebrtc/moz-patch-stack/s0102.patch @@ -601,7 +601,7 @@ index b7561e53b6..fe7eb57423 100644 import("../../webrtc.gni") diff --git a/pc/BUILD.gn b/pc/BUILD.gn -index f43d1b9ba1..2efd33c566 100644 +index 4c837bb838..96fbcc9539 100644 --- a/pc/BUILD.gn +++ b/pc/BUILD.gn @@ -30,8 +30,8 @@ diff --git a/third_party/libwebrtc/p2p/base/stun_request_unittest.cc b/third_party/libwebrtc/p2p/base/stun_request_unittest.cc @@ -25,7 +25,6 @@ #include "rtc_base/gunit.h" #include "rtc_base/logging.h" #include "rtc_base/thread.h" -#include "rtc_base/time_utils.h" #include "test/create_test_environment.h" #include "test/gmock.h" #include "test/gtest.h" @@ -172,14 +171,14 @@ TEST_F(StunRequestTest, TestBackoff) { std::unique_ptr<StunMessage> res = request->CreateResponseMessage(STUN_BINDING_RESPONSE); - int64_t start = TimeMillis(); + int64_t start = env_.clock().TimeInMilliseconds(); manager_.Send(std::move(request)); for (int i = 0; i < 9; ++i) { EXPECT_THAT(WaitUntil([&] { return request_count_; }, Ne(i), {.timeout = TimeDelta::Millis(STUN_TOTAL_TIMEOUT), .clock = &fake_clock}), IsRtcOk()); - int64_t elapsed = TimeMillis() - start; + int64_t elapsed = env_.clock().TimeInMilliseconds() - start; RTC_DLOG(LS_INFO) << "STUN request #" << (i + 1) << " sent at " << elapsed << " ms"; EXPECT_EQ(TotalDelay(i), elapsed); diff --git a/third_party/libwebrtc/p2p/test/turn_server.cc b/third_party/libwebrtc/p2p/test/turn_server.cc @@ -45,7 +45,6 @@ #include "rtc_base/ssl_adapter.h" #include "rtc_base/string_encode.h" #include "rtc_base/strings/string_builder.h" -#include "rtc_base/time_utils.h" namespace webrtc { namespace { @@ -419,7 +418,8 @@ bool TurnServer::ValidateNonce(absl::string_view nonce) const { } // Validate the timestamp. - return TimeDelta::Millis(TimeMillis() - then) < kNonceTimeout; + return TimeDelta::Millis(env_.clock().TimeInMilliseconds() - then) < + kNonceTimeout; } TurnServerAllocation* TurnServer::FindAllocation(TurnServerConnection* conn) { @@ -465,7 +465,7 @@ void TurnServer::SendErrorResponseWithRealmAndNonce(TurnServerConnection* conn, TurnMessage resp(GetStunErrorResponseTypeOrZero(*msg), msg->transaction_id()); InitErrorResponse(code, reason, &resp); - int64_t timestamp = TimeMillis(); + int64_t timestamp = env_.clock().TimeInMilliseconds(); if (ts_for_next_nonce_) { timestamp = ts_for_next_nonce_; ts_for_next_nonce_ = 0; diff --git a/third_party/libwebrtc/pc/BUILD.gn b/third_party/libwebrtc/pc/BUILD.gn @@ -2277,6 +2277,7 @@ if (rtc_include_tests && !build_with_chromium) { "../api/test/metrics:global_metrics_logger_and_exporter", "../api/test/metrics:metric", "../api/units:time_delta", + "../api/units:timestamp", "../api/video_codecs:video_decoder_factory_template", "../api/video_codecs:video_decoder_factory_template_dav1d_adapter", "../api/video_codecs:video_decoder_factory_template_libvpx_vp8_adapter", diff --git a/third_party/libwebrtc/pc/peer_connection_callsetup_perf_tests.cc b/third_party/libwebrtc/pc/peer_connection_callsetup_perf_tests.cc @@ -10,7 +10,6 @@ #include <cassert> #include <cstddef> -#include <cstdint> #include <memory> #include <string> #include <tuple> @@ -30,13 +29,13 @@ #include "api/test/metrics/metric.h" #include "api/test/rtc_error_matchers.h" #include "api/units/time_delta.h" +#include "api/units/timestamp.h" #include "p2p/base/transport_description.h" #include "pc/sdp_utils.h" #include "pc/test/mock_peer_connection_observers.h" #include "pc/test/peer_connection_test_wrapper.h" #include "rtc_base/checks.h" #include "rtc_base/thread.h" -#include "rtc_base/time_utils.h" #include "rtc_base/virtual_socket_server.h" #include "test/create_test_environment.h" #include "test/create_test_field_trials.h" @@ -196,12 +195,12 @@ TEST_P(PeerConnectionDataChannelOpenTest, OpenAtCaller) { auto dc = local_pc_wrapper->CreateDataChannel("test", {}); Negotiate(local_pc_wrapper, remote_pc_wrapper, role); - uint64_t start_time = TimeNanos(); + Timestamp start_time = env_.clock().CurrentTime(); EXPECT_TRUE(WaitForDataChannelOpen(dc)); - uint64_t open_time = TimeNanos(); - uint64_t setup_time = open_time - start_time; + Timestamp open_time = env_.clock().CurrentTime(); + TimeDelta setup_time = open_time - start_time; - double setup_time_millis = setup_time / kNumNanosecsPerMillisec; + double setup_time_millis = setup_time.ms<double>(); std::string test_description = "emulate_server=" + absl::StrCat(skip_candidates_from_caller) + "/dtls_role=" + role_string + "/trials=" + trials;