commit 760200bc890707fd5b355458775d294161490337
parent 4d430ba7811074133f558f10ccbaaced9bc55e80
Author: Dan Baker <dbaker@mozilla.com>
Date: Tue, 2 Dec 2025 00:09:57 -0700
Bug 2000941 - Vendor libwebrtc from 7f3523e81a
Upstream commit: https://webrtc.googlesource.com/src/+/7f3523e81a3b373e85e37e5b7873a03397bf9ab8
Use helper function to derive DcSctpOptions from SctpOptions and trials
Bug: webrtc:426480601
Change-Id: I5d87c682ba275db30ad22c4607c982e218a2a75f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/394380
Reviewed-by: Victor Boivie <boivie@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/main@{#45728}
Diffstat:
10 files changed, 40 insertions(+), 23 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-02T07:06:55.460672+00:00.
+libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-12-02T07:09:44.340664+00:00.
# base of lastest vendoring
-928102e64d
+7f3523e81a
diff --git a/third_party/libwebrtc/media/BUILD.gn b/third_party/libwebrtc/media/BUILD.gn
@@ -759,6 +759,7 @@ if (rtc_build_dcsctp) {
":rtc_data_sctp_transport_internal",
"../api:array_view",
"../api:dtls_transport_interface",
+ "../api:field_trials_view",
"../api:libjingle_peerconnection_api",
"../api:priority",
"../api:rtc_error",
diff --git a/third_party/libwebrtc/media/sctp/dcsctp_transport.cc b/third_party/libwebrtc/media/sctp/dcsctp_transport.cc
@@ -26,6 +26,7 @@
#include "api/data_channel_interface.h"
#include "api/dtls_transport_interface.h"
#include "api/environment/environment.h"
+#include "api/field_trials_view.h"
#include "api/priority.h"
#include "api/rtc_error.h"
#include "api/sctp_transport_interface.h"
@@ -200,21 +201,8 @@ bool DcSctpTransport::Start(const SctpOptions& options) {
<< ", max_message_size=" << options.max_message_size << ")";
if (!socket_) {
- dcsctp::DcSctpOptions dcsctp_options;
- dcsctp_options.local_port = options.local_port;
- dcsctp_options.remote_port = options.remote_port;
- dcsctp_options.max_message_size = options.max_message_size;
- dcsctp_options.max_timer_backoff_duration = kMaxTimerBackoffDuration;
- // Don't close the connection automatically on too many retransmissions.
- dcsctp_options.max_retransmissions = std::nullopt;
- dcsctp_options.max_init_retransmits = std::nullopt;
- dcsctp_options.per_stream_send_queue_limit =
- DataChannelInterface::MaxSendQueueSize();
- // This is just set to avoid denial-of-service. Practically unlimited.
- dcsctp_options.max_send_buffer_size = std::numeric_limits<size_t>::max();
- dcsctp_options.enable_message_interleaving =
- env_.field_trials().IsEnabled("WebRTC-DataChannelMessageInterleaving");
-
+ dcsctp::DcSctpOptions dcsctp_options =
+ CreateDcSctpOptions(options, env_.field_trials());
std::unique_ptr<dcsctp::PacketObserver> packet_observer;
if (RTC_LOG_CHECK_LEVEL(LS_VERBOSE)) {
packet_observer =
@@ -753,4 +741,26 @@ void DcSctpTransport::MaybeConnectSocket() {
socket_->Connect();
}
}
+
+dcsctp::DcSctpOptions DcSctpTransport::CreateDcSctpOptions(
+ const SctpOptions& options,
+ const FieldTrialsView& field_trials) {
+ dcsctp::DcSctpOptions dcsctp_options;
+ dcsctp_options.local_port = options.local_port;
+ dcsctp_options.remote_port = options.remote_port;
+ dcsctp_options.max_message_size = options.max_message_size;
+ dcsctp_options.max_timer_backoff_duration = kMaxTimerBackoffDuration;
+ // Don't close the connection automatically on too many retransmissions.
+ dcsctp_options.max_retransmissions = std::nullopt;
+ dcsctp_options.max_init_retransmits = std::nullopt;
+ dcsctp_options.per_stream_send_queue_limit =
+ DataChannelInterface::MaxSendQueueSize();
+ // This is just set to avoid denial-of-service. Practically unlimited.
+ dcsctp_options.max_send_buffer_size = std::numeric_limits<size_t>::max();
+ dcsctp_options.enable_message_interleaving =
+ field_trials.IsEnabled("WebRTC-DataChannelMessageInterleaving");
+
+ return dcsctp_options;
+}
+
} // namespace webrtc
diff --git a/third_party/libwebrtc/media/sctp/dcsctp_transport.h b/third_party/libwebrtc/media/sctp/dcsctp_transport.h
@@ -22,6 +22,7 @@
#include "api/array_view.h"
#include "api/dtls_transport_interface.h"
#include "api/environment/environment.h"
+#include "api/field_trials_view.h"
#include "api/priority.h"
#include "api/rtc_error.h"
#include "api/sctp_transport_interface.h"
@@ -29,6 +30,7 @@
#include "api/transport/data_channel_transport_interface.h"
#include "media/sctp/sctp_transport_internal.h"
#include "net/dcsctp/public/dcsctp_message.h"
+#include "net/dcsctp/public/dcsctp_options.h"
#include "net/dcsctp/public/dcsctp_socket.h"
#include "net/dcsctp/public/dcsctp_socket_factory.h"
#include "net/dcsctp/public/timeout.h"
@@ -146,6 +148,10 @@ class DcSctpTransport : public SctpTransportInternal,
bool ready_to_send_data_ RTC_GUARDED_BY(network_thread_) = false;
std::function<void()> on_connected_callback_ RTC_GUARDED_BY(network_thread_);
DataChannelSink* data_channel_sink_ RTC_GUARDED_BY(network_thread_) = nullptr;
+
+ static dcsctp::DcSctpOptions CreateDcSctpOptions(
+ const SctpOptions& options,
+ const FieldTrialsView& field_trials);
};
} // namespace webrtc
diff --git a/third_party/libwebrtc/moz-patch-stack/s0027.patch b/third_party/libwebrtc/moz-patch-stack/s0027.patch
@@ -544,7 +544,7 @@ index 88890be798..c9aefc297b 100644
#include "rtc_base/memory/aligned_malloc.h"
diff --git a/media/BUILD.gn b/media/BUILD.gn
-index 0221c2b573..0f58959926 100644
+index 3dc74678c0..cda5e96dbd 100644
--- a/media/BUILD.gn
+++ b/media/BUILD.gn
@@ -77,7 +77,7 @@ rtc_library("rtc_media_base") {
diff --git a/third_party/libwebrtc/moz-patch-stack/s0087.patch b/third_party/libwebrtc/moz-patch-stack/s0087.patch
@@ -9,7 +9,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/60304c5d8a86fdecf
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/media/BUILD.gn b/media/BUILD.gn
-index 0f58959926..6dcbc2bb33 100644
+index cda5e96dbd..c210f60c43 100644
--- a/media/BUILD.gn
+++ b/media/BUILD.gn
@@ -56,6 +56,11 @@ rtc_library("rtc_media_base") {
diff --git a/third_party/libwebrtc/moz-patch-stack/s0100.patch b/third_party/libwebrtc/moz-patch-stack/s0100.patch
@@ -26,7 +26,7 @@ index 26080d9abc..4df8681a9b 100644
# These are the targets to skip header checking by default. The files in targets
# matching these patterns (see "gn help label_pattern" for format) will not have
diff --git a/media/BUILD.gn b/media/BUILD.gn
-index 6dcbc2bb33..6896edbc34 100644
+index c210f60c43..96b7b457f0 100644
--- a/media/BUILD.gn
+++ b/media/BUILD.gn
@@ -7,7 +7,7 @@
diff --git a/third_party/libwebrtc/moz-patch-stack/s0102.patch b/third_party/libwebrtc/moz-patch-stack/s0102.patch
@@ -427,7 +427,7 @@ index 401dca948a..cadd4bab1b 100644
group("logging") {
diff --git a/media/BUILD.gn b/media/BUILD.gn
-index 6896edbc34..ecbb7eae7e 100644
+index 96b7b457f0..efe964efaa 100644
--- a/media/BUILD.gn
+++ b/media/BUILD.gn
@@ -6,7 +6,7 @@
diff --git a/third_party/libwebrtc/moz-patch-stack/s0107.patch b/third_party/libwebrtc/moz-patch-stack/s0107.patch
@@ -38,7 +38,7 @@ index c01dd4ed48..4ce07a89d1 100644
]
# Added when we removed deps in other places to avoid building
diff --git a/media/BUILD.gn b/media/BUILD.gn
-index ecbb7eae7e..a13fe19324 100644
+index efe964efaa..98852e614a 100644
--- a/media/BUILD.gn
+++ b/media/BUILD.gn
@@ -12,12 +12,10 @@ import("../webrtc.gni")
diff --git a/third_party/libwebrtc/moz-patch-stack/s0109.patch b/third_party/libwebrtc/moz-patch-stack/s0109.patch
@@ -10,7 +10,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/b6dd815fc9d2df718
1 file changed, 11 deletions(-)
diff --git a/media/BUILD.gn b/media/BUILD.gn
-index a13fe19324..b709209b06 100644
+index 98852e614a..9fdbfd6cd6 100644
--- a/media/BUILD.gn
+++ b/media/BUILD.gn
@@ -54,11 +54,6 @@ rtc_library("rtc_media_base") {