From 035747712f46e1aeb0e63f187dc5a6ff1b8cca99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= Date: Mon, 15 Mar 2021 17:10:21 +0100 Subject: [PATCH] Delete use of AsyncInvoker from FakePacketTransport Bug: webrtc:12339 Change-Id: Ia9a5568b576b9a95ed9e1326f38fb68a8581dc88 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/211981 Reviewed-by: Taylor Commit-Queue: Niels Moller Cr-Commit-Position: refs/heads/master@{#33499} --- p2p/base/fake_packet_transport.h | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/p2p/base/fake_packet_transport.h b/p2p/base/fake_packet_transport.h index 88beaef7bf..b69c9b5208 100644 --- a/p2p/base/fake_packet_transport.h +++ b/p2p/base/fake_packet_transport.h @@ -15,7 +15,6 @@ #include #include "p2p/base/packet_transport_internal.h" -#include "rtc_base/async_invoker.h" #include "rtc_base/copy_on_write_buffer.h" namespace rtc { @@ -31,11 +30,6 @@ class FakePacketTransport : public PacketTransportInternal { } } - // If async, will send packets by "Post"-ing to message queue instead of - // synchronously "Send"-ing. - void SetAsync(bool async) { async_ = async; } - void SetAsyncDelay(int delay_ms) { async_delay_ms_ = delay_ms; } - // SetWritable, SetReceiving and SetDestination are the main methods that can // be used for testing, to simulate connectivity or lack thereof. void SetWritable(bool writable) { set_writable(writable); } @@ -70,13 +64,8 @@ class FakePacketTransport : public PacketTransportInternal { return -1; } CopyOnWriteBuffer packet(data, len); - if (async_) { - invoker_.AsyncInvokeDelayed( - RTC_FROM_HERE, Thread::Current(), - [this, packet] { SendPacketInternal(packet); }, async_delay_ms_); - } else { - SendPacketInternal(packet); - } + SendPacketInternal(packet); + SentPacket sent_packet(options.packet_id, TimeMillis()); SignalSentPacket(this, sent_packet); return static_cast(len); @@ -138,11 +127,8 @@ class FakePacketTransport : public PacketTransportInternal { } CopyOnWriteBuffer last_sent_packet_; - AsyncInvoker invoker_; std::string transport_name_; FakePacketTransport* dest_ = nullptr; - bool async_ = false; - int async_delay_ms_ = 0; bool writable_ = false; bool receiving_ = false;