commit 48498d0d20a3eb7d7bd85b23eb1fa437b6b4ab1a
parent 245e5e96ecbc4e9f143312032760456cbf09cfb3
Author: Dan Baker <dbaker@mozilla.com>
Date: Mon, 1 Dec 2025 23:10:10 -0700
Bug 2000941 - Vendor libwebrtc from 361404b5bc
Upstream commit: https://webrtc.googlesource.com/src/+/361404b5bcb376339632b7b49859d301ded68375
Cleanup p2p functions that use integerss to represent time
Downstream projects, including chromium, were updated to similar
functions that use Timestamp and TimeDelta to represent time
Bug: webrtc:42223979
Change-Id: I0d1b12bd1506dd326115a1bd2eda9aa59f2e9e9d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/409840
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45708}
Diffstat:
6 files changed, 3 insertions(+), 86 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-02T06:07:36.799314+00:00.
+libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-12-02T06:09:57.361633+00:00.
# base of lastest vendoring
-d702862c01
+361404b5bc
diff --git a/third_party/libwebrtc/p2p/base/connection.h b/third_party/libwebrtc/p2p/base/connection.h
@@ -58,10 +58,6 @@ constexpr int kGoogPingVersion = 1;
// 1200 is the "commonly used" MTU. Subtract M-I attribute (20+4) and FP (4+4).
constexpr int kMaxStunBindingLength = 1200 - 24 - 8;
-// TODO: bugs.webrtc.org/42223979 - Delete or mark deprecated functions that
-// use integers to represent time when remaining WebRTC is updated to use
-// Timestamp and TimeDelta types instead.
-
// Represents a communication link between a port on the local client and a
// port on the remote client.
class RTC_EXPORT Connection : public CandidatePairInterface {
@@ -125,32 +121,13 @@ class RTC_EXPORT Connection : public CandidatePairInterface {
// A connection is dead if it can be safely deleted.
bool dead(Timestamp now) const;
- // Estimate of the round-trip time over this connection.
- // [[deprecated("bugs.webrtc.org/42223979")]]
- int rtt() const { return Rtt().ms(); }
TimeDelta Rtt() const;
TimeDelta UnwritableTimeout() const;
- // [[deprecated("bugs.webrtc.org/42223979")]]
- void set_unwritable_timeout(const std::optional<int>& value_ms) {
- if (value_ms.has_value()) {
- SetUnwritableTimeout(TimeDelta::Millis(*value_ms));
- } else {
- SetUnwritableTimeout(std::nullopt);
- }
- }
void SetUnwritableTimeout(std::optional<TimeDelta> value);
int unwritable_min_checks() const;
void set_unwritable_min_checks(const std::optional<int>& value);
- // [[deprecated("bugs.webrtc.org/42223979")]]
- void set_inactive_timeout(const std::optional<int>& value) {
- if (value.has_value()) {
- SetInactiveTimeout(TimeDelta::Millis(*value));
- } else {
- SetInactiveTimeout(std::nullopt);
- }
- }
TimeDelta InactiveTimeout() const;
void SetInactiveTimeout(std::optional<TimeDelta> value);
@@ -224,14 +201,6 @@ class RTC_EXPORT Connection : public CandidatePairInterface {
bool nominated() const;
TimeDelta ReceivingTimeout() const;
- // [[deprecated("bugs.webrtc.org/42223979")]]
- void set_receiving_timeout(std::optional<int> receiving_timeout_ms) {
- if (receiving_timeout_ms.has_value()) {
- SetReceivingTimeout(TimeDelta::Millis(*receiving_timeout_ms));
- } else {
- SetReceivingTimeout(std::nullopt);
- }
- }
void SetReceivingTimeout(std::optional<TimeDelta> receiving_timeout);
// Deletes a `Connection` instance is by calling the `DestroyConnection`
@@ -252,8 +221,6 @@ class RTC_EXPORT Connection : public CandidatePairInterface {
// Checks that the state of this connection is up-to-date. The argument is
// the current time, which is compared against various timeouts.
- // [[deprecated("bugs.webrtc.org/42223979")]]
- void UpdateState(int64_t now) { UpdateState(Timestamp::Millis(now)); }
void UpdateState(Timestamp now);
void UpdateLocalIceParameters(int component,
@@ -261,25 +228,11 @@ class RTC_EXPORT Connection : public CandidatePairInterface {
absl::string_view password);
// Called when this connection should try checking writability again.
- // [[deprecated("bugs.webrtc.org/42223979")]]
- int64_t last_ping_sent() const { return LastPingSent().ms(); }
Timestamp LastPingSent() const;
- // [[deprecated("bugs.webrtc.org/42223979")]]
- void Ping(int64_t now,
- std::unique_ptr<StunByteStringAttribute> delta = nullptr) {
- Ping(Timestamp::Millis(now), std::move(delta));
- }
void Ping();
void Ping(Timestamp now,
std::unique_ptr<StunByteStringAttribute> delta = nullptr);
- // [[deprecated("bugs.webrtc.org/42223979")]]
- void ReceivedPingResponse(
- int rtt,
- absl::string_view request_id,
- const std::optional<uint32_t>& nomination = std::nullopt) {
- ReceivedPingResponse(TimeDelta::Millis(rtt), request_id, nomination);
- }
void ReceivedPingResponse(
TimeDelta rtt,
absl::string_view request_id,
@@ -288,20 +241,12 @@ class RTC_EXPORT Connection : public CandidatePairInterface {
std::unique_ptr<StunByteStringAttribute> delta)
RTC_RUN_ON(network_thread_);
- // [[deprecated("bugs.webrtc.org/42223979")]]
- int64_t last_ping_response_received() const {
- return LastPingResponseReceived().ms();
- }
Timestamp LastPingResponseReceived() const;
const std::optional<std::string>& last_ping_id_received() const;
// Used to check if any STUN ping response has been received.
int rtt_samples() const;
- // Called whenever a valid ping is received on this connection. This is
- // public because the connection intercepts the first ping for us.
- // [[deprecated("bugs.webrtc.org/42223979")]]
- int64_t last_ping_received() const { return LastPingReceived().ms(); }
Timestamp LastPingReceived() const;
void ReceivedPing(
@@ -314,8 +259,6 @@ class RTC_EXPORT Connection : public CandidatePairInterface {
void HandlePiggybackCheckAcknowledgementIfAny(StunMessage* msg);
// Timestamp when data was last sent (or attempted to be sent).
Timestamp LastSendData() const;
- // [[deprecated("bugs.webrtc.org/42223979")]]
- int64_t last_data_received() const { return LastDataReceived().ms(); }
Timestamp LastDataReceived() const;
// Debugging description of this connection
@@ -363,18 +306,12 @@ class RTC_EXPORT Connection : public CandidatePairInterface {
Timestamp LastReceived() const;
// Returns the last time when the connection changed its receiving state.
- // [[deprecated("bugs.webrtc.org/42223979")]]
- int64_t receiving_unchanged_since() const {
- return ReceivingUnchangedSince().ms();
- }
Timestamp ReceivingUnchangedSince() const;
// Constructs the prflx priority as described in
// https://datatracker.ietf.org/doc/html/rfc5245#section-4.1.2.1
uint32_t prflx_priority() const;
- // [[deprecated("bugs.webrtc.org/42223979")]]
- bool stable(int64_t now) const { return stable(Timestamp::Millis(now)); }
bool stable(Timestamp now) const;
// Check if we sent `val` pings without receving a response.
diff --git a/third_party/libwebrtc/p2p/base/ice_agent_interface.h b/third_party/libwebrtc/p2p/base/ice_agent_interface.h
@@ -11,8 +11,6 @@
#ifndef P2P_BASE_ICE_AGENT_INTERFACE_H_
#define P2P_BASE_ICE_AGENT_INTERFACE_H_
-#include <cstdint>
-
#include "api/array_view.h"
#include "api/units/timestamp.h"
#include "p2p/base/connection.h"
@@ -34,9 +32,6 @@ class IceAgentInterface {
// keep this state on its own.
// TODO(bugs.webrtc.org/14367): route extra pings through the ICE controller.
virtual Timestamp GetLastPingSent() const = 0;
- // TODO: bugs.webrtc.org/42223979 - Remove this function when chromium is
- // updated to the one above.
- virtual int64_t GetLastPingSentMs() const { return GetLastPingSent().ms(); }
// Get the ICE role of this ICE agent.
virtual IceRole GetIceRole() const = 0;
diff --git a/third_party/libwebrtc/p2p/base/ice_controller_interface.h b/third_party/libwebrtc/p2p/base/ice_controller_interface.h
@@ -11,7 +11,6 @@
#ifndef P2P_BASE_ICE_CONTROLLER_INTERFACE_H_
#define P2P_BASE_ICE_CONTROLLER_INTERFACE_H_
-#include <cstdint>
#include <optional>
#include <string>
#include <vector>
@@ -131,16 +130,7 @@ class IceControllerInterface {
virtual bool HasPingableConnection() const = 0;
// Selects a connection to Ping, or nullptr if none.
- // TODO: bugs.webrtc.org/42223979 - make pure virtual when implemented by
- // downstream.
- virtual PingResult GetConnectionToPing(Timestamp last_ping_sent) {
- return SelectConnectionToPing(last_ping_sent.ms());
- }
- // TODO: bugs.webrtc.org/42223979 - Remove when downstream implementaions are
- // removed.
- virtual PingResult SelectConnectionToPing(int64_t last_ping_sent_ms) {
- return GetConnectionToPing(Timestamp::Millis(last_ping_sent_ms));
- }
+ virtual PingResult GetConnectionToPing(Timestamp last_ping_sent) = 0;
// Compute the "STUN_ATTR_USE_CANDIDATE" for `conn`.
virtual bool GetUseCandidateAttr(const Connection* conn,
diff --git a/third_party/libwebrtc/p2p/test/mock_ice_agent.h b/third_party/libwebrtc/p2p/test/mock_ice_agent.h
@@ -11,8 +11,6 @@
#ifndef P2P_TEST_MOCK_ICE_AGENT_H_
#define P2P_TEST_MOCK_ICE_AGENT_H_
-#include <cstdint>
-
#include "api/array_view.h"
#include "api/units/timestamp.h"
#include "p2p/base/connection.h"
@@ -28,7 +26,6 @@ class MockIceAgent : public IceAgentInterface {
~MockIceAgent() override = default;
MOCK_METHOD(Timestamp, GetLastPingSent, (), (override, const));
- MOCK_METHOD(int64_t, GetLastPingSentMs, (), (override, const));
MOCK_METHOD(IceRole, GetIceRole, (), (override, const));
MOCK_METHOD(void, OnStartedPinging, (), (override));
MOCK_METHOD(void, UpdateConnectionStates, (), (override));
diff --git a/third_party/libwebrtc/p2p/test/mock_ice_controller.h b/third_party/libwebrtc/p2p/test/mock_ice_controller.h
@@ -11,7 +11,6 @@
#ifndef P2P_TEST_MOCK_ICE_CONTROLLER_H_
#define P2P_TEST_MOCK_ICE_CONTROLLER_H_
-#include <cstdint>
#include <memory>
#include <vector>
@@ -43,7 +42,6 @@ class MockIceController : public IceControllerInterface {
(const, override));
MOCK_METHOD(ArrayView<const Connection*>, connections, (), (const, override));
MOCK_METHOD(bool, HasPingableConnection, (), (const, override));
- MOCK_METHOD(PingResult, SelectConnectionToPing, (int64_t), (override));
MOCK_METHOD(PingResult, GetConnectionToPing, (Timestamp), (override));
MOCK_METHOD(bool,
GetUseCandidateAttr,