Migrate net/dcsctp/ to absl::AnyInvocable based TaskQueueBase interface
Bug: webrtc:14245 Change-Id: Ibf34bdfa1b623c712978728abc4dd821bf2cb089 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267981 Auto-Submit: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Victor Boivie <boivie@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Victor Boivie <boivie@webrtc.org> Cr-Commit-Position: refs/heads/main@{#37458}
This commit is contained in:

committed by
WebRTC LUCI CQ

parent
25e268ae0f
commit
ecf88f4ade
@ -19,7 +19,6 @@
|
||||
#include "absl/types/optional.h"
|
||||
#include "api/array_view.h"
|
||||
#include "api/task_queue/task_queue_base.h"
|
||||
#include "api/task_queue/to_queued_task.h"
|
||||
#include "api/test/create_network_emulation_manager.h"
|
||||
#include "api/test/network_emulation_manager.h"
|
||||
#include "api/units/time_delta.h"
|
||||
@ -157,8 +156,7 @@ class SctpActor : public rtc::MessageHandlerAutoCleanup,
|
||||
emulated_socket.SetReceiver([this](rtc::CopyOnWriteBuffer buf) {
|
||||
// The receiver will be executed on the NetworkEmulation task queue, but
|
||||
// the dcSCTP socket is owned by `thread_` and is not thread-safe.
|
||||
thread_->PostTask(webrtc::ToQueuedTask(
|
||||
[this, buf] { this->sctp_socket_.ReceivePacket(buf); }));
|
||||
thread_->PostTask([this, buf] { this->sctp_socket_.ReceivePacket(buf); });
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ rtc_library("task_queue_timeout") {
|
||||
"../../../api:array_view",
|
||||
"../../../api/task_queue:pending_task_safety_flag",
|
||||
"../../../api/task_queue:task_queue",
|
||||
"../../../api/task_queue:to_queued_task",
|
||||
"../../../api/units:time_delta",
|
||||
"../../../rtc_base:checks",
|
||||
"../../../rtc_base:logging",
|
||||
"../public:socket",
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "net/dcsctp/timer/task_queue_timeout.h"
|
||||
|
||||
#include "api/task_queue/pending_task_safety_flag.h"
|
||||
#include "api/task_queue/to_queued_task.h"
|
||||
#include "api/units/time_delta.h"
|
||||
#include "rtc_base/logging.h"
|
||||
|
||||
namespace dcsctp {
|
||||
@ -58,7 +58,7 @@ void TaskQueueTimeoutFactory::TaskQueueTimeout::Start(DurationMs duration_ms,
|
||||
posted_task_expiration_ = timeout_expiration_;
|
||||
parent_.task_queue_.PostDelayedTaskWithPrecision(
|
||||
precision_,
|
||||
webrtc::ToQueuedTask(
|
||||
webrtc::SafeTask(
|
||||
pending_task_safety_flag_,
|
||||
[timeout_id, this]() {
|
||||
RTC_DLOG(LS_VERBOSE) << "Timout expired: " << timeout_id.value();
|
||||
@ -86,7 +86,7 @@ void TaskQueueTimeoutFactory::TaskQueueTimeout::Start(DurationMs duration_ms,
|
||||
}
|
||||
}
|
||||
}),
|
||||
duration_ms.value());
|
||||
webrtc::TimeDelta::Millis(duration_ms.value()));
|
||||
}
|
||||
|
||||
void TaskQueueTimeoutFactory::TaskQueueTimeout::Stop() {
|
||||
|
Reference in New Issue
Block a user