commit 453b72faea86ab41fc4c8f3c9557de9a8987b53e
parent 85e184fb2f285b3b0e628f186190dba36552fc05
Author: Dan Baker <dbaker@mozilla.com>
Date: Fri, 24 Oct 2025 13:00:23 -0600
Bug 1995393 - Vendor libwebrtc from ddfbd2782c
Upstream commit: https://webrtc.googlesource.com/src/+/ddfbd2782c7b3ca7f0f3b254095a92d3498f5f5e
Remove deprecated DtlsTransportInternalImpl constructor
This allows to rely on Environment to be always provided, and thus
this class can use propagate clock
Bug: webrtc:42223992
Change-Id: I98a6df5827e0ee82014608064a6933b805fd7ac6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/405140
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45394}
Diffstat:
4 files changed, 11 insertions(+), 52 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-24T18:57:59.768033+00:00.
+libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-24T19:00:10.783793+00:00.
# base of lastest vendoring
-6012750735
+ddfbd2782c
diff --git a/third_party/libwebrtc/p2p/BUILD.gn b/third_party/libwebrtc/p2p/BUILD.gn
@@ -310,7 +310,6 @@ rtc_library("dtls_transport") {
"../rtc_base:stream",
"../rtc_base:stringutils",
"../rtc_base:threading",
- "../rtc_base:timeutils",
"../rtc_base/network:received_packet",
"../rtc_base/network:sent_packet",
"../rtc_base/system:no_unique_address",
diff --git a/third_party/libwebrtc/p2p/dtls/dtls_transport.cc b/third_party/libwebrtc/p2p/dtls/dtls_transport.cc
@@ -33,7 +33,6 @@
#include "api/transport/ecn_marking.h"
#include "api/transport/stun.h"
#include "api/units/time_delta.h"
-#include "api/units/timestamp.h"
#include "logging/rtc_event_log/events/rtc_event_dtls_transport_state.h"
#include "logging/rtc_event_log/events/rtc_event_dtls_writable_state.h"
#include "p2p/base/ice_transport_internal.h"
@@ -56,7 +55,6 @@
#include "rtc_base/ssl_stream_adapter.h"
#include "rtc_base/stream.h"
#include "rtc_base/thread.h"
-#include "rtc_base/time_utils.h"
namespace webrtc {
@@ -192,10 +190,9 @@ void StreamInterfaceChannel::Close() {
}
DtlsTransportInternalImpl::DtlsTransportInternalImpl(
- std::optional<Environment> env,
+ const Environment& env,
IceTransportInternal* ice_transport,
const CryptoOptions& crypto_options,
- RtcEventLog* event_log,
SSLProtocolVersion max_version)
: env_(std::move(env)),
component_(ice_transport->component()),
@@ -205,7 +202,6 @@ DtlsTransportInternalImpl::DtlsTransportInternalImpl(
ephemeral_key_exchange_cipher_groups_(
crypto_options.ephemeral_key_exchange_cipher_groups.GetEnabled()),
ssl_max_version_(max_version),
- event_log_(event_log),
dtls_stun_piggyback_controller_(
[this](ArrayView<const uint8_t> piggybacked_dtls_packet) {
if (piggybacked_dtls_callback_ == nullptr) {
@@ -894,10 +890,10 @@ void DtlsTransportInternalImpl::OnDtlsEvent(int sig, int err) {
// TODO(bugs.webrtc.org/15368): It should be possible to use information
// from the original packet here to populate socket address and
// timestamp.
- NotifyPacketReceived(ReceivedIpPacket(
- MakeArrayView(buf, read), SocketAddress(),
- Timestamp::Micros(TimeMicros()), EcnMarking::kNotEct,
- ReceivedIpPacket::kDtlsDecrypted));
+ NotifyPacketReceived(
+ ReceivedIpPacket(MakeArrayView(buf, read), SocketAddress(),
+ env_.clock().CurrentTime(), EcnMarking::kNotEct,
+ ReceivedIpPacket::kDtlsDecrypted));
} else if (ret == SR_EOS) {
// Remote peer shut down the association with no error.
RTC_LOG(LS_INFO) << ToString() << ": DTLS transport closed by remote";
@@ -1015,9 +1011,7 @@ void DtlsTransportInternalImpl::set_writable(bool writable) {
return;
}
- if (event_log_) {
- event_log_->Log(std::make_unique<RtcEventDtlsWritableState>(writable));
- }
+ env_.event_log().Log(std::make_unique<RtcEventDtlsWritableState>(writable));
RTC_LOG(LS_VERBOSE) << ToString() << ": set_writable to: " << writable;
writable_ = writable;
if (writable_) {
@@ -1030,9 +1024,7 @@ void DtlsTransportInternalImpl::set_dtls_state(DtlsTransportState state) {
if (dtls_state_ == state) {
return;
}
- if (event_log_) {
- event_log_->Log(std::make_unique<RtcEventDtlsTransportState>(state));
- }
+ env_.event_log().Log(std::make_unique<RtcEventDtlsTransportState>(state));
RTC_LOG(LS_VERBOSE) << ToString() << ": set_dtls_state from:"
<< static_cast<int>(dtls_state_) << " to "
<< static_cast<int>(state);
diff --git a/third_party/libwebrtc/p2p/dtls/dtls_transport.h b/third_party/libwebrtc/p2p/dtls/dtls_transport.h
@@ -25,7 +25,6 @@
#include "api/dtls_transport_interface.h"
#include "api/environment/environment.h"
#include "api/rtc_error.h"
-#include "api/rtc_event_log/rtc_event_log.h"
#include "api/scoped_refptr.h"
#include "api/sequence_checker.h"
#include "api/task_queue/pending_task_safety_flag.h"
@@ -121,31 +120,11 @@ class DtlsTransportInternalImpl : public DtlsTransportInternal {
//
// `crypto_options` are the options used for the DTLS handshake. This affects
// whether GCM crypto suites are negotiated.
- //
- // `event_log` is an optional RtcEventLog for logging state changes. It should
- // outlive the DtlsTransport.
- [[deprecated("bugs.webrtc.org/42223992")]]
- DtlsTransportInternalImpl(
- IceTransportInternal* ice_transport,
- const CryptoOptions& crypto_options,
- RtcEventLog* event_log,
- SSLProtocolVersion max_version = SSL_PROTOCOL_DTLS_12)
- : DtlsTransportInternalImpl(std::nullopt,
- ice_transport,
- crypto_options,
- event_log,
- max_version) {}
-
DtlsTransportInternalImpl(
const Environment& env,
IceTransportInternal* ice_transport,
const CryptoOptions& crypto_options,
- SSLProtocolVersion max_version = SSL_PROTOCOL_DTLS_12)
- : DtlsTransportInternalImpl(env,
- ice_transport,
- crypto_options,
- &env.event_log(),
- max_version) {}
+ SSLProtocolVersion max_version = SSL_PROTOCOL_DTLS_12);
~DtlsTransportInternalImpl() override;
@@ -262,13 +241,6 @@ class DtlsTransportInternalImpl : public DtlsTransportInternal {
bool WasDtlsCompletedByPiggybacking();
private:
- // Temporary constructor to unify deprecated and new one.
- DtlsTransportInternalImpl(std::optional<Environment> env,
- IceTransportInternal* ice_transport,
- const CryptoOptions& crypto_options,
- RtcEventLog* event_log,
- SSLProtocolVersion max_version);
-
void ConnectToIceTransport();
void OnWritableState(PacketTransportInternal* transport);
@@ -296,9 +268,7 @@ class DtlsTransportInternalImpl : public DtlsTransportInternal {
const ReceivedIpPacket& packet)> callback);
void PeriodicRetransmitDtlsPacketUntilDtlsConnected();
- // TODO: bugs.webrtc.org/42223992 - Make non-optional when deprecated
- // constructor is removed.
- const std::optional<Environment> env_;
+ const Environment env_;
RTC_NO_UNIQUE_ADDRESS SequenceChecker thread_checker_;
const int component_;
@@ -332,8 +302,6 @@ class DtlsTransportInternalImpl : public DtlsTransportInternal {
// of the stack.
bool ice_has_been_writable_ = false;
- RtcEventLog* const event_log_;
-
// Initialized in constructor based on WebRTC-IceHandshakeDtls,
// (so that we return PIGGYBACK_ACK to client if we get STUN_BINDING_REQUEST
// directly). Maybe disabled in SetupDtls has been called.