tor-browser

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

commit 4ff746d15fadc1deb7a8bd300b66bd4e90766a0c
parent 41a957a49af906b4d9a5d5558afb46e19951f445
Author: Dan Baker <dbaker@mozilla.com>
Date:   Wed, 22 Oct 2025 13:35:38 -0600

Bug 1995393 - Vendor libwebrtc from 84990b350f

Upstream commit: https://webrtc.googlesource.com/src/+/84990b350f0cc857caed495b2a7cab6d92802893
    Use CurrentTime instead of converting to Timestamp

    The old calls were simply redundant.

    Bug: webrtc:42223979
    Change-Id: I81407efea06feb3bd7bacd6df7cedba4dd26ac7f
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/403120
    Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
    Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
    Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
    Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#45279}

Diffstat:
Mthird_party/libwebrtc/README.mozilla.last-vendor | 4++--
Mthird_party/libwebrtc/call/rtp_transport_controller_send.cc | 22+++++++++-------------
Mthird_party/libwebrtc/modules/congestion_controller/goog_cc/delay_based_bwe_unittest_helper.cc | 4++--
Mthird_party/libwebrtc/rtc_tools/rtc_event_log_visualizer/analyzer.cc | 7+++----
Mthird_party/libwebrtc/test/network/cross_traffic_unittest.cc | 4++--
Mthird_party/libwebrtc/video/send_statistics_proxy_unittest.cc | 33+++++++++++----------------------
6 files changed, 29 insertions(+), 45 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-22T19:33:18.896003+00:00. +libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-22T19:35:28.029422+00:00. # base of lastest vendoring -2b561ccf35 +84990b350f diff --git a/third_party/libwebrtc/call/rtp_transport_controller_send.cc b/third_party/libwebrtc/call/rtp_transport_controller_send.cc @@ -71,7 +71,7 @@ TargetRateConstraints ConvertConstraints(int min_bitrate_bps, int start_bitrate_bps, Clock* clock) { TargetRateConstraints msg; - msg.at_time = Timestamp::Millis(clock->TimeInMilliseconds()); + msg.at_time = clock->CurrentTime(); msg.min_data_rate = min_bitrate_bps >= 0 ? DataRate::BitsPerSec(min_bitrate_bps) : DataRate::Zero(); @@ -113,8 +113,7 @@ RtpTransportControllerSend::RtpTransportControllerSend( GoogCcFactoryConfig{.network_state_predictor_factory = config.network_state_predictor_factory})), process_interval_(controller_factory_fallback_->GetProcessInterval()), - last_report_block_time_( - Timestamp::Millis(env_.clock().TimeInMilliseconds())), + last_report_block_time_(env_.clock().CurrentTime()), initial_config_(env_), reset_feedback_on_route_change_( !env_.field_trials().IsEnabled("WebRTC-Bwe-NoFeedbackReset")), @@ -400,7 +399,7 @@ void RtpTransportControllerSend::OnNetworkRouteChanged( packet_router_.ConfigureForRfc8888Feedback(sending_packets_as_ect1_); } NetworkRouteChange msg; - msg.at_time = Timestamp::Millis(env_.clock().TimeInMilliseconds()); + msg.at_time = env_.clock().CurrentTime(); msg.constraints = ConvertConstraints(bitrate_config, &env_.clock()); transport_overhead_bytes_per_packet_ = network_route.packet_overhead; if (reset_feedback_on_route_change_) { @@ -623,8 +622,7 @@ void RtpTransportControllerSend::NotifyBweOfPacedSentPacket( RTC_DCHECK_NOTREACHED() << "Unknown packet type"; return; } - Timestamp creation_time = - Timestamp::Millis(env_.clock().TimeInMilliseconds()); + Timestamp creation_time = env_.clock().CurrentTime(); transport_feedback_adapter_.AddPacket( packet, pacing_info, transport_overhead_bytes_per_packet_, creation_time); } @@ -687,7 +685,7 @@ void RtpTransportControllerSend::HandleTransportPacketsFeedback( void RtpTransportControllerSend::OnRemoteNetworkEstimate( NetworkStateEstimate estimate) { RTC_DCHECK_RUN_ON(&sequence_checker_); - estimate.update_time = Timestamp::Millis(env_.clock().TimeInMilliseconds()); + estimate.update_time = env_.clock().CurrentTime(); if (controller_) PostUpdates(controller_->OnNetworkStateEstimate(estimate)); } @@ -700,8 +698,7 @@ void RtpTransportControllerSend::MaybeCreateControllers() { return; control_handler_ = std::make_unique<CongestionControlHandler>(); - initial_config_.constraints.at_time = - Timestamp::Millis(env_.clock().TimeInMilliseconds()); + initial_config_.constraints.at_time = env_.clock().CurrentTime(); initial_config_.stream_based_config = streams_config_; // TODO(srte): Use fallback controller if no feedback is available. @@ -723,7 +720,7 @@ void RtpTransportControllerSend::UpdateNetworkAvailability() { return; } NetworkAvailability msg; - msg.at_time = Timestamp::Millis(env_.clock().TimeInMilliseconds()); + msg.at_time = env_.clock().CurrentTime(); msg.network_available = network_available_; control_handler_->SetNetworkAvailability(network_available_); PostUpdates(controller_->OnNetworkAvailability(msg)); @@ -764,15 +761,14 @@ void RtpTransportControllerSend::StartProcessPeriodicTasks() { void RtpTransportControllerSend::UpdateControllerWithTimeInterval() { RTC_DCHECK(controller_); ProcessInterval msg; - msg.at_time = Timestamp::Millis(env_.clock().TimeInMilliseconds()); + msg.at_time = env_.clock().CurrentTime(); if (add_pacing_to_cwin_) msg.pacer_queue = pacer_.QueueSizeData(); PostUpdates(controller_->OnProcessInterval(msg)); } void RtpTransportControllerSend::UpdateStreamsConfig() { - streams_config_.at_time = - Timestamp::Millis(env_.clock().TimeInMilliseconds()); + streams_config_.at_time = env_.clock().CurrentTime(); if (controller_) PostUpdates(controller_->OnStreamsConfig(streams_config_)); } diff --git a/third_party/libwebrtc/modules/congestion_controller/goog_cc/delay_based_bwe_unittest_helper.cc b/third_party/libwebrtc/modules/congestion_controller/goog_cc/delay_based_bwe_unittest_helper.cc @@ -211,7 +211,7 @@ void DelayBasedBweTest::IncomingFeedback(Timestamp receive_time, probe_bitrate_estimator_->HandleProbeAndEstimateBitrate(packet); TransportPacketsFeedback msg; - msg.feedback_time = Timestamp::Millis(clock_.TimeInMilliseconds()); + msg.feedback_time = clock_.CurrentTime(); msg.packet_feedbacks.push_back(packet); acknowledged_bitrate_estimator_->IncomingPacketFeedbackVector( msg.SortedByReceiveTime()); @@ -257,7 +257,7 @@ bool DelayBasedBweTest::GenerateAndProcessFrame(uint32_t /* ssrc */, acknowledged_bitrate_estimator_->IncomingPacketFeedbackVector(packets); TransportPacketsFeedback msg; msg.packet_feedbacks = packets; - msg.feedback_time = Timestamp::Millis(clock_.TimeInMilliseconds()); + msg.feedback_time = clock_.CurrentTime(); DelayBasedBwe::Result result = bitrate_estimator_->IncomingPacketFeedbackVector( diff --git a/third_party/libwebrtc/rtc_tools/rtc_event_log_visualizer/analyzer.cc b/third_party/libwebrtc/rtc_tools/rtc_event_log_visualizer/analyzer.cc @@ -1769,7 +1769,7 @@ void EventLogAnalyzer::CreateSendSideBweSimulationGraph(Plot* plot) const { // TODO(holmer): Log the call config and use that here instead. static const uint32_t kDefaultStartBitrateBps = 300000; NetworkControllerConfig cc_config(env_); - cc_config.constraints.at_time = Timestamp::Micros(clock.TimeInMicroseconds()); + cc_config.constraints.at_time = clock.CurrentTime(); cc_config.constraints.starting_rate = DataRate::BitsPerSec(kDefaultStartBitrateBps); auto goog_cc = factory.Create(cc_config); @@ -1870,8 +1870,7 @@ void EventLogAnalyzer::CreateSendSideBweSimulationGraph(Plot* plot) const { RTC_DCHECK_EQ(clock.TimeInMicroseconds(), NextRtcpTime()); auto feedback_msg = transport_feedback.ProcessTransportFeedback( - rtcp_iterator->transport_feedback, - Timestamp::Millis(clock.TimeInMilliseconds())); + rtcp_iterator->transport_feedback, clock.CurrentTime()); if (feedback_msg) { observer.Update(goog_cc->OnTransportPacketsFeedback(*feedback_msg)); std::vector<PacketResult> feedback = @@ -1910,7 +1909,7 @@ void EventLogAnalyzer::CreateSendSideBweSimulationGraph(Plot* plot) const { if (clock.TimeInMicroseconds() >= NextProcessTime()) { RTC_DCHECK_EQ(clock.TimeInMicroseconds(), NextProcessTime()); ProcessInterval msg; - msg.at_time = Timestamp::Micros(clock.TimeInMicroseconds()); + msg.at_time = clock.CurrentTime(); observer.Update(goog_cc->OnProcessInterval(msg)); next_process_time_us_ += process_interval.us(); } diff --git a/third_party/libwebrtc/test/network/cross_traffic_unittest.cc b/third_party/libwebrtc/test/network/cross_traffic_unittest.cc @@ -87,7 +87,7 @@ TEST(CrossTrafficTest, PulsedPeaksCrossTraffic) { PulsedPeaksCrossTraffic pulsed_peaks(config, &traffic); const auto kRunTime = TimeDelta::Seconds(1); while (fixture.clock.TimeInMilliseconds() < kRunTime.ms()) { - pulsed_peaks.Process(Timestamp::Millis(fixture.clock.TimeInMilliseconds())); + pulsed_peaks.Process(fixture.clock.CurrentTime()); fixture.clock.AdvanceTimeMilliseconds(1); } @@ -115,7 +115,7 @@ TEST(CrossTrafficTest, RandomWalkCrossTraffic) { RandomWalkCrossTraffic random_walk(config, &traffic); const auto kRunTime = TimeDelta::Seconds(1); while (fixture.clock.TimeInMilliseconds() < kRunTime.ms()) { - random_walk.Process(Timestamp::Millis(fixture.clock.TimeInMilliseconds())); + random_walk.Process(fixture.clock.CurrentTime()); fixture.clock.AdvanceTimeMilliseconds(1); } diff --git a/third_party/libwebrtc/video/send_statistics_proxy_unittest.cc b/third_party/libwebrtc/video/send_statistics_proxy_unittest.cc @@ -476,8 +476,7 @@ TEST_F(SendStatisticsProxyTest, // TODO(https://crbug.com/webrtc/10640): When the RateTracker uses a Clock // this test can stop relying on ScopedFakeClock. ScopedFakeClock fake_global_clock; - fake_global_clock.SetTime( - Timestamp::Millis(fake_clock_.TimeInMilliseconds())); + fake_global_clock.SetTime(fake_clock_.CurrentTime()); statistics_proxy_->OnSetEncoderTargetRate(kTargetBytesPerSecond * 8); EncodedImage encoded_image; @@ -488,8 +487,7 @@ TEST_F(SendStatisticsProxyTest, statistics_proxy_->GetStats().total_encoded_bytes_target; // Second frame fake_clock_.AdvanceTimeMilliseconds(kInterframeDelayMs); - fake_global_clock.SetTime( - Timestamp::Millis(fake_clock_.TimeInMilliseconds())); + fake_global_clock.SetTime(fake_clock_.CurrentTime()); encoded_image.SetRtpTimestamp(encoded_image.RtpTimestamp() + 90 * kInterframeDelayMs); statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr); @@ -507,22 +505,19 @@ TEST_F(SendStatisticsProxyTest, EncodeFrameRateInSubStream) { const int kInterframeDelayMs = 100; const auto ssrc = config_.rtp.ssrcs[0]; ScopedFakeClock fake_global_clock; - fake_global_clock.SetTime( - Timestamp::Millis(fake_clock_.TimeInMilliseconds())); + fake_global_clock.SetTime(fake_clock_.CurrentTime()); // First frame EncodedImage encoded_image; statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr); fake_clock_.AdvanceTimeMilliseconds(kInterframeDelayMs); - fake_global_clock.SetTime( - Timestamp::Millis(fake_clock_.TimeInMilliseconds())); + fake_global_clock.SetTime(fake_clock_.CurrentTime()); // Second frame encoded_image.SetRtpTimestamp(encoded_image.RtpTimestamp() + 90 * kInterframeDelayMs); statistics_proxy_->OnSendEncodedImage(encoded_image, nullptr); fake_clock_.AdvanceTimeMilliseconds(kInterframeDelayMs); - fake_global_clock.SetTime( - Timestamp::Millis(fake_clock_.TimeInMilliseconds())); + fake_global_clock.SetTime(fake_clock_.CurrentTime()); auto stats = statistics_proxy_->GetStats(); EXPECT_EQ(stats.substreams[ssrc].encode_frame_rate, 10); @@ -531,8 +526,7 @@ TEST_F(SendStatisticsProxyTest, EncodeFrameRateInSubStream) { TEST_F(SendStatisticsProxyTest, EncodeFrameRateInSubStreamsVp8Simulcast) { const int kInterframeDelayMs = 100; ScopedFakeClock fake_global_clock; - fake_global_clock.SetTime( - Timestamp::Millis(fake_clock_.TimeInMilliseconds())); + fake_global_clock.SetTime(fake_clock_.CurrentTime()); EncodedImage encoded_image; CodecSpecificInfo codec_info; codec_info.codecType = kVideoCodecVP8; @@ -545,8 +539,7 @@ TEST_F(SendStatisticsProxyTest, EncodeFrameRateInSubStreamsVp8Simulcast) { encoded_image.SetSimulcastIndex(1); statistics_proxy_->OnSendEncodedImage(encoded_image, &codec_info); fake_clock_.AdvanceTimeMilliseconds(kInterframeDelayMs); - fake_global_clock.SetTime( - Timestamp::Millis(fake_clock_.TimeInMilliseconds())); + fake_global_clock.SetTime(fake_clock_.CurrentTime()); } VideoSendStream::Stats stats = statistics_proxy_->GetStats(); @@ -561,8 +554,7 @@ TEST_F(SendStatisticsProxyTest, EncodeFrameRateInSubStreamsVp8Simulcast) { encoded_image.SetSimulcastIndex(0); statistics_proxy_->OnSendEncodedImage(encoded_image, &codec_info); fake_clock_.AdvanceTimeMilliseconds(kInterframeDelayMs); - fake_global_clock.SetTime( - Timestamp::Millis(fake_clock_.TimeInMilliseconds())); + fake_global_clock.SetTime(fake_clock_.CurrentTime()); } stats = statistics_proxy_->GetStats(); @@ -579,8 +571,7 @@ TEST_F(SendStatisticsProxyTest, EncodeFrameRateInSubStreamsVp8Simulcast) { encoded_image.SetSimulcastIndex(1); statistics_proxy_->OnSendEncodedImage(encoded_image, &codec_info); fake_clock_.AdvanceTimeMilliseconds(kInterframeDelayMs); - fake_global_clock.SetTime( - Timestamp::Millis(fake_clock_.TimeInMilliseconds())); + fake_global_clock.SetTime(fake_clock_.CurrentTime()); } stats = statistics_proxy_->GetStats(); @@ -592,8 +583,7 @@ TEST_F(SendStatisticsProxyTest, EncodeFrameRateInSubStreamsVp8Simulcast) { TEST_F(SendStatisticsProxyTest, EncodeFrameRateInSubStreamsVp9Svc) { const int kInterframeDelayMs = 100; ScopedFakeClock fake_global_clock; - fake_global_clock.SetTime( - Timestamp::Millis(fake_clock_.TimeInMilliseconds())); + fake_global_clock.SetTime(fake_clock_.CurrentTime()); EncodedImage encoded_image; CodecSpecificInfo codec_info; codec_info.codecType = kVideoCodecVP9; @@ -608,8 +598,7 @@ TEST_F(SendStatisticsProxyTest, EncodeFrameRateInSubStreamsVp9Svc) { codec_info.end_of_picture = true; statistics_proxy_->OnSendEncodedImage(encoded_image, &codec_info); fake_clock_.AdvanceTimeMilliseconds(kInterframeDelayMs); - fake_global_clock.SetTime( - Timestamp::Millis(fake_clock_.TimeInMilliseconds())); + fake_global_clock.SetTime(fake_clock_.CurrentTime()); } VideoSendStream::Stats stats = statistics_proxy_->GetStats();