Format /net folder
Formatting done via: git ls-files | grep -E '^net\/.*\.(h|cc|mm)' | xargs clang-format -i No-Iwyu: Includes didn't change and it isn't related to formatting Bug: webrtc:42225392 Change-Id: I5c9daed6c83459ace469dd2820e1cc4565dad8f6 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/373882 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Harald Alvestrand <hta@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#43683}
This commit is contained in:
parent
536c19a64d
commit
6b6ebf3689
@ -100,8 +100,7 @@ HeartbeatHandler::HeartbeatHandler(absl::string_view log_prefix,
|
|||||||
interval_timer_(timer_manager_->CreateTimer(
|
interval_timer_(timer_manager_->CreateTimer(
|
||||||
"heartbeat-interval",
|
"heartbeat-interval",
|
||||||
absl::bind_front(&HeartbeatHandler::OnIntervalTimerExpiry, this),
|
absl::bind_front(&HeartbeatHandler::OnIntervalTimerExpiry, this),
|
||||||
TimerOptions(interval_duration_,
|
TimerOptions(interval_duration_, TimerBackoffAlgorithm::kFixed))),
|
||||||
TimerBackoffAlgorithm::kFixed))),
|
|
||||||
timeout_timer_(timer_manager_->CreateTimer(
|
timeout_timer_(timer_manager_->CreateTimer(
|
||||||
"heartbeat-timeout",
|
"heartbeat-timeout",
|
||||||
absl::bind_front(&HeartbeatHandler::OnTimeoutTimerExpiry, this),
|
absl::bind_front(&HeartbeatHandler::OnTimeoutTimerExpiry, this),
|
||||||
@ -121,8 +120,7 @@ void HeartbeatHandler::RestartTimer() {
|
|||||||
if (interval_duration_should_include_rtt_) {
|
if (interval_duration_should_include_rtt_) {
|
||||||
// The RTT should be used, but it's not easy accessible. The RTO will
|
// The RTT should be used, but it's not easy accessible. The RTO will
|
||||||
// suffice.
|
// suffice.
|
||||||
interval_timer_->set_duration(
|
interval_timer_->set_duration(interval_duration_ + ctx_->current_rto());
|
||||||
interval_duration_ + ctx_->current_rto());
|
|
||||||
} else {
|
} else {
|
||||||
interval_timer_->set_duration(interval_duration_);
|
interval_timer_->set_duration(interval_duration_);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -60,23 +60,26 @@ void TaskQueueTimeoutFactory::TaskQueueTimeout::Start(DurationMs duration_ms,
|
|||||||
posted_task_expiration_ = timeout_expiration_;
|
posted_task_expiration_ = timeout_expiration_;
|
||||||
parent_.task_queue_.PostDelayedTaskWithPrecision(
|
parent_.task_queue_.PostDelayedTaskWithPrecision(
|
||||||
precision_,
|
precision_,
|
||||||
webrtc::SafeTask(
|
webrtc::SafeTask(pending_task_safety_flag_,
|
||||||
pending_task_safety_flag_,
|
|
||||||
[timeout_id, this]() {
|
[timeout_id, this]() {
|
||||||
RTC_DLOG(LS_VERBOSE) << "Timout expired: " << timeout_id.value();
|
RTC_DLOG(LS_VERBOSE)
|
||||||
|
<< "Timout expired: " << timeout_id.value();
|
||||||
RTC_DCHECK_RUN_ON(&parent_.thread_checker_);
|
RTC_DCHECK_RUN_ON(&parent_.thread_checker_);
|
||||||
RTC_DCHECK(!posted_task_expiration_.IsPlusInfinity());
|
RTC_DCHECK(!posted_task_expiration_.IsPlusInfinity());
|
||||||
posted_task_expiration_ = Timestamp::PlusInfinity();
|
posted_task_expiration_ = Timestamp::PlusInfinity();
|
||||||
|
|
||||||
if (timeout_expiration_.IsPlusInfinity()) {
|
if (timeout_expiration_.IsPlusInfinity()) {
|
||||||
// The timeout was stopped before it expired. Very common.
|
// The timeout was stopped before it expired. Very
|
||||||
|
// common.
|
||||||
} else {
|
} else {
|
||||||
// Note that the timeout might have been restarted, which updated
|
// Note that the timeout might have been restarted,
|
||||||
// `timeout_expiration_` but left the scheduled task running. So
|
// which updated `timeout_expiration_` but left the
|
||||||
// if it's not quite time to trigger the timeout yet, schedule a
|
// scheduled task running. So if it's not quite time
|
||||||
// new delayed task with what's remaining and retry at that point
|
// to trigger the timeout yet, schedule a new delayed
|
||||||
|
// task with what's remaining and retry at that point
|
||||||
// in time.
|
// in time.
|
||||||
TimeDelta remaining = timeout_expiration_ - parent_.Now();
|
TimeDelta remaining =
|
||||||
|
timeout_expiration_ - parent_.Now();
|
||||||
timeout_expiration_ = Timestamp::PlusInfinity();
|
timeout_expiration_ = Timestamp::PlusInfinity();
|
||||||
if (remaining > TimeDelta::Zero()) {
|
if (remaining > TimeDelta::Zero()) {
|
||||||
Start(DurationMs(remaining.ms()), timeout_id_);
|
Start(DurationMs(remaining.ms()), timeout_id_);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user