dcsctp: Migrating to using absl::bind_front
It is now allowed in WebRTC, so let's use it. Bug: webrtc:12943 Change-Id: I74a0f2fd9c1b9e7b5613ae1c592cf26842b8dddd Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228564 Commit-Queue: Victor Boivie <boivie@webrtc.org> Reviewed-by: Florent Castelli <orphis@webrtc.org> Cr-Commit-Position: refs/heads/master@{#34768}
This commit is contained in:

committed by
WebRTC LUCI CQ

parent
8df32eb0e1
commit
600bb8c79f
@ -39,6 +39,7 @@ rtc_library("heartbeat_handler") {
|
||||
"heartbeat_handler.h",
|
||||
]
|
||||
absl_deps = [
|
||||
"//third_party/abseil-cpp/absl/functional:bind_front",
|
||||
"//third_party/abseil-cpp/absl/strings",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
@ -69,6 +70,7 @@ rtc_library("stream_reset_handler") {
|
||||
"stream_reset_handler.h",
|
||||
]
|
||||
absl_deps = [
|
||||
"//third_party/abseil-cpp/absl/functional:bind_front",
|
||||
"//third_party/abseil-cpp/absl/strings",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
@ -102,6 +104,7 @@ rtc_library("transmission_control_block") {
|
||||
"transmission_control_block.h",
|
||||
]
|
||||
absl_deps = [
|
||||
"//third_party/abseil-cpp/absl/functional:bind_front",
|
||||
"//third_party/abseil-cpp/absl/strings",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
@ -147,6 +150,7 @@ rtc_library("dcsctp_socket") {
|
||||
"state_cookie.h",
|
||||
]
|
||||
absl_deps = [
|
||||
"//third_party/abseil-cpp/absl/functional:bind_front",
|
||||
"//third_party/abseil-cpp/absl/strings",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/functional/bind_front.h"
|
||||
#include "absl/memory/memory.h"
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "absl/types/optional.h"
|
||||
@ -151,19 +152,19 @@ DcSctpSocket::DcSctpSocket(absl::string_view log_prefix,
|
||||
timer_manager_([this]() { return callbacks_.CreateTimeout(); }),
|
||||
t1_init_(timer_manager_.CreateTimer(
|
||||
"t1-init",
|
||||
[this]() { return OnInitTimerExpiry(); },
|
||||
absl::bind_front(&DcSctpSocket::OnInitTimerExpiry, this),
|
||||
TimerOptions(options.t1_init_timeout,
|
||||
TimerBackoffAlgorithm::kExponential,
|
||||
options.max_init_retransmits))),
|
||||
t1_cookie_(timer_manager_.CreateTimer(
|
||||
"t1-cookie",
|
||||
[this]() { return OnCookieTimerExpiry(); },
|
||||
absl::bind_front(&DcSctpSocket::OnCookieTimerExpiry, this),
|
||||
TimerOptions(options.t1_cookie_timeout,
|
||||
TimerBackoffAlgorithm::kExponential,
|
||||
options.max_init_retransmits))),
|
||||
t2_shutdown_(timer_manager_.CreateTimer(
|
||||
"t2-shutdown",
|
||||
[this]() { return OnShutdownTimerExpiry(); },
|
||||
absl::bind_front(&DcSctpSocket::OnShutdownTimerExpiry, this),
|
||||
TimerOptions(options.t2_shutdown_timeout,
|
||||
TimerBackoffAlgorithm::kExponential,
|
||||
options.max_retransmissions))),
|
||||
@ -1109,7 +1110,7 @@ void DcSctpSocket::HandleInitAck(
|
||||
connect_params_.initial_tsn, chunk->initiate_tag(), chunk->initial_tsn(),
|
||||
chunk->a_rwnd(), MakeTieTag(callbacks_),
|
||||
[this]() { return state_ == State::kEstablished; },
|
||||
[this](SctpPacket::Builder& builder) { return SendPacket(builder); });
|
||||
absl::bind_front(&DcSctpSocket::SendPacket, this));
|
||||
RTC_DLOG(LS_VERBOSE) << log_prefix()
|
||||
<< "Created peer TCB: " << tcb_->ToString();
|
||||
|
||||
@ -1171,7 +1172,7 @@ void DcSctpSocket::HandleCookieEcho(
|
||||
connect_params_.initial_tsn, cookie->initiate_tag(),
|
||||
cookie->initial_tsn(), cookie->a_rwnd(), MakeTieTag(callbacks_),
|
||||
[this]() { return state_ == State::kEstablished; },
|
||||
[this](SctpPacket::Builder& builder) { return SendPacket(builder); });
|
||||
absl::bind_front(&DcSctpSocket::SendPacket, this));
|
||||
RTC_DLOG(LS_VERBOSE) << log_prefix()
|
||||
<< "Created peer TCB: " << tcb_->ToString();
|
||||
}
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/functional/bind_front.h"
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "absl/types/optional.h"
|
||||
#include "api/array_view.h"
|
||||
@ -95,11 +96,11 @@ HeartbeatHandler::HeartbeatHandler(absl::string_view log_prefix,
|
||||
options.heartbeat_interval_include_rtt),
|
||||
interval_timer_(timer_manager_->CreateTimer(
|
||||
"heartbeat-interval",
|
||||
[this]() { return OnIntervalTimerExpiry(); },
|
||||
absl::bind_front(&HeartbeatHandler::OnIntervalTimerExpiry, this),
|
||||
TimerOptions(interval_duration_, TimerBackoffAlgorithm::kFixed))),
|
||||
timeout_timer_(timer_manager_->CreateTimer(
|
||||
"heartbeat-timeout",
|
||||
[this]() { return OnTimeoutTimerExpiry(); },
|
||||
absl::bind_front(&HeartbeatHandler::OnTimeoutTimerExpiry, this),
|
||||
TimerOptions(options.rto_initial,
|
||||
TimerBackoffAlgorithm::kExponential,
|
||||
/*max_restarts=*/0))) {
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/functional/bind_front.h"
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "absl/types/optional.h"
|
||||
#include "api/array_view.h"
|
||||
@ -77,7 +78,7 @@ class StreamResetHandler {
|
||||
retransmission_queue_(retransmission_queue),
|
||||
reconfig_timer_(timer_manager->CreateTimer(
|
||||
"re-config",
|
||||
[this]() { return OnReconfigTimerExpiry(); },
|
||||
absl::bind_front(&StreamResetHandler::OnReconfigTimerExpiry, this),
|
||||
TimerOptions(DurationMs(0)))),
|
||||
next_outgoing_req_seq_nbr_(ReconfigRequestSN(*ctx_->my_initial_tsn())),
|
||||
last_processed_req_seq_nbr_(
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "absl/functional/bind_front.h"
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "net/dcsctp/common/sequence_numbers.h"
|
||||
#include "net/dcsctp/packet/chunk/cookie_echo_chunk.h"
|
||||
@ -63,11 +64,12 @@ class TransmissionControlBlock : public Context {
|
||||
callbacks_(callbacks),
|
||||
t3_rtx_(timer_manager_.CreateTimer(
|
||||
"t3-rtx",
|
||||
[this]() { return OnRtxTimerExpiry(); },
|
||||
absl::bind_front(&TransmissionControlBlock::OnRtxTimerExpiry, this),
|
||||
TimerOptions(options.rto_initial))),
|
||||
delayed_ack_timer_(timer_manager_.CreateTimer(
|
||||
"delayed-ack",
|
||||
[this]() { return OnDelayedAckTimerExpiry(); },
|
||||
absl::bind_front(&TransmissionControlBlock::OnDelayedAckTimerExpiry,
|
||||
this),
|
||||
TimerOptions(options.delayed_ack_max_timeout,
|
||||
TimerBackoffAlgorithm::kExponential,
|
||||
/*max_restarts=*/0))),
|
||||
@ -89,7 +91,7 @@ class TransmissionControlBlock : public Context {
|
||||
my_initial_tsn,
|
||||
a_rwnd,
|
||||
send_queue,
|
||||
[this](DurationMs rtt) { return ObserveRTT(rtt); },
|
||||
absl::bind_front(&TransmissionControlBlock::ObserveRTT, this),
|
||||
[this]() { tx_error_counter_.Clear(); },
|
||||
*t3_rtx_,
|
||||
options,
|
||||
|
Reference in New Issue
Block a user