diff options
Diffstat (limited to '')
-rw-r--r-- | third_party/libwebrtc/net/dcsctp/public/dcsctp_socket.h | 11 | ||||
-rw-r--r-- | third_party/libwebrtc/net/dcsctp/public/mock_dcsctp_socket.h | 8 |
2 files changed, 19 insertions, 0 deletions
diff --git a/third_party/libwebrtc/net/dcsctp/public/dcsctp_socket.h b/third_party/libwebrtc/net/dcsctp/public/dcsctp_socket.h index d0a81eaeb2..9989ae8d43 100644 --- a/third_party/libwebrtc/net/dcsctp/public/dcsctp_socket.h +++ b/third_party/libwebrtc/net/dcsctp/public/dcsctp_socket.h @@ -13,6 +13,7 @@ #include <cstdint> #include <memory> #include <utility> +#include <vector> #include "absl/strings/string_view.h" #include "absl/types/optional.h" @@ -577,6 +578,16 @@ class DcSctpSocketInterface { virtual SendStatus Send(DcSctpMessage message, const SendOptions& send_options) = 0; + // Sends the messages `messages` using the provided send options. + // Sending a message is an asynchronous operation, and the `OnError` callback + // may be invoked to indicate any errors in sending the message. + // + // This has identical semantics to Send, except that it may coalesce many + // messages into a single SCTP packet if they would fit. + virtual std::vector<SendStatus> SendMany( + rtc::ArrayView<DcSctpMessage> messages, + const SendOptions& send_options) = 0; + // Resetting streams is an asynchronous operation and the results will // be notified using `DcSctpSocketCallbacks::OnStreamsResetDone()` on success // and `DcSctpSocketCallbacks::OnStreamsResetFailed()` on failure. Note that diff --git a/third_party/libwebrtc/net/dcsctp/public/mock_dcsctp_socket.h b/third_party/libwebrtc/net/dcsctp/public/mock_dcsctp_socket.h index 0fd572bd94..c71c3ae16f 100644 --- a/third_party/libwebrtc/net/dcsctp/public/mock_dcsctp_socket.h +++ b/third_party/libwebrtc/net/dcsctp/public/mock_dcsctp_socket.h @@ -10,6 +10,8 @@ #ifndef NET_DCSCTP_PUBLIC_MOCK_DCSCTP_SOCKET_H_ #define NET_DCSCTP_PUBLIC_MOCK_DCSCTP_SOCKET_H_ +#include <vector> + #include "net/dcsctp/public/dcsctp_socket.h" #include "test/gmock.h" @@ -56,6 +58,12 @@ class MockDcSctpSocket : public DcSctpSocketInterface { (DcSctpMessage message, const SendOptions& send_options), (override)); + MOCK_METHOD(std::vector<SendStatus>, + SendMany, + (rtc::ArrayView<DcSctpMessage> messages, + const SendOptions& send_options), + (override)); + MOCK_METHOD(ResetStreamsStatus, ResetStreams, (rtc::ArrayView<const StreamID> outgoing_streams), |