Move thread.h to webrtc namespace
As well,
- network_monitor.h
- platform_thread.h
- race_checker.h
Bug: webrtc:42232595
Change-Id: I63a457dff61f1e8f33a816958a377e112b05f446
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/382240
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#44189}
diff --git a/api/DEPS b/api/DEPS
index 5f83817..858e9f2 100644
--- a/api/DEPS
+++ b/api/DEPS
@@ -84,6 +84,10 @@
"+rtc_base/socket_address.h",
],
+ "create_peerconnection_factory\.h": [
+ "+rtc_base/thread.h",
+ ],
+
"data_channel_interface\.h": [
"+rtc_base/copy_on_write_buffer.h",
],
diff --git a/api/create_peerconnection_factory.cc b/api/create_peerconnection_factory.cc
index 67cf913..a6557cf 100644
--- a/api/create_peerconnection_factory.cc
+++ b/api/create_peerconnection_factory.cc
@@ -31,9 +31,9 @@
namespace webrtc {
rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory(
- rtc::Thread* network_thread,
- rtc::Thread* worker_thread,
- rtc::Thread* signaling_thread,
+ Thread* network_thread,
+ Thread* worker_thread,
+ Thread* signaling_thread,
rtc::scoped_refptr<AudioDeviceModule> default_adm,
rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory,
rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory,
diff --git a/api/create_peerconnection_factory.h b/api/create_peerconnection_factory.h
index 6c37124..b51beb1 100644
--- a/api/create_peerconnection_factory.h
+++ b/api/create_peerconnection_factory.h
@@ -25,13 +25,8 @@
#include "api/video_codecs/video_decoder_factory.h"
#include "api/video_codecs/video_encoder_factory.h"
#include "rtc_base/system/rtc_export.h"
+#include "rtc_base/thread.h"
-namespace rtc {
-// TODO(bugs.webrtc.org/9987): Move rtc::Thread to api/ or expose a better
-// type. At the moment, rtc::Thread is not part of api/ so it cannot be
-// included in order to avoid to leak internal types.
-class Thread; // IWYU pragma: keep
-} // namespace rtc
namespace webrtc {
class AudioFrameProcessor;
@@ -40,9 +35,9 @@
// extra internal video codecs will be added.
RTC_EXPORT rtc::scoped_refptr<PeerConnectionFactoryInterface>
CreatePeerConnectionFactory(
- rtc::Thread* network_thread,
- rtc::Thread* worker_thread,
- rtc::Thread* signaling_thread,
+ Thread* network_thread,
+ Thread* worker_thread,
+ Thread* signaling_thread,
rtc::scoped_refptr<AudioDeviceModule> default_adm,
rtc::scoped_refptr<AudioEncoderFactory> audio_encoder_factory,
rtc::scoped_refptr<AudioDecoderFactory> audio_decoder_factory,
diff --git a/api/peer_connection_interface.h b/api/peer_connection_interface.h
index 0f0f0d1..b8a12a6 100644
--- a/api/peer_connection_interface.h
+++ b/api/peer_connection_interface.h
@@ -146,10 +146,6 @@
#include "rtc_base/system/rtc_export.h"
#include "rtc_base/thread.h"
-namespace rtc {
-class Thread; // IWYU pragma: keep
-} // namespace rtc
-
namespace webrtc {
// IWYU pragma: begin_keep
// MediaFactory class definition is not part of the api.
@@ -1238,7 +1234,7 @@
//
// Also the only thread on which it's safe to use SessionDescriptionInterface
// pointers.
- virtual rtc::Thread* signaling_thread() const = 0;
+ virtual Thread* signaling_thread() const = 0;
// NetworkController instance being used by this PeerConnection, to be used
// to identify instances when using a custom NetworkControllerFactory.
@@ -1435,9 +1431,9 @@
~PeerConnectionFactoryDependencies();
// Optional dependencies
- rtc::Thread* network_thread = nullptr;
- rtc::Thread* worker_thread = nullptr;
- rtc::Thread* signaling_thread = nullptr;
+ Thread* network_thread = nullptr;
+ Thread* worker_thread = nullptr;
+ Thread* signaling_thread = nullptr;
SocketFactory* socket_factory = nullptr;
// The `packet_socket_factory` will only be used if CreatePeerConnection is
// called without a `port_allocator`.
diff --git a/api/sequence_checker_unittest.cc b/api/sequence_checker_unittest.cc
index 2174698..41eef3a 100644
--- a/api/sequence_checker_unittest.cc
+++ b/api/sequence_checker_unittest.cc
@@ -49,7 +49,7 @@
void RunOnDifferentThread(FunctionView<void()> run) {
Event thread_has_run_event;
- rtc::PlatformThread::SpawnJoinable(
+ PlatformThread::SpawnJoinable(
[&] {
run();
thread_has_run_event.Set();
diff --git a/api/test/mock_peerconnectioninterface.h b/api/test/mock_peerconnectioninterface.h
index 47a4b82..d0ea047 100644
--- a/api/test/mock_peerconnectioninterface.h
+++ b/api/test/mock_peerconnectioninterface.h
@@ -234,7 +234,7 @@
(override));
MOCK_METHOD(void, StopRtcEventLog, (), (override));
MOCK_METHOD(void, Close, (), (override));
- MOCK_METHOD(rtc::Thread*, signaling_thread, (), (const, override));
+ MOCK_METHOD(Thread*, signaling_thread, (), (const, override));
MOCK_METHOD(NetworkControllerInterface*,
GetNetworkController,
(),
diff --git a/api/test/pclf/media_quality_test_params.h b/api/test/pclf/media_quality_test_params.h
index f86f264..ceaf5bf 100644
--- a/api/test/pclf/media_quality_test_params.h
+++ b/api/test/pclf/media_quality_test_params.h
@@ -93,7 +93,7 @@
// Contains all components, that can be overridden in peer connection. Also
// has a network thread, that will be used to communicate with another peers.
struct InjectableComponents {
- InjectableComponents(rtc::Thread* network_thread,
+ InjectableComponents(Thread* network_thread,
std::unique_ptr<rtc::NetworkManager> network_manager,
SocketFactory* socket_factory)
: network_thread(network_thread),
@@ -105,8 +105,8 @@
pcf_dependencies->socket_factory = socket_factory;
}
- rtc::Thread* const network_thread;
- rtc::Thread* worker_thread;
+ Thread* const network_thread;
+ Thread* worker_thread;
std::unique_ptr<PeerConnectionFactoryComponents> pcf_dependencies;
std::unique_ptr<PeerConnectionComponents> pc_dependencies;
diff --git a/api/test/peer_network_dependencies.h b/api/test/peer_network_dependencies.h
index c61fa14..32e8b63 100644
--- a/api/test/peer_network_dependencies.h
+++ b/api/test/peer_network_dependencies.h
@@ -27,7 +27,7 @@
public:
virtual ~PeerNetworkDependencies() = default;
- virtual absl::Nonnull<rtc::Thread*> network_thread() = 0;
+ virtual absl::Nonnull<Thread*> network_thread() = 0;
virtual absl::Nonnull<SocketFactory*> socket_factory() = 0;
virtual absl::Nonnull<std::unique_ptr<rtc::NetworkManager>>
ReleaseNetworkManager() = 0;
diff --git a/api/test/time_controller.h b/api/test/time_controller.h
index b227df7..950f0af 100644
--- a/api/test/time_controller.h
+++ b/api/test/time_controller.h
@@ -43,13 +43,13 @@
// Creates an rtc::Thread instance. If `socket_server` is nullptr, a default
// noop socket server is created.
// Returned thread is not null and started.
- virtual std::unique_ptr<rtc::Thread> CreateThread(
+ virtual std::unique_ptr<Thread> CreateThread(
const std::string& name,
std::unique_ptr<SocketServer> socket_server = nullptr) = 0;
// Creates an rtc::Thread instance that ensure that it's set as the current
// thread.
- virtual rtc::Thread* GetMainThread() = 0;
+ virtual Thread* GetMainThread() = 0;
// Allow task queues and process threads created by this instance to execute
// for the given `duration`.
virtual void AdvanceTime(TimeDelta duration) = 0;
diff --git a/api/video_track_source_proxy_factory.h b/api/video_track_source_proxy_factory.h
index 3ab10da..81afee9 100644
--- a/api/video_track_source_proxy_factory.h
+++ b/api/video_track_source_proxy_factory.h
@@ -22,8 +22,8 @@
// VideoTrackSourceInterface implementation is destroyed on the signaling thread
// and marshals calls to `worker_thread` and `signaling_thread`.
rtc::scoped_refptr<VideoTrackSourceInterface> RTC_EXPORT
-CreateVideoTrackSourceProxy(rtc::Thread* signaling_thread,
- rtc::Thread* worker_thread,
+CreateVideoTrackSourceProxy(Thread* signaling_thread,
+ Thread* worker_thread,
VideoTrackSourceInterface* source);
} // namespace webrtc
diff --git a/audio/audio_send_stream.h b/audio/audio_send_stream.h
index 62a5537..52d4edf 100644
--- a/audio/audio_send_stream.h
+++ b/audio/audio_send_stream.h
@@ -154,7 +154,7 @@
const Environment env_;
SequenceChecker worker_thread_checker_;
- rtc::RaceChecker audio_capture_race_checker_;
+ RaceChecker audio_capture_race_checker_;
const bool allocate_audio_without_feedback_;
const bool force_no_audio_feedback_ = allocate_audio_without_feedback_;
diff --git a/audio/audio_state_unittest.cc b/audio/audio_state_unittest.cc
index a563f69..fa067ff 100644
--- a/audio/audio_state_unittest.cc
+++ b/audio/audio_state_unittest.cc
@@ -469,7 +469,7 @@
}
// SetPlayout(false) starts the NullAudioPoller...which needs a thread.
- rtc::ThreadManager::Instance()->WrapCurrentThread();
+ ThreadManager::Instance()->WrapCurrentThread();
EXPECT_CALL(*adm, StopPlayout());
audio_state->SetPlayout(false);
@@ -483,7 +483,7 @@
// Playout without streams starts the NullAudioPoller...
// which needs a thread.
- rtc::ThreadManager::Instance()->WrapCurrentThread();
+ ThreadManager::Instance()->WrapCurrentThread();
EXPECT_CALL(*adm, StopPlayout());
audio_state->RemoveReceivingStream(&stream);
@@ -516,7 +516,7 @@
// AddReceivingStream with playout disabled start the NullAudioPoller...
// which needs a thread.
- rtc::ThreadManager::Instance()->WrapCurrentThread();
+ ThreadManager::Instance()->WrapCurrentThread();
MockAudioReceiveStream stream;
audio_state->AddReceivingStream(&stream);
diff --git a/audio/channel_receive.cc b/audio/channel_receive.cc
index 9fa64ce..79e3828 100644
--- a/audio/channel_receive.cc
+++ b/audio/channel_receive.cc
@@ -252,7 +252,7 @@
// only access. We don't necessarily own and control these threads, so thread
// checkers cannot be used. E.g. Chromium may transfer "ownership" from one
// audio thread to another, but access is still sequential.
- rtc::RaceChecker audio_thread_race_checker_;
+ RaceChecker audio_thread_race_checker_;
Mutex callback_mutex_;
Mutex volume_settings_mutex_;
mutable Mutex call_stats_mutex_;
diff --git a/audio/channel_receive_frame_transformer_delegate_unittest.cc b/audio/channel_receive_frame_transformer_delegate_unittest.cc
index ccf3872..a7e12c5 100644
--- a/audio/channel_receive_frame_transformer_delegate_unittest.cc
+++ b/audio/channel_receive_frame_transformer_delegate_unittest.cc
@@ -85,14 +85,13 @@
// transformer, it passes it to the channel using the ReceiveFrameCallback.
TEST(ChannelReceiveFrameTransformerDelegateTest,
TransformRunsChannelReceiveCallback) {
- rtc::AutoThread main_thread;
+ AutoThread main_thread;
rtc::scoped_refptr<MockFrameTransformer> mock_frame_transformer =
rtc::make_ref_counted<NiceMock<MockFrameTransformer>>();
MockChannelReceive mock_channel;
rtc::scoped_refptr<ChannelReceiveFrameTransformerDelegate> delegate =
rtc::make_ref_counted<ChannelReceiveFrameTransformerDelegate>(
- mock_channel.callback(), mock_frame_transformer,
- rtc::Thread::Current());
+ mock_channel.callback(), mock_frame_transformer, Thread::Current());
rtc::scoped_refptr<TransformedFrameCallback> callback;
EXPECT_CALL(*mock_frame_transformer, RegisterTransformedFrameCallback)
.WillOnce(SaveArg<0>(&callback));
@@ -110,21 +109,20 @@
});
delegate->Transform(packet, header, /*ssrc=*/1111, /*mimeType=*/"audio/opus",
kFakeReceiveTimestamp);
- rtc::ThreadManager::ProcessAllMessageQueuesForTesting();
+ ThreadManager::ProcessAllMessageQueuesForTesting();
}
// Test that when the delegate receives a Outgoing frame from the frame
// transformer, it passes it to the channel using the ReceiveFrameCallback.
TEST(ChannelReceiveFrameTransformerDelegateTest,
TransformRunsChannelReceiveCallbackForSenderFrame) {
- rtc::AutoThread main_thread;
+ AutoThread main_thread;
rtc::scoped_refptr<MockFrameTransformer> mock_frame_transformer =
rtc::make_ref_counted<NiceMock<MockFrameTransformer>>();
MockChannelReceive mock_channel;
rtc::scoped_refptr<ChannelReceiveFrameTransformerDelegate> delegate =
rtc::make_ref_counted<ChannelReceiveFrameTransformerDelegate>(
- mock_channel.callback(), mock_frame_transformer,
- rtc::Thread::Current());
+ mock_channel.callback(), mock_frame_transformer, Thread::Current());
rtc::scoped_refptr<TransformedFrameCallback> callback;
EXPECT_CALL(*mock_frame_transformer, RegisterTransformedFrameCallback)
.WillOnce(SaveArg<0>(&callback));
@@ -145,7 +143,7 @@
});
delegate->Transform(packet, header, /*ssrc=*/1111, /*mimeType=*/"audio/opus",
kFakeReceiveTimestamp);
- rtc::ThreadManager::ProcessAllMessageQueuesForTesting();
+ ThreadManager::ProcessAllMessageQueuesForTesting();
}
// Test that if the delegate receives a transformed frame after it has been
@@ -153,37 +151,35 @@
// after resetting the delegate.
TEST(ChannelReceiveFrameTransformerDelegateTest,
OnTransformedDoesNotRunChannelReceiveCallbackAfterReset) {
- rtc::AutoThread main_thread;
+ AutoThread main_thread;
rtc::scoped_refptr<MockFrameTransformer> mock_frame_transformer =
rtc::make_ref_counted<testing::NiceMock<MockFrameTransformer>>();
MockChannelReceive mock_channel;
rtc::scoped_refptr<ChannelReceiveFrameTransformerDelegate> delegate =
rtc::make_ref_counted<ChannelReceiveFrameTransformerDelegate>(
- mock_channel.callback(), mock_frame_transformer,
- rtc::Thread::Current());
+ mock_channel.callback(), mock_frame_transformer, Thread::Current());
delegate->Reset();
EXPECT_CALL(mock_channel, ReceiveFrame).Times(0);
delegate->OnTransformedFrame(std::make_unique<MockTransformableAudioFrame>());
- rtc::ThreadManager::ProcessAllMessageQueuesForTesting();
+ ThreadManager::ProcessAllMessageQueuesForTesting();
}
TEST(ChannelReceiveFrameTransformerDelegateTest,
ShortCircuitingSkipsTransform) {
- rtc::AutoThread main_thread;
+ AutoThread main_thread;
rtc::scoped_refptr<MockFrameTransformer> mock_frame_transformer =
rtc::make_ref_counted<testing::NiceMock<MockFrameTransformer>>();
MockChannelReceive mock_channel;
rtc::scoped_refptr<ChannelReceiveFrameTransformerDelegate> delegate =
rtc::make_ref_counted<ChannelReceiveFrameTransformerDelegate>(
- mock_channel.callback(), mock_frame_transformer,
- rtc::Thread::Current());
+ mock_channel.callback(), mock_frame_transformer, Thread::Current());
const uint8_t data[] = {1, 2, 3, 4};
rtc::ArrayView<const uint8_t> packet(data, sizeof(data));
RTPHeader header;
delegate->StartShortCircuiting();
- rtc::ThreadManager::ProcessAllMessageQueuesForTesting();
+ ThreadManager::ProcessAllMessageQueuesForTesting();
// Will not call the actual transformer.
EXPECT_CALL(*mock_frame_transformer, Transform).Times(0);
@@ -195,13 +191,13 @@
TEST(ChannelReceiveFrameTransformerDelegateTest,
AudioLevelAndCaptureTimeAbsentWithoutExtension) {
- rtc::AutoThread main_thread;
+ AutoThread main_thread;
rtc::scoped_refptr<MockFrameTransformer> mock_frame_transformer =
rtc::make_ref_counted<NiceMock<MockFrameTransformer>>();
rtc::scoped_refptr<ChannelReceiveFrameTransformerDelegate> delegate =
rtc::make_ref_counted<ChannelReceiveFrameTransformerDelegate>(
/*receive_frame_callback=*/nullptr, mock_frame_transformer,
- rtc::Thread::Current());
+ Thread::Current());
rtc::scoped_refptr<TransformedFrameCallback> callback;
EXPECT_CALL(*mock_frame_transformer, RegisterTransformedFrameCallback)
.WillOnce(SaveArg<0>(&callback));
@@ -232,13 +228,13 @@
TEST(ChannelReceiveFrameTransformerDelegateTest,
AudioLevelPresentWithExtension) {
- rtc::AutoThread main_thread;
+ AutoThread main_thread;
rtc::scoped_refptr<MockFrameTransformer> mock_frame_transformer =
rtc::make_ref_counted<NiceMock<MockFrameTransformer>>();
rtc::scoped_refptr<ChannelReceiveFrameTransformerDelegate> delegate =
rtc::make_ref_counted<ChannelReceiveFrameTransformerDelegate>(
/*receive_frame_callback=*/nullptr, mock_frame_transformer,
- rtc::Thread::Current());
+ Thread::Current());
rtc::scoped_refptr<TransformedFrameCallback> callback;
EXPECT_CALL(*mock_frame_transformer, RegisterTransformedFrameCallback)
.WillOnce(SaveArg<0>(&callback));
@@ -270,13 +266,13 @@
TEST(ChannelReceiveFrameTransformerDelegateTest,
CaptureTimePresentWithExtension) {
- rtc::AutoThread main_thread;
+ AutoThread main_thread;
rtc::scoped_refptr<MockFrameTransformer> mock_frame_transformer =
rtc::make_ref_counted<NiceMock<MockFrameTransformer>>();
rtc::scoped_refptr<ChannelReceiveFrameTransformerDelegate> delegate =
rtc::make_ref_counted<ChannelReceiveFrameTransformerDelegate>(
/*receive_frame_callback=*/nullptr, mock_frame_transformer,
- rtc::Thread::Current());
+ Thread::Current());
rtc::scoped_refptr<TransformedFrameCallback> callback;
EXPECT_CALL(*mock_frame_transformer, RegisterTransformedFrameCallback)
.WillOnce(SaveArg<0>(&callback));
diff --git a/audio/channel_send.cc b/audio/channel_send.cc
index a971cae..13f7526 100644
--- a/audio/channel_send.cc
+++ b/audio/channel_send.cc
@@ -261,7 +261,7 @@
// only access. We don't necessarily own and control these threads, so thread
// checkers cannot be used. E.g. Chromium may transfer "ownership" from one
// audio thread to another, but access is still sequential.
- rtc::RaceChecker audio_thread_race_checker_;
+ RaceChecker audio_thread_race_checker_;
mutable Mutex volume_settings_mutex_;
diff --git a/call/adaptation/resource_adaptation_processor_unittest.cc b/call/adaptation/resource_adaptation_processor_unittest.cc
index 20696ea..c1e0d09 100644
--- a/call/adaptation/resource_adaptation_processor_unittest.cc
+++ b/call/adaptation/resource_adaptation_processor_unittest.cc
@@ -142,11 +142,11 @@
}
static void WaitUntilTaskQueueIdle() {
- ASSERT_TRUE(rtc::Thread::Current()->ProcessMessages(0));
+ ASSERT_TRUE(Thread::Current()->ProcessMessages(0));
}
protected:
- rtc::AutoThread main_thread_;
+ AutoThread main_thread_;
webrtc::test::ScopedKeyValueConfig field_trials_;
FakeFrameRateProvider frame_rate_provider_;
VideoStreamInputStateProvider input_state_provider_;
diff --git a/call/call.cc b/call/call.cc
index 6bda5045..da6a6a4 100644
--- a/call/call.cc
+++ b/call/call.cc
@@ -177,7 +177,7 @@
TaskQueueBase* GetCurrentTaskQueueOrThread() {
TaskQueueBase* current = TaskQueueBase::Current();
if (!current)
- current = rtc::ThreadManager::Instance()->CurrentThread();
+ current = ThreadManager::Instance()->CurrentThread();
return current;
}
diff --git a/call/call_perf_tests.cc b/call/call_perf_tests.cc
index 23e9254..90c9e7a 100644
--- a/call/call_perf_tests.cc
+++ b/call/call_perf_tests.cc
@@ -863,8 +863,8 @@
send_simulated_network_->SetConfig(pipe_config);
receive_simulated_network_->SetConfig(pipe_config);
- rtc::Thread::SleepMs(quick_perf_test ? kShortDelayMs
- : kBitrateStabilizationMs);
+ Thread::SleepMs(quick_perf_test ? kShortDelayMs
+ : kBitrateStabilizationMs);
int64_t avg_rtt = 0;
for (int i = 0; i < kBitrateMeasurements; i++) {
@@ -873,8 +873,8 @@
call_stats = sender_call_->GetStats();
});
avg_rtt += call_stats.rtt_ms;
- rtc::Thread::SleepMs(quick_perf_test ? kShortDelayMs
- : kBitrateMeasurementMs);
+ Thread::SleepMs(quick_perf_test ? kShortDelayMs
+ : kBitrateMeasurementMs);
}
avg_rtt = avg_rtt / kBitrateMeasurements;
if (avg_rtt > kMinGoodRttMs) {
diff --git a/call/flexfec_receive_stream_unittest.cc b/call/flexfec_receive_stream_unittest.cc
index e155e7f..96d3491 100644
--- a/call/flexfec_receive_stream_unittest.cc
+++ b/call/flexfec_receive_stream_unittest.cc
@@ -91,7 +91,7 @@
~FlexfecReceiveStreamTest() { receive_stream_->UnregisterFromTransport(); }
- rtc::AutoThread main_thread_;
+ AutoThread main_thread_;
MockTransport rtcp_send_transport_;
FlexfecReceiveStream::Config config_;
MockRecoveredPacketReceiver recovered_packet_receiver_;
diff --git a/common_video/include/video_frame_buffer_pool.h b/common_video/include/video_frame_buffer_pool.h
index 3d94bc5..d2a8b22 100644
--- a/common_video/include/video_frame_buffer_pool.h
+++ b/common_video/include/video_frame_buffer_pool.h
@@ -67,7 +67,7 @@
rtc::scoped_refptr<VideoFrameBuffer>
GetExistingBuffer(int width, int height, VideoFrameBuffer::Type type);
- rtc::RaceChecker race_checker_;
+ RaceChecker race_checker_;
std::list<rtc::scoped_refptr<VideoFrameBuffer>> buffers_;
// If true, newly allocated buffers are zero-initialized. Note that recycled
// buffers are not zero'd before reuse. This is required of buffers used by
diff --git a/examples/stunserver/stunserver_main.cc b/examples/stunserver/stunserver_main.cc
index 28ae01b..1c8f505 100644
--- a/examples/stunserver/stunserver_main.cc
+++ b/examples/stunserver/stunserver_main.cc
@@ -29,7 +29,8 @@
return 1;
}
- rtc::Thread* pthMain = rtc::ThreadManager::Instance()->WrapCurrentThread();
+ webrtc::Thread* pthMain =
+ webrtc::ThreadManager::Instance()->WrapCurrentThread();
RTC_DCHECK(pthMain);
webrtc::AsyncUDPSocket* server_socket =
diff --git a/examples/turnserver/turnserver_main.cc b/examples/turnserver/turnserver_main.cc
index 4a58271..0c8de32 100644
--- a/examples/turnserver/turnserver_main.cc
+++ b/examples/turnserver/turnserver_main.cc
@@ -71,7 +71,7 @@
}
webrtc::PhysicalSocketServer socket_server;
- rtc::AutoSocketServerThread main(&socket_server);
+ webrtc::AutoSocketServerThread main(&socket_server);
webrtc::AsyncUDPSocket* int_socket =
webrtc::AsyncUDPSocket::Create(&socket_server, int_addr);
if (!int_socket) {
diff --git a/media/base/fake_network_interface.h b/media/base/fake_network_interface.h
index ab73408..1174d51 100644
--- a/media/base/fake_network_interface.h
+++ b/media/base/fake_network_interface.h
@@ -42,7 +42,7 @@
class FakeNetworkInterface : public cricket::MediaChannelNetworkInterface {
public:
FakeNetworkInterface()
- : thread_(rtc::Thread::Current()),
+ : thread_(Thread::Current()),
dest_(NULL),
conf_(false),
sendbuf_size_(-1),
diff --git a/media/engine/fake_webrtc_call.cc b/media/engine/fake_webrtc_call.cc
index f4543bd..6901ab1 100644
--- a/media/engine/fake_webrtc_call.cc
+++ b/media/engine/fake_webrtc_call.cc
@@ -461,7 +461,7 @@
}
FakeCall::FakeCall(const Environment& env)
- : FakeCall(env, rtc::Thread::Current(), rtc::Thread::Current()) {}
+ : FakeCall(env, Thread::Current(), Thread::Current()) {}
FakeCall::FakeCall(const Environment& env,
TaskQueueBase* worker_thread,
diff --git a/media/engine/webrtc_voice_engine.cc b/media/engine/webrtc_voice_engine.cc
index 2c7962e..a6caad6 100644
--- a/media/engine/webrtc_voice_engine.cc
+++ b/media/engine/webrtc_voice_engine.cc
@@ -1237,7 +1237,7 @@
const AdaptivePtimeConfig adaptive_ptime_config_;
webrtc::SequenceChecker worker_thread_checker_;
- rtc::RaceChecker audio_capture_race_checker_;
+ webrtc::RaceChecker audio_capture_race_checker_;
webrtc::Call* call_ = nullptr;
webrtc::AudioSendStream::Config config_;
// The stream is owned by WebRtcAudioSendStream and may be reallocated if
diff --git a/media/engine/webrtc_voice_engine_unittest.cc b/media/engine/webrtc_voice_engine_unittest.cc
index a529a3d..74e3d1f 100644
--- a/media/engine/webrtc_voice_engine_unittest.cc
+++ b/media/engine/webrtc_voice_engine_unittest.cc
@@ -354,7 +354,7 @@
webrtc::RtpPacketReceived packet;
packet.Parse(reinterpret_cast<const uint8_t*>(data), len);
receive_channel_->OnPacketReceived(packet);
- rtc::Thread::Current()->ProcessMessages(0);
+ webrtc::Thread::Current()->ProcessMessages(0);
}
const webrtc::FakeAudioSendStream& GetSendStream(uint32_t ssrc) {
@@ -912,7 +912,7 @@
}
protected:
- rtc::AutoThread main_thread_;
+ webrtc::AutoThread main_thread_;
const bool use_null_apm_;
webrtc::test::ScopedKeyValueConfig field_trials_;
const Environment env_;
@@ -1625,7 +1625,7 @@
ASSERT_TRUE(received_packet.Parse(reference_packet.Buffer()));
receive_channel_->OnPacketReceived(received_packet);
- rtc::Thread::Current()->ProcessMessages(0);
+ webrtc::Thread::Current()->ProcessMessages(0);
webrtc::AudioLevel audio_level;
EXPECT_TRUE(call_.last_received_rtp_packet()
@@ -3656,7 +3656,7 @@
webrtc::RtpPacketReceived parsed_packet;
RTC_CHECK(parsed_packet.Parse(kPcmuPacket));
receive_channel_->OnPacketReceived(parsed_packet);
- rtc::Thread::Current()->ProcessMessages(0);
+ webrtc::Thread::Current()->ProcessMessages(0);
EXPECT_EQ(1, s->received_packets());
}
@@ -3824,7 +3824,7 @@
// Tests that the library initializes and shuts down properly.
TEST(WebRtcVoiceEngineTest, StartupShutdown) {
- rtc::AutoThread main_thread;
+ webrtc::AutoThread main_thread;
for (bool use_null_apm : {false, true}) {
// If the VoiceEngine wants to gather available codecs early, that's fine
// but we never want it to create a decoder at this stage.
@@ -3855,7 +3855,7 @@
// Tests that reference counting on the external ADM is correct.
TEST(WebRtcVoiceEngineTest, StartupShutdownWithExternalADM) {
- rtc::AutoThread main_thread;
+ webrtc::AutoThread main_thread;
for (bool use_null_apm : {false, true}) {
Environment env = CreateEnvironment();
auto adm = rtc::make_ref_counted<
@@ -3938,7 +3938,7 @@
// Tests that VoE supports at least 32 channels
TEST(WebRtcVoiceEngineTest, Has32Channels) {
- rtc::AutoThread main_thread;
+ webrtc::AutoThread main_thread;
for (bool use_null_apm : {false, true}) {
Environment env = CreateEnvironment();
rtc::scoped_refptr<webrtc::test::MockAudioDeviceModule> adm =
@@ -3971,7 +3971,7 @@
// Test that we set our preferred codecs properly.
TEST(WebRtcVoiceEngineTest, SetRecvCodecs) {
- rtc::AutoThread main_thread;
+ webrtc::AutoThread main_thread;
for (bool use_null_apm : {false, true}) {
Environment env = CreateEnvironment();
// TODO(ossu): I'm not sure of the intent of this test. It's either:
@@ -4003,7 +4003,7 @@
}
TEST(WebRtcVoiceEngineTest, SetRtpSendParametersMaxBitrate) {
- rtc::AutoThread main_thread;
+ webrtc::AutoThread main_thread;
Environment env = CreateEnvironment();
rtc::scoped_refptr<webrtc::test::MockAudioDeviceModule> adm =
webrtc::test::MockAudioDeviceModule::CreateNice();
diff --git a/media/sctp/dcsctp_transport.cc b/media/sctp/dcsctp_transport.cc
index 5c38ef5..0be0e2a 100644
--- a/media/sctp/dcsctp_transport.cc
+++ b/media/sctp/dcsctp_transport.cc
@@ -134,7 +134,7 @@
} // namespace
DcSctpTransport::DcSctpTransport(const Environment& env,
- rtc::Thread* network_thread,
+ Thread* network_thread,
cricket::DtlsTransportInternal* transport)
: DcSctpTransport(env,
network_thread,
@@ -143,7 +143,7 @@
DcSctpTransport::DcSctpTransport(
const Environment& env,
- rtc::Thread* network_thread,
+ Thread* network_thread,
cricket::DtlsTransportInternal* transport,
std::unique_ptr<dcsctp::DcSctpSocketFactory> socket_factory)
: network_thread_(network_thread),
diff --git a/media/sctp/dcsctp_transport.h b/media/sctp/dcsctp_transport.h
index 3d3b1ec..fb738af 100644
--- a/media/sctp/dcsctp_transport.h
+++ b/media/sctp/dcsctp_transport.h
@@ -51,10 +51,10 @@
public sigslot::has_slots<> {
public:
DcSctpTransport(const Environment& env,
- rtc::Thread* network_thread,
+ Thread* network_thread,
cricket::DtlsTransportInternal* transport);
DcSctpTransport(const Environment& env,
- rtc::Thread* network_thread,
+ Thread* network_thread,
cricket::DtlsTransportInternal* transport,
std::unique_ptr<dcsctp::DcSctpSocketFactory> socket_factory);
~DcSctpTransport() override;
@@ -112,7 +112,7 @@
webrtc::DtlsTransportState);
void MaybeConnectSocket();
- rtc::Thread* network_thread_;
+ Thread* network_thread_;
cricket::DtlsTransportInternal* transport_;
Environment env_;
Random random_;
diff --git a/media/sctp/dcsctp_transport_unittest.cc b/media/sctp/dcsctp_transport_unittest.cc
index ab17e51..e951864 100644
--- a/media/sctp/dcsctp_transport_unittest.cc
+++ b/media/sctp/dcsctp_transport_unittest.cc
@@ -83,7 +83,7 @@
.WillOnce(Return(ByMove(std::move(socket_ptr))));
sctp_transport_ = std::make_unique<webrtc::DcSctpTransport>(
- env_, rtc::Thread::Current(), &fake_dtls_transport_,
+ env_, Thread::Current(), &fake_dtls_transport_,
std::move(mock_dcsctp_socket_factory));
sctp_transport_->SetDataChannelSink(&sink_);
sctp_transport_->SetOnConnectedCallback([this]() { sink_.OnConnected(); });
@@ -99,7 +99,7 @@
} // namespace
TEST(DcSctpTransportTest, OpenSequence) {
- rtc::AutoThread main_thread;
+ AutoThread main_thread;
Peer peer_a;
peer_a.fake_dtls_transport_.SetWritable(true);
@@ -117,7 +117,7 @@
// Tests that the close sequence invoked from one end results in the stream to
// be reset from both ends and all the proper signals are sent.
TEST(DcSctpTransportTest, CloseSequence) {
- rtc::AutoThread main_thread;
+ AutoThread main_thread;
Peer peer_a;
Peer peer_b;
peer_a.fake_dtls_transport_.SetDestination(&peer_b.fake_dtls_transport_,
@@ -167,7 +167,7 @@
// terminates properly. Both peers will think they initiated it, so no
// OnClosingProcedureStartedRemotely should be called.
TEST(DcSctpTransportTest, CloseSequenceSimultaneous) {
- rtc::AutoThread main_thread;
+ AutoThread main_thread;
Peer peer_a;
Peer peer_b;
peer_a.fake_dtls_transport_.SetDestination(&peer_b.fake_dtls_transport_,
@@ -211,7 +211,7 @@
}
TEST(DcSctpTransportTest, SetStreamPriority) {
- rtc::AutoThread main_thread;
+ AutoThread main_thread;
Peer peer_a;
{
@@ -235,7 +235,7 @@
}
TEST(DcSctpTransportTest, DiscardMessageClosedChannel) {
- rtc::AutoThread main_thread;
+ AutoThread main_thread;
Peer peer_a;
EXPECT_CALL(*peer_a.socket_, Send(_, _)).Times(0);
@@ -251,7 +251,7 @@
}
TEST(DcSctpTransportTest, DiscardMessageClosingChannel) {
- rtc::AutoThread main_thread;
+ AutoThread main_thread;
Peer peer_a;
EXPECT_CALL(*peer_a.socket_, Send(_, _)).Times(0);
@@ -269,7 +269,7 @@
}
TEST(DcSctpTransportTest, SendDataOpenChannel) {
- rtc::AutoThread main_thread;
+ AutoThread main_thread;
Peer peer_a;
dcsctp::DcSctpOptions options;
@@ -287,7 +287,7 @@
}
TEST(DcSctpTransportTest, DeliversMessage) {
- rtc::AutoThread main_thread;
+ AutoThread main_thread;
Peer peer_a;
EXPECT_CALL(peer_a.sink_,
@@ -305,7 +305,7 @@
}
TEST(DcSctpTransportTest, DropMessageWithUnknownPpid) {
- rtc::AutoThread main_thread;
+ AutoThread main_thread;
Peer peer_a;
EXPECT_CALL(peer_a.sink_, OnDataReceived(_, _, _)).Times(0);
diff --git a/media/sctp/sctp_transport_factory.cc b/media/sctp/sctp_transport_factory.cc
index 0a3f5ac..154e7ce 100644
--- a/media/sctp/sctp_transport_factory.cc
+++ b/media/sctp/sctp_transport_factory.cc
@@ -24,7 +24,7 @@
namespace cricket {
-SctpTransportFactory::SctpTransportFactory(rtc::Thread* network_thread)
+SctpTransportFactory::SctpTransportFactory(webrtc::Thread* network_thread)
: network_thread_(network_thread) {
RTC_UNUSED(network_thread_);
}
diff --git a/media/sctp/sctp_transport_factory.h b/media/sctp/sctp_transport_factory.h
index f1eefe5..0fe6c9f 100644
--- a/media/sctp/sctp_transport_factory.h
+++ b/media/sctp/sctp_transport_factory.h
@@ -22,14 +22,14 @@
class SctpTransportFactory : public webrtc::SctpTransportFactoryInterface {
public:
- explicit SctpTransportFactory(rtc::Thread* network_thread);
+ explicit SctpTransportFactory(webrtc::Thread* network_thread);
std::unique_ptr<SctpTransportInternal> CreateSctpTransport(
const webrtc::Environment& env,
DtlsTransportInternal* transport) override;
private:
- rtc::Thread* network_thread_;
+ webrtc::Thread* network_thread_;
};
} // namespace cricket
diff --git a/modules/audio_coding/acm2/audio_coding_module_unittest.cc b/modules/audio_coding/acm2/audio_coding_module_unittest.cc
index a6f5e36..8b44504 100644
--- a/modules/audio_coding/acm2/audio_coding_module_unittest.cc
+++ b/modules/audio_coding/acm2/audio_coding_module_unittest.cc
@@ -381,22 +381,22 @@
quit_.store(false);
const auto attributes =
- rtc::ThreadAttributes().SetPriority(rtc::ThreadPriority::kRealtime);
- send_thread_ = rtc::PlatformThread::SpawnJoinable(
+ ThreadAttributes().SetPriority(ThreadPriority::kRealtime);
+ send_thread_ = PlatformThread::SpawnJoinable(
[this] {
while (!quit_.load()) {
CbSendImpl();
}
},
"send", attributes);
- insert_packet_thread_ = rtc::PlatformThread::SpawnJoinable(
+ insert_packet_thread_ = PlatformThread::SpawnJoinable(
[this] {
while (!quit_.load()) {
CbInsertPacketImpl();
}
},
"insert_packet", attributes);
- pull_audio_thread_ = rtc::PlatformThread::SpawnJoinable(
+ pull_audio_thread_ = PlatformThread::SpawnJoinable(
[this] {
while (!quit_.load()) {
CbPullAudioImpl();
@@ -470,9 +470,9 @@
fake_clock_->AdvanceTimeMilliseconds(10);
}
- rtc::PlatformThread send_thread_;
- rtc::PlatformThread insert_packet_thread_;
- rtc::PlatformThread pull_audio_thread_;
+ PlatformThread send_thread_;
+ PlatformThread insert_packet_thread_;
+ PlatformThread pull_audio_thread_;
// Used to force worker threads to stop looping.
std::atomic<bool> quit_;
diff --git a/modules/audio_device/audio_device_unittest.cc b/modules/audio_device/audio_device_unittest.cc
index 1507fe9..95c2b96 100644
--- a/modules/audio_device/audio_device_unittest.cc
+++ b/modules/audio_device/audio_device_unittest.cc
@@ -200,7 +200,7 @@
using Buffer16 = rtc::BufferT<int16_t>;
mutable Mutex lock_;
- rtc::RaceChecker race_checker_;
+ RaceChecker race_checker_;
std::list<Buffer16> fifo_ RTC_GUARDED_BY(lock_);
size_t write_count_ RTC_GUARDED_BY(race_checker_) = 0;
@@ -316,7 +316,7 @@
}
Mutex lock_;
- rtc::RaceChecker race_checker_;
+ RaceChecker race_checker_;
SequenceChecker read_thread_checker_;
SequenceChecker write_thread_checker_;
diff --git a/modules/audio_device/dummy/file_audio_device.cc b/modules/audio_device/dummy/file_audio_device.cc
index 7be47ef..9a36504 100644
--- a/modules/audio_device/dummy/file_audio_device.cc
+++ b/modules/audio_device/dummy/file_audio_device.cc
@@ -217,13 +217,13 @@
}
}
- _ptrThreadPlay = rtc::PlatformThread::SpawnJoinable(
+ _ptrThreadPlay = PlatformThread::SpawnJoinable(
[this] {
while (PlayThreadProcess()) {
}
},
"webrtc_audio_module_play_thread",
- rtc::ThreadAttributes().SetPriority(rtc::ThreadPriority::kRealtime));
+ ThreadAttributes().SetPriority(ThreadPriority::kRealtime));
RTC_LOG(LS_INFO) << "Started playout capture to output file: "
<< _outputFilename;
@@ -278,13 +278,13 @@
}
}
- _ptrThreadRec = rtc::PlatformThread::SpawnJoinable(
+ _ptrThreadRec = PlatformThread::SpawnJoinable(
[this] {
while (RecThreadProcess()) {
}
},
"webrtc_audio_module_capture_thread",
- rtc::ThreadAttributes().SetPriority(rtc::ThreadPriority::kRealtime));
+ ThreadAttributes().SetPriority(ThreadPriority::kRealtime));
RTC_LOG(LS_INFO) << "Started recording from input file: " << _inputFilename;
diff --git a/modules/audio_device/dummy/file_audio_device.h b/modules/audio_device/dummy/file_audio_device.h
index 2797993..ab7dee0 100644
--- a/modules/audio_device/dummy/file_audio_device.h
+++ b/modules/audio_device/dummy/file_audio_device.h
@@ -144,8 +144,8 @@
size_t _recordingFramesIn10MS;
size_t _playoutFramesIn10MS;
- rtc::PlatformThread _ptrThreadRec;
- rtc::PlatformThread _ptrThreadPlay;
+ PlatformThread _ptrThreadRec;
+ PlatformThread _ptrThreadPlay;
bool _playing;
bool _recording;
diff --git a/modules/audio_processing/aec3/echo_canceller3.h b/modules/audio_processing/aec3/echo_canceller3.h
index fb6b354..34ed93f 100644
--- a/modules/audio_processing/aec3/echo_canceller3.h
+++ b/modules/audio_processing/aec3/echo_canceller3.h
@@ -182,8 +182,8 @@
void AnalyzeCapture(const AudioBuffer& capture);
const Environment env_;
- rtc::RaceChecker capture_race_checker_;
- rtc::RaceChecker render_race_checker_;
+ RaceChecker capture_race_checker_;
+ RaceChecker render_race_checker_;
// State that is accessed by the AnalyzeRender call.
std::unique_ptr<RenderWriter> render_writer_
diff --git a/modules/audio_processing/aec_dump/aec_dump_impl.h b/modules/audio_processing/aec_dump/aec_dump_impl.h
index d5af31b..dc8239b 100644
--- a/modules/audio_processing/aec_dump/aec_dump_impl.h
+++ b/modules/audio_processing/aec_dump/aec_dump_impl.h
@@ -73,7 +73,7 @@
FileWrapper debug_file_;
int64_t num_bytes_left_for_log_ = 0;
- rtc::RaceChecker race_checker_;
+ RaceChecker race_checker_;
absl::Nonnull<TaskQueueBase*> worker_queue_;
CaptureStreamInfo capture_stream_info_;
};
diff --git a/modules/audio_processing/audio_processing_impl_locking_unittest.cc b/modules/audio_processing/audio_processing_impl_locking_unittest.cc
index 8d5423f..3346976 100644
--- a/modules/audio_processing/audio_processing_impl_locking_unittest.cc
+++ b/modules/audio_processing/audio_processing_impl_locking_unittest.cc
@@ -396,14 +396,14 @@
// Start the threads used in the test.
void StartThreads() {
const auto attributes =
- rtc::ThreadAttributes().SetPriority(rtc::ThreadPriority::kRealtime);
- render_thread_ = rtc::PlatformThread::SpawnJoinable(
+ ThreadAttributes().SetPriority(ThreadPriority::kRealtime);
+ render_thread_ = PlatformThread::SpawnJoinable(
[this] {
while (!MaybeEndTest())
render_thread_state_.Process();
},
"render", attributes);
- capture_thread_ = rtc::PlatformThread::SpawnJoinable(
+ capture_thread_ = PlatformThread::SpawnJoinable(
[this] {
while (!MaybeEndTest()) {
capture_thread_state_.Process();
@@ -411,7 +411,7 @@
},
"capture", attributes);
- stats_thread_ = rtc::PlatformThread::SpawnJoinable(
+ stats_thread_ = PlatformThread::SpawnJoinable(
[this] {
while (!MaybeEndTest())
stats_thread_state_.Process();
@@ -433,9 +433,9 @@
RenderProcessor render_thread_state_;
CaptureProcessor capture_thread_state_;
StatsProcessor stats_thread_state_;
- rtc::PlatformThread render_thread_;
- rtc::PlatformThread capture_thread_;
- rtc::PlatformThread stats_thread_;
+ PlatformThread render_thread_;
+ PlatformThread capture_thread_;
+ PlatformThread stats_thread_;
};
// Sleeps a random time between 0 and max_sleep milliseconds.
diff --git a/modules/audio_processing/audio_processing_performance_unittest.cc b/modules/audio_processing/audio_processing_performance_unittest.cc
index 5051ee5..a7bb10b 100644
--- a/modules/audio_processing/audio_processing_performance_unittest.cc
+++ b/modules/audio_processing/audio_processing_performance_unittest.cc
@@ -493,14 +493,14 @@
// Start the threads used in the test.
void StartThreads() {
const auto attributes =
- rtc::ThreadAttributes().SetPriority(rtc::ThreadPriority::kRealtime);
- render_thread_ = rtc::PlatformThread::SpawnJoinable(
+ ThreadAttributes().SetPriority(ThreadPriority::kRealtime);
+ render_thread_ = PlatformThread::SpawnJoinable(
[this] {
while (render_thread_state_->Process()) {
}
},
"render", attributes);
- capture_thread_ = rtc::PlatformThread::SpawnJoinable(
+ capture_thread_ = PlatformThread::SpawnJoinable(
[this] {
while (capture_thread_state_->Process()) {
}
@@ -520,8 +520,8 @@
LockedFlag capture_call_checker_;
std::unique_ptr<TimedThreadApiProcessor> render_thread_state_;
std::unique_ptr<TimedThreadApiProcessor> capture_thread_state_;
- rtc::PlatformThread render_thread_;
- rtc::PlatformThread capture_thread_;
+ PlatformThread render_thread_;
+ PlatformThread capture_thread_;
};
// Implements the callback functionality for the threads.
diff --git a/modules/congestion_controller/goog_cc/delay_based_bwe.h b/modules/congestion_controller/goog_cc/delay_based_bwe.h
index 50dcae9..4f02e2e 100644
--- a/modules/congestion_controller/goog_cc/delay_based_bwe.h
+++ b/modules/congestion_controller/goog_cc/delay_based_bwe.h
@@ -104,7 +104,7 @@
std::optional<DataRate> acked_bitrate,
DataRate* target_rate);
- rtc::RaceChecker network_race_;
+ RaceChecker network_race_;
RtcEventLog* const event_log_;
const FieldTrialsView* const key_value_config_;
diff --git a/modules/desktop_capture/screen_drawer_unittest.cc b/modules/desktop_capture/screen_drawer_unittest.cc
index f779013..f674355 100644
--- a/modules/desktop_capture/screen_drawer_unittest.cc
+++ b/modules/desktop_capture/screen_drawer_unittest.cc
@@ -76,8 +76,8 @@
const FunctionView<std::unique_ptr<ScreenDrawerLock>()> ctor_;
} task(&created, ready, ctor);
- auto lock_thread = rtc::PlatformThread::SpawnJoinable(
- [&task] { task.RunTask(); }, "lock_thread");
+ auto lock_thread =
+ PlatformThread::SpawnJoinable([&task] { task.RunTask(); }, "lock_thread");
// Wait for the first lock in Task::RunTask() to be created.
// TODO(zijiehe): Find a better solution to wait for the creation of the first
diff --git a/modules/rtp_rtcp/source/nack_rtx_unittest.cc b/modules/rtp_rtcp/source/nack_rtx_unittest.cc
index 709dacb..450754b 100644
--- a/modules/rtp_rtcp/source/nack_rtx_unittest.cc
+++ b/modules/rtp_rtcp/source/nack_rtx_unittest.cc
@@ -223,7 +223,7 @@
media_stream_.sequence_numbers_.sort();
}
- rtc::AutoThread main_thread_;
+ AutoThread main_thread_;
SimulatedClock fake_clock_;
const Environment env_;
std::unique_ptr<ReceiveStatistics> receive_statistics_;
diff --git a/modules/rtp_rtcp/source/rtcp_sender_unittest.cc b/modules/rtp_rtcp/source/rtcp_sender_unittest.cc
index 9cca326..b7466fc 100644
--- a/modules/rtp_rtcp/source/rtcp_sender_unittest.cc
+++ b/modules/rtp_rtcp/source/rtcp_sender_unittest.cc
@@ -150,7 +150,7 @@
return rtp_rtcp_impl_.GetFeedbackState();
}
- rtc::AutoThread main_thread_;
+ AutoThread main_thread_;
SimulatedClock clock_;
const Environment env_;
TestTransport test_transport_;
diff --git a/modules/rtp_rtcp/source/rtp_sender_audio_unittest.cc b/modules/rtp_rtcp/source/rtp_sender_audio_unittest.cc
index 300a6c1..c619ec9 100644
--- a/modules/rtp_rtcp/source/rtp_sender_audio_unittest.cc
+++ b/modules/rtp_rtcp/source/rtp_sender_audio_unittest.cc
@@ -80,7 +80,7 @@
rtp_module_.SetSequenceNumber(kSeqNum);
}
- rtc::AutoThread main_thread_;
+ AutoThread main_thread_;
SimulatedClock fake_clock_;
const Environment env_;
LoopbackTransportTest transport_;
diff --git a/modules/rtp_rtcp/source/rtp_sender_video.h b/modules/rtp_rtcp/source/rtp_sender_video.h
index 72fc83f..44a14d0 100644
--- a/modules/rtp_rtcp/source/rtp_sender_video.h
+++ b/modules/rtp_rtcp/source/rtp_sender_video.h
@@ -200,7 +200,7 @@
// These members should only be accessed from within SendVideo() to avoid
// potential race conditions.
- rtc::RaceChecker send_checker_;
+ RaceChecker send_checker_;
int32_t retransmission_settings_ RTC_GUARDED_BY(send_checker_);
VideoRotation last_rotation_ RTC_GUARDED_BY(send_checker_);
std::optional<ColorSpace> last_color_space_ RTC_GUARDED_BY(send_checker_);
diff --git a/modules/rtp_rtcp/source/rtp_sender_video_unittest.cc b/modules/rtp_rtcp/source/rtp_sender_video_unittest.cc
index 996eb6d..dc72575 100644
--- a/modules/rtp_rtcp/source/rtp_sender_video_unittest.cc
+++ b/modules/rtp_rtcp/source/rtp_sender_video_unittest.cc
@@ -208,7 +208,7 @@
int version);
protected:
- rtc::AutoThread main_thread_;
+ AutoThread main_thread_;
SimulatedClock fake_clock_;
const Environment env_;
LoopbackTransportTest transport_;
diff --git a/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.cc b/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.cc
index 0e52007..6c6f43c 100644
--- a/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.cc
+++ b/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.cc
@@ -123,7 +123,7 @@
RtpVideoFrameReceiver* receiver,
Clock* clock,
rtc::scoped_refptr<FrameTransformerInterface> frame_transformer,
- rtc::Thread* network_thread,
+ Thread* network_thread,
uint32_t ssrc)
: receiver_(receiver),
frame_transformer_(std::move(frame_transformer)),
diff --git a/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.h b/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.h
index f08fc69..c992608 100644
--- a/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.h
+++ b/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate.h
@@ -41,7 +41,7 @@
RtpVideoFrameReceiver* receiver,
Clock* clock,
rtc::scoped_refptr<FrameTransformerInterface> frame_transformer,
- rtc::Thread* network_thread,
+ Thread* network_thread,
uint32_t ssrc);
void Init();
@@ -71,7 +71,7 @@
RtpVideoFrameReceiver* receiver_ RTC_GUARDED_BY(network_sequence_checker_);
rtc::scoped_refptr<FrameTransformerInterface> frame_transformer_
RTC_GUARDED_BY(network_sequence_checker_);
- rtc::Thread* const network_thread_;
+ Thread* const network_thread_;
const uint32_t ssrc_;
Clock* const clock_;
bool short_circuit_ RTC_GUARDED_BY(network_sequence_checker_) = false;
diff --git a/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate_unittest.cc b/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate_unittest.cc
index d59e969..3a0c2c7 100644
--- a/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate_unittest.cc
+++ b/modules/rtp_rtcp/source/rtp_video_stream_receiver_frame_transformer_delegate_unittest.cc
@@ -77,7 +77,7 @@
SimulatedClock clock(0);
auto delegate(
rtc::make_ref_counted<RtpVideoStreamReceiverFrameTransformerDelegate>(
- &receiver, &clock, frame_transformer, rtc::Thread::Current(),
+ &receiver, &clock, frame_transformer, Thread::Current(),
/*remote_ssrc*/ 1111));
EXPECT_CALL(*frame_transformer,
RegisterTransformedFrameSinkCallback(testing::_, 1111));
@@ -91,7 +91,7 @@
SimulatedClock clock(0);
auto delegate(
rtc::make_ref_counted<RtpVideoStreamReceiverFrameTransformerDelegate>(
- &receiver, &clock, frame_transformer, rtc::Thread::Current(),
+ &receiver, &clock, frame_transformer, Thread::Current(),
/*remote_ssrc*/ 1111));
EXPECT_CALL(*frame_transformer, UnregisterTransformedFrameSinkCallback(1111));
delegate->Reset();
@@ -104,7 +104,7 @@
SimulatedClock clock(0);
auto delegate(
rtc::make_ref_counted<RtpVideoStreamReceiverFrameTransformerDelegate>(
- &receiver, &clock, frame_transformer, rtc::Thread::Current(),
+ &receiver, &clock, frame_transformer, Thread::Current(),
/*remote_ssrc*/ 1111));
auto frame = CreateRtpFrameObject();
EXPECT_CALL(*frame_transformer, Transform);
@@ -113,7 +113,7 @@
TEST(RtpVideoStreamReceiverFrameTransformerDelegateTest,
ManageFrameOnTransformedFrame) {
- rtc::AutoThread main_thread_;
+ AutoThread main_thread_;
TestRtpVideoFrameReceiver receiver;
auto mock_frame_transformer(
rtc::make_ref_counted<NiceMock<MockFrameTransformer>>());
@@ -121,7 +121,7 @@
std::vector<uint32_t> csrcs = {234, 345, 456};
auto delegate =
rtc::make_ref_counted<RtpVideoStreamReceiverFrameTransformerDelegate>(
- &receiver, &clock, mock_frame_transformer, rtc::Thread::Current(),
+ &receiver, &clock, mock_frame_transformer, Thread::Current(),
/*remote_ssrc*/ 1111);
rtc::scoped_refptr<TransformedFrameCallback> callback;
@@ -143,7 +143,7 @@
callback->OnTransformedFrame(std::move(frame));
});
delegate->TransformFrame(CreateRtpFrameObject(RTPVideoHeader(), csrcs));
- rtc::ThreadManager::ProcessAllMessageQueuesForTesting();
+ ThreadManager::ProcessAllMessageQueuesForTesting();
}
TEST(RtpVideoStreamReceiverFrameTransformerDelegateTest,
@@ -154,8 +154,7 @@
SimulatedClock clock(0);
auto delegate =
rtc::make_ref_counted<RtpVideoStreamReceiverFrameTransformerDelegate>(
- &receiver, &clock, mock_frame_transformer, rtc::Thread::Current(),
- 1111);
+ &receiver, &clock, mock_frame_transformer, Thread::Current(), 1111);
delegate->Init();
RTPVideoHeader video_header;
video_header.width = 1280u;
@@ -215,8 +214,7 @@
SimulatedClock clock(0);
auto delegate =
rtc::make_ref_counted<RtpVideoStreamReceiverFrameTransformerDelegate>(
- &receiver, &clock, mock_frame_transformer, rtc::Thread::Current(),
- 1111);
+ &receiver, &clock, mock_frame_transformer, Thread::Current(), 1111);
delegate->Init();
RTPVideoHeader video_header;
Timestamp capture_time = Timestamp::Millis(1234);
@@ -243,15 +241,14 @@
TEST(RtpVideoStreamReceiverFrameTransformerDelegateTest,
TransformableFrameMetadataHasCorrectValueAfterSetMetadata) {
- rtc::AutoThread main_thread;
+ AutoThread main_thread;
TestRtpVideoFrameReceiver receiver;
auto mock_frame_transformer =
rtc::make_ref_counted<NiceMock<MockFrameTransformer>>();
SimulatedClock clock(1000);
auto delegate =
rtc::make_ref_counted<RtpVideoStreamReceiverFrameTransformerDelegate>(
- &receiver, &clock, mock_frame_transformer, rtc::Thread::Current(),
- 1111);
+ &receiver, &clock, mock_frame_transformer, Thread::Current(), 1111);
rtc::scoped_refptr<TransformedFrameCallback> callback;
EXPECT_CALL(*mock_frame_transformer, RegisterTransformedFrameSinkCallback)
@@ -302,19 +299,19 @@
// The delegate creates a transformable frame from the RtpFrameObject.
delegate->TransformFrame(CreateRtpFrameObject(video_header, csrcs));
- rtc::ThreadManager::ProcessAllMessageQueuesForTesting();
+ ThreadManager::ProcessAllMessageQueuesForTesting();
}
TEST(RtpVideoStreamReceiverFrameTransformerDelegateTest,
SenderFramesAreConvertedToReceiverFrames) {
- rtc::AutoThread main_thread_;
+ AutoThread main_thread_;
TestRtpVideoFrameReceiver receiver;
auto mock_frame_transformer =
rtc::make_ref_counted<NiceMock<MockFrameTransformer>>();
SimulatedClock clock(/*initial_timestamp_us=*/12345000);
auto delegate =
rtc::make_ref_counted<RtpVideoStreamReceiverFrameTransformerDelegate>(
- &receiver, &clock, mock_frame_transformer, rtc::Thread::Current(),
+ &receiver, &clock, mock_frame_transformer, Thread::Current(),
/*remote_ssrc*/ 1111);
auto mock_sender_frame =
@@ -342,12 +339,12 @@
EXPECT_EQ(frame->ReceivedTime(), 12345);
});
callback->OnTransformedFrame(std::move(mock_sender_frame));
- rtc::ThreadManager::ProcessAllMessageQueuesForTesting();
+ ThreadManager::ProcessAllMessageQueuesForTesting();
}
TEST(RtpVideoStreamReceiverFrameTransformerDelegateTest,
ManageFrameFromDifferentReceiver) {
- rtc::AutoThread main_thread_;
+ AutoThread main_thread_;
std::vector<uint32_t> csrcs = {234, 345, 456};
const int frame_id = 11;
@@ -357,7 +354,7 @@
SimulatedClock clock(0);
auto delegate1 =
rtc::make_ref_counted<RtpVideoStreamReceiverFrameTransformerDelegate>(
- &receiver1, &clock, mock_frame_transformer1, rtc::Thread::Current(),
+ &receiver1, &clock, mock_frame_transformer1, Thread::Current(),
/*remote_ssrc*/ 1111);
TestRtpVideoFrameReceiver receiver2;
@@ -365,7 +362,7 @@
rtc::make_ref_counted<NiceMock<MockFrameTransformer>>());
auto delegate2 =
rtc::make_ref_counted<RtpVideoStreamReceiverFrameTransformerDelegate>(
- &receiver2, &clock, mock_frame_transformer2, rtc::Thread::Current(),
+ &receiver2, &clock, mock_frame_transformer2, Thread::Current(),
/*remote_ssrc*/ 1111);
delegate1->Init();
@@ -394,24 +391,23 @@
CreateRtpFrameObject(RTPVideoHeader(), csrcs);
untransformed_frame->SetId(frame_id);
delegate1->TransformFrame(std::move(untransformed_frame));
- rtc::ThreadManager::ProcessAllMessageQueuesForTesting();
+ ThreadManager::ProcessAllMessageQueuesForTesting();
}
TEST(RtpVideoStreamReceiverFrameTransformerDelegateTest,
ShortCircuitingSkipsTransform) {
- rtc::AutoThread main_thread_;
+ AutoThread main_thread_;
TestRtpVideoFrameReceiver receiver;
auto mock_frame_transformer =
rtc::make_ref_counted<NiceMock<MockFrameTransformer>>();
SimulatedClock clock(0);
auto delegate =
rtc::make_ref_counted<RtpVideoStreamReceiverFrameTransformerDelegate>(
- &receiver, &clock, mock_frame_transformer, rtc::Thread::Current(),
- 1111);
+ &receiver, &clock, mock_frame_transformer, Thread::Current(), 1111);
delegate->Init();
delegate->StartShortCircuiting();
- rtc::ThreadManager::ProcessAllMessageQueuesForTesting();
+ ThreadManager::ProcessAllMessageQueuesForTesting();
// Will not call the actual transformer.
EXPECT_CALL(*mock_frame_transformer, Transform).Times(0);
diff --git a/modules/rtp_rtcp/source/ulpfec_generator.h b/modules/rtp_rtcp/source/ulpfec_generator.h
index bf82878..e62e37f 100644
--- a/modules/rtp_rtcp/source/ulpfec_generator.h
+++ b/modules/rtp_rtcp/source/ulpfec_generator.h
@@ -103,7 +103,7 @@
const int red_payload_type_;
const int ulpfec_payload_type_;
- rtc::RaceChecker race_checker_;
+ RaceChecker race_checker_;
const std::unique_ptr<ForwardErrorCorrection> fec_
RTC_GUARDED_BY(race_checker_);
ForwardErrorCorrection::PacketList media_packets_
diff --git a/modules/video_capture/linux/video_capture_v4l2.cc b/modules/video_capture/linux/video_capture_v4l2.cc
index 377c1ec..e4c86c5 100644
--- a/modules/video_capture/linux/video_capture_v4l2.cc
+++ b/modules/video_capture/linux/video_capture_v4l2.cc
@@ -294,13 +294,12 @@
// start capture thread;
if (_captureThread.empty()) {
quit_ = false;
- _captureThread = rtc::PlatformThread::SpawnJoinable(
+ _captureThread = PlatformThread::SpawnJoinable(
[this] {
while (CaptureProcess()) {
}
},
- "CaptureThread",
- rtc::ThreadAttributes().SetPriority(rtc::ThreadPriority::kHigh));
+ "CaptureThread", ThreadAttributes().SetPriority(ThreadPriority::kHigh));
}
return 0;
}
diff --git a/modules/video_capture/linux/video_capture_v4l2.h b/modules/video_capture/linux/video_capture_v4l2.h
index 9bc4ce8..2611192 100644
--- a/modules/video_capture/linux/video_capture_v4l2.h
+++ b/modules/video_capture/linux/video_capture_v4l2.h
@@ -41,7 +41,7 @@
bool AllocateVideoBuffers() RTC_EXCLUSIVE_LOCKS_REQUIRED(capture_lock_);
bool DeAllocateVideoBuffers() RTC_EXCLUSIVE_LOCKS_REQUIRED(capture_lock_);
- rtc::PlatformThread _captureThread RTC_GUARDED_BY(api_checker_);
+ PlatformThread _captureThread RTC_GUARDED_BY(api_checker_);
Mutex capture_lock_ RTC_ACQUIRED_BEFORE(api_lock_);
bool quit_ RTC_GUARDED_BY(capture_lock_);
int32_t _deviceId RTC_GUARDED_BY(api_checker_);
diff --git a/modules/video_capture/video_capture_impl.h b/modules/video_capture/video_capture_impl.h
index 5ec1fd4..3511867 100644
--- a/modules/video_capture/video_capture_impl.h
+++ b/modules/video_capture/video_capture_impl.h
@@ -92,7 +92,7 @@
SequenceChecker api_checker_;
// RaceChecker for members that can be accessed on the API thread while
// capture is not happening, and on a callback thread otherwise.
- rtc::RaceChecker capture_checker_;
+ RaceChecker capture_checker_;
// current Device unique name;
char* _deviceUniqueId RTC_GUARDED_BY(api_checker_);
Mutex api_lock_;
diff --git a/modules/video_coding/nack_requester_unittest.cc b/modules/video_coding/nack_requester_unittest.cc
index 8307d1c..0abdfd1 100644
--- a/modules/video_coding/nack_requester_unittest.cc
+++ b/modules/video_coding/nack_requester_unittest.cc
@@ -89,7 +89,7 @@
}
static constexpr int64_t kDefaultRttMs = 20;
- rtc::AutoThread main_thread_;
+ AutoThread main_thread_;
test::RunLoop loop_;
std::unique_ptr<SimulatedClock> clock_;
std::unique_ptr<NackPeriodicProcessor> nack_periodic_processor_;
@@ -284,7 +284,7 @@
void RequestKeyFrame() override { ++keyframes_requested_; }
test::ScopedKeyValueConfig nack_delay_field_trial_;
- rtc::AutoThread main_thread_;
+ AutoThread main_thread_;
std::unique_ptr<SimulatedClock> clock_;
NackPeriodicProcessor nack_periodic_processor_;
NackRequester nack_module_;
diff --git a/net/dcsctp/socket/dcsctp_socket_network_test.cc b/net/dcsctp/socket/dcsctp_socket_network_test.cc
index c079c6e..2bcd47d 100644
--- a/net/dcsctp/socket/dcsctp_socket_network_test.cc
+++ b/net/dcsctp/socket/dcsctp_socket_network_test.cc
@@ -142,7 +142,7 @@
BoundSocket& emulated_socket,
const DcSctpOptions& sctp_options)
: log_prefix_(std::string(name) + ": "),
- thread_(rtc::Thread::Current()),
+ thread_(webrtc::Thread::Current()),
emulated_socket_(emulated_socket),
timeout_factory_(
*thread_,
@@ -313,7 +313,7 @@
ActorMode mode_ = ActorMode::kAtRest;
const std::string log_prefix_;
- rtc::Thread* thread_;
+ webrtc::Thread* thread_;
BoundSocket& emulated_socket_;
TaskQueueTimeoutFactory timeout_factory_;
webrtc::Random random_;
diff --git a/net/dcsctp/timer/task_queue_timeout_test.cc b/net/dcsctp/timer/task_queue_timeout_test.cc
index 3039e44..07e1a59 100644
--- a/net/dcsctp/timer/task_queue_timeout_test.cc
+++ b/net/dcsctp/timer/task_queue_timeout_test.cc
@@ -43,7 +43,7 @@
MockFunction<void(TimeoutID)> on_expired_;
webrtc::GlobalSimulatedTimeController time_controller_;
- rtc::Thread* task_queue_;
+ webrtc::Thread* task_queue_;
TaskQueueTimeoutFactory factory_;
};
diff --git a/p2p/BUILD.gn b/p2p/BUILD.gn
index ec61616..406eb2d 100644
--- a/p2p/BUILD.gn
+++ b/p2p/BUILD.gn
@@ -870,6 +870,7 @@
"../api:packet_socket_factory",
"../rtc_base:async_packet_socket",
"../rtc_base:refcount",
+ "../rtc_base:threading",
]
}
diff --git a/p2p/base/async_stun_tcp_socket_unittest.cc b/p2p/base/async_stun_tcp_socket_unittest.cc
index 6f83bc1..6ab6d00 100644
--- a/p2p/base/async_stun_tcp_socket_unittest.cc
+++ b/p2p/base/async_stun_tcp_socket_unittest.cc
@@ -140,7 +140,7 @@
}
std::unique_ptr<VirtualSocketServer> vss_;
- rtc::AutoSocketServerThread thread_;
+ AutoSocketServerThread thread_;
std::unique_ptr<AsyncStunTCPSocket> send_socket_;
std::unique_ptr<AsyncListenSocket> listen_socket_;
std::unique_ptr<AsyncPacketSocket> recv_socket_;
diff --git a/p2p/base/p2p_transport_channel.cc b/p2p/base/p2p_transport_channel.cc
index 2457170..e754796 100644
--- a/p2p/base/p2p_transport_channel.cc
+++ b/p2p/base/p2p_transport_channel.cc
@@ -188,7 +188,7 @@
? owned_dns_resolver_factory.get()
: async_dns_resolver_factory),
owned_dns_resolver_factory_(std::move(owned_dns_resolver_factory)),
- network_thread_(rtc::Thread::Current()),
+ network_thread_(webrtc::Thread::Current()),
incoming_only_(false),
error_(0),
remote_ice_mode_(ICEMODE_FULL),
@@ -958,7 +958,7 @@
void P2PTransportChannel::OnCandidateError(
webrtc::PortAllocatorSession* /* session */,
const IceCandidateErrorEvent& event) {
- RTC_DCHECK(network_thread_ == rtc::Thread::Current());
+ RTC_DCHECK(network_thread_ == webrtc::Thread::Current());
if (candidate_error_callback_) {
candidate_error_callback_(this, event);
}
diff --git a/p2p/base/p2p_transport_channel.h b/p2p/base/p2p_transport_channel.h
index 69be2ff..e9b6a31 100644
--- a/p2p/base/p2p_transport_channel.h
+++ b/p2p/base/p2p_transport_channel.h
@@ -420,7 +420,7 @@
RTC_GUARDED_BY(network_thread_);
const std::unique_ptr<webrtc::AsyncDnsResolverFactoryInterface>
owned_dns_resolver_factory_;
- rtc::Thread* const network_thread_;
+ webrtc::Thread* const network_thread_;
bool incoming_only_ RTC_GUARDED_BY(network_thread_);
int error_ RTC_GUARDED_BY(network_thread_);
std::vector<std::unique_ptr<webrtc::PortAllocatorSession>> allocator_sessions_
diff --git a/p2p/base/p2p_transport_channel_unittest.cc b/p2p/base/p2p_transport_channel_unittest.cc
index e1caaa0..631a075 100644
--- a/p2p/base/p2p_transport_channel_unittest.cc
+++ b/p2p/base/p2p_transport_channel_unittest.cc
@@ -540,7 +540,7 @@
ep2_.cd2_.ch_.reset();
// Process pending tasks that need to run for cleanup purposes such as
// pending deletion of Connection objects (see Connection::Destroy).
- rtc::Thread::Current()->ProcessMessages(0);
+ webrtc::Thread::Current()->ProcessMessages(0);
}
P2PTransportChannel* ep1_ch1() { return ep1_.cd1_.ch_.get(); }
P2PTransportChannel* ep1_ch2() { return ep1_.cd2_.ch_.get(); }
@@ -1054,7 +1054,7 @@
std::unique_ptr<webrtc::FirewallSocketServer> ss_;
std::unique_ptr<webrtc::BasicPacketSocketFactory> socket_factory_;
- rtc::AutoSocketServerThread main_;
+ webrtc::AutoSocketServerThread main_;
rtc::scoped_refptr<PendingTaskSafetyFlag> safety_ =
PendingTaskSafetyFlag::Create();
webrtc::TestStunServer::StunServerPtr stun_server_;
@@ -4150,7 +4150,7 @@
private:
std::unique_ptr<webrtc::VirtualSocketServer> vss_;
std::unique_ptr<webrtc::PacketSocketFactory> packet_socket_factory_;
- rtc::AutoSocketServerThread thread_;
+ webrtc::AutoSocketServerThread thread_;
int selected_candidate_pair_switches_ = 0;
int last_sent_packet_id_ = -1;
bool channel_ready_to_send_ = false;
@@ -4161,7 +4161,7 @@
TEST_F(P2PTransportChannelPingTest, TestTriggeredChecks) {
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("trigger checks", 1, &pa, &env.field_trials());
PrepareChannel(&ch);
@@ -4189,7 +4189,7 @@
TEST_F(P2PTransportChannelPingTest, TestAllConnectionsPingedSufficiently) {
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("ping sufficiently", 1, &pa, &env.field_trials());
PrepareChannel(&ch);
@@ -4225,7 +4225,7 @@
int SCHEDULING_RANGE = 200;
int RTT_RANGE = 10;
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("TestChannel", 1, &pa, &env.field_trials());
PrepareChannel(&ch);
@@ -4322,7 +4322,7 @@
webrtc::ScopedFakeClock clock;
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("TestChannel", 1, &pa, &env.field_trials());
ch.SetIceRole(ICEROLE_CONTROLLING);
@@ -4365,7 +4365,7 @@
TEST_F(P2PTransportChannelPingTest, TestNoTriggeredChecksWhenWritable) {
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("trigger checks", 1, &pa, &env.field_trials());
PrepareChannel(&ch);
@@ -4394,7 +4394,7 @@
TEST_F(P2PTransportChannelPingTest, TestFailedConnectionNotPingable) {
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("Do not ping failed connections", 1, &pa,
&env.field_trials());
@@ -4415,7 +4415,7 @@
TEST_F(P2PTransportChannelPingTest, TestSignalStateChanged) {
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("state change", 1, &pa, &env.field_trials());
PrepareChannel(&ch);
@@ -4442,7 +4442,7 @@
// ufrag, its pwd and generation will be set properly.
TEST_F(P2PTransportChannelPingTest, TestAddRemoteCandidateWithVariousUfrags) {
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("add candidate", 1, &pa, &env.field_trials());
PrepareChannel(&ch);
@@ -4468,7 +4468,7 @@
// Add a candidate with an old ufrag. No connection will be created.
ch.AddRemoteCandidate(CreateUdpCandidate(IceCandidateType::kHost, "2.2.2.2",
2, 2, kIceUfrag[1]));
- rtc::Thread::Current()->ProcessMessages(500);
+ webrtc::Thread::Current()->ProcessMessages(500);
EXPECT_TRUE(GetConnectionTo(&ch, "2.2.2.2", 2) == nullptr);
// Add a candidate with the current ufrag, its pwd and generation will be
@@ -4499,7 +4499,7 @@
TEST_F(P2PTransportChannelPingTest, ConnectionResurrection) {
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("connection resurrection", 1, &pa,
&env.field_trials());
@@ -4563,7 +4563,7 @@
TEST_F(P2PTransportChannelPingTest, TestReceivingStateChange) {
webrtc::ScopedFakeClock clock;
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("receiving state change", 1, &pa, &env.field_trials());
PrepareChannel(&ch);
@@ -4605,7 +4605,7 @@
// selected connection is writable.
TEST_F(P2PTransportChannelPingTest, TestSelectConnectionBeforeNomination) {
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("receiving state change", 1, &pa, &env.field_trials());
PrepareChannel(&ch);
@@ -4708,7 +4708,7 @@
TEST_F(P2PTransportChannelPingTest, TestPingOnNomination) {
const Environment env = CreateEnvironment(FieldTrials::CreateNoGlobal(
"WebRTC-IceFieldTrials/send_ping_on_nomination_ice_controlled:true/"));
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("receiving state change", 1, &pa, &env.field_trials());
PrepareChannel(&ch);
@@ -4757,7 +4757,7 @@
TEST_F(P2PTransportChannelPingTest, TestPingOnSwitch) {
const Environment env = CreateEnvironment(FieldTrials::CreateNoGlobal(
"WebRTC-IceFieldTrials/send_ping_on_switch_ice_controlling:true/"));
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("receiving state change", 1, &pa, &env.field_trials());
PrepareChannel(&ch);
@@ -4803,7 +4803,7 @@
TEST_F(P2PTransportChannelPingTest, TestPingOnSelected) {
const Environment env = CreateEnvironment(FieldTrials::CreateNoGlobal(
"WebRTC-IceFieldTrials/send_ping_on_selected_ice_controlling:true/"));
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("receiving state change", 1, &pa, &env.field_trials());
PrepareChannel(&ch);
@@ -4837,7 +4837,7 @@
// appropriately.
TEST_F(P2PTransportChannelPingTest, TestSelectConnectionFromUnknownAddress) {
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("receiving state change", 1, &pa, &env.field_trials());
PrepareChannel(&ch);
@@ -4923,7 +4923,7 @@
// the "selected connection".
TEST_F(P2PTransportChannelPingTest, TestSelectConnectionBasedOnMediaReceived) {
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("receiving state change", 1, &pa, &env.field_trials());
PrepareChannel(&ch);
@@ -4991,7 +4991,7 @@
webrtc::ScopedFakeClock clock;
const Environment env = CreateEnvironment();
clock.AdvanceTime(webrtc::TimeDelta::Seconds(1));
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("SwitchSelectedConnection", 1, &pa,
&env.field_trials());
@@ -5047,7 +5047,7 @@
clock.AdvanceTime(webrtc::TimeDelta::Seconds(1));
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("SwitchSelectedConnection", 1, &pa,
&env.field_trials());
@@ -5092,7 +5092,7 @@
clock.AdvanceTime(webrtc::TimeDelta::Seconds(1));
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("test", 1, &pa, &env.field_trials());
PrepareChannel(&ch);
@@ -5143,7 +5143,7 @@
clock.AdvanceTime(webrtc::TimeDelta::Seconds(1));
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("test", 1, &pa, &env.field_trials());
PrepareChannel(&ch);
@@ -5208,7 +5208,7 @@
clock.AdvanceTime(webrtc::TimeDelta::Seconds(1));
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("test", 1, &pa, &env.field_trials());
PrepareChannel(&ch);
@@ -5228,7 +5228,7 @@
webrtc::ScopedFakeClock clock;
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("SwitchSelectedConnection", 1, &pa,
&env.field_trials());
@@ -5286,7 +5286,7 @@
// an old one, it will be used to create a new connection.
TEST_F(P2PTransportChannelPingTest, TestAddRemoteCandidateWithAddressReuse) {
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("candidate reuse", 1, &pa, &env.field_trials());
PrepareChannel(&ch);
@@ -5328,7 +5328,7 @@
webrtc::ScopedFakeClock clock;
clock.AdvanceTime(webrtc::TimeDelta::Seconds(1));
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("test channel", 1, &pa, &env.field_trials());
PrepareChannel(&ch);
@@ -5377,7 +5377,7 @@
TEST_F(P2PTransportChannelPingTest, TestDontPruneHighPriorityConnections) {
webrtc::ScopedFakeClock clock;
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("test channel", 1, &pa, &env.field_trials());
PrepareChannel(&ch);
@@ -5404,7 +5404,7 @@
webrtc::ScopedFakeClock clock;
clock.AdvanceTime(webrtc::TimeDelta::Seconds(1));
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("test channel", 1, &pa, &env.field_trials());
EXPECT_EQ(webrtc::IceTransportState::kNew, ch.GetIceTransportState());
@@ -5457,7 +5457,7 @@
clock.AdvanceTime(webrtc::TimeDelta::Seconds(1));
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("test channel", 1, &pa, &env.field_trials());
PrepareChannel(&ch);
@@ -5536,7 +5536,7 @@
TEST_F(P2PTransportChannelPingTest, TestDeleteConnectionsIfAllWriteTimedout) {
webrtc::ScopedFakeClock clock;
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("test channel", 1, &pa, &env.field_trials());
PrepareChannel(&ch);
@@ -5581,7 +5581,7 @@
// the current port allocator session.
TEST_F(P2PTransportChannelPingTest, TestStopPortAllocatorSessions) {
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("test channel", 1, &pa, &env.field_trials());
PrepareChannel(&ch);
@@ -5618,7 +5618,7 @@
// the connections on it may still receive stun pings.
TEST_F(P2PTransportChannelPingTest, TestIceRoleUpdatedOnRemovedPort) {
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("test channel", ICE_CANDIDATE_COMPONENT_DEFAULT, &pa,
&env.field_trials());
@@ -5647,7 +5647,7 @@
// connections.
TEST_F(P2PTransportChannelPingTest, TestIceRoleUpdatedOnPortAfterIceRestart) {
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("test channel", ICE_CANDIDATE_COMPONENT_DEFAULT, &pa,
&env.field_trials());
@@ -5675,7 +5675,7 @@
webrtc::ScopedFakeClock fake_clock;
const Environment env = CreateEnvironment();
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("test channel", ICE_CANDIDATE_COMPONENT_DEFAULT, &pa,
&env.field_trials());
@@ -5711,7 +5711,7 @@
TEST_F(P2PTransportChannelPingTest, TestMaxOutstandingPingsFieldTrial) {
const Environment env = CreateEnvironment(FieldTrials::CreateNoGlobal(
"WebRTC-IceFieldTrials/max_outstanding_pings:3/"));
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("max", 1, &pa, &env.field_trials());
ch.SetIceConfig(ch.config());
@@ -5743,7 +5743,7 @@
: public P2PTransportChannelPingTest {
public:
P2PTransportChannelMostLikelyToWorkFirstTest()
- : turn_server_(rtc::Thread::Current(),
+ : turn_server_(webrtc::Thread::Current(),
ss(),
kTurnUdpIntAddr,
kTurnUdpExtAddr) {
@@ -6056,9 +6056,9 @@
ResolverFactoryFixture resolver_fixture;
std::unique_ptr<webrtc::SocketServer> socket_server =
rtc::CreateDefaultSocketServer();
- rtc::AutoSocketServerThread main_thread(socket_server.get());
+ webrtc::AutoSocketServerThread main_thread(socket_server.get());
webrtc::BasicPacketSocketFactory packet_socket_factory(socket_server.get());
- FakePortAllocator allocator(rtc::Thread::Current(), &packet_socket_factory,
+ FakePortAllocator allocator(webrtc::Thread::Current(), &packet_socket_factory,
&env.field_trials());
webrtc::IceTransportInit init;
init.set_port_allocator(&allocator);
@@ -6091,7 +6091,7 @@
// ICE parameter will be set up when creating the channels.
set_remote_ice_parameter_source(FROM_SETICEPARAMETERS);
GetEndpoint(0)->network_manager_.set_mdns_responder(
- std::make_unique<webrtc::FakeMdnsResponder>(rtc::Thread::Current()));
+ std::make_unique<webrtc::FakeMdnsResponder>(webrtc::Thread::Current()));
ResolverFactoryFixture resolver_fixture;
GetEndpoint(1)->async_dns_resolver_factory_ = &resolver_fixture;
@@ -6169,7 +6169,7 @@
// ICE parameter will be set up when creating the channels.
set_remote_ice_parameter_source(FROM_SETICEPARAMETERS);
GetEndpoint(0)->network_manager_.set_mdns_responder(
- std::make_unique<webrtc::FakeMdnsResponder>(rtc::Thread::Current()));
+ std::make_unique<webrtc::FakeMdnsResponder>(webrtc::Thread::Current()));
GetEndpoint(1)->async_dns_resolver_factory_ = &resolver_fixture;
CreateChannels(env);
// Pause sending candidates from both endpoints until we find out what port
@@ -6244,7 +6244,7 @@
// ICE parameter will be set up when creating the channels.
set_remote_ice_parameter_source(FROM_SETICEPARAMETERS);
GetEndpoint(0)->network_manager_.set_mdns_responder(
- std::make_unique<webrtc::FakeMdnsResponder>(rtc::Thread::Current()));
+ std::make_unique<webrtc::FakeMdnsResponder>(webrtc::Thread::Current()));
GetEndpoint(1)->async_dns_resolver_factory_ = &resolver_fixture;
CreateChannels(env);
// Pause sending candidates from both endpoints until we find out what port
@@ -6302,7 +6302,7 @@
// ICE parameter will be set up when creating the channels.
set_remote_ice_parameter_source(FROM_SETICEPARAMETERS);
GetEndpoint(0)->network_manager_.set_mdns_responder(
- std::make_unique<webrtc::FakeMdnsResponder>(rtc::Thread::Current()));
+ std::make_unique<webrtc::FakeMdnsResponder>(webrtc::Thread::Current()));
GetEndpoint(1)->async_dns_resolver_factory_ = &resolver_fixture;
CreateChannels(env);
// Pause sending candidates from both endpoints until we find out what port
@@ -6516,7 +6516,7 @@
// ICE parameter will be set up when creating the channels.
set_remote_ice_parameter_source(FROM_SETICEPARAMETERS);
GetEndpoint(0)->network_manager_.set_mdns_responder(
- std::make_unique<webrtc::FakeMdnsResponder>(rtc::Thread::Current()));
+ std::make_unique<webrtc::FakeMdnsResponder>(webrtc::Thread::Current()));
GetEndpoint(1)->async_dns_resolver_factory_ = &resolver_fixture;
CreateChannels(env);
// Pause sending candidates from both endpoints until we find out what port
@@ -7084,7 +7084,7 @@
const Environment env = CreateEnvironment(FieldTrials::CreateNoGlobal(
"WebRTC-IceFieldTrials/initial_select_dampening:0/"));
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("test channel", 1, &pa, &env.field_trials());
PrepareChannel(&ch);
@@ -7113,7 +7113,7 @@
const Environment env = CreateEnvironment(FieldTrials::CreateNoGlobal(
"WebRTC-IceFieldTrials/initial_select_dampening:100/"));
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("test channel", 1, &pa, &env.field_trials());
PrepareChannel(&ch);
@@ -7142,7 +7142,7 @@
const Environment env = CreateEnvironment(FieldTrials::CreateNoGlobal(
"WebRTC-IceFieldTrials/initial_select_dampening_ping_received:100/"));
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("test channel", 1, &pa, &env.field_trials());
PrepareChannel(&ch);
@@ -7174,7 +7174,7 @@
"initial_select_dampening:100,initial_select_dampening_ping_received:"
"50/"));
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
P2PTransportChannel ch("test channel", 1, &pa, &env.field_trials());
PrepareChannel(&ch);
@@ -7202,10 +7202,10 @@
const Environment env = CreateEnvironment();
std::unique_ptr<webrtc::SocketServer> socket_server =
rtc::CreateDefaultSocketServer();
- rtc::AutoSocketServerThread main_thread(socket_server.get());
+ webrtc::AutoSocketServerThread main_thread(socket_server.get());
webrtc::BasicPacketSocketFactory packet_socket_factory(socket_server.get());
webrtc::MockIceControllerFactory factory;
- FakePortAllocator pa(rtc::Thread::Current(), &packet_socket_factory,
+ FakePortAllocator pa(webrtc::Thread::Current(), &packet_socket_factory,
&env.field_trials());
EXPECT_CALL(factory, RecordIceControllerCreated()).Times(1);
webrtc::IceTransportInit init;
@@ -7221,10 +7221,10 @@
const Environment env = CreateEnvironment();
std::unique_ptr<webrtc::SocketServer> socket_server =
rtc::CreateDefaultSocketServer();
- rtc::AutoSocketServerThread main_thread(socket_server.get());
+ webrtc::AutoSocketServerThread main_thread(socket_server.get());
webrtc::BasicPacketSocketFactory packet_socket_factory(socket_server.get());
webrtc::MockActiveIceControllerFactory factory;
- FakePortAllocator pa(rtc::Thread::Current(), &packet_socket_factory,
+ FakePortAllocator pa(webrtc::Thread::Current(), &packet_socket_factory,
&env.field_trials());
EXPECT_CALL(factory, RecordActiveIceControllerCreated()).Times(1);
webrtc::IceTransportInit init;
@@ -7280,7 +7280,7 @@
TEST_F(P2PTransportChannelPingTest, TestForgetLearnedState) {
const Environment env = CreateEnvironment();
ForgetLearnedStateControllerFactory factory;
- FakePortAllocator pa(rtc::Thread::Current(), packet_socket_factory(),
+ FakePortAllocator pa(webrtc::Thread::Current(), packet_socket_factory(),
&env.field_trials());
webrtc::IceTransportInit init;
init.set_port_allocator(&pa);
diff --git a/p2p/base/port_allocator_unittest.cc b/p2p/base/port_allocator_unittest.cc
index ed42cac..f9689f0 100644
--- a/p2p/base/port_allocator_unittest.cc
+++ b/p2p/base/port_allocator_unittest.cc
@@ -37,7 +37,7 @@
packet_socket_factory_(
std::make_unique<webrtc::BasicPacketSocketFactory>(vss_.get())),
allocator_(std::make_unique<cricket::FakePortAllocator>(
- rtc::Thread::Current(),
+ webrtc::Thread::Current(),
packet_socket_factory_.get(),
&field_trials_)) {}
@@ -88,7 +88,7 @@
webrtc::test::ScopedKeyValueConfig field_trials_;
std::unique_ptr<webrtc::VirtualSocketServer> vss_;
- rtc::AutoSocketServerThread main_;
+ webrtc::AutoSocketServerThread main_;
std::unique_ptr<webrtc::PacketSocketFactory> packet_socket_factory_;
std::unique_ptr<cricket::FakePortAllocator> allocator_;
webrtc::SocketAddress stun_server_1{"11.11.11.11", 3478};
diff --git a/p2p/base/port_unittest.cc b/p2p/base/port_unittest.cc
index 49e85ad..a5d1d01 100644
--- a/p2p/base/port_unittest.cc
+++ b/p2p/base/port_unittest.cc
@@ -447,7 +447,7 @@
// Workaround for tests that trigger async destruction of objects that we
// need to give an opportunity here to run, before proceeding with other
// teardown.
- rtc::Thread::Current()->ProcessMessages(0);
+ webrtc::Thread::Current()->ProcessMessages(0);
}
protected:
@@ -947,7 +947,7 @@
// vector so that when it grows, pointers aren't invalidated.
std::list<rtc::Network> networks_;
std::unique_ptr<webrtc::VirtualSocketServer> ss_;
- rtc::AutoSocketServerThread main_;
+ webrtc::AutoSocketServerThread main_;
webrtc::BasicPacketSocketFactory socket_factory_;
std::unique_ptr<webrtc::NATServer> nat_server1_;
std::unique_ptr<webrtc::NATServer> nat_server2_;
@@ -1490,12 +1490,12 @@
ASSERT_NE(conn, nullptr);
// It is not dead if it is after MIN_CONNECTION_LIFETIME but not pruned.
conn->UpdateState(after_created + MIN_CONNECTION_LIFETIME + 1);
- rtc::Thread::Current()->ProcessMessages(0);
+ webrtc::Thread::Current()->ProcessMessages(0);
EXPECT_TRUE(ch1.conn() != nullptr);
// It is not dead if it is before MIN_CONNECTION_LIFETIME and pruned.
conn->UpdateState(before_created + MIN_CONNECTION_LIFETIME - 1);
conn->Prune();
- rtc::Thread::Current()->ProcessMessages(0);
+ webrtc::Thread::Current()->ProcessMessages(0);
EXPECT_TRUE(ch1.conn() != nullptr);
// It will be dead after MIN_CONNECTION_LIFETIME and pruned.
conn->UpdateState(after_created + MIN_CONNECTION_LIFETIME + 1);
@@ -1515,7 +1515,7 @@
// The connection will be dead after DEAD_CONNECTION_RECEIVE_TIMEOUT
conn->UpdateState(before_last_receiving + DEAD_CONNECTION_RECEIVE_TIMEOUT -
1);
- rtc::Thread::Current()->ProcessMessages(100);
+ webrtc::Thread::Current()->ProcessMessages(100);
EXPECT_TRUE(ch1.conn() != nullptr);
conn->UpdateState(after_last_receiving + DEAD_CONNECTION_RECEIVE_TIMEOUT + 1);
EXPECT_THAT(webrtc::WaitUntil(
@@ -1555,7 +1555,7 @@
int64_t after_last_receiving = webrtc::TimeMillis();
// The connection will be dead after 90s
conn->UpdateState(before_last_receiving + 90000 - 1);
- rtc::Thread::Current()->ProcessMessages(100);
+ webrtc::Thread::Current()->ProcessMessages(100);
EXPECT_TRUE(ch1.conn() != nullptr);
conn->UpdateState(after_last_receiving + 90000 + 1);
EXPECT_THAT(webrtc::WaitUntil(
@@ -1604,7 +1604,7 @@
// The connection will be dead 30s after the ping was sent.
conn->UpdateState(send_ping_timestamp + DEAD_CONNECTION_RECEIVE_TIMEOUT - 1);
- rtc::Thread::Current()->ProcessMessages(100);
+ webrtc::Thread::Current()->ProcessMessages(100);
EXPECT_TRUE(ch1.conn() != nullptr);
conn->UpdateState(send_ping_timestamp + DEAD_CONNECTION_RECEIVE_TIMEOUT + 1);
EXPECT_THAT(webrtc::WaitUntil(
@@ -2826,7 +2826,7 @@
int64_t last_ping_received1 = lconn->last_ping_received();
// Adding a delay of 100ms.
- rtc::Thread::Current()->ProcessMessages(100);
+ webrtc::Thread::Current()->ProcessMessages(100);
// Pinging lconn using stun indication message.
lconn->OnReadPacket(rtc::ReceivedPacket::CreateFromLegacy(
buf->Data(), buf->Length(), /*packet_time_us=*/-1));
@@ -2985,7 +2985,7 @@
// Running a second turn server, to get different base IP address.
SocketAddress kTurnUdpIntAddr2("99.99.98.4", webrtc::STUN_SERVER_PORT);
SocketAddress kTurnUdpExtAddr2("99.99.98.5", 0);
- webrtc::TestTurnServer turn_server2(rtc::Thread::Current(), vss(),
+ webrtc::TestTurnServer turn_server2(webrtc::Thread::Current(), vss(),
kTurnUdpIntAddr2, kTurnUdpExtAddr2);
auto turnport3 =
CreateTurnPort(kLocalAddr1, nat_socket_factory1(), webrtc::PROTO_UDP,
@@ -3000,7 +3000,7 @@
// Start a TCP turn server, and check that two turn candidates have
// different foundations if their relay protocols are different.
- webrtc::TestTurnServer turn_server3(rtc::Thread::Current(), vss(),
+ webrtc::TestTurnServer turn_server3(webrtc::Thread::Current(), vss(),
kTurnTcpIntAddr, kTurnUdpExtAddr,
webrtc::PROTO_TCP);
auto turnport4 = CreateTurnPort(kLocalAddr1, nat_socket_factory1(),
@@ -4134,7 +4134,7 @@
EXPECT_EQ(2u, conn_in_use->remote_candidate().generation());
// Make sure the new connection was not deleted.
- rtc::Thread::Current()->ProcessMessages(300);
+ webrtc::Thread::Current()->ProcessMessages(300);
EXPECT_TRUE(port->GetConnection(address) != nullptr);
}
diff --git a/p2p/base/pseudo_tcp_unittest.cc b/p2p/base/pseudo_tcp_unittest.cc
index 7b8a8a5..98bb5b9 100644
--- a/p2p/base/pseudo_tcp_unittest.cc
+++ b/p2p/base/pseudo_tcp_unittest.cc
@@ -212,7 +212,7 @@
TimeDelta::Millis(interval));
}
- rtc::AutoThread main_thread_;
+ webrtc::AutoThread main_thread_;
PseudoTcpForTest local_;
PseudoTcpForTest remote_;
ScopedTaskSafety local_timer_;
@@ -606,8 +606,8 @@
if (packets_in_flight_ > 0) {
// If there are packet tasks, attempt to continue sending after giving
// those packets time to process, which should free up the send buffer.
- rtc::Thread::Current()->PostDelayedTask([this] { WriteData(); },
- TimeDelta::Millis(10));
+ webrtc::Thread::Current()->PostDelayedTask([this] { WriteData(); },
+ TimeDelta::Millis(10));
} else {
if (!remote_.isReceiveBufferFull()) {
RTC_LOG(LS_ERROR) << "This shouldn't happen - the send buffer is full, "
diff --git a/p2p/base/regathering_controller.cc b/p2p/base/regathering_controller.cc
index 281489f..0a0b0d0 100644
--- a/p2p/base/regathering_controller.cc
+++ b/p2p/base/regathering_controller.cc
@@ -18,7 +18,7 @@
BasicRegatheringController::BasicRegatheringController(
const Config& config,
IceTransportInternal* ice_transport,
- rtc::Thread* thread)
+ Thread* thread)
: config_(config), ice_transport_(ice_transport), thread_(thread) {
RTC_DCHECK(thread_);
RTC_DCHECK_RUN_ON(thread_);
diff --git a/p2p/base/regathering_controller.h b/p2p/base/regathering_controller.h
index 95dcd16..b0ac916 100644
--- a/p2p/base/regathering_controller.h
+++ b/p2p/base/regathering_controller.h
@@ -51,7 +51,7 @@
BasicRegatheringController() = delete;
BasicRegatheringController(const Config& config,
IceTransportInternal* ice_transport,
- rtc::Thread* thread);
+ Thread* thread);
~BasicRegatheringController() override;
// TODO(qingsi): Remove this method after implementing a new signal in
// P2PTransportChannel and reacting to that signal for the initial schedules
@@ -89,7 +89,7 @@
Config config_;
IceTransportInternal* ice_transport_;
PortAllocatorSession* allocator_session_ = nullptr;
- rtc::Thread* const thread_;
+ Thread* const thread_;
};
} // namespace webrtc
diff --git a/p2p/base/regathering_controller_unittest.cc b/p2p/base/regathering_controller_unittest.cc
index d065f29..239773b 100644
--- a/p2p/base/regathering_controller_unittest.cc
+++ b/p2p/base/regathering_controller_unittest.cc
@@ -55,13 +55,13 @@
packet_socket_factory_(
std::make_unique<BasicPacketSocketFactory>(vss_.get())),
allocator_(std::make_unique<cricket::FakePortAllocator>(
- rtc::Thread::Current(),
+ Thread::Current(),
packet_socket_factory_.get(),
&field_trials_)) {
BasicRegatheringController::Config regathering_config;
regathering_config.regather_on_failed_networks_interval = 0;
regathering_controller_.reset(new BasicRegatheringController(
- regathering_config, ice_transport_.get(), rtc::Thread::Current()));
+ regathering_config, ice_transport_.get(), Thread::Current()));
}
// Initializes the allocator and gathers candidates once by StartGettingPorts.
@@ -111,7 +111,7 @@
private:
webrtc::test::ScopedKeyValueConfig field_trials_;
std::unique_ptr<VirtualSocketServer> vss_;
- rtc::AutoSocketServerThread thread_;
+ AutoSocketServerThread thread_;
std::unique_ptr<IceTransportInternal> ice_transport_;
std::unique_ptr<BasicRegatheringController> regathering_controller_;
std::unique_ptr<PacketSocketFactory> packet_socket_factory_;
diff --git a/p2p/base/stun_port_unittest.cc b/p2p/base/stun_port_unittest.cc
index 7b90e12..0b66fc7 100644
--- a/p2p/base/stun_port_unittest.cc
+++ b/p2p/base/stun_port_unittest.cc
@@ -294,7 +294,7 @@
webrtc::TestStunServer* stun_server_1() { return stun_servers_[0].get(); }
webrtc::TestStunServer* stun_server_2() { return stun_servers_[1].get(); }
- rtc::AutoSocketServerThread& thread() { return thread_; }
+ webrtc::AutoSocketServerThread& thread() { return thread_; }
webrtc::SocketFactory* nat_factory() { return &nat_factory_; }
private:
@@ -302,7 +302,7 @@
rtc::Network* network_;
std::unique_ptr<webrtc::VirtualSocketServer> ss_;
- rtc::AutoSocketServerThread thread_;
+ webrtc::AutoSocketServerThread thread_;
webrtc::NATSocketFactory nat_factory_;
webrtc::BasicPacketSocketFactory nat_socket_factory_;
std::unique_ptr<cricket::UDPPort> stun_port_;
diff --git a/p2p/base/stun_request_unittest.cc b/p2p/base/stun_request_unittest.cc
index 8c68cee..f0cac13 100644
--- a/p2p/base/stun_request_unittest.cc
+++ b/p2p/base/stun_request_unittest.cc
@@ -50,7 +50,7 @@
class StunRequestTest : public ::testing::Test {
public:
StunRequestTest()
- : manager_(rtc::Thread::Current(),
+ : manager_(webrtc::Thread::Current(),
[this](const void* data, size_t size, StunRequest* request) {
OnSendPacket(data, size, request);
}),
@@ -75,7 +75,7 @@
virtual void OnTimeout() { timeout_ = true; }
protected:
- rtc::AutoThread main_thread_;
+ webrtc::AutoThread main_thread_;
StunRequestManager manager_;
int request_count_;
StunMessage* response_;
diff --git a/p2p/base/tcp_port_unittest.cc b/p2p/base/tcp_port_unittest.cc
index cf15e6c..c579126 100644
--- a/p2p/base/tcp_port_unittest.cc
+++ b/p2p/base/tcp_port_unittest.cc
@@ -132,7 +132,7 @@
// vector so that when it grows, pointers aren't invalidated.
std::list<rtc::Network> networks_;
std::unique_ptr<webrtc::VirtualSocketServer> ss_;
- rtc::AutoSocketServerThread main_;
+ webrtc::AutoSocketServerThread main_;
webrtc::BasicPacketSocketFactory socket_factory_;
std::string username_;
std::string password_;
@@ -422,7 +422,7 @@
{.timeout = webrtc::TimeDelta::Millis(kTimeout)}),
webrtc::IsRtcOk());
// Wait a bit for the Stun response to be received.
- rtc::Thread::Current()->ProcessMessages(100);
+ webrtc::Thread::Current()->ProcessMessages(100);
// After the Stun Ping response has been received, packets can be sent again
// and SignalSentPacket should be invoked.
diff --git a/p2p/base/turn_port_unittest.cc b/p2p/base/turn_port_unittest.cc
index 01268b5..c03567a 100644
--- a/p2p/base/turn_port_unittest.cc
+++ b/p2p/base/turn_port_unittest.cc
@@ -951,7 +951,7 @@
// vector so that when it grows, pointers aren't invalidated.
std::list<rtc::Network> networks_;
std::unique_ptr<TurnPortTestVirtualSocketServer> ss_;
- rtc::AutoSocketServerThread main_;
+ webrtc::AutoSocketServerThread main_;
std::unique_ptr<webrtc::AsyncPacketSocket> socket_;
webrtc::TestTurnServer turn_server_;
std::unique_ptr<TurnPort> turn_port_;
@@ -1989,7 +1989,7 @@
webrtc::IsRtcOk());
EXPECT_TRUE(turn_port_->Candidates().empty());
turn_port_.reset();
- rtc::Thread::Current()->PostTask([this] { test_finish_ = true; });
+ webrtc::Thread::Current()->PostTask([this] { test_finish_ = true; });
// Waiting for above message to be processed.
ASSERT_THAT(webrtc::WaitUntil([&] { return test_finish_; }, IsTrue(),
{.clock = &fake_clock_}),
diff --git a/p2p/base/wrapping_active_ice_controller.cc b/p2p/base/wrapping_active_ice_controller.cc
index fbc90ac..8aa7c72 100644
--- a/p2p/base/wrapping_active_ice_controller.cc
+++ b/p2p/base/wrapping_active_ice_controller.cc
@@ -38,7 +38,7 @@
WrappingActiveIceController::WrappingActiveIceController(
IceAgentInterface* ice_agent,
std::unique_ptr<IceControllerInterface> wrapped)
- : network_thread_(rtc::Thread::Current()),
+ : network_thread_(webrtc::Thread::Current()),
wrapped_(std::move(wrapped)),
agent_(*ice_agent) {
RTC_DCHECK(ice_agent != nullptr);
@@ -48,7 +48,7 @@
IceAgentInterface* ice_agent,
webrtc::IceControllerFactoryInterface* wrapped_factory,
const webrtc::IceControllerFactoryArgs& wrapped_factory_args)
- : network_thread_(rtc::Thread::Current()), agent_(*ice_agent) {
+ : network_thread_(webrtc::Thread::Current()), agent_(*ice_agent) {
RTC_DCHECK(ice_agent != nullptr);
if (wrapped_factory) {
wrapped_ = wrapped_factory->Create(wrapped_factory_args);
diff --git a/p2p/base/wrapping_active_ice_controller.h b/p2p/base/wrapping_active_ice_controller.h
index de75573..7e23eff 100644
--- a/p2p/base/wrapping_active_ice_controller.h
+++ b/p2p/base/wrapping_active_ice_controller.h
@@ -79,7 +79,7 @@
void PruneConnections();
- rtc::Thread* const network_thread_;
+ webrtc::Thread* const network_thread_;
webrtc::ScopedTaskSafety task_safety_;
bool started_pinging_ RTC_GUARDED_BY(network_thread_) = false;
diff --git a/p2p/base/wrapping_active_ice_controller_unittest.cc b/p2p/base/wrapping_active_ice_controller_unittest.cc
index 4f54216..7798dc8 100644
--- a/p2p/base/wrapping_active_ice_controller_unittest.cc
+++ b/p2p/base/wrapping_active_ice_controller_unittest.cc
@@ -44,7 +44,7 @@
using ::testing::Return;
using ::testing::Sequence;
-using ::rtc::AutoThread;
+using ::webrtc::AutoThread;
using ::webrtc::Event;
using ::webrtc::ScopedFakeClock;
using ::webrtc::TimeDelta;
diff --git a/p2p/client/basic_port_allocator.cc b/p2p/client/basic_port_allocator.cc
index 16ce2a1..2efca79 100644
--- a/p2p/client/basic_port_allocator.cc
+++ b/p2p/client/basic_port_allocator.cc
@@ -267,7 +267,7 @@
ice_pwd,
allocator->flags()),
allocator_(allocator),
- network_thread_(rtc::Thread::Current()),
+ network_thread_(webrtc::Thread::Current()),
socket_factory_(allocator->socket_factory()),
allocation_started_(false),
network_manager_started_(false),
@@ -1415,7 +1415,7 @@
}
void AllocationSequence::Process(int epoch) {
- RTC_DCHECK(rtc::Thread::Current() == session_->network_thread());
+ RTC_DCHECK(webrtc::Thread::Current() == session_->network_thread());
const char* const PHASE_NAMES[kNumPhases] = {"Udp", "Relay", "Tcp"};
if (epoch != epoch_)
diff --git a/p2p/client/basic_port_allocator.h b/p2p/client/basic_port_allocator.h
index 5a690b6..9664880 100644
--- a/p2p/client/basic_port_allocator.h
+++ b/p2p/client/basic_port_allocator.h
@@ -135,7 +135,7 @@
~BasicPortAllocatorSession() override;
virtual BasicPortAllocator* allocator();
- rtc::Thread* network_thread() { return network_thread_; }
+ webrtc::Thread* network_thread() { return network_thread_; }
webrtc::PacketSocketFactory* socket_factory() { return socket_factory_; }
// If the new filter allows new types of candidates compared to the previous
@@ -280,7 +280,7 @@
bool PruneNewlyPairableTurnPort(PortData* newly_pairable_turn_port);
BasicPortAllocator* allocator_;
- rtc::Thread* network_thread_;
+ webrtc::Thread* network_thread_;
webrtc::PacketSocketFactory* socket_factory_;
bool allocation_started_;
bool network_manager_started_;
diff --git a/p2p/client/basic_port_allocator_unittest.cc b/p2p/client/basic_port_allocator_unittest.cc
index fbfb80f..a0851fa 100644
--- a/p2p/client/basic_port_allocator_unittest.cc
+++ b/p2p/client/basic_port_allocator_unittest.cc
@@ -164,7 +164,7 @@
new webrtc::BasicPacketSocketFactory(&nat_factory_)),
stun_server_(
webrtc::TestStunServer::Create(fss_.get(), kStunAddr, thread_)),
- turn_server_(rtc::Thread::Current(),
+ turn_server_(webrtc::Thread::Current(),
fss_.get(),
kTurnUdpIntAddr,
kTurnUdpExtAddr),
@@ -512,7 +512,7 @@
std::unique_ptr<webrtc::VirtualSocketServer> vss_;
std::unique_ptr<webrtc::FirewallSocketServer> fss_;
webrtc::BasicPacketSocketFactory socket_factory_;
- rtc::AutoSocketServerThread thread_;
+ webrtc::AutoSocketServerThread thread_;
std::unique_ptr<webrtc::NATServer> nat_server_;
webrtc::NATSocketFactory nat_factory_;
std::unique_ptr<webrtc::BasicPacketSocketFactory> nat_socket_factory_;
@@ -2789,7 +2789,7 @@
ASSERT_EQ(&network_manager_, allocator().network_manager());
network_manager_.set_mdns_responder(
- std::make_unique<webrtc::FakeMdnsResponder>(rtc::Thread::Current()));
+ std::make_unique<webrtc::FakeMdnsResponder>(webrtc::Thread::Current()));
AddInterface(kClientAddr);
ASSERT_TRUE(CreateSession(ICE_CANDIDATE_COMPONENT_RTP));
session_->StartGettingPorts();
diff --git a/p2p/client/relay_port_factory_interface.h b/p2p/client/relay_port_factory_interface.h
index faf8606..fc1cb94 100644
--- a/p2p/client/relay_port_factory_interface.h
+++ b/p2p/client/relay_port_factory_interface.h
@@ -18,12 +18,12 @@
#include "p2p/base/port_allocator.h"
#include "p2p/base/port_interface.h"
#include "rtc_base/async_packet_socket.h"
+#include "rtc_base/thread.h"
namespace rtc {
class Network;
-class Thread;
} // namespace rtc
namespace webrtc {
@@ -37,7 +37,7 @@
// A struct containing arguments to RelayPortFactory::Create()
struct CreateRelayPortArgs {
- rtc::Thread* network_thread;
+ webrtc::Thread* network_thread;
webrtc::PacketSocketFactory* socket_factory;
const rtc::Network* network;
const ProtocolAddress* server_address;
diff --git a/p2p/dtls/dtls_ice_integrationtest.cc b/p2p/dtls/dtls_ice_integrationtest.cc
index 9db6494..c68168f 100644
--- a/p2p/dtls/dtls_ice_integrationtest.cc
+++ b/p2p/dtls/dtls_ice_integrationtest.cc
@@ -199,7 +199,7 @@
rtc::SSLIdentity::Create("test", rtc::KT_DEFAULT));
if (network_emulation_manager_ == nullptr) {
- thread_ = std::make_unique<rtc::AutoSocketServerThread>(ss_.get());
+ thread_ = std::make_unique<webrtc::AutoSocketServerThread>(ss_.get());
}
client_thread()->BlockingCall([&]() {
@@ -274,7 +274,7 @@
}
}
- rtc::Thread* thread(Endpoint& ep) {
+ webrtc::Thread* thread(Endpoint& ep) {
if (ep.emulated_network_manager == nullptr) {
return thread_.get();
} else {
@@ -282,9 +282,9 @@
}
}
- rtc::Thread* client_thread() { return thread(client_); }
+ webrtc::Thread* client_thread() { return thread(client_); }
- rtc::Thread* server_thread() { return thread(server_); }
+ webrtc::Thread* server_thread() { return thread(server_); }
void SetRemoteFingerprintFromCert(
Endpoint& ep,
@@ -320,7 +320,7 @@
std::unique_ptr<webrtc::VirtualSocketServer> ss_;
std::unique_ptr<webrtc::BasicPacketSocketFactory> socket_factory_;
std::unique_ptr<webrtc::NetworkEmulationManager> network_emulation_manager_;
- std::unique_ptr<rtc::AutoSocketServerThread> thread_;
+ std::unique_ptr<webrtc::AutoSocketServerThread> thread_;
Endpoint client_;
Endpoint server_;
diff --git a/p2p/dtls/dtls_transport.cc b/p2p/dtls/dtls_transport.cc
index a33c292..6096596 100644
--- a/p2p/dtls/dtls_transport.cc
+++ b/p2p/dtls/dtls_transport.cc
@@ -1035,7 +1035,7 @@
// Set pending before we post task.
pending_periodic_retransmit_dtls_packet_ = true;
- rtc::Thread::Current()->PostDelayedHighPrecisionTask(
+ webrtc::Thread::Current()->PostDelayedHighPrecisionTask(
webrtc::SafeTask(safety_flag_.flag(),
[this] {
RTC_DCHECK_RUN_ON(&thread_checker_);
diff --git a/p2p/dtls/dtls_transport_unittest.cc b/p2p/dtls/dtls_transport_unittest.cc
index de8f3f5..33f90fc 100644
--- a/p2p/dtls/dtls_transport_unittest.cc
+++ b/p2p/dtls/dtls_transport_unittest.cc
@@ -538,7 +538,7 @@
}
protected:
- rtc::AutoThread main_thread_;
+ webrtc::AutoThread main_thread_;
webrtc::ScopedFakeClock fake_clock_;
DtlsTestClient client1_;
DtlsTestClient client2_;
diff --git a/p2p/dtls/fake_dtls_transport.h b/p2p/dtls/fake_dtls_transport.h
index 6c4b1d6..ef8eaf2 100644
--- a/p2p/dtls/fake_dtls_transport.h
+++ b/p2p/dtls/fake_dtls_transport.h
@@ -84,7 +84,7 @@
std::make_unique<cricket::FakeIceTransport>(name, component)) {}
FakeDtlsTransport(const std::string& name,
int component,
- rtc::Thread* network_thread)
+ Thread* network_thread)
: FakeDtlsTransport(
std::make_unique<cricket::FakeIceTransport>(name,
component,
diff --git a/p2p/test/fake_ice_transport.h b/p2p/test/fake_ice_transport.h
index ad4e40e..393e3f9 100644
--- a/p2p/test/fake_ice_transport.h
+++ b/p2p/test/fake_ice_transport.h
@@ -58,11 +58,11 @@
public:
explicit FakeIceTransport(absl::string_view name,
int component,
- rtc::Thread* network_thread = nullptr)
+ webrtc::Thread* network_thread = nullptr)
: name_(name),
component_(component),
network_thread_(network_thread ? network_thread
- : rtc::Thread::Current()),
+ : webrtc::Thread::Current()),
field_trials_("") {
RTC_DCHECK(network_thread_);
}
@@ -619,7 +619,7 @@
std::map<webrtc::Socket::Option, int> socket_options_
RTC_GUARDED_BY(network_thread_);
rtc::CopyOnWriteBuffer last_sent_packet_ RTC_GUARDED_BY(network_thread_);
- rtc::Thread* const network_thread_;
+ webrtc::Thread* const network_thread_;
webrtc::ScopedTaskSafetyDetached task_safety_;
std::optional<int> rtt_estimate_;
std::optional<int64_t> last_sent_ping_timestamp_;
diff --git a/p2p/test/fake_port_allocator.h b/p2p/test/fake_port_allocator.h
index 20960b1..5fbf1f1 100644
--- a/p2p/test/fake_port_allocator.h
+++ b/p2p/test/fake_port_allocator.h
@@ -83,7 +83,7 @@
class FakePortAllocatorSession : public webrtc::PortAllocatorSession {
public:
FakePortAllocatorSession(webrtc::PortAllocator* allocator,
- rtc::Thread* network_thread,
+ webrtc::Thread* network_thread,
webrtc::PacketSocketFactory* factory,
absl::string_view content_name,
int component,
@@ -206,7 +206,7 @@
}
webrtc::PortAllocator* allocator_;
- rtc::Thread* network_thread_;
+ webrtc::Thread* network_thread_;
webrtc::PacketSocketFactory* factory_;
rtc::Network ipv4_network_;
rtc::Network ipv6_network_;
@@ -226,12 +226,12 @@
class FakePortAllocator : public webrtc::PortAllocator {
public:
- FakePortAllocator(rtc::Thread* network_thread,
+ FakePortAllocator(webrtc::Thread* network_thread,
webrtc::PacketSocketFactory* factory,
const webrtc::FieldTrialsView* field_trials)
: FakePortAllocator(network_thread, factory, nullptr, field_trials) {}
- FakePortAllocator(rtc::Thread* network_thread,
+ FakePortAllocator(webrtc::Thread* network_thread,
std::unique_ptr<webrtc::PacketSocketFactory> factory,
const webrtc::FieldTrialsView* field_trials)
: FakePortAllocator(network_thread,
@@ -262,7 +262,7 @@
}
private:
- FakePortAllocator(rtc::Thread* network_thread,
+ FakePortAllocator(webrtc::Thread* network_thread,
webrtc::PacketSocketFactory* factory,
std::unique_ptr<webrtc::PacketSocketFactory> owned_factory,
const webrtc::FieldTrialsView* field_trials)
@@ -270,14 +270,14 @@
factory_(std::move(owned_factory), factory),
field_trials_(field_trials) {
if (network_thread_ == nullptr) {
- network_thread_ = rtc::Thread::Current();
+ network_thread_ = webrtc::Thread::Current();
Initialize();
return;
}
SendTask(network_thread_, [this] { Initialize(); });
}
- rtc::Thread* network_thread_;
+ webrtc::Thread* network_thread_;
const webrtc::AlwaysValidPointerNoDefault<webrtc::PacketSocketFactory>
factory_;
const webrtc::FieldTrialsView* field_trials_;
diff --git a/p2p/test/nat_server.cc b/p2p/test/nat_server.cc
index a703e40..a4c1386 100644
--- a/p2p/test/nat_server.cc
+++ b/p2p/test/nat_server.cc
@@ -131,11 +131,11 @@
};
NATServer::NATServer(NATType type,
- rtc::Thread& internal_socket_thread,
+ Thread& internal_socket_thread,
SocketFactory* internal,
const SocketAddress& internal_udp_addr,
const SocketAddress& internal_tcp_addr,
- rtc::Thread& external_socket_thread,
+ Thread& external_socket_thread,
SocketFactory* external,
const SocketAddress& external_ip)
: internal_socket_thread_(internal_socket_thread),
diff --git a/p2p/test/nat_server.h b/p2p/test/nat_server.h
index 38ff496..fe5d770 100644
--- a/p2p/test/nat_server.h
+++ b/p2p/test/nat_server.h
@@ -61,11 +61,11 @@
class NATServer {
public:
NATServer(NATType type,
- rtc::Thread& internal_socket_thread,
+ Thread& internal_socket_thread,
SocketFactory* internal,
const SocketAddress& internal_udp_addr,
const SocketAddress& internal_tcp_addr,
- rtc::Thread& external_socket_thread,
+ Thread& external_socket_thread,
SocketFactory* external,
const SocketAddress& external_ip);
~NATServer();
@@ -114,8 +114,8 @@
bool ShouldFilterOut(TransEntry* entry, const SocketAddress& ext_addr);
NAT* nat_;
- rtc::Thread& internal_socket_thread_;
- rtc::Thread& external_socket_thread_;
+ Thread& internal_socket_thread_;
+ Thread& external_socket_thread_;
SocketFactory* external_;
SocketAddress external_ip_;
AsyncUDPSocket* udp_server_socket_;
diff --git a/p2p/test/nat_socket_factory.cc b/p2p/test/nat_socket_factory.cc
index 6888ece..d0786ee 100644
--- a/p2p/test/nat_socket_factory.cc
+++ b/p2p/test/nat_socket_factory.cc
@@ -364,7 +364,7 @@
return new NATSocket(this, family, type);
}
-void NATSocketServer::SetMessageQueue(rtc::Thread* queue) {
+void NATSocketServer::SetMessageQueue(Thread* queue) {
msg_queue_ = queue;
server_->SetMessageQueue(queue);
}
@@ -397,7 +397,7 @@
NATSocketServer::Translator::Translator(NATSocketServer* server,
NATType type,
const SocketAddress& int_ip,
- rtc::Thread& external_socket_thread,
+ Thread& external_socket_thread,
SocketFactory* ext_factory,
const SocketAddress& ext_ip)
: server_(server) {
diff --git a/p2p/test/nat_socket_factory.h b/p2p/test/nat_socket_factory.h
index 82c462e..226a412 100644
--- a/p2p/test/nat_socket_factory.h
+++ b/p2p/test/nat_socket_factory.h
@@ -105,7 +105,7 @@
Translator(NATSocketServer* server,
NATType type,
const SocketAddress& int_addr,
- rtc::Thread& external_socket_thread,
+ Thread& external_socket_thread,
SocketFactory* ext_factory,
const SocketAddress& ext_addr);
~Translator();
@@ -144,7 +144,7 @@
NATSocketServer& operator=(const NATSocketServer&) = delete;
SocketServer* socketserver() { return server_; }
- rtc::Thread* queue() { return msg_queue_; }
+ Thread* queue() { return msg_queue_; }
Translator* GetTranslator(const SocketAddress& ext_ip);
Translator* AddTranslator(const SocketAddress& ext_ip,
@@ -155,7 +155,7 @@
// SocketServer implementation
Socket* CreateSocket(int family, int type) override;
- void SetMessageQueue(rtc::Thread* queue) override;
+ void SetMessageQueue(Thread* queue) override;
bool Wait(TimeDelta max_wait_duration, bool process_io) override;
void WakeUp() override;
@@ -167,7 +167,7 @@
private:
SocketServer* server_;
- rtc::Thread* msg_queue_;
+ Thread* msg_queue_;
TranslatorMap nats_;
};
diff --git a/p2p/test/nat_unittest.cc b/p2p/test/nat_unittest.cc
index 88055b8..b9fac2d 100644
--- a/p2p/test/nat_unittest.cc
+++ b/p2p/test/nat_unittest.cc
@@ -73,8 +73,8 @@
const webrtc::SocketAddress external_addrs[4],
webrtc::NATType nat_type,
bool exp_same) {
- Thread th_int(internal);
- Thread th_ext(external);
+ webrtc::Thread th_int(internal);
+ webrtc::Thread th_ext(external);
th_int.Start();
th_ext.Start();
@@ -135,8 +135,8 @@
webrtc::NATType nat_type,
bool filter_ip,
bool filter_port) {
- Thread th_int(internal);
- Thread th_ext(external);
+ webrtc::Thread th_int(internal);
+ webrtc::Thread th_ext(external);
webrtc::SocketAddress server_addr = internal_addr;
server_addr.SetPort(0); // Auto-select a port
@@ -238,7 +238,7 @@
size_t len = strlen(buf);
int sent = client->SendTo(buf, len, server->GetLocalAddress());
- Thread::Current()->SleepMs(100);
+ webrtc::Thread::Current()->SleepMs(100);
rtc::Buffer payload;
webrtc::Socket::ReceiveBuffer receive_buffer(payload);
int received = server->RecvFrom(receive_buffer);
@@ -247,12 +247,12 @@
void TestPhysicalInternal(const webrtc::SocketAddress& int_addr) {
webrtc::test::ScopedKeyValueConfig field_trials;
- rtc::AutoThread main_thread;
+ webrtc::AutoThread main_thread;
webrtc::PhysicalSocketServer socket_server;
BasicNetworkManager network_manager(nullptr, &socket_server, &field_trials);
network_manager.StartUpdating();
// Process pending messages so the network list is updated.
- Thread::Current()->ProcessMessages(0);
+ webrtc::Thread::Current()->ProcessMessages(0);
std::vector<const Network*> networks = network_manager.GetNetworks();
networks.erase(std::remove_if(networks.begin(), networks.end(),
@@ -323,7 +323,7 @@
} // namespace
void TestVirtualInternal(int family) {
- rtc::AutoThread main_thread;
+ webrtc::AutoThread main_thread;
std::unique_ptr<TestVirtualSocketServer> int_vss(
new TestVirtualSocketServer());
std::unique_ptr<TestVirtualSocketServer> ext_vss(
@@ -361,8 +361,8 @@
connected_(false),
int_vss_(new TestVirtualSocketServer()),
ext_vss_(new TestVirtualSocketServer()),
- int_thread_(new Thread(int_vss_.get())),
- ext_thread_(new Thread(ext_vss_.get())),
+ int_thread_(new webrtc::Thread(int_vss_.get())),
+ ext_thread_(new webrtc::Thread(ext_vss_.get())),
nat_(new webrtc::NATServer(webrtc::NAT_OPEN_CONE,
*int_thread_,
int_vss_.get(),
@@ -396,8 +396,8 @@
bool connected_;
std::unique_ptr<TestVirtualSocketServer> int_vss_;
std::unique_ptr<TestVirtualSocketServer> ext_vss_;
- std::unique_ptr<Thread> int_thread_;
- std::unique_ptr<Thread> ext_thread_;
+ std::unique_ptr<webrtc::Thread> int_thread_;
+ std::unique_ptr<webrtc::Thread> ext_thread_;
std::unique_ptr<webrtc::NATServer> nat_;
std::unique_ptr<webrtc::NATSocketFactory> natsf_;
std::unique_ptr<webrtc::Socket> client_;
diff --git a/p2p/test/stun_server_unittest.cc b/p2p/test/stun_server_unittest.cc
index 200b445..1e89be6 100644
--- a/p2p/test/stun_server_unittest.cc
+++ b/p2p/test/stun_server_unittest.cc
@@ -64,7 +64,7 @@
}
private:
- rtc::AutoThread main_thread;
+ AutoThread main_thread;
std::unique_ptr<VirtualSocketServer> ss_;
std::unique_ptr<StunServer> server_;
std::unique_ptr<TestClient> client_;
diff --git a/p2p/test/test_stun_server.cc b/p2p/test/test_stun_server.cc
index 0aa0178..7c113c8 100644
--- a/p2p/test/test_stun_server.cc
+++ b/p2p/test/test_stun_server.cc
@@ -20,7 +20,7 @@
std::unique_ptr<TestStunServer, std::function<void(webrtc::TestStunServer*)>>
TestStunServer::Create(SocketServer* ss,
const SocketAddress& addr,
- rtc::Thread& network_thread) {
+ Thread& network_thread) {
Socket* socket = ss->CreateSocket(addr.family(), SOCK_DGRAM);
RTC_CHECK(socket != nullptr) << "Failed to create socket";
AsyncUDPSocket* udp_socket = AsyncUDPSocket::Create(socket, addr);
diff --git a/p2p/test/test_stun_server.h b/p2p/test/test_stun_server.h
index b16cdb5..624e0d8 100644
--- a/p2p/test/test_stun_server.h
+++ b/p2p/test/test_stun_server.h
@@ -30,7 +30,7 @@
std::function<void(webrtc::TestStunServer*)>>;
static StunServerPtr Create(SocketServer* ss,
const SocketAddress& addr,
- rtc::Thread& network_thread);
+ Thread& network_thread);
// Set a fake STUN address to return to the client.
void set_fake_stun_addr(const SocketAddress& addr) { fake_stun_addr_ = addr; }
@@ -38,7 +38,7 @@
private:
static void DeleteOnNetworkThread(TestStunServer* server);
- TestStunServer(AsyncUDPSocket* socket, rtc::Thread& network_thread)
+ TestStunServer(AsyncUDPSocket* socket, Thread& network_thread)
: StunServer(socket), network_thread_(network_thread) {}
void OnBindingRequest(cricket::StunMessage* msg,
@@ -46,7 +46,7 @@
private:
SocketAddress fake_stun_addr_;
- rtc::Thread& network_thread_;
+ Thread& network_thread_;
};
} // namespace webrtc
diff --git a/p2p/test/test_turn_server.h b/p2p/test/test_turn_server.h
index 7999f6e..19390b6 100644
--- a/p2p/test/test_turn_server.h
+++ b/p2p/test/test_turn_server.h
@@ -52,7 +52,7 @@
class TestTurnServer : public TurnAuthInterface {
public:
- TestTurnServer(rtc::Thread* thread,
+ TestTurnServer(Thread* thread,
SocketFactory* socket_factory,
const SocketAddress& int_addr,
const SocketAddress& udp_ext_addr,
diff --git a/p2p/test/turn_server_unittest.cc b/p2p/test/turn_server_unittest.cc
index 1cb69e7..2ed8b66 100644
--- a/p2p/test/turn_server_unittest.cc
+++ b/p2p/test/turn_server_unittest.cc
@@ -46,7 +46,7 @@
protected:
VirtualSocketServer vss_;
- rtc::AutoSocketServerThread thread_;
+ AutoSocketServerThread thread_;
BasicPacketSocketFactory socket_factory_;
};
diff --git a/pc/audio_rtp_receiver.cc b/pc/audio_rtp_receiver.cc
index 705ec1b..eae2175 100644
--- a/pc/audio_rtp_receiver.cc
+++ b/pc/audio_rtp_receiver.cc
@@ -24,7 +24,7 @@
namespace webrtc {
AudioRtpReceiver::AudioRtpReceiver(
- rtc::Thread* worker_thread,
+ Thread* worker_thread,
std::string receiver_id,
std::vector<std::string> stream_ids,
bool is_unified_plan,
@@ -36,7 +36,7 @@
voice_channel) {}
AudioRtpReceiver::AudioRtpReceiver(
- rtc::Thread* worker_thread,
+ Thread* worker_thread,
const std::string& receiver_id,
const std::vector<rtc::scoped_refptr<MediaStreamInterface>>& streams,
bool is_unified_plan,
@@ -49,7 +49,7 @@
? RemoteAudioSource::OnAudioChannelGoneAction::kSurvive
: RemoteAudioSource::OnAudioChannelGoneAction::kEnd)),
track_(AudioTrackProxyWithInternal<AudioTrack>::Create(
- rtc::Thread::Current(),
+ Thread::Current(),
AudioTrack::Create(receiver_id, source_))),
media_channel_(voice_channel),
cached_track_enabled_(track_->internal()->enabled()),
diff --git a/pc/audio_rtp_receiver.h b/pc/audio_rtp_receiver.h
index 628690f..e5942e7 100644
--- a/pc/audio_rtp_receiver.h
+++ b/pc/audio_rtp_receiver.h
@@ -51,14 +51,14 @@
// a call to either `SetupUnsignaledMediaChannel` or `SetupMediaChannel`
// will be made, which will internally start the source on the worker thread.
AudioRtpReceiver(
- rtc::Thread* worker_thread,
+ Thread* worker_thread,
std::string receiver_id,
std::vector<std::string> stream_ids,
bool is_unified_plan,
cricket::VoiceMediaReceiveChannelInterface* voice_channel = nullptr);
// TODO(https://crbug.com/webrtc/9480): Remove this when streams() is removed.
AudioRtpReceiver(
- rtc::Thread* worker_thread,
+ Thread* worker_thread,
const std::string& receiver_id,
const std::vector<rtc::scoped_refptr<MediaStreamInterface>>& streams,
bool is_unified_plan,
@@ -131,7 +131,7 @@
void SetOutputVolume_w(double volume) RTC_RUN_ON(worker_thread_);
RTC_NO_UNIQUE_ADDRESS SequenceChecker signaling_thread_checker_;
- rtc::Thread* const worker_thread_;
+ Thread* const worker_thread_;
const std::string id_;
const rtc::scoped_refptr<RemoteAudioSource> source_;
const rtc::scoped_refptr<AudioTrackProxyWithInternal<AudioTrack>> track_;
diff --git a/pc/audio_rtp_receiver_unittest.cc b/pc/audio_rtp_receiver_unittest.cc
index f983eb0..07a9554 100644
--- a/pc/audio_rtp_receiver_unittest.cc
+++ b/pc/audio_rtp_receiver_unittest.cc
@@ -40,7 +40,7 @@
class AudioRtpReceiverTest : public ::testing::Test {
protected:
AudioRtpReceiverTest()
- : worker_(rtc::Thread::Current()),
+ : worker_(Thread::Current()),
receiver_(
rtc::make_ref_counted<AudioRtpReceiver>(worker_,
std::string(),
@@ -55,8 +55,8 @@
receiver_->SetMediaChannel(nullptr);
}
- rtc::AutoThread main_thread_;
- rtc::Thread* worker_;
+ AutoThread main_thread_;
+ Thread* worker_;
rtc::scoped_refptr<AudioRtpReceiver> receiver_;
cricket::MockVoiceMediaReceiveChannelInterface receive_channel_;
};
@@ -108,7 +108,7 @@
// constructor.
TEST(AudioRtpReceiver, OnChangedNotificationsAfterConstruction) {
test::RunLoop loop;
- auto* thread = rtc::Thread::Current(); // Points to loop's thread.
+ auto* thread = Thread::Current(); // Points to loop's thread.
cricket::MockVoiceMediaReceiveChannelInterface receive_channel;
auto receiver = rtc::make_ref_counted<AudioRtpReceiver>(
thread, std::string(), std::vector<std::string>(), true,
diff --git a/pc/channel.cc b/pc/channel.cc
index 44e021b..012143d 100644
--- a/pc/channel.cc
+++ b/pc/channel.cc
@@ -130,7 +130,7 @@
BaseChannel::BaseChannel(
webrtc::TaskQueueBase* worker_thread,
- rtc::Thread* network_thread,
+ webrtc::Thread* network_thread,
webrtc::TaskQueueBase* signaling_thread,
std::unique_ptr<MediaSendChannelInterface> send_media_channel_impl,
std::unique_ptr<MediaReceiveChannelInterface> receive_media_channel_impl,
@@ -852,7 +852,7 @@
VoiceChannel::VoiceChannel(
webrtc::TaskQueueBase* worker_thread,
- rtc::Thread* network_thread,
+ webrtc::Thread* network_thread,
webrtc::TaskQueueBase* signaling_thread,
std::unique_ptr<VoiceMediaSendChannelInterface> media_send_channel,
std::unique_ptr<VoiceMediaReceiveChannelInterface> media_receive_channel,
@@ -996,7 +996,7 @@
VideoChannel::VideoChannel(
webrtc::TaskQueueBase* worker_thread,
- rtc::Thread* network_thread,
+ webrtc::Thread* network_thread,
webrtc::TaskQueueBase* signaling_thread,
std::unique_ptr<VideoMediaSendChannelInterface> media_send_channel,
std::unique_ptr<VideoMediaReceiveChannelInterface> media_receive_channel,
diff --git a/pc/channel.h b/pc/channel.h
index 9108669..3a3680f 100644
--- a/pc/channel.h
+++ b/pc/channel.h
@@ -83,7 +83,7 @@
// Constructor for use when the MediaChannels are split
BaseChannel(
webrtc::TaskQueueBase* worker_thread,
- rtc::Thread* network_thread,
+ webrtc::Thread* network_thread,
webrtc::TaskQueueBase* signaling_thread,
std::unique_ptr<MediaSendChannelInterface> media_send_channel,
std::unique_ptr<MediaReceiveChannelInterface> media_receive_channel,
@@ -94,7 +94,7 @@
virtual ~BaseChannel();
webrtc::TaskQueueBase* worker_thread() const { return worker_thread_; }
- rtc::Thread* network_thread() const { return network_thread_; }
+ webrtc::Thread* network_thread() const { return network_thread_; }
const std::string& mid() const override { return demuxer_criteria_.mid(); }
// TODO(deadbeef): This is redundant; remove this.
absl::string_view transport_name() const override {
@@ -313,7 +313,7 @@
void SignalSentPacket_n(const rtc::SentPacket& sent_packet);
webrtc::TaskQueueBase* const worker_thread_;
- rtc::Thread* const network_thread_;
+ webrtc::Thread* const network_thread_;
webrtc::TaskQueueBase* const signaling_thread_;
rtc::scoped_refptr<webrtc::PendingTaskSafetyFlag> alive_;
@@ -371,7 +371,7 @@
public:
VoiceChannel(
webrtc::TaskQueueBase* worker_thread,
- rtc::Thread* network_thread,
+ webrtc::Thread* network_thread,
webrtc::TaskQueueBase* signaling_thread,
std::unique_ptr<VoiceMediaSendChannelInterface> send_channel_impl,
std::unique_ptr<VoiceMediaReceiveChannelInterface> receive_channel_impl,
@@ -441,7 +441,7 @@
public:
VideoChannel(
webrtc::TaskQueueBase* worker_thread,
- rtc::Thread* network_thread,
+ webrtc::Thread* network_thread,
webrtc::TaskQueueBase* signaling_thread,
std::unique_ptr<VideoMediaSendChannelInterface> media_send_channel,
std::unique_ptr<VideoMediaReceiveChannelInterface> media_receive_channel,
diff --git a/pc/channel_unittest.cc b/pc/channel_unittest.cc
index 70c1b23..1a06c85 100644
--- a/pc/channel_unittest.cc
+++ b/pc/channel_unittest.cc
@@ -154,9 +154,9 @@
rtp_packet_(rtp_data.data(), rtp_data.size()),
rtcp_packet_(rtcp_data.data(), rtcp_data.size()) {
if (network_is_worker == NetworkIsWorker::Yes) {
- network_thread_ = rtc::Thread::Current();
+ network_thread_ = webrtc::Thread::Current();
} else {
- network_thread_keeper_ = rtc::Thread::Create();
+ network_thread_keeper_ = webrtc::Thread::Create();
network_thread_keeper_->SetName("Network", nullptr);
network_thread_ = network_thread_keeper_.get();
}
@@ -215,7 +215,7 @@
// Make sure if using raw packet transports, they're used for both
// channels.
RTC_DCHECK_EQ(flags1 & RAW_PACKET_TRANSPORT, flags2 & RAW_PACKET_TRANSPORT);
- rtc::Thread* worker_thread = rtc::Thread::Current();
+ webrtc::Thread* worker_thread = webrtc::Thread::Current();
network_thread_->BlockingCall([&] {
// Based on flags, create fake DTLS or raw packet transports.
@@ -305,8 +305,8 @@
}
}
std::unique_ptr<typename T::Channel> CreateChannel(
- rtc::Thread* worker_thread,
- rtc::Thread* network_thread,
+ webrtc::Thread* worker_thread,
+ webrtc::Thread* network_thread,
std::unique_ptr<typename T::MediaSendChannel> ch_send,
std::unique_ptr<typename T::MediaReceiveChannel> ch_receive,
webrtc::RtpTransportInternal* rtp_transport,
@@ -559,17 +559,17 @@
class ScopedCallThread {
public:
explicit ScopedCallThread(absl::AnyInvocable<void() &&> functor)
- : thread_(rtc::Thread::Create()) {
+ : thread_(webrtc::Thread::Create()) {
thread_->Start();
thread_->PostTask(std::move(functor));
}
~ScopedCallThread() { thread_->Stop(); }
- rtc::Thread* thread() { return thread_.get(); }
+ webrtc::Thread* thread() { return thread_.get(); }
private:
- std::unique_ptr<rtc::Thread> thread_;
+ std::unique_ptr<webrtc::Thread> thread_;
};
cricket::CandidatePairInterface* last_selected_candidate_pair() {
@@ -1128,7 +1128,8 @@
EXPECT_TRUE(SendAccept());
ScopedCallThread send_rtp1([this] { SendRtp1(); });
ScopedCallThread send_rtp2([this] { SendRtp2(); });
- rtc::Thread* involved_threads[] = {send_rtp1.thread(), send_rtp2.thread()};
+ webrtc::Thread* involved_threads[] = {send_rtp1.thread(),
+ send_rtp2.thread()};
WaitForThreads(involved_threads);
EXPECT_TRUE(CheckRtp1());
EXPECT_TRUE(CheckRtp2());
@@ -1490,28 +1491,28 @@
protected:
void WaitForThreads() { WaitForThreads(rtc::ArrayView<rtc::Thread*>()); }
- static void ProcessThreadQueue(rtc::Thread* thread) {
+ static void ProcessThreadQueue(webrtc::Thread* thread) {
RTC_DCHECK(thread->IsCurrent());
while (!thread->empty()) {
thread->ProcessMessages(0);
}
}
static void FlushCurrentThread() {
- rtc::Thread::Current()->ProcessMessages(0);
+ webrtc::Thread::Current()->ProcessMessages(0);
}
void WaitForThreads(rtc::ArrayView<rtc::Thread*> threads) {
// `threads` and current thread post packets to network thread.
for (rtc::Thread* thread : threads) {
SendTask(thread, [thread] { ProcessThreadQueue(thread); });
}
- ProcessThreadQueue(rtc::Thread::Current());
+ ProcessThreadQueue(webrtc::Thread::Current());
// Network thread move them around and post back to worker = current thread.
if (!network_thread_->IsCurrent()) {
SendTask(network_thread_,
[this] { ProcessThreadQueue(network_thread_); });
}
// Worker thread = current Thread process received messages.
- ProcessThreadQueue(rtc::Thread::Current());
+ ProcessThreadQueue(webrtc::Thread::Current());
}
// Accessors that return the standard VideoMedia{Send|Receive}ChannelInterface
@@ -1559,14 +1560,14 @@
channel2_->media_receive_channel());
}
- rtc::AutoThread main_thread_;
+ webrtc::AutoThread main_thread_;
// TODO(pbos): Remove playout from all media channels and let renderers mute
// themselves.
const bool verify_playout_;
rtc::scoped_refptr<webrtc::PendingTaskSafetyFlag> network_thread_safety_ =
webrtc::PendingTaskSafetyFlag::CreateDetached();
- std::unique_ptr<rtc::Thread> network_thread_keeper_;
- rtc::Thread* network_thread_;
+ std::unique_ptr<webrtc::Thread> network_thread_keeper_;
+ webrtc::Thread* network_thread_;
std::unique_ptr<webrtc::FakeDtlsTransport> fake_rtp_dtls_transport1_;
std::unique_ptr<webrtc::FakeDtlsTransport> fake_rtcp_dtls_transport1_;
std::unique_ptr<webrtc::FakeDtlsTransport> fake_rtp_dtls_transport2_;
@@ -1595,13 +1596,13 @@
template <>
std::unique_ptr<cricket::VoiceChannel> ChannelTest<VoiceTraits>::CreateChannel(
- rtc::Thread* worker_thread,
- rtc::Thread* network_thread,
+ webrtc::Thread* worker_thread,
+ webrtc::Thread* network_thread,
std::unique_ptr<cricket::FakeVoiceMediaSendChannel> send_ch,
std::unique_ptr<cricket::FakeVoiceMediaReceiveChannel> receive_ch,
webrtc::RtpTransportInternal* rtp_transport,
int flags) {
- rtc::Thread* signaling_thread = rtc::Thread::Current();
+ webrtc::Thread* signaling_thread = webrtc::Thread::Current();
auto channel = std::make_unique<cricket::VoiceChannel>(
worker_thread, network_thread, signaling_thread, std::move(send_ch),
std::move(receive_ch), cricket::CN_AUDIO, (flags & DTLS) != 0,
@@ -1675,13 +1676,13 @@
// override to add NULL parameter
template <>
std::unique_ptr<cricket::VideoChannel> ChannelTest<VideoTraits>::CreateChannel(
- rtc::Thread* worker_thread,
- rtc::Thread* network_thread,
+ webrtc::Thread* worker_thread,
+ webrtc::Thread* network_thread,
std::unique_ptr<cricket::FakeVideoMediaSendChannel> send_ch,
std::unique_ptr<cricket::FakeVideoMediaReceiveChannel> receive_ch,
webrtc::RtpTransportInternal* rtp_transport,
int flags) {
- rtc::Thread* signaling_thread = rtc::Thread::Current();
+ webrtc::Thread* signaling_thread = webrtc::Thread::Current();
auto channel = std::make_unique<cricket::VideoChannel>(
worker_thread, network_thread, signaling_thread, std::move(send_ch),
std::move(receive_ch), cricket::CN_VIDEO, (flags & DTLS) != 0,
diff --git a/pc/connection_context.cc b/pc/connection_context.cc
index 07b3c24..0ab7df3 100644
--- a/pc/connection_context.cc
+++ b/pc/connection_context.cc
@@ -27,16 +27,16 @@
namespace {
-rtc::Thread* MaybeStartNetworkThread(
- rtc::Thread* old_thread,
+Thread* MaybeStartNetworkThread(
+ Thread* old_thread,
std::unique_ptr<SocketFactory>& socket_factory_holder,
- std::unique_ptr<rtc::Thread>& thread_holder) {
+ std::unique_ptr<Thread>& thread_holder) {
if (old_thread) {
return old_thread;
}
std::unique_ptr<SocketServer> socket_server =
rtc::CreateDefaultSocketServer();
- thread_holder = std::make_unique<rtc::Thread>(socket_server.get());
+ thread_holder = std::make_unique<Thread>(socket_server.get());
socket_factory_holder = std::move(socket_server);
thread_holder->SetName("pc_network_thread", nullptr);
@@ -44,17 +44,16 @@
return thread_holder.get();
}
-rtc::Thread* MaybeWrapThread(rtc::Thread* signaling_thread,
- bool& wraps_current_thread) {
+Thread* MaybeWrapThread(Thread* signaling_thread, bool& wraps_current_thread) {
wraps_current_thread = false;
if (signaling_thread) {
return signaling_thread;
}
- auto this_thread = rtc::Thread::Current();
+ auto this_thread = Thread::Current();
if (!this_thread) {
// If this thread isn't already wrapped by an rtc::Thread, create a
// wrapper and own it in this class.
- this_thread = rtc::ThreadManager::Instance()->WrapCurrentThread();
+ this_thread = ThreadManager::Instance()->WrapCurrentThread();
wraps_current_thread = true;
}
return this_thread;
@@ -62,7 +61,7 @@
std::unique_ptr<SctpTransportFactoryInterface> MaybeCreateSctpFactory(
std::unique_ptr<SctpTransportFactoryInterface> factory,
- rtc::Thread* network_thread) {
+ Thread* network_thread) {
if (factory) {
return factory;
}
@@ -91,7 +90,7 @@
owned_network_thread_)),
worker_thread_(dependencies->worker_thread,
[]() {
- auto thread_holder = rtc::Thread::Create();
+ auto thread_holder = Thread::Create();
thread_holder->SetName("pc_worker_thread", nullptr);
thread_holder->Start();
return thread_holder;
@@ -187,7 +186,7 @@
default_network_manager_ = nullptr;
if (wraps_current_thread_)
- rtc::ThreadManager::Instance()->UnwrapCurrentThread();
+ ThreadManager::Instance()->UnwrapCurrentThread();
}
} // namespace webrtc
diff --git a/pc/connection_context.h b/pc/connection_context.h
index 2af7f44..b7ea87c 100644
--- a/pc/connection_context.h
+++ b/pc/connection_context.h
@@ -62,12 +62,12 @@
return media_engine_.get();
}
- rtc::Thread* signaling_thread() { return signaling_thread_; }
- const rtc::Thread* signaling_thread() const { return signaling_thread_; }
- rtc::Thread* worker_thread() { return worker_thread_.get(); }
- const rtc::Thread* worker_thread() const { return worker_thread_.get(); }
- rtc::Thread* network_thread() { return network_thread_; }
- const rtc::Thread* network_thread() const { return network_thread_; }
+ Thread* signaling_thread() { return signaling_thread_; }
+ const Thread* signaling_thread() const { return signaling_thread_; }
+ Thread* worker_thread() { return worker_thread_.get(); }
+ const Thread* worker_thread() const { return worker_thread_.get(); }
+ Thread* network_thread() { return network_thread_; }
+ const Thread* network_thread() const { return network_thread_; }
// Environment associated with the PeerConnectionFactory.
// Note: environments are different for different PeerConnections,
@@ -109,11 +109,11 @@
// constructor and the destructor, and are never exposed externally.
bool wraps_current_thread_;
std::unique_ptr<SocketFactory> owned_socket_factory_;
- std::unique_ptr<rtc::Thread> owned_network_thread_
+ std::unique_ptr<Thread> owned_network_thread_
RTC_GUARDED_BY(signaling_thread_);
- rtc::Thread* const network_thread_;
- AlwaysValidPointer<rtc::Thread> const worker_thread_;
- rtc::Thread* const signaling_thread_;
+ Thread* const network_thread_;
+ AlwaysValidPointer<Thread> const worker_thread_;
+ Thread* const signaling_thread_;
const Environment env_;
diff --git a/pc/data_channel_controller.cc b/pc/data_channel_controller.cc
index 5960040..8c6aa02 100644
--- a/pc/data_channel_controller.cc
+++ b/pc/data_channel_controller.cc
@@ -480,11 +480,11 @@
}
}
-rtc::Thread* DataChannelController::network_thread() const {
+Thread* DataChannelController::network_thread() const {
return pc_->network_thread();
}
-rtc::Thread* DataChannelController::signaling_thread() const {
+Thread* DataChannelController::signaling_thread() const {
return pc_->signaling_thread();
}
diff --git a/pc/data_channel_controller.h b/pc/data_channel_controller.h
index 0fcd108..a54b5d0 100644
--- a/pc/data_channel_controller.h
+++ b/pc/data_channel_controller.h
@@ -100,8 +100,8 @@
bool HasUsedDataChannels() const;
protected:
- rtc::Thread* network_thread() const;
- rtc::Thread* signaling_thread() const;
+ Thread* network_thread() const;
+ Thread* signaling_thread() const;
private:
void OnSctpDataChannelClosed(SctpDataChannel* channel);
diff --git a/pc/data_channel_controller_unittest.cc b/pc/data_channel_controller_unittest.cc
index 393362d..994e43f 100644
--- a/pc/data_channel_controller_unittest.cc
+++ b/pc/data_channel_controller_unittest.cc
@@ -87,8 +87,7 @@
: network_thread_(std::make_unique<NullSocketServer>()) {
network_thread_.Start();
pc_ = rtc::make_ref_counted<NiceMock<MockPeerConnectionInternal>>();
- ON_CALL(*pc_, signaling_thread)
- .WillByDefault(Return(rtc::Thread::Current()));
+ ON_CALL(*pc_, signaling_thread).WillByDefault(Return(Thread::Current()));
ON_CALL(*pc_, network_thread).WillByDefault(Return(&network_thread_));
}
@@ -98,7 +97,7 @@
}
test::RunLoop run_loop_;
- rtc::Thread network_thread_;
+ Thread network_thread_;
rtc::scoped_refptr<NiceMock<MockPeerConnectionInternal>> pc_;
};
diff --git a/pc/data_channel_unittest.cc b/pc/data_channel_unittest.cc
index 4e96638..d2dcd0c 100644
--- a/pc/data_channel_unittest.cc
+++ b/pc/data_channel_unittest.cc
@@ -148,7 +148,7 @@
}
test::RunLoop run_loop_;
- rtc::Thread network_thread_;
+ Thread network_thread_;
InternalDataChannelInit init_;
rtc::scoped_refptr<PendingTaskSafetyFlag> signaling_safety_ =
PendingTaskSafetyFlag::Create();
diff --git a/pc/dtls_srtp_transport_integrationtest.cc b/pc/dtls_srtp_transport_integrationtest.cc
index 86163f8..b72970f 100644
--- a/pc/dtls_srtp_transport_integrationtest.cc
+++ b/pc/dtls_srtp_transport_integrationtest.cc
@@ -217,7 +217,7 @@
}
private:
- rtc::AutoThread main_thread_;
+ webrtc::AutoThread main_thread_;
webrtc::ScopedFakeClock fake_clock_;
webrtc::test::ScopedKeyValueConfig field_trials_;
diff --git a/pc/dtls_srtp_transport_unittest.cc b/pc/dtls_srtp_transport_unittest.cc
index 6f9625b..55f0c4b 100644
--- a/pc/dtls_srtp_transport_unittest.cc
+++ b/pc/dtls_srtp_transport_unittest.cc
@@ -261,7 +261,7 @@
SendRecvRtcpPackets();
}
- rtc::AutoThread main_thread_;
+ webrtc::AutoThread main_thread_;
std::unique_ptr<DtlsSrtpTransport> dtls_srtp_transport1_;
std::unique_ptr<DtlsSrtpTransport> dtls_srtp_transport2_;
webrtc::TransportObserver transport_observer1_;
diff --git a/pc/dtls_transport.cc b/pc/dtls_transport.cc
index df06a0c..004ea06 100644
--- a/pc/dtls_transport.cc
+++ b/pc/dtls_transport.cc
@@ -26,7 +26,7 @@
// Implementation of DtlsTransportInterface
DtlsTransport::DtlsTransport(
std::unique_ptr<cricket::DtlsTransportInternal> internal)
- : owner_thread_(rtc::Thread::Current()),
+ : owner_thread_(Thread::Current()),
info_(DtlsTransportState::kNew),
internal_dtls_transport_(std::move(internal)),
ice_transport_(rtc::make_ref_counted<IceTransportWithPointer>(
diff --git a/pc/dtls_transport.h b/pc/dtls_transport.h
index 59cb0b4..7798c22 100644
--- a/pc/dtls_transport.h
+++ b/pc/dtls_transport.h
@@ -76,7 +76,7 @@
}
DtlsTransportObserverInterface* observer_ = nullptr;
- rtc::Thread* owner_thread_;
+ Thread* owner_thread_;
mutable Mutex lock_;
DtlsTransportInformation info_ RTC_GUARDED_BY(lock_);
std::unique_ptr<cricket::DtlsTransportInternal> internal_dtls_transport_
diff --git a/pc/dtls_transport_unittest.cc b/pc/dtls_transport_unittest.cc
index 7a4cc9c..4a6cffb 100644
--- a/pc/dtls_transport_unittest.cc
+++ b/pc/dtls_transport_unittest.cc
@@ -88,7 +88,7 @@
fake_dtls1->SetDestination(fake_dtls2.get());
}
- rtc::AutoThread main_thread_;
+ AutoThread main_thread_;
rtc::scoped_refptr<DtlsTransport> transport_;
TestDtlsTransportObserver observer_;
};
diff --git a/pc/dtmf_sender_unittest.cc b/pc/dtmf_sender_unittest.cc
index 13a709f..c7ffa2f 100644
--- a/pc/dtmf_sender_unittest.cc
+++ b/pc/dtmf_sender_unittest.cc
@@ -119,7 +119,7 @@
DtmfSenderTest()
: observer_(new FakeDtmfObserver()), provider_(new FakeDtmfProvider()) {
provider_->SetCanInsertDtmf(true);
- dtmf_ = DtmfSender::Create(rtc::Thread::Current(), provider_.get());
+ dtmf_ = DtmfSender::Create(webrtc::Thread::Current(), provider_.get());
dtmf_->RegisterObserver(observer_.get());
}
@@ -214,7 +214,7 @@
}
}
- rtc::AutoThread main_thread_;
+ webrtc::AutoThread main_thread_;
std::unique_ptr<FakeDtmfObserver> observer_;
std::unique_ptr<FakeDtmfProvider> provider_;
rtc::scoped_refptr<DtmfSender> dtmf_;
diff --git a/pc/ice_transport.h b/pc/ice_transport.h
index d076ff7..74b78fd 100644
--- a/pc/ice_transport.h
+++ b/pc/ice_transport.h
@@ -25,7 +25,7 @@
class IceTransportWithPointer : public IceTransportInterface {
public:
explicit IceTransportWithPointer(IceTransportInternal* internal)
- : creator_thread_(rtc::Thread::Current()), internal_(internal) {
+ : creator_thread_(Thread::Current()), internal_(internal) {
RTC_DCHECK(internal_);
}
@@ -43,7 +43,7 @@
~IceTransportWithPointer() override;
private:
- const rtc::Thread* creator_thread_;
+ const Thread* creator_thread_;
IceTransportInternal* internal_ RTC_GUARDED_BY(creator_thread_);
};
diff --git a/pc/ice_transport_unittest.cc b/pc/ice_transport_unittest.cc
index 4635a09..dcdf116 100644
--- a/pc/ice_transport_unittest.cc
+++ b/pc/ice_transport_unittest.cc
@@ -36,7 +36,7 @@
private:
std::unique_ptr<SocketServer> socket_server_;
- rtc::AutoSocketServerThread main_thread_;
+ AutoSocketServerThread main_thread_;
};
TEST_F(IceTransportTest, CreateNonSelfDeletingTransport) {
diff --git a/pc/jsep_transport.cc b/pc/jsep_transport.cc
index 2dd55b6..d590577 100644
--- a/pc/jsep_transport.cc
+++ b/pc/jsep_transport.cc
@@ -79,7 +79,7 @@
std::unique_ptr<SctpTransportInternal> sctp_transport,
std::function<void()> rtcp_mux_active_callback,
webrtc::PayloadTypePicker& suggester)
- : network_thread_(rtc::Thread::Current()),
+ : network_thread_(webrtc::Thread::Current()),
mid_(mid),
local_certificate_(local_certificate),
ice_transport_(std::move(ice_transport)),
diff --git a/pc/jsep_transport.h b/pc/jsep_transport.h
index 0ac6467..fdbbea1 100644
--- a/pc/jsep_transport.h
+++ b/pc/jsep_transport.h
@@ -289,7 +289,7 @@
TransportStats* stats) const;
// Owning thread, for safety checks
- const rtc::Thread* const network_thread_;
+ const webrtc::Thread* const network_thread_;
const std::string mid_;
// needs-ice-restart bit as described in JSEP.
bool needs_ice_restart_ RTC_GUARDED_BY(network_thread_) = false;
diff --git a/pc/jsep_transport_controller.cc b/pc/jsep_transport_controller.cc
index 161e146..d435396 100644
--- a/pc/jsep_transport_controller.cc
+++ b/pc/jsep_transport_controller.cc
@@ -73,7 +73,7 @@
JsepTransportController::JsepTransportController(
const Environment& env,
- rtc::Thread* network_thread,
+ Thread* network_thread,
PortAllocator* port_allocator,
AsyncDnsResolverFactoryInterface* async_dns_resolver_factory,
PayloadTypePicker& payload_type_picker,
diff --git a/pc/jsep_transport_controller.h b/pc/jsep_transport_controller.h
index 8c42a3d..836cf27 100644
--- a/pc/jsep_transport_controller.h
+++ b/pc/jsep_transport_controller.h
@@ -71,7 +71,7 @@
#include "rtc_base/thread_annotations.h"
namespace rtc {
-class Thread;
+
class PacketTransportInternal;
} // namespace rtc
@@ -149,7 +149,7 @@
// `network_thread`.
JsepTransportController(
const Environment& env,
- rtc::Thread* network_thread,
+ Thread* network_thread,
PortAllocator* port_allocator,
AsyncDnsResolverFactoryInterface* async_dns_resolver_factory,
PayloadTypePicker& payload_type_picker,
@@ -488,7 +488,7 @@
cricket::JsepTransport* transport);
const Environment env_;
- rtc::Thread* const network_thread_ = nullptr;
+ Thread* const network_thread_ = nullptr;
PortAllocator* const port_allocator_ = nullptr;
AsyncDnsResolverFactoryInterface* const async_dns_resolver_factory_ = nullptr;
diff --git a/pc/jsep_transport_controller_unittest.cc b/pc/jsep_transport_controller_unittest.cc
index 4483249..cf96683 100644
--- a/pc/jsep_transport_controller_unittest.cc
+++ b/pc/jsep_transport_controller_unittest.cc
@@ -113,15 +113,14 @@
public:
JsepTransportControllerTest()
: env_(CreateEnvironment(&field_trials_)),
- signaling_thread_(rtc::Thread::Current()) {
+ signaling_thread_(Thread::Current()) {
fake_ice_transport_factory_ = std::make_unique<FakeIceTransportFactory>();
fake_dtls_transport_factory_ = std::make_unique<FakeDtlsTransportFactory>();
}
- void CreateJsepTransportController(
- JsepTransportController::Config config,
- rtc::Thread* network_thread = rtc::Thread::Current(),
- PortAllocator* port_allocator = nullptr) {
+ void CreateJsepTransportController(JsepTransportController::Config config,
+ Thread* network_thread = Thread::Current(),
+ PortAllocator* port_allocator = nullptr) {
config.transport_observer = this;
config.rtcp_handler = [](const rtc::CopyOnWriteBuffer& packet,
int64_t packet_time_us) {
@@ -323,14 +322,14 @@
protected:
void OnConnectionState(cricket::IceConnectionState state) {
- ice_signaled_on_thread_ = rtc::Thread::Current();
+ ice_signaled_on_thread_ = Thread::Current();
connection_state_ = state;
++connection_state_signal_count_;
}
void OnStandardizedIceConnectionState(
PeerConnectionInterface::IceConnectionState state) {
- ice_signaled_on_thread_ = rtc::Thread::Current();
+ ice_signaled_on_thread_ = Thread::Current();
ice_connection_state_ = state;
++ice_connection_state_signal_count_;
}
@@ -339,20 +338,20 @@
PeerConnectionInterface::PeerConnectionState state) {
RTC_LOG(LS_INFO) << "OnCombinedConnectionState: "
<< static_cast<int>(state);
- ice_signaled_on_thread_ = rtc::Thread::Current();
+ ice_signaled_on_thread_ = Thread::Current();
combined_connection_state_ = state;
++combined_connection_state_signal_count_;
}
void OnGatheringState(IceGatheringState state) {
- ice_signaled_on_thread_ = rtc::Thread::Current();
+ ice_signaled_on_thread_ = Thread::Current();
gathering_state_ = state;
++gathering_state_signal_count_;
}
void OnCandidatesGathered(const std::string& transport_name,
const Candidates& candidates) {
- ice_signaled_on_thread_ = rtc::Thread::Current();
+ ice_signaled_on_thread_ = Thread::Current();
candidates_[transport_name].insert(candidates_[transport_name].end(),
candidates.begin(), candidates.end());
++candidates_signal_count_;
@@ -375,7 +374,7 @@
test::ScopedKeyValueConfig field_trials_;
Environment env_;
- rtc::AutoThread main_thread_;
+ AutoThread main_thread_;
// Information received from signals from transport controller.
cricket::IceConnectionState connection_state_ =
cricket::kIceConnectionConnecting;
@@ -396,11 +395,11 @@
int candidates_signal_count_ = 0;
// `network_thread_` should be destroyed after `transport_controller_`
- std::unique_ptr<rtc::Thread> network_thread_;
+ std::unique_ptr<Thread> network_thread_;
std::unique_ptr<FakeIceTransportFactory> fake_ice_transport_factory_;
std::unique_ptr<FakeDtlsTransportFactory> fake_dtls_transport_factory_;
- rtc::Thread* const signaling_thread_ = nullptr;
- rtc::Thread* ice_signaled_on_thread_ = nullptr;
+ Thread* const signaling_thread_ = nullptr;
+ Thread* ice_signaled_on_thread_ = nullptr;
// Used to verify the SignalRtpTransportChanged/SignalDtlsTransportChanged are
// signaled correctly.
std::map<std::string, RtpTransportInternal*> changed_rtp_transport_by_mid_;
@@ -1134,7 +1133,7 @@
}
TEST_F(JsepTransportControllerTest, IceSignalingOccursOnNetworkThread) {
- network_thread_ = rtc::Thread::CreateWithSocketServer();
+ network_thread_ = Thread::CreateWithSocketServer();
network_thread_->Start();
EXPECT_EQ(ice_signaled_on_thread_, nullptr);
CreateJsepTransportController(JsepTransportController::Config(),
diff --git a/pc/jsep_transport_unittest.cc b/pc/jsep_transport_unittest.cc
index 1347fed..7f5ce18 100644
--- a/pc/jsep_transport_unittest.cc
+++ b/pc/jsep_transport_unittest.cc
@@ -190,7 +190,7 @@
void OnRtcpMuxActive() { signal_rtcp_mux_active_received_ = true; }
- rtc::AutoThread main_thread_;
+ webrtc::AutoThread main_thread_;
std::unique_ptr<JsepTransport> jsep_transport_;
bool signal_rtcp_mux_active_received_ = false;
// The SrtpTransport is owned by `jsep_transport_`. Keep a raw pointer here
diff --git a/pc/legacy_stats_collector.cc b/pc/legacy_stats_collector.cc
index 8e01d19..300a4e1 100644
--- a/pc/legacy_stats_collector.cc
+++ b/pc/legacy_stats_collector.cc
@@ -630,7 +630,7 @@
RTC_DCHECK(reports != NULL);
RTC_DCHECK(reports->empty());
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
if (!track) {
reports->reserve(reports_.size());
@@ -906,7 +906,7 @@
std::optional<std::string> sctp_mid) {
TRACE_EVENT0("webrtc", "LegacyStatsCollector::ExtractSessionInfo_n");
RTC_DCHECK_RUN_ON(pc_->network_thread());
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
SessionStats stats;
stats.candidate_stats = pc_->GetPooledCandidateStats();
for (auto& transceiver : transceivers) {
@@ -957,7 +957,7 @@
void LegacyStatsCollector::ExtractSessionInfo_s(SessionStats& session_stats) {
RTC_DCHECK_RUN_ON(pc_->signaling_thread());
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
StatsReport::Id id(StatsReport::NewTypedId(
StatsReport::kStatsReportTypeSession, pc_->session_id()));
@@ -1213,7 +1213,7 @@
auto transceivers = pc_->GetTransceiversInternal();
{
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
for (const auto& transceiver : transceivers) {
cricket::ChannelInterface* channel = transceiver->internal()->channel();
if (!channel) {
@@ -1240,7 +1240,7 @@
}
pc_->worker_thread()->BlockingCall([&] {
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
// Populate `receiver_track_id_by_ssrc` for the gatherers.
int i = 0;
for (const auto& transceiver : transceivers) {
@@ -1269,7 +1269,7 @@
}
});
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
bool has_remote_audio = false;
for (const auto& gatherer : gatherers) {
@@ -1316,7 +1316,7 @@
void LegacyStatsCollector::ExtractDataInfo_n(StatsCollection* reports) {
RTC_DCHECK_RUN_ON(pc_->network_thread());
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
std::vector<DataChannelStats> data_stats = pc_->GetDataChannelStats();
for (const auto& stats : data_stats) {
@@ -1398,7 +1398,7 @@
void LegacyStatsCollector::UpdateTrackReports() {
RTC_DCHECK_RUN_ON(pc_->signaling_thread());
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
for (const auto& entry : track_ids_) {
StatsReport* report = entry.second;
diff --git a/pc/legacy_stats_collector_unittest.cc b/pc/legacy_stats_collector_unittest.cc
index 924840e..268eabf 100644
--- a/pc/legacy_stats_collector_unittest.cc
+++ b/pc/legacy_stats_collector_unittest.cc
@@ -724,7 +724,7 @@
}
private:
- rtc::AutoThread main_thread_;
+ AutoThread main_thread_;
};
static rtc::scoped_refptr<MockRtpSenderInternal> CreateMockSender(
@@ -769,7 +769,7 @@
void AddOutgoingVideoTrack(FakePeerConnectionForStats* pc,
LegacyStatsCollectorForTest* stats) {
video_track_ = VideoTrack::Create(
- kLocalTrackId, FakeVideoTrackSource::Create(), rtc::Thread::Current());
+ kLocalTrackId, FakeVideoTrackSource::Create(), Thread::Current());
if (GetParam()) {
if (!stream_)
stream_ = MediaStream::Create("streamid");
@@ -785,7 +785,7 @@
void AddIncomingVideoTrack(FakePeerConnectionForStats* pc,
LegacyStatsCollectorForTest* stats) {
video_track_ = VideoTrack::Create(
- kRemoteTrackId, FakeVideoTrackSource::Create(), rtc::Thread::Current());
+ kRemoteTrackId, FakeVideoTrackSource::Create(), Thread::Current());
if (GetParam()) {
stream_ = MediaStream::Create("streamid");
stream_->AddTrack(video_track());
@@ -868,7 +868,7 @@
// Similar to `DetachAndMerge` above but detaches on one thread, merges on
// another to test that we don't trigger sequence checker.
TEST(StatsCollectionTest, DetachAndMergeThreaded) {
- rtc::Thread new_thread(std::make_unique<NullSocketServer>());
+ Thread new_thread(std::make_unique<NullSocketServer>());
new_thread.Start();
StatsReport::Id id(
diff --git a/pc/media_stream_unittest.cc b/pc/media_stream_unittest.cc
index d6c79ef..56b714e 100644
--- a/pc/media_stream_unittest.cc
+++ b/pc/media_stream_unittest.cc
@@ -57,7 +57,7 @@
ASSERT_TRUE(stream_.get() != NULL);
video_track_ = VideoTrack::Create(
- kVideoTrackId, FakeVideoTrackSource::Create(), rtc::Thread::Current());
+ kVideoTrackId, FakeVideoTrackSource::Create(), Thread::Current());
ASSERT_TRUE(video_track_.get() != NULL);
EXPECT_EQ(MediaStreamTrackInterface::kLive, video_track_->state());
@@ -80,7 +80,7 @@
EXPECT_FALSE(track->enabled());
}
- rtc::AutoThread main_thread_;
+ AutoThread main_thread_;
scoped_refptr<MediaStreamInterface> stream_;
scoped_refptr<AudioTrackInterface> audio_track_;
scoped_refptr<VideoTrackInterface> video_track_;
diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc
index 3b5e7e3..9c7492d 100644
--- a/pc/peer_connection.cc
+++ b/pc/peer_connection.cc
@@ -2313,7 +2313,7 @@
if (!network_thread_safety_->alive())
return {};
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
std::map<std::string, cricket::TransportStats> transport_stats_by_name;
for (const std::string& transport_name : transport_names) {
cricket::TransportStats transport_stats;
@@ -2498,7 +2498,7 @@
return worker_thread()->BlockingCall([this] { return GetCallStats(); });
}
RTC_DCHECK_RUN_ON(worker_thread());
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
if (call_) {
return call_->GetStats();
} else {
@@ -2738,7 +2738,7 @@
void PeerConnection::ReportTransportStats(
std::vector<RtpTransceiverProxyRefPtr> transceivers) {
TRACE_EVENT0("webrtc", "PeerConnection::ReportTransportStats");
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
std::map<std::string, std::set<cricket::MediaType>>
media_types_by_transport_name;
for (const auto& transceiver : transceivers) {
diff --git a/pc/peer_connection.h b/pc/peer_connection.h
index 6b53479..0a78847 100644
--- a/pc/peer_connection.h
+++ b/pc/peer_connection.h
@@ -264,14 +264,12 @@
void Close() override;
- rtc::Thread* signaling_thread() const final {
+ Thread* signaling_thread() const final {
return context_->signaling_thread();
}
- rtc::Thread* network_thread() const final {
- return context_->network_thread();
- }
- rtc::Thread* worker_thread() const final { return context_->worker_thread(); }
+ Thread* network_thread() const final { return context_->network_thread(); }
+ Thread* worker_thread() const final { return context_->worker_thread(); }
std::string session_id() const override { return session_id_; }
diff --git a/pc/peer_connection_adaptation_integrationtest.cc b/pc/peer_connection_adaptation_integrationtest.cc
index 28f3681..150177f 100644
--- a/pc/peer_connection_adaptation_integrationtest.cc
+++ b/pc/peer_connection_adaptation_integrationtest.cc
@@ -84,8 +84,8 @@
public:
PeerConnectionAdaptationIntegrationTest()
: virtual_socket_server_(),
- network_thread_(new rtc::Thread(&virtual_socket_server_)),
- worker_thread_(rtc::Thread::Create()) {
+ network_thread_(new Thread(&virtual_socket_server_)),
+ worker_thread_(Thread::Create()) {
RTC_CHECK(network_thread_->Start());
RTC_CHECK(worker_thread_->Start());
}
@@ -105,8 +105,8 @@
protected:
VirtualSocketServer virtual_socket_server_;
- std::unique_ptr<rtc::Thread> network_thread_;
- std::unique_ptr<rtc::Thread> worker_thread_;
+ std::unique_ptr<Thread> network_thread_;
+ std::unique_ptr<Thread> worker_thread_;
};
TEST_F(PeerConnectionAdaptationIntegrationTest,
diff --git a/pc/peer_connection_bundle_unittest.cc b/pc/peer_connection_bundle_unittest.cc
index 397a3a3..54e24ab 100644
--- a/pc/peer_connection_bundle_unittest.cc
+++ b/pc/peer_connection_bundle_unittest.cc
@@ -208,9 +208,9 @@
// `PeerConnectionFactoryDependencies`, thus each PeerConnection in these
// tests is created with own PeerConnectionFactory.
PeerConnectionFactoryDependencies pcf_deps;
- pcf_deps.network_thread = rtc::Thread::Current();
- pcf_deps.worker_thread = rtc::Thread::Current();
- pcf_deps.signaling_thread = rtc::Thread::Current();
+ pcf_deps.network_thread = Thread::Current();
+ pcf_deps.worker_thread = Thread::Current();
+ pcf_deps.signaling_thread = Thread::Current();
pcf_deps.socket_factory = &vss_;
auto network_manager =
std::make_unique<FakeNetworkManagerWithNoAnyNetwork>();
@@ -270,7 +270,7 @@
}
VirtualSocketServer vss_;
- rtc::AutoSocketServerThread main_;
+ AutoSocketServerThread main_;
const SdpSemantics sdp_semantics_;
};
diff --git a/pc/peer_connection_crypto_unittest.cc b/pc/peer_connection_crypto_unittest.cc
index 7788f58..dd87ac2 100644
--- a/pc/peer_connection_crypto_unittest.cc
+++ b/pc/peer_connection_crypto_unittest.cc
@@ -84,7 +84,7 @@
InitializeAndroidObjects();
#endif
pc_factory_ = CreatePeerConnectionFactory(
- rtc::Thread::Current(), rtc::Thread::Current(), rtc::Thread::Current(),
+ Thread::Current(), Thread::Current(), Thread::Current(),
FakeAudioCaptureModule::Create(), CreateBuiltinAudioEncoderFactory(),
CreateBuiltinAudioDecoderFactory(),
std::make_unique<VideoEncoderFactoryTemplate<
@@ -108,7 +108,7 @@
const RTCConfiguration& config,
std::unique_ptr<RTCCertificateGeneratorInterface> cert_gen) {
auto fake_port_allocator = std::make_unique<cricket::FakePortAllocator>(
- rtc::Thread::Current(),
+ Thread::Current(),
std::make_unique<BasicPacketSocketFactory>(vss_.get()),
field_trials_.get());
auto observer = std::make_unique<MockPeerConnectionObserver>();
@@ -159,7 +159,7 @@
std::unique_ptr<FieldTrials> field_trials_ = FieldTrials::CreateNoGlobal("");
std::unique_ptr<VirtualSocketServer> vss_;
- rtc::AutoSocketServerThread main_;
+ AutoSocketServerThread main_;
rtc::scoped_refptr<PeerConnectionFactoryInterface> pc_factory_;
const SdpSemantics sdp_semantics_;
};
diff --git a/pc/peer_connection_data_channel_unittest.cc b/pc/peer_connection_data_channel_unittest.cc
index 58f7a4c..d55afe9 100644
--- a/pc/peer_connection_data_channel_unittest.cc
+++ b/pc/peer_connection_data_channel_unittest.cc
@@ -53,9 +53,9 @@
PeerConnectionFactoryDependencies CreatePeerConnectionFactoryDependencies() {
PeerConnectionFactoryDependencies deps;
- deps.network_thread = rtc::Thread::Current();
- deps.worker_thread = rtc::Thread::Current();
- deps.signaling_thread = rtc::Thread::Current();
+ deps.network_thread = Thread::Current();
+ deps.worker_thread = Thread::Current();
+ deps.signaling_thread = Thread::Current();
deps.task_queue_factory = CreateDefaultTaskQueueFactory();
EnableFakeMedia(deps);
deps.sctp_factory = std::make_unique<FakeSctpTransportFactory>();
@@ -158,7 +158,7 @@
}
std::unique_ptr<VirtualSocketServer> vss_;
- rtc::AutoSocketServerThread main_;
+ AutoSocketServerThread main_;
const SdpSemantics sdp_semantics_;
};
diff --git a/pc/peer_connection_encodings_integrationtest.cc b/pc/peer_connection_encodings_integrationtest.cc
index 85676ac..0e9ed6a 100644
--- a/pc/peer_connection_encodings_integrationtest.cc
+++ b/pc/peer_connection_encodings_integrationtest.cc
@@ -226,7 +226,7 @@
class PeerConnectionEncodingsIntegrationTest : public ::testing::Test {
public:
PeerConnectionEncodingsIntegrationTest()
- : background_thread_(std::make_unique<rtc::Thread>(&pss_)) {
+ : background_thread_(std::make_unique<Thread>(&pss_)) {
RTC_CHECK(background_thread_->Start());
}
@@ -428,7 +428,7 @@
}
PhysicalSocketServer pss_;
- std::unique_ptr<rtc::Thread> background_thread_;
+ std::unique_ptr<Thread> background_thread_;
};
TEST_F(PeerConnectionEncodingsIntegrationTest,
@@ -1166,7 +1166,7 @@
remote_pc_wrapper->WaitForConnection();
// Ensure no media is flowing (1 second should be enough).
- rtc::Thread::Current()->SleepMs(1000);
+ Thread::Current()->SleepMs(1000);
rtc::scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
std::vector<const RTCOutboundRtpStreamStats*> outbound_rtps =
report->GetStatsOfType<RTCOutboundRtpStreamStats>();
@@ -1205,7 +1205,7 @@
remote_pc_wrapper->WaitForConnection();
// Ensure no media is flowing (1 second should be enough).
- rtc::Thread::Current()->SleepMs(1000);
+ Thread::Current()->SleepMs(1000);
rtc::scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
std::vector<const RTCOutboundRtpStreamStats*> outbound_rtps =
report->GetStatsOfType<RTCOutboundRtpStreamStats>();
@@ -1254,7 +1254,7 @@
// The target bitrate typically reaches `kVp9ExpectedMaxBitrateForL1T3`
// in a short period of time. However to reduce risk of flakiness in bot
// environments, this test only fails if we we exceed the expected target.
- rtc::Thread::Current()->SleepMs(1000);
+ Thread::Current()->SleepMs(1000);
rtc::scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
std::vector<const RTCOutboundRtpStreamStats*> outbound_rtps =
report->GetStatsOfType<RTCOutboundRtpStreamStats>();
@@ -1307,7 +1307,7 @@
// The target bitrate typically reaches `kVp9ExpectedMaxBitrateForL1T3`
// in a short period of time. However to reduce risk of flakiness in bot
// environments, this test only fails if we we exceed the expected target.
- rtc::Thread::Current()->SleepMs(1000);
+ Thread::Current()->SleepMs(1000);
rtc::scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
std::vector<const RTCOutboundRtpStreamStats*> outbound_rtps =
report->GetStatsOfType<RTCOutboundRtpStreamStats>();
@@ -2452,7 +2452,7 @@
remote_pc_wrapper->WaitForConnection();
// Ensure no media is flowing (1 second should be enough).
- rtc::Thread::Current()->SleepMs(1000);
+ Thread::Current()->SleepMs(1000);
rtc::scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
std::vector<const RTCOutboundRtpStreamStats*> outbound_rtps =
report->GetStatsOfType<RTCOutboundRtpStreamStats>();
diff --git a/pc/peer_connection_end_to_end_unittest.cc b/pc/peer_connection_end_to_end_unittest.cc
index 50b1b11..84fecf9 100644
--- a/pc/peer_connection_end_to_end_unittest.cc
+++ b/pc/peer_connection_end_to_end_unittest.cc
@@ -83,8 +83,8 @@
typedef std::vector<rtc::scoped_refptr<DataChannelInterface>> DataChannelList;
explicit PeerConnectionEndToEndBaseTest(SdpSemantics sdp_semantics)
- : network_thread_(std::make_unique<rtc::Thread>(&pss_)),
- worker_thread_(rtc::Thread::Create()) {
+ : network_thread_(std::make_unique<webrtc::Thread>(&pss_)),
+ worker_thread_(webrtc::Thread::Create()) {
RTC_CHECK(network_thread_->Start());
RTC_CHECK(worker_thread_->Start());
caller_ = rtc::make_ref_counted<PeerConnectionTestWrapper>(
@@ -249,10 +249,10 @@
}
protected:
- rtc::AutoThread main_thread_;
+ webrtc::AutoThread main_thread_;
webrtc::PhysicalSocketServer pss_;
- std::unique_ptr<rtc::Thread> network_thread_;
- std::unique_ptr<rtc::Thread> worker_thread_;
+ std::unique_ptr<webrtc::Thread> network_thread_;
+ std::unique_ptr<webrtc::Thread> worker_thread_;
rtc::scoped_refptr<PeerConnectionTestWrapper> caller_;
rtc::scoped_refptr<PeerConnectionTestWrapper> callee_;
DataChannelList caller_signaled_data_channels_;
@@ -761,7 +761,7 @@
// Wait for a bit longer so the remote data channel will receive the
// close message and be destroyed.
- rtc::Thread::Current()->ProcessMessages(100);
+ webrtc::Thread::Current()->ProcessMessages(100);
}
// Test behavior of creating too many datachannels.
diff --git a/pc/peer_connection_factory.h b/pc/peer_connection_factory.h
index 0b1e167..fe04e0f 100644
--- a/pc/peer_connection_factory.h
+++ b/pc/peer_connection_factory.h
@@ -91,13 +91,13 @@
return context_->sctp_transport_factory();
}
- rtc::Thread* signaling_thread() const {
+ Thread* signaling_thread() const {
// This method can be called on a different thread when the factory is
// created in CreatePeerConnectionFactory().
return context_->signaling_thread();
}
- rtc::Thread* worker_thread() const { return context_->worker_thread(); }
+ Thread* worker_thread() const { return context_->worker_thread(); }
const Options& options() const {
RTC_DCHECK_RUN_ON(signaling_thread());
@@ -124,7 +124,7 @@
virtual ~PeerConnectionFactory();
private:
- rtc::Thread* network_thread() const { return context_->network_thread(); }
+ Thread* network_thread() const { return context_->network_thread(); }
bool IsTrialEnabled(absl::string_view key) const;
diff --git a/pc/peer_connection_factory_unittest.cc b/pc/peer_connection_factory_unittest.cc
index 7df8b5d..cad99fb 100644
--- a/pc/peer_connection_factory_unittest.cc
+++ b/pc/peer_connection_factory_unittest.cc
@@ -156,7 +156,7 @@
// level, and using a real one could make tests flaky e.g. when run in
// parallel.
factory_ = CreatePeerConnectionFactory(
- rtc::Thread::Current(), rtc::Thread::Current(), rtc::Thread::Current(),
+ Thread::Current(), Thread::Current(), Thread::Current(),
rtc::scoped_refptr<AudioDeviceModule>(FakeAudioCaptureModule::Create()),
CreateBuiltinAudioEncoderFactory(), CreateBuiltinAudioDecoderFactory(),
std::make_unique<VideoEncoderFactoryTemplate<
@@ -171,8 +171,7 @@
packet_socket_factory_.reset(
new BasicPacketSocketFactory(socket_server_.get()));
port_allocator_.reset(new cricket::FakePortAllocator(
- rtc::Thread::Current(), packet_socket_factory_.get(),
- field_trials_.get()));
+ Thread::Current(), packet_socket_factory_.get(), field_trials_.get()));
raw_port_allocator_ = port_allocator_.get();
}
@@ -269,7 +268,7 @@
std::unique_ptr<FieldTrials> field_trials_ = FieldTrials::CreateNoGlobal("");
std::unique_ptr<SocketServer> socket_server_;
- rtc::AutoSocketServerThread main_thread_;
+ AutoSocketServerThread main_thread_;
rtc::scoped_refptr<PeerConnectionFactoryInterface> factory_;
NullPeerConnectionObserver observer_;
std::unique_ptr<PacketSocketFactory> packet_socket_factory_;
@@ -284,9 +283,9 @@
rtc::scoped_refptr<PeerConnectionFactoryInterface>
CreatePeerConnectionFactoryWithRtxDisabled() {
PeerConnectionFactoryDependencies pcf_dependencies;
- pcf_dependencies.signaling_thread = rtc::Thread::Current();
- pcf_dependencies.worker_thread = rtc::Thread::Current();
- pcf_dependencies.network_thread = rtc::Thread::Current();
+ pcf_dependencies.signaling_thread = Thread::Current();
+ pcf_dependencies.worker_thread = Thread::Current();
+ pcf_dependencies.network_thread = Thread::Current();
pcf_dependencies.task_queue_factory = CreateDefaultTaskQueueFactory();
pcf_dependencies.adm = FakeAudioCaptureModule::Create();
diff --git a/pc/peer_connection_field_trial_tests.cc b/pc/peer_connection_field_trial_tests.cc
index 94b7731..0ff31ef 100644
--- a/pc/peer_connection_field_trial_tests.cc
+++ b/pc/peer_connection_field_trial_tests.cc
@@ -65,7 +65,7 @@
void CreatePCFactory(std::unique_ptr<FieldTrialsView> field_trials) {
PeerConnectionFactoryDependencies pcf_deps;
- pcf_deps.signaling_thread = rtc::Thread::Current();
+ pcf_deps.signaling_thread = Thread::Current();
pcf_deps.trials = std::move(field_trials);
pcf_deps.task_queue_factory = CreateDefaultTaskQueueFactory();
pcf_deps.adm = FakeAudioCaptureModule::Create();
@@ -93,7 +93,7 @@
Clock* const clock_;
std::unique_ptr<SocketServer> socket_server_;
- rtc::AutoSocketServerThread main_thread_;
+ AutoSocketServerThread main_thread_;
rtc::scoped_refptr<PeerConnectionFactoryInterface> pc_factory_ = nullptr;
PeerConnectionInterface::RTCConfiguration config_;
};
diff --git a/pc/peer_connection_header_extension_unittest.cc b/pc/peer_connection_header_extension_unittest.cc
index be83d43..620ee63 100644
--- a/pc/peer_connection_header_extension_unittest.cc
+++ b/pc/peer_connection_header_extension_unittest.cc
@@ -80,9 +80,9 @@
else
media_engine->fake_video_engine()->SetRtpHeaderExtensions(extensions_);
PeerConnectionFactoryDependencies factory_dependencies;
- factory_dependencies.network_thread = rtc::Thread::Current();
- factory_dependencies.worker_thread = rtc::Thread::Current();
- factory_dependencies.signaling_thread = rtc::Thread::Current();
+ factory_dependencies.network_thread = Thread::Current();
+ factory_dependencies.worker_thread = Thread::Current();
+ factory_dependencies.signaling_thread = Thread::Current();
factory_dependencies.task_queue_factory = CreateDefaultTaskQueueFactory();
EnableFakeMedia(factory_dependencies, std::move(media_engine));
@@ -93,7 +93,7 @@
CreateModularPeerConnectionFactory(std::move(factory_dependencies));
auto fake_port_allocator = std::make_unique<cricket::FakePortAllocator>(
- rtc::Thread::Current(),
+ Thread::Current(),
std::make_unique<BasicPacketSocketFactory>(socket_server_.get()),
field_trials_.get());
auto observer = std::make_unique<MockPeerConnectionObserver>();
@@ -112,7 +112,7 @@
std::unique_ptr<FieldTrials> field_trials_ = FieldTrials::CreateNoGlobal("");
std::unique_ptr<SocketServer> socket_server_;
- rtc::AutoSocketServerThread main_thread_;
+ AutoSocketServerThread main_thread_;
std::vector<RtpHeaderExtensionCapability> extensions_;
};
diff --git a/pc/peer_connection_histogram_unittest.cc b/pc/peer_connection_histogram_unittest.cc
index 8b92b29..34b19f0 100644
--- a/pc/peer_connection_histogram_unittest.cc
+++ b/pc/peer_connection_histogram_unittest.cc
@@ -230,7 +230,7 @@
auto fake_network = std::make_unique<FakeNetworkManager>();
fake_network->set_mdns_responder(
- std::make_unique<FakeMdnsResponder>(rtc::Thread::Current()));
+ std::make_unique<FakeMdnsResponder>(Thread::Current()));
fake_network->AddInterface(NextLocalAddress());
return CreatePeerConnection(config,
@@ -275,9 +275,9 @@
PeerConnectionDependencies deps,
std::unique_ptr<rtc::NetworkManager> network_manager) {
PeerConnectionFactoryDependencies pcf_deps;
- pcf_deps.network_thread = rtc::Thread::Current();
- pcf_deps.worker_thread = rtc::Thread::Current();
- pcf_deps.signaling_thread = rtc::Thread::Current();
+ pcf_deps.network_thread = Thread::Current();
+ pcf_deps.worker_thread = Thread::Current();
+ pcf_deps.signaling_thread = Thread::Current();
pcf_deps.socket_factory = &vss_;
if (network_manager != nullptr) {
pcf_deps.network_manager = std::move(network_manager);
@@ -322,7 +322,7 @@
int next_local_address_ = 0;
VirtualSocketServer vss_;
- rtc::AutoSocketServerThread main_;
+ AutoSocketServerThread main_;
};
TEST_F(PeerConnectionUsageHistogramTest, UsageFingerprintHistogramFromTimeout) {
diff --git a/pc/peer_connection_ice_unittest.cc b/pc/peer_connection_ice_unittest.cc
index 00dc1b0..371b366 100644
--- a/pc/peer_connection_ice_unittest.cc
+++ b/pc/peer_connection_ice_unittest.cc
@@ -156,9 +156,9 @@
WrapperPtr CreatePeerConnection(const RTCConfiguration& config) {
PeerConnectionFactoryDependencies pcf_deps;
- pcf_deps.network_thread = rtc::Thread::Current();
- pcf_deps.worker_thread = rtc::Thread::Current();
- pcf_deps.signaling_thread = rtc::Thread::Current();
+ pcf_deps.network_thread = Thread::Current();
+ pcf_deps.worker_thread = Thread::Current();
+ pcf_deps.signaling_thread = Thread::Current();
pcf_deps.socket_factory = &vss_;
auto network_manager = std::make_unique<FakeNetworkManager>();
auto* fake_network = network_manager.get();
@@ -315,7 +315,7 @@
}
VirtualSocketServer vss_;
- rtc::AutoSocketServerThread main_;
+ AutoSocketServerThread main_;
const SdpSemantics sdp_semantics_;
};
@@ -467,7 +467,7 @@
caller->network()->AddInterface(kLocalAddress);
// Pump for 1 second and verify that no candidates are generated.
- rtc::Thread::Current()->ProcessMessages(1000);
+ Thread::Current()->ProcessMessages(1000);
EXPECT_EQ(0u, caller->observer()->candidates_.size());
}
@@ -485,7 +485,7 @@
ASSERT_TRUE(callee->SetRemoteDescription(std::move(offer)));
// Pump for 1 second and verify that no candidates are generated.
- rtc::Thread::Current()->ProcessMessages(1000);
+ Thread::Current()->ProcessMessages(1000);
EXPECT_EQ(0u, callee->observer()->candidates_.size());
}
@@ -989,7 +989,7 @@
caller->network()->RemoveInterface(kLocalAddress);
// Verify that the local candidates are not removed;
- rtc::Thread::Current()->ProcessMessages(1000);
+ Thread::Current()->ProcessMessages(1000);
EXPECT_EQ(0, caller->observer()->num_candidates_removed_);
}
@@ -1453,7 +1453,7 @@
protected:
void SetUp() override {
pc_factory_ = CreatePeerConnectionFactory(
- rtc::Thread::Current(), rtc::Thread::Current(), rtc::Thread::Current(),
+ Thread::Current(), Thread::Current(), Thread::Current(),
FakeAudioCaptureModule::Create(), CreateBuiltinAudioEncoderFactory(),
CreateBuiltinAudioDecoderFactory(),
std::make_unique<VideoEncoderFactoryTemplate<
@@ -1468,7 +1468,7 @@
packet_socket_factory_.reset(
new BasicPacketSocketFactory(socket_server_.get()));
std::unique_ptr<cricket::FakePortAllocator> port_allocator(
- new cricket::FakePortAllocator(rtc::Thread::Current(),
+ new cricket::FakePortAllocator(Thread::Current(),
packet_socket_factory_.get(),
field_trials_.get()));
port_allocator_ = port_allocator.get();
@@ -1482,7 +1482,7 @@
std::unique_ptr<FieldTrials> field_trials_ = FieldTrials::CreateNoGlobal("");
std::unique_ptr<SocketServer> socket_server_;
- rtc::AutoSocketServerThread main_thread_;
+ AutoSocketServerThread main_thread_;
rtc::scoped_refptr<PeerConnectionFactoryInterface> pc_factory_ = nullptr;
rtc::scoped_refptr<PeerConnectionInterface> pc_ = nullptr;
std::unique_ptr<PacketSocketFactory> packet_socket_factory_;
diff --git a/pc/peer_connection_interface_unittest.cc b/pc/peer_connection_interface_unittest.cc
index 19d3915..4f66d0c 100644
--- a/pc/peer_connection_interface_unittest.cc
+++ b/pc/peer_connection_interface_unittest.cc
@@ -538,7 +538,7 @@
// Add a local video track.
rtc::scoped_refptr<VideoTrackInterface> video_track(VideoTrack::Create(
kVideoTracks[i * tracks_per_stream + j],
- FakeVideoTrackSource::Create(), rtc::Thread::Current()));
+ FakeVideoTrackSource::Create(), Thread::Current()));
stream->AddTrack(video_track);
}
@@ -615,9 +615,9 @@
static rtc::scoped_refptr<PeerConnectionFactoryForTest>
CreatePeerConnectionFactoryForTest() {
PeerConnectionFactoryDependencies dependencies;
- dependencies.worker_thread = rtc::Thread::Current();
- dependencies.network_thread = rtc::Thread::Current();
- dependencies.signaling_thread = rtc::Thread::Current();
+ dependencies.worker_thread = Thread::Current();
+ dependencies.network_thread = Thread::Current();
+ dependencies.signaling_thread = Thread::Current();
dependencies.task_queue_factory = CreateDefaultTaskQueueFactory();
dependencies.trials = std::make_unique<FieldTrialBasedConfig>();
// Use fake audio device module since we're only testing the interface
@@ -653,7 +653,7 @@
// level, and using a real one could make tests flaky when run in parallel.
fake_audio_capture_module_ = FakeAudioCaptureModule::Create();
pc_factory_ = CreatePeerConnectionFactory(
- rtc::Thread::Current(), rtc::Thread::Current(), rtc::Thread::Current(),
+ Thread::Current(), Thread::Current(), Thread::Current(),
rtc::scoped_refptr<AudioDeviceModule>(fake_audio_capture_module_),
CreateBuiltinAudioEncoderFactory(), CreateBuiltinAudioDecoderFactory(),
std::make_unique<VideoEncoderFactoryTemplate<
@@ -713,7 +713,7 @@
}
std::unique_ptr<cricket::FakePortAllocator> port_allocator(
new cricket::FakePortAllocator(
- rtc::Thread::Current(),
+ Thread::Current(),
std::make_unique<BasicPacketSocketFactory>(vss_.get()),
field_trials_.get()));
port_allocator_ = port_allocator.get();
@@ -1147,7 +1147,7 @@
void AddVideoTrack(const std::string& track_id,
MediaStreamInterface* stream) {
rtc::scoped_refptr<VideoTrackInterface> video_track(VideoTrack::Create(
- track_id, FakeVideoTrackSource::Create(), rtc::Thread::Current()));
+ track_id, FakeVideoTrackSource::Create(), Thread::Current()));
ASSERT_TRUE(stream->AddTrack(video_track));
}
@@ -1260,7 +1260,7 @@
std::unique_ptr<FieldTrials> field_trials_ = FieldTrials::CreateNoGlobal("");
std::unique_ptr<VirtualSocketServer> vss_;
- rtc::AutoSocketServerThread main_;
+ AutoSocketServerThread main_;
rtc::scoped_refptr<FakeAudioCaptureModule> fake_audio_capture_module_;
cricket::FakePortAllocator* port_allocator_ = nullptr;
FakeRTCCertificateGenerator* fake_certificate_generator_ = nullptr;
@@ -1365,9 +1365,8 @@
std::unique_ptr<PacketSocketFactory> packet_socket_factory(
new BasicPacketSocketFactory(socket_server()));
std::unique_ptr<cricket::FakePortAllocator> port_allocator(
- new cricket::FakePortAllocator(rtc::Thread::Current(),
- packet_socket_factory.get(),
- field_trials_.get()));
+ new cricket::FakePortAllocator(
+ Thread::Current(), packet_socket_factory.get(), field_trials_.get()));
cricket::FakePortAllocator* raw_port_allocator = port_allocator.get();
// Create RTCConfiguration with some network-related fields relevant to
@@ -1385,9 +1384,8 @@
// Create the PC factory and PC with the above config.
rtc::scoped_refptr<PeerConnectionFactoryInterface> pc_factory(
CreatePeerConnectionFactory(
- rtc::Thread::Current(), rtc::Thread::Current(),
- rtc::Thread::Current(), fake_audio_capture_module_,
- CreateBuiltinAudioEncoderFactory(),
+ Thread::Current(), Thread::Current(), Thread::Current(),
+ fake_audio_capture_module_, CreateBuiltinAudioEncoderFactory(),
CreateBuiltinAudioDecoderFactory(),
std::make_unique<VideoEncoderFactoryTemplate<
LibvpxVp8EncoderTemplateAdapter, LibvpxVp9EncoderTemplateAdapter,
diff --git a/pc/peer_connection_internal.h b/pc/peer_connection_internal.h
index 5b0f746..3f38b58 100644
--- a/pc/peer_connection_internal.h
+++ b/pc/peer_connection_internal.h
@@ -164,8 +164,8 @@
class PeerConnectionInternal : public PeerConnectionInterface,
public PeerConnectionSdpMethods {
public:
- virtual rtc::Thread* network_thread() const = 0;
- virtual rtc::Thread* worker_thread() const = 0;
+ virtual Thread* network_thread() const = 0;
+ virtual Thread* worker_thread() const = 0;
// Returns true if we were the initial offerer.
virtual bool initial_offerer() const = 0;
diff --git a/pc/peer_connection_jsep_unittest.cc b/pc/peer_connection_jsep_unittest.cc
index f2f0b4d..7a4df54 100644
--- a/pc/peer_connection_jsep_unittest.cc
+++ b/pc/peer_connection_jsep_unittest.cc
@@ -70,9 +70,9 @@
PeerConnectionFactoryDependencies CreatePeerConnectionFactoryDependencies() {
PeerConnectionFactoryDependencies dependencies;
- dependencies.worker_thread = rtc::Thread::Current();
- dependencies.network_thread = rtc::Thread::Current();
- dependencies.signaling_thread = rtc::Thread::Current();
+ dependencies.worker_thread = Thread::Current();
+ dependencies.network_thread = Thread::Current();
+ dependencies.signaling_thread = Thread::Current();
dependencies.task_queue_factory = CreateDefaultTaskQueueFactory();
dependencies.trials = std::make_unique<FieldTrialBasedConfig>();
dependencies.adm = FakeAudioCaptureModule::Create();
@@ -115,7 +115,7 @@
}
std::unique_ptr<VirtualSocketServer> vss_;
- rtc::AutoSocketServerThread main_;
+ AutoSocketServerThread main_;
};
// Tests for JSEP initial offer generation.
diff --git a/pc/peer_connection_media_unittest.cc b/pc/peer_connection_media_unittest.cc
index 5c71ab7..686cf8a 100644
--- a/pc/peer_connection_media_unittest.cc
+++ b/pc/peer_connection_media_unittest.cc
@@ -167,9 +167,9 @@
PeerConnectionFactoryDependencies factory_dependencies;
- factory_dependencies.network_thread = rtc::Thread::Current();
- factory_dependencies.worker_thread = rtc::Thread::Current();
- factory_dependencies.signaling_thread = rtc::Thread::Current();
+ factory_dependencies.network_thread = Thread::Current();
+ factory_dependencies.worker_thread = Thread::Current();
+ factory_dependencies.signaling_thread = Thread::Current();
factory_dependencies.task_queue_factory = CreateDefaultTaskQueueFactory();
EnableFakeMedia(factory_dependencies, std::move(media_engine));
factory_dependencies.event_log_factory =
@@ -178,7 +178,7 @@
CreateModularPeerConnectionFactory(std::move(factory_dependencies));
auto fake_port_allocator = std::make_unique<cricket::FakePortAllocator>(
- rtc::Thread::Current(),
+ Thread::Current(),
std::make_unique<BasicPacketSocketFactory>(vss_.get()), nullptr);
auto observer = std::make_unique<MockPeerConnectionObserver>();
auto modified_config = config;
@@ -250,7 +250,7 @@
}
std::unique_ptr<VirtualSocketServer> vss_;
- rtc::AutoSocketServerThread main_;
+ AutoSocketServerThread main_;
const SdpSemantics sdp_semantics_;
};
diff --git a/pc/peer_connection_message_handler.h b/pc/peer_connection_message_handler.h
index 8bd0e5e..b9498e8 100644
--- a/pc/peer_connection_message_handler.h
+++ b/pc/peer_connection_message_handler.h
@@ -26,7 +26,7 @@
class PeerConnectionMessageHandler {
public:
- explicit PeerConnectionMessageHandler(rtc::Thread* signaling_thread)
+ explicit PeerConnectionMessageHandler(Thread* signaling_thread)
: signaling_thread_(signaling_thread) {}
~PeerConnectionMessageHandler() = default;
diff --git a/pc/peer_connection_proxy.h b/pc/peer_connection_proxy.h
index 46f62b9..03f8a80 100644
--- a/pc/peer_connection_proxy.h
+++ b/pc/peer_connection_proxy.h
@@ -167,7 +167,7 @@
PROXY_METHOD0(void, StopRtcEventLog)
PROXY_METHOD0(void, Close)
PROXY_METHOD0(NetworkControllerInterface*, GetNetworkController)
-BYPASS_PROXY_CONSTMETHOD0(rtc::Thread*, signaling_thread)
+BYPASS_PROXY_CONSTMETHOD0(Thread*, signaling_thread)
END_PROXY_MAP(PeerConnection)
} // namespace webrtc
diff --git a/pc/peer_connection_rampup_tests.cc b/pc/peer_connection_rampup_tests.cc
index 925568b..d313c53 100644
--- a/pc/peer_connection_rampup_tests.cc
+++ b/pc/peer_connection_rampup_tests.cc
@@ -153,7 +153,7 @@
: clock_(Clock::GetRealTimeClock()),
firewall_socket_server_(&virtual_socket_server_),
network_thread_(&firewall_socket_server_),
- worker_thread_(rtc::Thread::Create()) {
+ worker_thread_(Thread::Create()) {
network_thread_.SetName("PCNetworkThread", this);
worker_thread_->SetName("PCWorkerThread", this);
RTC_CHECK(network_thread_.Start());
@@ -178,7 +178,7 @@
PeerConnectionFactoryDependencies pcf_deps;
pcf_deps.network_thread = network_thread();
pcf_deps.worker_thread = worker_thread_.get();
- pcf_deps.signaling_thread = rtc::Thread::Current();
+ pcf_deps.signaling_thread = Thread::Current();
pcf_deps.socket_factory = &firewall_socket_server_;
auto network_manager = std::make_unique<FakeNetworkManager>();
network_manager->AddInterface(kDefaultLocalAddress);
@@ -249,7 +249,7 @@
void CreateTurnServer(ProtocolType type,
const std::string& common_name = "test turn server") {
- rtc::Thread* thread = network_thread();
+ Thread* thread = network_thread();
SocketFactory* factory = &firewall_socket_server_;
std::unique_ptr<TestTurnServer> turn_server;
SendTask(network_thread(), [&] {
@@ -271,12 +271,12 @@
// bandwidth estimations and prints the bandwidth estimation result as a perf
// metric.
void RunTest(const std::string& test_string) {
- rtc::Thread::Current()->ProcessMessages(kRampUpTimeMs);
+ Thread::Current()->ProcessMessages(kRampUpTimeMs);
int number_of_polls =
(kDefaultTestTimeMs - kRampUpTimeMs) / kPollIntervalTimeMs;
int total_bwe = 0;
for (int i = 0; i < number_of_polls; ++i) {
- rtc::Thread::Current()->ProcessMessages(kPollIntervalTimeMs);
+ Thread::Current()->ProcessMessages(kPollIntervalTimeMs);
total_bwe += static_cast<int>(GetCallerAvailableBitrateEstimate());
}
double average_bandwidth_estimate = total_bwe / number_of_polls;
@@ -288,7 +288,7 @@
ImprovementDirection::kNeitherIsBetter);
}
- rtc::Thread* network_thread() { return &network_thread_; }
+ Thread* network_thread() { return &network_thread_; }
FirewallSocketServer* firewall_socket_server() {
return &firewall_socket_server_;
@@ -345,8 +345,8 @@
VirtualSocketServer virtual_socket_server_;
FirewallSocketServer firewall_socket_server_;
- rtc::Thread network_thread_;
- std::unique_ptr<rtc::Thread> worker_thread_;
+ Thread network_thread_;
+ std::unique_ptr<Thread> worker_thread_;
std::unique_ptr<PeerConnectionWrapperForRampUpTest> caller_;
std::unique_ptr<PeerConnectionWrapperForRampUpTest> callee_;
diff --git a/pc/peer_connection_rtp_unittest.cc b/pc/peer_connection_rtp_unittest.cc
index 181665d..4b17364 100644
--- a/pc/peer_connection_rtp_unittest.cc
+++ b/pc/peer_connection_rtp_unittest.cc
@@ -92,9 +92,9 @@
explicit PeerConnectionRtpBaseTest(SdpSemantics sdp_semantics)
: sdp_semantics_(sdp_semantics),
pc_factory_(CreatePeerConnectionFactory(
- rtc::Thread::Current(),
- rtc::Thread::Current(),
- rtc::Thread::Current(),
+ Thread::Current(),
+ Thread::Current(),
+ Thread::Current(),
FakeAudioCaptureModule::Create(),
CreateBuiltinAudioEncoderFactory(),
CreateBuiltinAudioDecoderFactory(),
@@ -154,7 +154,7 @@
pc_factory_, result.MoveValue(), std::move(observer));
}
- rtc::AutoThread main_thread_;
+ AutoThread main_thread_;
};
class PeerConnectionRtpTest
@@ -939,7 +939,7 @@
auto offer = caller->CreateOfferAndSetAsLocal();
callee->pc()->SetRemoteDescription(observer.get(), offer.release());
callee = nullptr;
- rtc::Thread::Current()->ProcessMessages(0);
+ Thread::Current()->ProcessMessages(0);
EXPECT_FALSE(observer->called());
}
diff --git a/pc/peer_connection_signaling_unittest.cc b/pc/peer_connection_signaling_unittest.cc
index 3acec31..fd2ab40 100644
--- a/pc/peer_connection_signaling_unittest.cc
+++ b/pc/peer_connection_signaling_unittest.cc
@@ -130,7 +130,7 @@
InitializeAndroidObjects();
#endif
pc_factory_ = CreatePeerConnectionFactory(
- rtc::Thread::Current(), rtc::Thread::Current(), rtc::Thread::Current(),
+ Thread::Current(), Thread::Current(), Thread::Current(),
rtc::scoped_refptr<AudioDeviceModule>(FakeAudioCaptureModule::Create()),
CreateBuiltinAudioEncoderFactory(), CreateBuiltinAudioDecoderFactory(),
std::make_unique<VideoEncoderFactoryTemplate<
@@ -197,7 +197,7 @@
}
std::unique_ptr<VirtualSocketServer> vss_;
- rtc::AutoSocketServerThread main_;
+ AutoSocketServerThread main_;
rtc::scoped_refptr<PeerConnectionFactoryInterface> pc_factory_;
const SdpSemantics sdp_semantics_;
};
@@ -693,7 +693,7 @@
EXPECT_FALSE(observer->called());
// Process all currently pending messages by waiting for a posted task to run.
bool checkpoint_reached = false;
- rtc::Thread::Current()->PostTask(
+ Thread::Current()->PostTask(
[&checkpoint_reached] { checkpoint_reached = true; });
EXPECT_THAT(WaitUntil([&] { return checkpoint_reached; }, ::testing::IsTrue(),
{.timeout = webrtc::TimeDelta::Millis(kWaitTimeout)}),
diff --git a/pc/peer_connection_simulcast_unittest.cc b/pc/peer_connection_simulcast_unittest.cc
index b2c0d71..c912269 100644
--- a/pc/peer_connection_simulcast_unittest.cc
+++ b/pc/peer_connection_simulcast_unittest.cc
@@ -94,9 +94,9 @@
public:
PeerConnectionSimulcastTests()
: pc_factory_(CreatePeerConnectionFactory(
- rtc::Thread::Current(),
- rtc::Thread::Current(),
- rtc::Thread::Current(),
+ Thread::Current(),
+ Thread::Current(),
+ Thread::Current(),
FakeAudioCaptureModule::Create(),
CreateBuiltinAudioEncoderFactory(),
CreateBuiltinAudioDecoderFactory(),
diff --git a/pc/proxy.h b/pc/proxy.h
index 3e6bde4..60ef713 100644
--- a/pc/proxy.h
+++ b/pc/proxy.h
@@ -113,7 +113,7 @@
m_(m),
args_(std::forward_as_tuple(std::forward<Args>(args)...)) {}
- R Marshal(rtc::Thread* t) {
+ R Marshal(Thread* t) {
if (t->IsCurrent()) {
Invoke(std::index_sequence_for<Args...>());
} else {
@@ -148,7 +148,7 @@
m_(m),
args_(std::forward_as_tuple(std::forward<Args>(args)...)) {}
- R Marshal(rtc::Thread* t) {
+ R Marshal(Thread* t) {
if (t->IsCurrent()) {
Invoke(std::index_sequence_for<Args...>());
} else {
diff --git a/pc/proxy_unittest.cc b/pc/proxy_unittest.cc
index c131095..865b041 100644
--- a/pc/proxy_unittest.cc
+++ b/pc/proxy_unittest.cc
@@ -95,7 +95,7 @@
protected:
void SetUp() override {
- signaling_thread_ = rtc::Thread::Create();
+ signaling_thread_ = Thread::Create();
ASSERT_TRUE(signaling_thread_->Start());
fake_ = Fake::Create();
fake_signaling_proxy_ =
@@ -103,7 +103,7 @@
}
protected:
- std::unique_ptr<rtc::Thread> signaling_thread_;
+ std::unique_ptr<Thread> signaling_thread_;
rtc::scoped_refptr<FakeInterface> fake_signaling_proxy_;
rtc::scoped_refptr<Fake> fake_;
};
@@ -182,8 +182,8 @@
protected:
void SetUp() override {
- signaling_thread_ = rtc::Thread::Create();
- worker_thread_ = rtc::Thread::Create();
+ signaling_thread_ = Thread::Create();
+ worker_thread_ = Thread::Create();
ASSERT_TRUE(signaling_thread_->Start());
ASSERT_TRUE(worker_thread_->Start());
fake_ = Fake::Create();
@@ -192,8 +192,8 @@
}
protected:
- std::unique_ptr<rtc::Thread> signaling_thread_;
- std::unique_ptr<rtc::Thread> worker_thread_;
+ std::unique_ptr<Thread> signaling_thread_;
+ std::unique_ptr<Thread> worker_thread_;
rtc::scoped_refptr<FakeInterface> fake_proxy_;
rtc::scoped_refptr<Fake> fake_;
};
diff --git a/pc/rtc_stats_collector.cc b/pc/rtc_stats_collector.cc
index 3c32f56..c3d6e51 100644
--- a/pc/rtc_stats_collector.cc
+++ b/pc/rtc_stats_collector.cc
@@ -1272,7 +1272,7 @@
void RTCStatsCollector::ProducePartialResultsOnSignalingThread(
Timestamp timestamp) {
RTC_DCHECK_RUN_ON(signaling_thread_);
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
partial_report_ = RTCStatsReport::Create(timestamp);
@@ -1290,7 +1290,7 @@
Timestamp timestamp,
RTCStatsReport* partial_report) {
RTC_DCHECK_RUN_ON(signaling_thread_);
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
ProduceMediaSourceStats_s(timestamp, partial_report);
ProducePeerConnectionStats_s(timestamp, partial_report);
@@ -1303,7 +1303,7 @@
TRACE_EVENT0("webrtc",
"RTCStatsCollector::ProducePartialResultsOnNetworkThread");
RTC_DCHECK_RUN_ON(network_thread_);
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
// Touching `network_report_` on this thread is safe by this method because
// `network_report_event_` is reset before this method is invoked.
@@ -1345,7 +1345,7 @@
const std::map<std::string, CertificateStatsPair>& transport_cert_stats,
RTCStatsReport* partial_report) {
RTC_DCHECK_RUN_ON(network_thread_);
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
ProduceCertificateStats_n(timestamp, transport_cert_stats, partial_report);
ProduceIceCandidateAndPairStats_n(timestamp, transport_stats_by_name,
@@ -1431,7 +1431,7 @@
const std::map<std::string, CertificateStatsPair>& transport_cert_stats,
RTCStatsReport* report) const {
RTC_DCHECK_RUN_ON(network_thread_);
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
for (const auto& transport_cert_stats_pair : transport_cert_stats) {
if (transport_cert_stats_pair.second.local) {
@@ -1449,7 +1449,7 @@
Timestamp timestamp,
RTCStatsReport* report) const {
RTC_DCHECK_RUN_ON(network_thread_);
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
std::vector<DataChannelStats> data_stats = pc_->GetDataChannelStats();
for (const auto& stats : data_stats) {
auto data_channel_stats = std::make_unique<RTCDataChannelStats>(
@@ -1477,7 +1477,7 @@
const Call::Stats& call_stats,
RTCStatsReport* report) const {
RTC_DCHECK_RUN_ON(network_thread_);
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
for (const auto& entry : transport_stats_by_name) {
const std::string& transport_name = entry.first;
@@ -1581,7 +1581,7 @@
Timestamp timestamp,
RTCStatsReport* report) const {
RTC_DCHECK_RUN_ON(signaling_thread_);
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
for (const RtpTransceiverStatsInfo& transceiver_stats_info :
transceiver_stats_infos_) {
@@ -1680,7 +1680,7 @@
Timestamp timestamp,
RTCStatsReport* report) const {
RTC_DCHECK_RUN_ON(signaling_thread_);
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
auto stats(std::make_unique<RTCPeerConnectionStats>("P", timestamp));
stats->data_channels_opened = internal_record_.data_channels_opened;
@@ -1692,7 +1692,7 @@
Timestamp timestamp,
RTCStatsReport* report) const {
RTC_DCHECK_RUN_ON(signaling_thread_);
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
if (audio_device_stats_) {
report->AddStats(CreateAudioPlayoutStats(*audio_device_stats_, timestamp));
@@ -1704,7 +1704,7 @@
const std::vector<RtpTransceiverStatsInfo>& transceiver_stats_infos,
RTCStatsReport* report) const {
RTC_DCHECK_RUN_ON(network_thread_);
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
for (const RtpTransceiverStatsInfo& stats : transceiver_stats_infos) {
if (stats.media_type == cricket::MEDIA_TYPE_AUDIO) {
@@ -1722,7 +1722,7 @@
const RtpTransceiverStatsInfo& stats,
RTCStatsReport* report) const {
RTC_DCHECK_RUN_ON(network_thread_);
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
if (!stats.mid || !stats.transport_name) {
return;
@@ -1827,7 +1827,7 @@
const RtpTransceiverStatsInfo& stats,
RTCStatsReport* report) const {
RTC_DCHECK_RUN_ON(network_thread_);
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
if (!stats.mid || !stats.transport_name) {
return;
@@ -1924,7 +1924,7 @@
const std::map<std::string, CertificateStatsPair>& transport_cert_stats,
RTCStatsReport* report) const {
RTC_DCHECK_RUN_ON(network_thread_);
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
for (const auto& entry : transport_stats_by_name) {
const std::string& transport_name = entry.first;
@@ -2031,7 +2031,7 @@
const std::map<std::string, cricket::TransportStats>&
transport_stats_by_name) {
RTC_DCHECK_RUN_ON(network_thread_);
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
std::map<std::string, CertificateStatsPair> transport_cert_stats;
{
@@ -2097,7 +2097,7 @@
// TODO(tommi): See if we can avoid synchronously blocking the signaling
// thread while we do this (or avoid the BlockingCall at all).
network_thread_->BlockingCall([&] {
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
for (const auto& transceiver_proxy : transceivers) {
RtpTransceiver* transceiver = transceiver_proxy->internal();
@@ -2153,7 +2153,7 @@
// TrackMediaInfoMaps, which also needs info from the worker thread. This
// minimizes the number of thread jumps.
worker_thread_->BlockingCall([&] {
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
for (auto& pair : voice_send_stats) {
if (!pair.first->GetStats(&pair.second)) {
diff --git a/pc/rtc_stats_collector.h b/pc/rtc_stats_collector.h
index 42714ae..b3264de 100644
--- a/pc/rtc_stats_collector.h
+++ b/pc/rtc_stats_collector.h
@@ -257,9 +257,9 @@
PeerConnectionInternal* const pc_;
const Environment env_;
const bool stats_timestamp_with_environment_clock_;
- rtc::Thread* const signaling_thread_;
- rtc::Thread* const worker_thread_;
- rtc::Thread* const network_thread_;
+ Thread* const signaling_thread_;
+ Thread* const worker_thread_;
+ Thread* const network_thread_;
int num_pending_partial_reports_;
int64_t partial_report_timestamp_us_;
diff --git a/pc/rtc_stats_collector_unittest.cc b/pc/rtc_stats_collector_unittest.cc
index b4f8ca2..5b37eaf 100644
--- a/pc/rtc_stats_collector_unittest.cc
+++ b/pc/rtc_stats_collector_unittest.cc
@@ -878,7 +878,7 @@
protected:
ScopedFakeClock fake_clock_;
- rtc::AutoThread main_thread_;
+ AutoThread main_thread_;
rtc::scoped_refptr<FakePeerConnectionForStats> pc_;
std::unique_ptr<RTCStatsCollectorWrapper> stats_;
std::unique_ptr<FakeDataChannelController> data_channel_controller_;
@@ -2092,10 +2092,10 @@
FakeDataChannelController controller(pc_->network_thread());
rtc::scoped_refptr<SctpDataChannel> dummy_channel_a = SctpDataChannel::Create(
controller.weak_ptr(), "DummyChannelA", false, InternalDataChannelInit(),
- rtc::Thread::Current(), rtc::Thread::Current());
+ Thread::Current(), Thread::Current());
rtc::scoped_refptr<SctpDataChannel> dummy_channel_b = SctpDataChannel::Create(
controller.weak_ptr(), "DummyChannelB", false, InternalDataChannelInit(),
- rtc::Thread::Current(), rtc::Thread::Current());
+ Thread::Current(), Thread::Current());
stats_->stats_collector()->OnSctpDataChannelStateChanged(
dummy_channel_a->internal_id(), DataChannelInterface::DataState::kOpen);
@@ -3854,9 +3854,9 @@
}
private:
- rtc::Thread* const signaling_thread_;
- rtc::Thread* const worker_thread_;
- rtc::Thread* const network_thread_;
+ Thread* const signaling_thread_;
+ Thread* const worker_thread_;
+ Thread* const network_thread_;
Mutex lock_;
rtc::scoped_refptr<const RTCStatsReport> delivered_report_;
@@ -3865,7 +3865,7 @@
};
TEST(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) {
- rtc::AutoThread main_thread_;
+ AutoThread main_thread_;
auto pc = rtc::make_ref_counted<FakePeerConnectionForStats>();
rtc::scoped_refptr<FakeRTCStatsCollector> stats_collector(
FakeRTCStatsCollector::Create(pc.get(), CreateEnvironment(),
diff --git a/pc/rtc_stats_integrationtest.cc b/pc/rtc_stats_integrationtest.cc
index 063b999..cc8b1b6 100644
--- a/pc/rtc_stats_integrationtest.cc
+++ b/pc/rtc_stats_integrationtest.cc
@@ -55,8 +55,8 @@
class RTCStatsIntegrationTest : public ::testing::Test {
public:
RTCStatsIntegrationTest()
- : network_thread_(new rtc::Thread(&virtual_socket_server_)),
- worker_thread_(rtc::Thread::Create()) {
+ : network_thread_(new Thread(&virtual_socket_server_)),
+ worker_thread_(Thread::Create()) {
RTC_CHECK(network_thread_->Start());
RTC_CHECK(worker_thread_->Start());
@@ -152,8 +152,8 @@
// `network_thread_` uses `virtual_socket_server_` so they must be
// constructed/destructed in the correct order.
VirtualSocketServer virtual_socket_server_;
- std::unique_ptr<rtc::Thread> network_thread_;
- std::unique_ptr<rtc::Thread> worker_thread_;
+ std::unique_ptr<Thread> network_thread_;
+ std::unique_ptr<Thread> worker_thread_;
rtc::scoped_refptr<PeerConnectionTestWrapper> caller_;
rtc::scoped_refptr<PeerConnectionTestWrapper> callee_;
};
diff --git a/pc/rtp_receiver.cc b/pc/rtp_receiver.cc
index ce221a2..28187f2 100644
--- a/pc/rtp_receiver.cc
+++ b/pc/rtp_receiver.cc
@@ -40,7 +40,7 @@
stream_ids.size());
for (size_t i = 0; i < stream_ids.size(); ++i) {
streams[i] = MediaStreamProxy::Create(
- rtc::Thread::Current(), MediaStream::Create(std::move(stream_ids[i])));
+ Thread::Current(), MediaStream::Create(std::move(stream_ids[i])));
}
return streams;
}
diff --git a/pc/rtp_sender.cc b/pc/rtp_sender.cc
index 5b2e0b2..a8e4fc2 100644
--- a/pc/rtp_sender.cc
+++ b/pc/rtp_sender.cc
@@ -92,7 +92,7 @@
class SignalingThreadCallback {
public:
- SignalingThreadCallback(rtc::Thread* signaling_thread,
+ SignalingThreadCallback(Thread* signaling_thread,
SetParametersCallback callback)
: signaling_thread_(signaling_thread), callback_(std::move(callback)) {}
SignalingThreadCallback(SignalingThreadCallback&& other)
@@ -126,7 +126,7 @@
callback_ = nullptr;
}
- rtc::Thread* signaling_thread_;
+ Thread* signaling_thread_;
SetParametersCallback callback_;
};
@@ -150,11 +150,11 @@
}
RtpSenderBase::RtpSenderBase(const Environment& env,
- rtc::Thread* worker_thread,
+ Thread* worker_thread,
const std::string& id,
SetStreamsObserver* set_streams_observer)
: env_(env),
- signaling_thread_(rtc::Thread::Current()),
+ signaling_thread_(Thread::Current()),
worker_thread_(worker_thread),
id_(id),
set_streams_observer_(set_streams_observer) {
@@ -647,7 +647,7 @@
rtc::scoped_refptr<AudioRtpSender> AudioRtpSender::Create(
const webrtc::Environment& env,
- rtc::Thread* worker_thread,
+ Thread* worker_thread,
const std::string& id,
LegacyStatsCollectorInterface* stats,
SetStreamsObserver* set_streams_observer) {
@@ -656,15 +656,15 @@
}
AudioRtpSender::AudioRtpSender(const webrtc::Environment& env,
- rtc::Thread* worker_thread,
+ Thread* worker_thread,
const std::string& id,
LegacyStatsCollectorInterface* legacy_stats,
SetStreamsObserver* set_streams_observer)
: RtpSenderBase(env, worker_thread, id, set_streams_observer),
legacy_stats_(legacy_stats),
- dtmf_sender_(DtmfSender::Create(rtc::Thread::Current(), this)),
+ dtmf_sender_(DtmfSender::Create(Thread::Current(), this)),
dtmf_sender_proxy_(
- DtmfSenderProxy::Create(rtc::Thread::Current(), dtmf_sender_)),
+ DtmfSenderProxy::Create(Thread::Current(), dtmf_sender_)),
sink_adapter_(new LocalAudioSinkAdapter()) {}
AudioRtpSender::~AudioRtpSender() {
@@ -802,7 +802,7 @@
rtc::scoped_refptr<VideoRtpSender> VideoRtpSender::Create(
const Environment& env,
- rtc::Thread* worker_thread,
+ Thread* worker_thread,
const std::string& id,
SetStreamsObserver* set_streams_observer) {
return rtc::make_ref_counted<VideoRtpSender>(env, worker_thread, id,
@@ -810,7 +810,7 @@
}
VideoRtpSender::VideoRtpSender(const Environment& env,
- rtc::Thread* worker_thread,
+ Thread* worker_thread,
const std::string& id,
SetStreamsObserver* set_streams_observer)
: RtpSenderBase(env, worker_thread, id, set_streams_observer) {}
diff --git a/pc/rtp_sender.h b/pc/rtp_sender.h
index 010e230..9de5129 100644
--- a/pc/rtp_sender.h
+++ b/pc/rtp_sender.h
@@ -240,7 +240,7 @@
// is called. `set_streams_observer` is not owned by this object. If not
// null, it must be valid at least until this sender becomes stopped.
RtpSenderBase(const Environment& env,
- rtc::Thread* worker_thread,
+ Thread* worker_thread,
const std::string& id,
SetStreamsObserver* set_streams_observer);
// TODO(bugs.webrtc.org/8694): Since SSRC == 0 is technically valid, figure
@@ -262,8 +262,8 @@
virtual void RemoveTrackFromStats() {}
const Environment env_;
- rtc::Thread* const signaling_thread_;
- rtc::Thread* const worker_thread_;
+ Thread* const signaling_thread_;
+ Thread* const worker_thread_;
uint32_t ssrc_ = 0;
bool stopped_ RTC_GUARDED_BY(signaling_thread_) = false;
bool is_transceiver_stopped_ RTC_GUARDED_BY(signaling_thread_) = false;
@@ -354,7 +354,7 @@
// null, it must be valid at least until this sender becomes stopped.
static rtc::scoped_refptr<AudioRtpSender> Create(
const Environment& env,
- rtc::Thread* worker_thread,
+ Thread* worker_thread,
const std::string& id,
LegacyStatsCollectorInterface* stats,
SetStreamsObserver* set_streams_observer);
@@ -379,7 +379,7 @@
protected:
AudioRtpSender(const Environment& env,
- rtc::Thread* worker_thread,
+ Thread* worker_thread,
const std::string& id,
LegacyStatsCollectorInterface* legacy_stats,
SetStreamsObserver* set_streams_observer);
@@ -421,7 +421,7 @@
// null, it must be valid at least until this sender becomes stopped.
static rtc::scoped_refptr<VideoRtpSender> Create(
const Environment& env,
- rtc::Thread* worker_thread,
+ Thread* worker_thread,
const std::string& id,
SetStreamsObserver* set_streams_observer);
virtual ~VideoRtpSender();
@@ -441,7 +441,7 @@
protected:
VideoRtpSender(const Environment& env,
- rtc::Thread* worker_thread,
+ Thread* worker_thread,
const std::string& id,
SetStreamsObserver* set_streams_observer);
diff --git a/pc/rtp_sender_receiver_unittest.cc b/pc/rtp_sender_receiver_unittest.cc
index 75e9f54..0422354 100644
--- a/pc/rtp_sender_receiver_unittest.cc
+++ b/pc/rtp_sender_receiver_unittest.cc
@@ -99,8 +99,8 @@
public ::testing::WithParamInterface<std::pair<RidList, RidList>> {
public:
RtpSenderReceiverTest()
- : network_thread_(rtc::Thread::Current()),
- worker_thread_(rtc::Thread::Current()),
+ : network_thread_(Thread::Current()),
+ worker_thread_(Thread::Current()),
video_bitrate_allocator_factory_(
CreateBuiltinVideoBitrateAllocatorFactory()),
// Create fake media engine/etc. so we can create channels to use to
@@ -181,8 +181,7 @@
void AddVideoTrack(bool is_screencast) {
rtc::scoped_refptr<VideoTrackSourceInterface> source(
FakeVideoTrackSource::Create(is_screencast));
- video_track_ =
- VideoTrack::Create(kVideoTrackId, source, rtc::Thread::Current());
+ video_track_ = VideoTrack::Create(kVideoTrackId, source, Thread::Current());
EXPECT_TRUE(local_stream_->AddTrack(video_track_));
}
@@ -284,7 +283,7 @@
void CreateAudioRtpReceiver(
std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams = {}) {
audio_rtp_receiver_ = rtc::make_ref_counted<AudioRtpReceiver>(
- rtc::Thread::Current(), kAudioTrackId, streams,
+ Thread::Current(), kAudioTrackId, streams,
/*is_unified_plan=*/true);
audio_rtp_receiver_->SetMediaChannel(voice_media_receive_channel());
audio_rtp_receiver_->SetupMediaChannel(kAudioSsrc);
@@ -295,7 +294,7 @@
void CreateVideoRtpReceiver(
std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams = {}) {
video_rtp_receiver_ = rtc::make_ref_counted<VideoRtpReceiver>(
- rtc::Thread::Current(), kVideoTrackId, streams);
+ Thread::Current(), kVideoTrackId, streams);
video_rtp_receiver_->SetMediaChannel(video_media_receive_channel());
video_rtp_receiver_->SetupMediaChannel(kVideoSsrc);
video_track_ = video_rtp_receiver_->video_track();
@@ -314,7 +313,7 @@
uint32_t primary_ssrc = stream_params.first_ssrc();
video_rtp_receiver_ = rtc::make_ref_counted<VideoRtpReceiver>(
- rtc::Thread::Current(), kVideoTrackId, streams);
+ Thread::Current(), kVideoTrackId, streams);
video_rtp_receiver_->SetMediaChannel(video_media_receive_channel());
video_rtp_receiver_->SetupMediaChannel(primary_ssrc);
video_track_ = video_rtp_receiver_->video_track();
@@ -447,8 +446,8 @@
void RunDisableSimulcastLayersWithoutMediaEngineTest(
const std::vector<std::string>& all_layers,
const std::vector<std::string>& disabled_layers) {
- auto sender = VideoRtpSender::Create(CreateEnvironment(),
- rtc::Thread::Current(), "1", nullptr);
+ auto sender = VideoRtpSender::Create(CreateEnvironment(), Thread::Current(),
+ "1", nullptr);
RtpParameters parameters;
parameters.encodings.resize(all_layers.size());
for (size_t i = 0; i < all_layers.size(); ++i) {
@@ -511,8 +510,8 @@
}
test::RunLoop run_loop_;
- rtc::Thread* const network_thread_;
- rtc::Thread* const worker_thread_;
+ Thread* const network_thread_;
+ Thread* const worker_thread_;
const Environment env_ = CreateEnvironment();
// The `rtp_dtls_transport_` and `rtp_transport_` should be destroyed after
// the `channel_manager`.
diff --git a/pc/rtp_transceiver.cc b/pc/rtp_transceiver.cc
index 9f411b9..f18d61b 100644
--- a/pc/rtp_transceiver.cc
+++ b/pc/rtp_transceiver.cc
@@ -109,7 +109,7 @@
TaskQueueBase* GetCurrentTaskQueueOrThread() {
TaskQueueBase* current = TaskQueueBase::Current();
if (!current)
- current = rtc::ThreadManager::Instance()->CurrentThread();
+ current = ThreadManager::Instance()->CurrentThread();
return current;
}
diff --git a/pc/rtp_transceiver_unittest.cc b/pc/rtp_transceiver_unittest.cc
index fe24a3c..6993d56 100644
--- a/pc/rtp_transceiver_unittest.cc
+++ b/pc/rtp_transceiver_unittest.cc
@@ -88,13 +88,13 @@
}
private:
- rtc::AutoThread main_thread_;
+ AutoThread main_thread_;
static PeerConnectionFactoryDependencies MakeDependencies() {
PeerConnectionFactoryDependencies d;
- d.network_thread = rtc::Thread::Current();
- d.worker_thread = rtc::Thread::Current();
- d.signaling_thread = rtc::Thread::Current();
+ d.network_thread = Thread::Current();
+ d.worker_thread = Thread::Current();
+ d.signaling_thread = Thread::Current();
EnableFakeMedia(d, std::make_unique<cricket::FakeMediaEngine>());
return d;
}
@@ -191,17 +191,16 @@
rtc::scoped_refptr<RtpReceiverInternal> receiver) {
return rtc::make_ref_counted<RtpTransceiver>(
RtpSenderProxyWithInternal<RtpSenderInternal>::Create(
- rtc::Thread::Current(), std::move(sender)),
+ Thread::Current(), std::move(sender)),
RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create(
- rtc::Thread::Current(), rtc::Thread::Current(),
- std::move(receiver)),
+ Thread::Current(), Thread::Current(), std::move(receiver)),
context(), codec_lookup_helper(),
media_engine()->voice().GetRtpHeaderExtensions(),
/* on_negotiation_needed= */ [] {});
}
protected:
- rtc::AutoThread main_thread_;
+ AutoThread main_thread_;
};
// Basic tests for Stop()
@@ -583,11 +582,11 @@
RtpTransceiverDirection::kSendRecv)}),
transceiver_(rtc::make_ref_counted<RtpTransceiver>(
RtpSenderProxyWithInternal<RtpSenderInternal>::Create(
- rtc::Thread::Current(),
+ Thread::Current(),
sender_),
RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create(
- rtc::Thread::Current(),
- rtc::Thread::Current(),
+ Thread::Current(),
+ Thread::Current(),
receiver_),
context(),
codec_lookup_helper(),
@@ -858,10 +857,10 @@
// Default is stopped.
auto sender = rtc::make_ref_counted<NiceMock<MockRtpSenderInternal>>();
auto transceiver = rtc::make_ref_counted<RtpTransceiver>(
- RtpSenderProxyWithInternal<RtpSenderInternal>::Create(
- rtc::Thread::Current(), sender),
+ RtpSenderProxyWithInternal<RtpSenderInternal>::Create(Thread::Current(),
+ sender),
RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create(
- rtc::Thread::Current(), rtc::Thread::Current(), receiver_),
+ Thread::Current(), Thread::Current(), receiver_),
context(), codec_lookup_helper(), extensions,
/* on_negotiation_needed= */ [] {});
std::vector<webrtc::RtpHeaderExtensionCapability> header_extensions =
@@ -880,10 +879,10 @@
EXPECT_CALL(*simulcast_sender, GetParametersInternal())
.WillRepeatedly(Return(simulcast_parameters));
auto simulcast_transceiver = rtc::make_ref_counted<RtpTransceiver>(
- RtpSenderProxyWithInternal<RtpSenderInternal>::Create(
- rtc::Thread::Current(), simulcast_sender),
+ RtpSenderProxyWithInternal<RtpSenderInternal>::Create(Thread::Current(),
+ simulcast_sender),
RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create(
- rtc::Thread::Current(), rtc::Thread::Current(), receiver_),
+ Thread::Current(), Thread::Current(), receiver_),
context(), codec_lookup_helper(), extensions,
/* on_negotiation_needed= */ [] {});
auto simulcast_extensions =
@@ -907,10 +906,10 @@
EXPECT_CALL(*svc_sender, GetParametersInternal())
.WillRepeatedly(Return(svc_parameters));
auto svc_transceiver = rtc::make_ref_counted<RtpTransceiver>(
- RtpSenderProxyWithInternal<RtpSenderInternal>::Create(
- rtc::Thread::Current(), svc_sender),
+ RtpSenderProxyWithInternal<RtpSenderInternal>::Create(Thread::Current(),
+ svc_sender),
RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create(
- rtc::Thread::Current(), rtc::Thread::Current(), receiver_),
+ Thread::Current(), Thread::Current(), receiver_),
context(), codec_lookup_helper(), extensions,
/* on_negotiation_needed= */ [] {});
std::vector<webrtc::RtpHeaderExtensionCapability> svc_extensions =
diff --git a/pc/rtp_transmission_manager.h b/pc/rtp_transmission_manager.h
index e605083..36bd3fd 100644
--- a/pc/rtp_transmission_manager.h
+++ b/pc/rtp_transmission_manager.h
@@ -43,10 +43,6 @@
#include "rtc_base/unique_id_generator.h"
#include "rtc_base/weak_ptr.h"
-namespace rtc {
-class Thread;
-}
-
namespace webrtc {
// This class contains information about
@@ -217,8 +213,8 @@
const;
private:
- rtc::Thread* signaling_thread() const { return context_->signaling_thread(); }
- rtc::Thread* worker_thread() const { return context_->worker_thread(); }
+ Thread* signaling_thread() const { return context_->signaling_thread(); }
+ Thread* worker_thread() const { return context_->worker_thread(); }
bool IsUnifiedPlan() const { return is_unified_plan_; }
void NoteUsageEvent(UsageEvent event) {
usage_pattern_->NoteUsageEvent(event);
diff --git a/pc/sctp_data_channel.cc b/pc/sctp_data_channel.cc
index 63d3c0b..d77f404 100644
--- a/pc/sctp_data_channel.cc
+++ b/pc/sctp_data_channel.cc
@@ -264,14 +264,14 @@
bool IsOkToCallOnTheNetworkThread() override { return true; }
- rtc::Thread* signaling_thread() const { return signaling_thread_; }
- rtc::Thread* network_thread() const { return channel_->network_thread_; }
+ Thread* signaling_thread() const { return signaling_thread_; }
+ Thread* network_thread() const { return channel_->network_thread_; }
DataChannelObserver* delegate_ RTC_GUARDED_BY(signaling_thread()) = nullptr;
SctpDataChannel* const channel_;
// Make sure to keep our own signaling_thread_ pointer to avoid dereferencing
// `channel_` in the `RTC_DCHECK_RUN_ON` checks on the signaling thread.
- rtc::Thread* const signaling_thread_{channel_->signaling_thread_};
+ Thread* const signaling_thread_{channel_->signaling_thread_};
ScopedTaskSafety safety_;
rtc::scoped_refptr<PendingTaskSafetyFlag> signaling_safety_;
CachedGetters* cached_getters_ RTC_GUARDED_BY(signaling_thread()) = nullptr;
@@ -283,8 +283,8 @@
const std::string& label,
bool connected_to_transport,
const InternalDataChannelInit& config,
- rtc::Thread* signaling_thread,
- rtc::Thread* network_thread) {
+ Thread* signaling_thread,
+ Thread* network_thread) {
RTC_DCHECK(config.IsValid());
return rtc::make_ref_counted<SctpDataChannel>(
config, std::move(controller), label, connected_to_transport,
@@ -309,8 +309,8 @@
WeakPtr<SctpDataChannelControllerInterface> controller,
const std::string& label,
bool connected_to_transport,
- rtc::Thread* signaling_thread,
- rtc::Thread* network_thread)
+ Thread* signaling_thread,
+ Thread* network_thread)
: signaling_thread_(signaling_thread),
network_thread_(network_thread),
id_n_(config.id == -1 ? std::nullopt : std::make_optional(config.id)),
@@ -359,7 +359,7 @@
// Check if we should set up an observer adapter that will make sure that
// callbacks are delivered on the signaling thread rather than directly
// on the network thread.
- const auto* current_thread = rtc::Thread::Current();
+ const auto* current_thread = Thread::Current();
// TODO(webrtc:11547): Eventually all DataChannelObserver implementations
// should be called on the network thread and IsOkToCallOnTheNetworkThread().
if (!observer->IsOkToCallOnTheNetworkThread()) {
@@ -399,7 +399,7 @@
void SctpDataChannel::UnregisterObserver() {
// Note: As with `RegisterObserver`, the proxy is being bypassed.
- const auto* current_thread = rtc::Thread::Current();
+ const auto* current_thread = Thread::Current();
// Callers must not be invoking the unregistration from the network thread
// (assuming a multi-threaded environment where we have a dedicated network
// thread). That would indicate non-network related work happening on the
@@ -500,7 +500,7 @@
// getting put behind other messages on the network thread and eventually
// fetch a different state value (since pending messages might cause the
// state to change in the meantime).
- const auto* current_thread = rtc::Thread::Current();
+ const auto* current_thread = Thread::Current();
if (current_thread == signaling_thread_ && observer_adapter_ &&
observer_adapter_->IsInsideCallback()) {
return observer_adapter_->cached_state();
@@ -517,7 +517,7 @@
}
RTCError SctpDataChannel::error() const {
- const auto* current_thread = rtc::Thread::Current();
+ const auto* current_thread = Thread::Current();
if (current_thread == signaling_thread_ && observer_adapter_ &&
observer_adapter_->IsInsideCallback()) {
return observer_adapter_->cached_error();
diff --git a/pc/sctp_data_channel.h b/pc/sctp_data_channel.h
index e5d45d6..de3c2b9 100644
--- a/pc/sctp_data_channel.h
+++ b/pc/sctp_data_channel.h
@@ -134,8 +134,8 @@
const std::string& label,
bool connected_to_transport,
const InternalDataChannelInit& config,
- rtc::Thread* signaling_thread,
- rtc::Thread* network_thread);
+ Thread* signaling_thread,
+ Thread* network_thread);
// Instantiates an API proxy for a SctpDataChannel instance that will be
// handed out to external callers.
@@ -231,8 +231,8 @@
WeakPtr<SctpDataChannelControllerInterface> controller,
const std::string& label,
bool connected_to_transport,
- rtc::Thread* signaling_thread,
- rtc::Thread* network_thread);
+ Thread* signaling_thread,
+ Thread* network_thread);
~SctpDataChannel() override;
private:
@@ -264,8 +264,8 @@
}
void MaybeSendOnBufferedAmountChanged() RTC_RUN_ON(network_thread_);
- rtc::Thread* const signaling_thread_;
- rtc::Thread* const network_thread_;
+ Thread* const signaling_thread_;
+ Thread* const network_thread_;
std::optional<StreamId> id_n_ RTC_GUARDED_BY(network_thread_) = std::nullopt;
const int internal_id_;
const std::string label_;
diff --git a/pc/sctp_transport.cc b/pc/sctp_transport.cc
index 78f50ff..8ec98a5 100644
--- a/pc/sctp_transport.cc
+++ b/pc/sctp_transport.cc
@@ -36,7 +36,7 @@
SctpTransport::SctpTransport(
std::unique_ptr<cricket::SctpTransportInternal> internal,
rtc::scoped_refptr<DtlsTransport> dtls_transport)
- : owner_thread_(rtc::Thread::Current()),
+ : owner_thread_(Thread::Current()),
info_(SctpTransportState::kConnecting,
dtls_transport,
/*max_message_size=*/std::nullopt,
diff --git a/pc/sctp_transport.h b/pc/sctp_transport.h
index 5b7f828..24e554a 100644
--- a/pc/sctp_transport.h
+++ b/pc/sctp_transport.h
@@ -92,7 +92,7 @@
// NOTE: `owner_thread_` is the thread that the SctpTransport object is
// constructed on. In the context of PeerConnection, it's the network thread.
- rtc::Thread* const owner_thread_;
+ Thread* const owner_thread_;
SctpTransportInformation info_ RTC_GUARDED_BY(owner_thread_);
std::unique_ptr<cricket::SctpTransportInternal> internal_sctp_transport_
RTC_GUARDED_BY(owner_thread_);
diff --git a/pc/sctp_transport_unittest.cc b/pc/sctp_transport_unittest.cc
index b7f318a..c06ec12 100644
--- a/pc/sctp_transport_unittest.cc
+++ b/pc/sctp_transport_unittest.cc
@@ -147,14 +147,14 @@
return static_cast<FakeCricketSctpTransport*>(transport_->internal());
}
- rtc::AutoThread main_thread_;
+ AutoThread main_thread_;
rtc::scoped_refptr<SctpTransport> transport_;
rtc::scoped_refptr<DtlsTransport> dtls_transport_;
TestSctpTransportObserver observer_;
};
TEST(SctpTransportSimpleTest, CreateClearDelete) {
- rtc::AutoThread main_thread;
+ AutoThread main_thread;
std::unique_ptr<cricket::DtlsTransportInternal> cricket_transport =
std::make_unique<FakeDtlsTransport>("audio",
cricket::ICE_CANDIDATE_COMPONENT_RTP);
diff --git a/pc/sdp_offer_answer.cc b/pc/sdp_offer_answer.cc
index 30d21e3..ec00cdd 100644
--- a/pc/sdp_offer_answer.cc
+++ b/pc/sdp_offer_answer.cc
@@ -877,7 +877,7 @@
}
rtc::scoped_refptr<DtlsTransport> LookupDtlsTransportByMid(
- rtc::Thread* network_thread,
+ Thread* network_thread,
JsepTransportController* controller,
const std::string& mid) {
// TODO(tommi): Can we post this (and associated operations where this
@@ -1563,11 +1563,11 @@
UpdateNegotiationNeeded();
}
-rtc::Thread* SdpOfferAnswerHandler::signaling_thread() const {
+Thread* SdpOfferAnswerHandler::signaling_thread() const {
return context_->signaling_thread();
}
-rtc::Thread* SdpOfferAnswerHandler::network_thread() const {
+Thread* SdpOfferAnswerHandler::network_thread() const {
return context_->network_thread();
}
@@ -2739,7 +2739,7 @@
rtc::scoped_refptr<MediaStreamInterface> stream(
remote_streams_->find(stream_id));
if (!stream) {
- stream = MediaStreamProxy::Create(rtc::Thread::Current(),
+ stream = MediaStreamProxy::Create(Thread::Current(),
MediaStream::Create(stream_id));
remote_streams_->AddStream(stream);
added_streams->push_back(stream);
@@ -2752,7 +2752,7 @@
kMsidSignalingMediaSection)) {
if (!missing_msid_default_stream_) {
missing_msid_default_stream_ = MediaStreamProxy::Create(
- rtc::Thread::Current(), MediaStream::Create(CreateRandomUuid()));
+ Thread::Current(), MediaStream::Create(CreateRandomUuid()));
added_streams->push_back(missing_msid_default_stream_);
}
media_streams.push_back(missing_msid_default_stream_);
@@ -4883,7 +4883,7 @@
remote_streams_->find(stream_id));
if (!stream) {
// This is a new MediaStream. Create a new remote MediaStream.
- stream = MediaStreamProxy::Create(rtc::Thread::Current(),
+ stream = MediaStreamProxy::Create(Thread::Current(),
MediaStream::Create(stream_id));
remote_streams_->AddStream(stream);
new_streams->AddStream(stream);
@@ -4905,7 +4905,7 @@
if (!default_stream) {
// Create the new default MediaStream.
default_stream = MediaStreamProxy::Create(
- rtc::Thread::Current(), MediaStream::Create(kDefaultStreamId));
+ Thread::Current(), MediaStream::Create(kDefaultStreamId));
remote_streams_->AddStream(default_stream);
new_streams->AddStream(default_stream);
}
@@ -5198,7 +5198,7 @@
const IceCandidateInterface* candidate) {
RTC_DCHECK_RUN_ON(signaling_thread());
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
RTCErrorOr<const ContentInfo*> result =
FindContentInfo(remote_description(), candidate);
diff --git a/pc/sdp_offer_answer.h b/pc/sdp_offer_answer.h
index 07ffacc..b7387da 100644
--- a/pc/sdp_offer_answer.h
+++ b/pc/sdp_offer_answer.h
@@ -221,8 +221,8 @@
ConnectionContext* context,
cricket::CodecLookupHelper* codec_lookup_helper);
- rtc::Thread* signaling_thread() const;
- rtc::Thread* network_thread() const;
+ Thread* signaling_thread() const;
+ Thread* network_thread() const;
// Non-const versions of local_description()/remote_description(), for use
// internally.
SessionDescriptionInterface* mutable_local_description()
diff --git a/pc/sdp_offer_answer_unittest.cc b/pc/sdp_offer_answer_unittest.cc
index b1915ee..efbda16 100644
--- a/pc/sdp_offer_answer_unittest.cc
+++ b/pc/sdp_offer_answer_unittest.cc
@@ -80,8 +80,8 @@
namespace {
-std::unique_ptr<rtc::Thread> CreateAndStartThread() {
- auto thread = rtc::Thread::Create();
+std::unique_ptr<Thread> CreateAndStartThread() {
+ auto thread = Thread::Create();
thread->Start();
return thread;
}
@@ -152,11 +152,11 @@
}
protected:
- std::unique_ptr<rtc::Thread> signaling_thread_;
+ std::unique_ptr<Thread> signaling_thread_;
rtc::scoped_refptr<PeerConnectionFactoryInterface> pc_factory_;
private:
- rtc::AutoThread main_thread_;
+ AutoThread main_thread_;
};
TEST_F(SdpOfferAnswerTest, OnTrackReturnsProxiedObject) {
diff --git a/pc/test/fake_audio_capture_module.cc b/pc/test/fake_audio_capture_module.cc
index 9aa3e8c..fc5e2ea 100644
--- a/pc/test/fake_audio_capture_module.cc
+++ b/pc/test/fake_audio_capture_module.cc
@@ -427,7 +427,7 @@
void FakeAudioCaptureModule::UpdateProcessing(bool start) {
if (start) {
if (!process_thread_) {
- process_thread_ = rtc::Thread::Create();
+ process_thread_ = webrtc::Thread::Create();
process_thread_->Start();
}
process_thread_->PostTask([this] { StartProcessP(); });
diff --git a/pc/test/fake_audio_capture_module.h b/pc/test/fake_audio_capture_module.h
index 968f459..bead09b 100644
--- a/pc/test/fake_audio_capture_module.h
+++ b/pc/test/fake_audio_capture_module.h
@@ -31,12 +31,9 @@
#include "api/scoped_refptr.h"
#include "api/sequence_checker.h"
#include "rtc_base/synchronization/mutex.h"
+#include "rtc_base/thread.h"
#include "rtc_base/thread_annotations.h"
-namespace rtc {
-class Thread;
-} // namespace rtc
-
class FakeAudioCaptureModule : public webrtc::AudioDeviceModule {
public:
typedef uint16_t Sample;
@@ -215,7 +212,7 @@
bool started_ RTC_GUARDED_BY(mutex_);
int64_t next_frame_time_ RTC_GUARDED_BY(process_thread_checker_);
- std::unique_ptr<rtc::Thread> process_thread_;
+ std::unique_ptr<webrtc::Thread> process_thread_;
// Buffer for storing samples received from the webrtc::AudioTransport.
char rec_buffer_[kNumberSamples * kNumberBytesPerSample];
diff --git a/pc/test/fake_audio_capture_module_unittest.cc b/pc/test/fake_audio_capture_module_unittest.cc
index e0b0e50..828dff7 100644
--- a/pc/test/fake_audio_capture_module_unittest.cc
+++ b/pc/test/fake_audio_capture_module_unittest.cc
@@ -121,7 +121,7 @@
return min_buffer_size;
}
- rtc::AutoThread main_thread_;
+ webrtc::AutoThread main_thread_;
mutable webrtc::Mutex mutex_;
diff --git a/pc/test/fake_data_channel_controller.h b/pc/test/fake_data_channel_controller.h
index 1299b31..ac70aea 100644
--- a/pc/test/fake_data_channel_controller.h
+++ b/pc/test/fake_data_channel_controller.h
@@ -35,8 +35,8 @@
class FakeDataChannelController
: public webrtc::SctpDataChannelControllerInterface {
public:
- explicit FakeDataChannelController(rtc::Thread* network_thread)
- : signaling_thread_(rtc::Thread::Current()),
+ explicit FakeDataChannelController(webrtc::Thread* network_thread)
+ : signaling_thread_(webrtc::Thread::Current()),
network_thread_(network_thread),
send_blocked_(false),
transport_available_(false),
@@ -238,8 +238,8 @@
}
private:
- rtc::Thread* const signaling_thread_;
- rtc::Thread* const network_thread_;
+ webrtc::Thread* const signaling_thread_;
+ webrtc::Thread* const network_thread_;
webrtc::StreamId last_sid_ RTC_GUARDED_BY(network_thread_);
webrtc::SendDataParams last_send_data_params_ RTC_GUARDED_BY(network_thread_);
bool send_blocked_ RTC_GUARDED_BY(network_thread_);
diff --git a/pc/test/fake_peer_connection_base.h b/pc/test/fake_peer_connection_base.h
index d79cdfd..aad1310 100644
--- a/pc/test/fake_peer_connection_base.h
+++ b/pc/test/fake_peer_connection_base.h
@@ -288,9 +288,9 @@
// PeerConnectionInternal implementation.
- rtc::Thread* network_thread() const override { return nullptr; }
- rtc::Thread* worker_thread() const override { return nullptr; }
- rtc::Thread* signaling_thread() const override { return nullptr; }
+ Thread* network_thread() const override { return nullptr; }
+ Thread* worker_thread() const override { return nullptr; }
+ Thread* signaling_thread() const override { return nullptr; }
std::string session_id() const override { return ""; }
diff --git a/pc/test/fake_peer_connection_for_stats.h b/pc/test/fake_peer_connection_for_stats.h
index 0970100..1a07bcb 100644
--- a/pc/test/fake_peer_connection_for_stats.h
+++ b/pc/test/fake_peer_connection_for_stats.h
@@ -176,9 +176,9 @@
class VoiceChannelForTesting : public cricket::VoiceChannel {
public:
VoiceChannelForTesting(
- rtc::Thread* worker_thread,
- rtc::Thread* network_thread,
- rtc::Thread* signaling_thread,
+ Thread* worker_thread,
+ Thread* network_thread,
+ Thread* signaling_thread,
std::unique_ptr<cricket::VoiceMediaSendChannelInterface> send_channel,
std::unique_ptr<cricket::VoiceMediaReceiveChannelInterface>
receive_channel,
@@ -209,9 +209,9 @@
class VideoChannelForTesting : public cricket::VideoChannel {
public:
VideoChannelForTesting(
- rtc::Thread* worker_thread,
- rtc::Thread* network_thread,
- rtc::Thread* signaling_thread,
+ Thread* worker_thread,
+ Thread* network_thread,
+ Thread* signaling_thread,
std::unique_ptr<cricket::VideoMediaSendChannelInterface> send_channel,
std::unique_ptr<cricket::VideoMediaReceiveChannelInterface>
receive_channel,
@@ -248,9 +248,9 @@
// TODO(steveanton): Add support for specifying separate threads to test
// multi-threading correctness.
FakePeerConnectionForStats()
- : network_thread_(rtc::Thread::Current()),
- worker_thread_(rtc::Thread::Current()),
- signaling_thread_(rtc::Thread::Current()),
+ : network_thread_(Thread::Current()),
+ worker_thread_(Thread::Current()),
+ signaling_thread_(Thread::Current()),
// TODO(hta): remove separate thread variables and use context.
dependencies_(MakeDependencies()),
context_(
@@ -268,9 +268,9 @@
static PeerConnectionFactoryDependencies MakeDependencies() {
PeerConnectionFactoryDependencies dependencies;
- dependencies.network_thread = rtc::Thread::Current();
- dependencies.worker_thread = rtc::Thread::Current();
- dependencies.signaling_thread = rtc::Thread::Current();
+ dependencies.network_thread = Thread::Current();
+ dependencies.worker_thread = Thread::Current();
+ dependencies.signaling_thread = Thread::Current();
EnableFakeMedia(dependencies);
return dependencies;
}
@@ -395,7 +395,7 @@
// TODO(bugs.webrtc.org/11547): Supply a separate network thread.
AddSctpDataChannel(SctpDataChannel::Create(
data_channel_controller_.weak_ptr(), label, false, init,
- rtc::Thread::Current(), rtc::Thread::Current()));
+ Thread::Current(), Thread::Current()));
}
void AddSctpDataChannel(rtc::scoped_refptr<SctpDataChannel> data_channel) {
@@ -469,11 +469,11 @@
// PeerConnectionInternal overrides.
- rtc::Thread* network_thread() const override { return network_thread_; }
+ Thread* network_thread() const override { return network_thread_; }
- rtc::Thread* worker_thread() const override { return worker_thread_; }
+ Thread* worker_thread() const override { return worker_thread_; }
- rtc::Thread* signaling_thread() const override { return signaling_thread_; }
+ Thread* signaling_thread() const override { return signaling_thread_; }
std::vector<
rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>>
@@ -570,9 +570,9 @@
return transceiver;
}
- rtc::Thread* const network_thread_;
- rtc::Thread* const worker_thread_;
- rtc::Thread* const signaling_thread_;
+ Thread* const network_thread_;
+ Thread* const worker_thread_;
+ Thread* const signaling_thread_;
PeerConnectionFactoryDependencies dependencies_;
rtc::scoped_refptr<ConnectionContext> context_;
diff --git a/pc/test/integration_test_helpers.cc b/pc/test/integration_test_helpers.cc
index 19882a4..23a712a 100644
--- a/pc/test/integration_test_helpers.cc
+++ b/pc/test/integration_test_helpers.cc
@@ -218,8 +218,8 @@
const PeerConnectionInterface::RTCConfiguration* config,
PeerConnectionDependencies dependencies,
SocketServer* socket_server,
- rtc::Thread* network_thread,
- rtc::Thread* worker_thread,
+ Thread* network_thread,
+ Thread* worker_thread,
std::unique_ptr<FieldTrialsView> field_trials,
std::unique_ptr<FakeRtcEventLogFactory> event_log_factory,
bool reset_encoder_factory,
@@ -239,7 +239,7 @@
if (!fake_audio_capture_module_) {
return false;
}
- rtc::Thread* const signaling_thread = rtc::Thread::Current();
+ Thread* const signaling_thread = Thread::Current();
PeerConnectionFactoryDependencies pc_factory_dependencies;
pc_factory_dependencies.network_thread = network_thread;
diff --git a/pc/test/integration_test_helpers.h b/pc/test/integration_test_helpers.h
index c90fa83..619b54d 100644
--- a/pc/test/integration_test_helpers.h
+++ b/pc/test/integration_test_helpers.h
@@ -795,8 +795,8 @@
const PeerConnectionInterface::RTCConfiguration* config,
PeerConnectionDependencies dependencies,
SocketServer* socket_server,
- rtc::Thread* network_thread,
- rtc::Thread* worker_thread,
+ Thread* network_thread,
+ Thread* worker_thread,
std::unique_ptr<FieldTrialsView> field_trials,
std::unique_ptr<FakeRtcEventLogFactory> event_log_factory,
bool reset_encoder_factory,
@@ -946,7 +946,7 @@
if (signaling_delay_ms_ == 0) {
RelaySdpMessageIfReceiverExists(type, msg);
} else {
- rtc::Thread::Current()->PostDelayedTask(
+ Thread::Current()->PostDelayedTask(
SafeTask(task_safety_.flag(),
[this, type, msg] {
RelaySdpMessageIfReceiverExists(type, msg);
@@ -969,7 +969,7 @@
if (signaling_delay_ms_ == 0) {
RelayIceMessageIfReceiverExists(sdp_mid, sdp_mline_index, msg);
} else {
- rtc::Thread::Current()->PostDelayedTask(
+ Thread::Current()->PostDelayedTask(
SafeTask(task_safety_.flag(),
[this, sdp_mid, sdp_mline_index, msg] {
RelayIceMessageIfReceiverExists(sdp_mid, sdp_mline_index,
@@ -1143,7 +1143,7 @@
// Network manager is owned by the `peer_connection_factory_`.
FakeNetworkManager* fake_network_manager_ = nullptr;
- rtc::Thread* network_thread_;
+ Thread* network_thread_;
// Reference to the mDNS responder owned by `fake_network_manager_` after set.
FakeMdnsResponder* mdns_responder_ = nullptr;
@@ -1376,8 +1376,8 @@
: sdp_semantics_(sdp_semantics),
ss_(new VirtualSocketServer()),
fss_(new FirewallSocketServer(ss_.get())),
- network_thread_(new rtc::Thread(fss_.get())),
- worker_thread_(rtc::Thread::Create()) {
+ network_thread_(new Thread(fss_.get())),
+ worker_thread_(Thread::Create()) {
network_thread_->SetName("PCNetworkThread", this);
worker_thread_->SetName("PCWorkerThread", this);
RTC_CHECK(network_thread_->Start());
@@ -1638,7 +1638,7 @@
SocketAddress external_address,
ProtocolType type = ProtocolType::PROTO_UDP,
const std::string& common_name = "test turn server") {
- rtc::Thread* thread = network_thread();
+ Thread* thread = network_thread();
SocketFactory* socket_factory = fss_.get();
std::unique_ptr<TestTurnServer> turn_server;
SendTask(network_thread(), [&] {
@@ -1706,7 +1706,7 @@
}
}
- rtc::Thread* network_thread() { return network_thread_.get(); }
+ Thread* network_thread() { return network_thread_.get(); }
VirtualSocketServer* virtual_socket_server() { return ss_.get(); }
@@ -1907,15 +1907,15 @@
SdpSemantics sdp_semantics_;
private:
- rtc::AutoThread main_thread_; // Used as the signal thread by most tests.
+ AutoThread main_thread_; // Used as the signal thread by most tests.
// `ss_` is used by `network_thread_` so it must be destroyed later.
std::unique_ptr<VirtualSocketServer> ss_;
std::unique_ptr<FirewallSocketServer> fss_;
// `network_thread_` and `worker_thread_` are used by both
// `caller_` and `callee_` so they must be destroyed
// later.
- std::unique_ptr<rtc::Thread> network_thread_;
- std::unique_ptr<rtc::Thread> worker_thread_;
+ std::unique_ptr<Thread> network_thread_;
+ std::unique_ptr<Thread> worker_thread_;
// The turn servers and turn customizers should be accessed & deleted on the
// network thread to avoid a race with the socket read/write that occurs
// on the network thread.
diff --git a/pc/test/mock_data_channel.h b/pc/test/mock_data_channel.h
index 94a42de..f2822cb 100644
--- a/pc/test/mock_data_channel.h
+++ b/pc/test/mock_data_channel.h
@@ -47,8 +47,8 @@
uint32_t messages_received,
uint64_t bytes_received,
const InternalDataChannelInit& config = InternalDataChannelInit(),
- rtc::Thread* signaling_thread = rtc::Thread::Current(),
- rtc::Thread* network_thread = rtc::Thread::Current())
+ Thread* signaling_thread = Thread::Current(),
+ Thread* network_thread = Thread::Current())
: SctpDataChannel(config,
std::move(controller),
label,
diff --git a/pc/test/mock_peer_connection_internal.h b/pc/test/mock_peer_connection_internal.h
index 3fcea19..b554c54 100644
--- a/pc/test/mock_peer_connection_internal.h
+++ b/pc/test/mock_peer_connection_internal.h
@@ -253,7 +253,7 @@
(override));
MOCK_METHOD(void, StopRtcEventLog, (), (override));
MOCK_METHOD(void, Close, (), (override));
- MOCK_METHOD(rtc::Thread*, signaling_thread, (), (const, override));
+ MOCK_METHOD(Thread*, signaling_thread, (), (const, override));
// PeerConnectionSdpMethods
MOCK_METHOD(std::string, session_id, (), (const, override));
@@ -324,8 +324,8 @@
MOCK_METHOD(const FieldTrialsView&, trials, (), (const, override));
// PeerConnectionInternal
- MOCK_METHOD(rtc::Thread*, network_thread, (), (const, override));
- MOCK_METHOD(rtc::Thread*, worker_thread, (), (const, override));
+ MOCK_METHOD(Thread*, network_thread, (), (const, override));
+ MOCK_METHOD(Thread*, worker_thread, (), (const, override));
MOCK_METHOD(bool, initial_offerer, (), (const, override));
MOCK_METHOD(
std::vector<
diff --git a/pc/test/peer_connection_test_wrapper.cc b/pc/test/peer_connection_test_wrapper.cc
index 21e5683..8434b2d 100644
--- a/pc/test/peer_connection_test_wrapper.cc
+++ b/pc/test/peer_connection_test_wrapper.cc
@@ -145,8 +145,8 @@
PeerConnectionTestWrapper::PeerConnectionTestWrapper(
const std::string& name,
webrtc::SocketServer* socket_server,
- rtc::Thread* network_thread,
- rtc::Thread* worker_thread)
+ webrtc::Thread* network_thread,
+ webrtc::Thread* worker_thread)
: name_(name),
socket_server_(socket_server),
network_thread_(network_thread),
@@ -190,7 +190,7 @@
}
peer_connection_factory_ = webrtc::CreatePeerConnectionFactory(
- network_thread_, worker_thread_, rtc::Thread::Current(),
+ network_thread_, worker_thread_, webrtc::Thread::Current(),
rtc::scoped_refptr<webrtc::AudioDeviceModule>(fake_audio_capture_module_),
audio_encoder_factory, audio_decoder_factory,
std::move(video_encoder_factory), std::move(video_decoder_factory),
diff --git a/pc/test/peer_connection_test_wrapper.h b/pc/test/peer_connection_test_wrapper.h
index 973fd42..ecd6bdb 100644
--- a/pc/test/peer_connection_test_wrapper.h
+++ b/pc/test/peer_connection_test_wrapper.h
@@ -51,8 +51,8 @@
PeerConnectionTestWrapper(const std::string& name,
webrtc::SocketServer* socket_server,
- rtc::Thread* network_thread,
- rtc::Thread* worker_thread);
+ webrtc::Thread* network_thread,
+ webrtc::Thread* worker_thread);
virtual ~PeerConnectionTestWrapper();
bool CreatePc(
@@ -145,8 +145,8 @@
std::string name_;
webrtc::SocketServer* const socket_server_;
- rtc::Thread* const network_thread_;
- rtc::Thread* const worker_thread_;
+ webrtc::Thread* const network_thread_;
+ webrtc::Thread* const worker_thread_;
webrtc::SequenceChecker pc_thread_checker_;
rtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection_;
rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface>
diff --git a/pc/track_media_info_map.cc b/pc/track_media_info_map.cc
index 7d440b8..3ad4bbc 100644
--- a/pc/track_media_info_map.cc
+++ b/pc/track_media_info_map.cc
@@ -111,7 +111,7 @@
std::optional<cricket::VideoMediaInfo> video_media_info,
rtc::ArrayView<rtc::scoped_refptr<RtpSenderInternal>> rtp_senders,
rtc::ArrayView<rtc::scoped_refptr<RtpReceiverInternal>> rtp_receivers) {
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
RTC_DCHECK(!is_initialized_);
is_initialized_ = true;
voice_media_info_ = std::move(voice_media_info);
diff --git a/pc/track_media_info_map_unittest.cc b/pc/track_media_info_map_unittest.cc
index 43a97b8..f62043a 100644
--- a/pc/track_media_info_map_unittest.cc
+++ b/pc/track_media_info_map_unittest.cc
@@ -90,7 +90,7 @@
rtc::scoped_refptr<VideoTrackInterface> CreateVideoTrack(
const std::string& id) {
return VideoTrack::Create(id, FakeVideoTrackSource::Create(false),
- rtc::Thread::Current());
+ Thread::Current());
}
rtc::scoped_refptr<VideoTrackInterface> CreateMockVideoTrack(
@@ -180,7 +180,7 @@
}
private:
- rtc::AutoThread main_thread_;
+ AutoThread main_thread_;
cricket::VoiceMediaInfo voice_media_info_;
cricket::VideoMediaInfo video_media_info_;
diff --git a/pc/video_rtp_receiver.cc b/pc/video_rtp_receiver.cc
index c3aeec9..01c86b4 100644
--- a/pc/video_rtp_receiver.cc
+++ b/pc/video_rtp_receiver.cc
@@ -23,7 +23,7 @@
namespace webrtc {
-VideoRtpReceiver::VideoRtpReceiver(rtc::Thread* worker_thread,
+VideoRtpReceiver::VideoRtpReceiver(Thread* worker_thread,
std::string receiver_id,
std::vector<std::string> stream_ids)
: VideoRtpReceiver(worker_thread,
@@ -31,14 +31,14 @@
CreateStreamsFromIds(std::move(stream_ids))) {}
VideoRtpReceiver::VideoRtpReceiver(
- rtc::Thread* worker_thread,
+ Thread* worker_thread,
const std::string& receiver_id,
const std::vector<rtc::scoped_refptr<MediaStreamInterface>>& streams)
: worker_thread_(worker_thread),
id_(receiver_id),
source_(rtc::make_ref_counted<VideoRtpTrackSource>(&source_callback_)),
track_(VideoTrackProxyWithInternal<VideoTrack>::Create(
- rtc::Thread::Current(),
+ Thread::Current(),
worker_thread,
VideoTrack::Create(receiver_id, source_, worker_thread))),
attachment_id_(GenerateUniqueId()) {
diff --git a/pc/video_rtp_receiver.h b/pc/video_rtp_receiver.h
index bc42ad3..caef459 100644
--- a/pc/video_rtp_receiver.h
+++ b/pc/video_rtp_receiver.h
@@ -46,13 +46,13 @@
public:
// An SSRC of 0 will create a receiver that will match the first SSRC it
// sees. Must be called on signaling thread.
- VideoRtpReceiver(rtc::Thread* worker_thread,
+ VideoRtpReceiver(Thread* worker_thread,
std::string receiver_id,
std::vector<std::string> streams_ids);
// TODO(hbos): Remove this when streams() is removed.
// https://crbug.com/webrtc/9480
VideoRtpReceiver(
- rtc::Thread* worker_thread,
+ Thread* worker_thread,
const std::string& receiver_id,
const std::vector<rtc::scoped_refptr<MediaStreamInterface>>& streams);
@@ -146,7 +146,7 @@
} source_callback_{this};
RTC_NO_UNIQUE_ADDRESS SequenceChecker signaling_thread_checker_;
- rtc::Thread* const worker_thread_;
+ Thread* const worker_thread_;
const std::string id_;
cricket::VideoMediaReceiveChannelInterface* media_channel_
diff --git a/pc/video_rtp_receiver_unittest.cc b/pc/video_rtp_receiver_unittest.cc
index e972917..f8f4191 100644
--- a/pc/video_rtp_receiver_unittest.cc
+++ b/pc/video_rtp_receiver_unittest.cc
@@ -37,9 +37,8 @@
protected:
class MockVideoMediaSendChannel : public cricket::FakeVideoMediaSendChannel {
public:
- MockVideoMediaSendChannel(
- const cricket::VideoOptions& options,
- TaskQueueBase* network_thread = rtc::Thread::Current())
+ MockVideoMediaSendChannel(const cricket::VideoOptions& options,
+ TaskQueueBase* network_thread = Thread::Current())
: FakeVideoMediaSendChannel(options, network_thread) {}
MOCK_METHOD(void,
GenerateSendKeyFrame,
@@ -52,7 +51,7 @@
public:
MockVideoMediaReceiveChannel(
const cricket::VideoOptions& options,
- TaskQueueBase* network_thread = rtc::Thread::Current())
+ TaskQueueBase* network_thread = Thread::Current())
: FakeVideoMediaReceiveChannel(options, network_thread) {}
MOCK_METHOD(void,
SetRecordableEncodedFrameCallback,
@@ -71,7 +70,7 @@
};
VideoRtpReceiverTest()
- : worker_thread_(rtc::Thread::Create()),
+ : worker_thread_(Thread::Create()),
channel_(cricket::VideoOptions()),
receiver_(rtc::make_ref_counted<VideoRtpReceiver>(
worker_thread_.get(),
@@ -98,8 +97,8 @@
return receiver_->streams()[0]->FindVideoTrack("receiver")->GetSource();
}
- rtc::AutoThread main_thread_;
- std::unique_ptr<rtc::Thread> worker_thread_;
+ AutoThread main_thread_;
+ std::unique_ptr<Thread> worker_thread_;
NiceMock<MockVideoMediaReceiveChannel> channel_;
rtc::scoped_refptr<VideoRtpReceiver> receiver_;
};
diff --git a/pc/video_track.cc b/pc/video_track.cc
index 0bf8687..d7e0a6b 100644
--- a/pc/video_track.cc
+++ b/pc/video_track.cc
@@ -23,7 +23,7 @@
absl::string_view label,
rtc::scoped_refptr<
VideoTrackSourceProxyWithInternal<VideoTrackSourceInterface>> source,
- rtc::Thread* worker_thread)
+ Thread* worker_thread)
: MediaStreamTrack<VideoTrackInterface>(label),
worker_thread_(worker_thread),
video_source_(std::move(source)),
@@ -123,7 +123,7 @@
void VideoTrack::OnChanged() {
RTC_DCHECK_RUN_ON(&signaling_thread_);
- rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
+ Thread::ScopedDisallowBlockingCalls no_blocking_calls;
MediaSourceInterface::SourceState state = video_source_->state();
set_state(state == MediaSourceInterface::kEnded ? kEnded : kLive);
}
@@ -131,11 +131,11 @@
rtc::scoped_refptr<VideoTrack> VideoTrack::Create(
absl::string_view id,
rtc::scoped_refptr<VideoTrackSourceInterface> source,
- rtc::Thread* worker_thread) {
+ Thread* worker_thread) {
rtc::scoped_refptr<
VideoTrackSourceProxyWithInternal<VideoTrackSourceInterface>>
source_proxy = VideoTrackSourceProxy::Create(
- rtc::Thread::Current(), worker_thread, std::move(source));
+ Thread::Current(), worker_thread, std::move(source));
return rtc::make_ref_counted<VideoTrack>(id, std::move(source_proxy),
worker_thread);
diff --git a/pc/video_track.h b/pc/video_track.h
index 6733ad0..d806a5e 100644
--- a/pc/video_track.h
+++ b/pc/video_track.h
@@ -40,7 +40,7 @@
static rtc::scoped_refptr<VideoTrack> Create(
absl::string_view label,
rtc::scoped_refptr<VideoTrackSourceInterface> source,
- rtc::Thread* worker_thread);
+ Thread* worker_thread);
void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
const rtc::VideoSinkWants& wants) override;
@@ -63,7 +63,7 @@
absl::string_view id,
rtc::scoped_refptr<
VideoTrackSourceProxyWithInternal<VideoTrackSourceInterface>> source,
- rtc::Thread* worker_thread);
+ Thread* worker_thread);
~VideoTrack();
private:
@@ -71,7 +71,7 @@
void OnChanged() override;
RTC_NO_UNIQUE_ADDRESS SequenceChecker signaling_thread_;
- rtc::Thread* const worker_thread_;
+ Thread* const worker_thread_;
const rtc::scoped_refptr<
VideoTrackSourceProxyWithInternal<VideoTrackSourceInterface>>
video_source_;
diff --git a/pc/video_track_source_proxy.cc b/pc/video_track_source_proxy.cc
index c3e95e2..95edcfe 100644
--- a/pc/video_track_source_proxy.cc
+++ b/pc/video_track_source_proxy.cc
@@ -18,8 +18,8 @@
namespace webrtc {
rtc::scoped_refptr<VideoTrackSourceInterface> CreateVideoTrackSourceProxy(
- rtc::Thread* signaling_thread,
- rtc::Thread* worker_thread,
+ Thread* signaling_thread,
+ Thread* worker_thread,
VideoTrackSourceInterface* source) {
return VideoTrackSourceProxy::Create(
signaling_thread, worker_thread,
diff --git a/pc/video_track_unittest.cc b/pc/video_track_unittest.cc
index c895801..a58d1d8 100644
--- a/pc/video_track_unittest.cc
+++ b/pc/video_track_unittest.cc
@@ -34,11 +34,11 @@
video_track_source_ = rtc::make_ref_counted<FakeVideoTrackSource>(
/*is_screencast=*/false);
video_track_ = VideoTrack::Create(kVideoTrackId, video_track_source_,
- rtc::Thread::Current());
+ webrtc::Thread::Current());
}
protected:
- rtc::AutoThread main_thread_;
+ webrtc::AutoThread main_thread_;
rtc::scoped_refptr<FakeVideoTrackSource> video_track_source_;
rtc::scoped_refptr<VideoTrack> video_track_;
webrtc::FakeFrameSource frame_source_;
diff --git a/rtc_base/async_dns_resolver.cc b/rtc_base/async_dns_resolver.cc
index f269e40..2930d0e 100644
--- a/rtc_base/async_dns_resolver.cc
+++ b/rtc_base/async_dns_resolver.cc
@@ -169,8 +169,7 @@
PostTaskToGlobalQueue(
std::make_unique<absl::AnyInvocable<void() &&>>(thread_function));
#else
- rtc::PlatformThread::SpawnDetached(std::move(thread_function),
- "AsyncResolver");
+ PlatformThread::SpawnDetached(std::move(thread_function), "AsyncResolver");
#endif
}
diff --git a/rtc_base/async_dns_resolver_unittest.cc b/rtc_base/async_dns_resolver_unittest.cc
index 80b567d..e9f1d2b 100644
--- a/rtc_base/async_dns_resolver_unittest.cc
+++ b/rtc_base/async_dns_resolver_unittest.cc
@@ -64,7 +64,7 @@
bool done = false;
resolver->Start(address, [&done] { done = true; });
resolver.reset(); // Deletes resolver.
- rtc::Thread::Current()->SleepMs(1); // Allows callback to execute
+ Thread::Current()->SleepMs(1); // Allows callback to execute
EXPECT_FALSE(done); // Expect no result.
}
diff --git a/rtc_base/cpu_time_unittest.cc b/rtc_base/cpu_time_unittest.cc
index b659fb5..005b3fc 100644
--- a/rtc_base/cpu_time_unittest.cc
+++ b/rtc_base/cpu_time_unittest.cc
@@ -61,9 +61,9 @@
int64_t thread_start_time_nanos = GetThreadCpuTimeNanos();
int64_t counter1;
int64_t counter2;
- auto thread1 = PlatformThread::SpawnJoinable(
+ auto thread1 = webrtc::PlatformThread::SpawnJoinable(
[&counter1] { WorkingFunction(&counter1); }, "Thread1");
- auto thread2 = PlatformThread::SpawnJoinable(
+ auto thread2 = webrtc::PlatformThread::SpawnJoinable(
[&counter2] { WorkingFunction(&counter2); }, "Thread2");
thread1.Finalize();
thread2.Finalize();
diff --git a/rtc_base/deprecated/recursive_critical_section_unittest.cc b/rtc_base/deprecated/recursive_critical_section_unittest.cc
index 1e7d957..590d02c 100644
--- a/rtc_base/deprecated/recursive_critical_section_unittest.cc
+++ b/rtc_base/deprecated/recursive_critical_section_unittest.cc
@@ -44,7 +44,7 @@
// Each value should only be taken by one thread, so if this value
// has already been added, something went wrong.
EXPECT_TRUE(result.second)
- << " Thread=" << Thread::Current() << " value=" << values[i];
+ << " Thread=" << webrtc::Thread::Current() << " value=" << values[i];
}
}
@@ -61,10 +61,10 @@
void Verify(const std::vector<int>& values) {
for (auto v : values) {
if (v == 0) {
- EXPECT_EQ(0, zero_count_) << "Thread=" << Thread::Current();
+ EXPECT_EQ(0, zero_count_) << "Thread=" << webrtc::Thread::Current();
++zero_count_;
} else {
- EXPECT_EQ(1, v) << " Thread=" << Thread::Current();
+ EXPECT_EQ(1, v) << " Thread=" << webrtc::Thread::Current();
}
}
}
@@ -155,7 +155,7 @@
void StartThreads(std::vector<std::unique_ptr<Thread>>* threads,
Runner* handler) {
for (int i = 0; i < kNumThreads; ++i) {
- std::unique_ptr<Thread> thread(Thread::Create());
+ std::unique_ptr<webrtc::Thread> thread(webrtc::Thread::Create());
thread->Start();
thread->PostTask([handler] { handler->Loop(); });
threads->push_back(std::move(thread));
@@ -167,7 +167,7 @@
TEST(RecursiveCriticalSectionTest, Basic) {
// Create and start lots of threads.
LockRunner<CriticalSectionLock> runner;
- std::vector<std::unique_ptr<Thread>> threads;
+ std::vector<std::unique_ptr<webrtc::Thread>> threads;
StartThreads(&threads, &runner);
runner.SetExpectedThreadCount(kNumThreads);
@@ -216,7 +216,7 @@
data_ = data;
repeats_ = repeats;
my_id_ = id;
- thread_ = PlatformThread::SpawnJoinable(
+ thread_ = webrtc::PlatformThread::SpawnJoinable(
[this] {
for (int i = 0; i < repeats_; ++i)
data_->AddToCounter(my_id_);
@@ -233,7 +233,7 @@
}
private:
- PlatformThread thread_;
+ webrtc::PlatformThread thread_;
PerfTestData* data_ = nullptr;
int repeats_ = 0;
int my_id_ = 0;
diff --git a/rtc_base/event_tracer.cc b/rtc_base/event_tracer.cc
index 3bb52a1..667a482 100644
--- a/rtc_base/event_tracer.cc
+++ b/rtc_base/event_tracer.cc
@@ -233,8 +233,8 @@
RTC_CHECK(g_event_logging_active.compare_exchange_strong(zero, 1));
// Finally start, everything should be set up now.
- logging_thread_ = rtc::PlatformThread::SpawnJoinable([this] { Log(); },
- "EventTracingThread");
+ logging_thread_ =
+ PlatformThread::SpawnJoinable([this] { Log(); }, "EventTracingThread");
TRACE_EVENT_INSTANT0("webrtc", "EventLogger::Start",
TRACE_EVENT_SCOPE_GLOBAL);
}
@@ -347,7 +347,7 @@
Mutex mutex_;
std::vector<TraceEvent> trace_events_ RTC_GUARDED_BY(mutex_);
- rtc::PlatformThread logging_thread_;
+ PlatformThread logging_thread_;
Event shutdown_event_;
SequenceChecker thread_checker_;
FILE* output_file_ = nullptr;
diff --git a/rtc_base/event_unittest.cc b/rtc_base/event_unittest.cc
index 57dfa17..695d27d 100644
--- a/rtc_base/event_unittest.cc
+++ b/rtc_base/event_unittest.cc
@@ -48,7 +48,7 @@
void Start(Event* writer, Event* reader) {
writer_ = writer;
reader_ = reader;
- thread_ = rtc::PlatformThread::SpawnJoinable(
+ thread_ = PlatformThread::SpawnJoinable(
[this] {
while (!stop_event_.Wait(TimeDelta::Zero())) {
writer_->Set();
@@ -64,7 +64,7 @@
Event stop_event_;
Event* writer_;
Event* reader_;
- rtc::PlatformThread thread_;
+ PlatformThread thread_;
};
TEST(EventTest, UnsignaledWaitDoesNotReturnBeforeTimeout) {
diff --git a/rtc_base/fake_clock.cc b/rtc_base/fake_clock.cc
index 49e942f..0ab8b52 100644
--- a/rtc_base/fake_clock.cc
+++ b/rtc_base/fake_clock.cc
@@ -35,12 +35,12 @@
clock_.SetTime(time);
// If message queues are waiting in a socket select() with a timeout provided
// by the OS, they should wake up and dispatch all messages that are ready.
- rtc::ThreadManager::ProcessAllMessageQueuesForTesting();
+ ThreadManager::ProcessAllMessageQueuesForTesting();
}
void ThreadProcessingFakeClock::AdvanceTime(TimeDelta delta) {
clock_.AdvanceTime(delta);
- rtc::ThreadManager::ProcessAllMessageQueuesForTesting();
+ ThreadManager::ProcessAllMessageQueuesForTesting();
}
ScopedBaseFakeClock::ScopedBaseFakeClock() {
diff --git a/rtc_base/fake_mdns_responder.h b/rtc_base/fake_mdns_responder.h
index 75759ce..ee9517b 100644
--- a/rtc_base/fake_mdns_responder.h
+++ b/rtc_base/fake_mdns_responder.h
@@ -27,7 +27,7 @@
// depends on, e.g., using WeakPtrFactory or PendingTaskSafetyFlag.
class FakeMdnsResponder : public MdnsResponderInterface {
public:
- explicit FakeMdnsResponder(rtc::Thread* thread) : thread_(thread) {}
+ explicit FakeMdnsResponder(Thread* thread) : thread_(thread) {}
~FakeMdnsResponder() = default;
void CreateNameForAddress(const IPAddress& addr,
@@ -63,7 +63,7 @@
private:
uint32_t next_available_id_ = 0;
std::map<IPAddress, std::string> addr_name_map_;
- rtc::Thread* const thread_;
+ Thread* const thread_;
};
} // namespace webrtc
diff --git a/rtc_base/fake_network.h b/rtc_base/fake_network.h
index bb9cef7..8363f78 100644
--- a/rtc_base/fake_network.h
+++ b/rtc_base/fake_network.h
@@ -74,9 +74,9 @@
++start_count_;
if (start_count_ == 1) {
sent_first_update_ = false;
- rtc::Thread::Current()->PostTask([this] { DoUpdateNetworks(); });
+ Thread::Current()->PostTask([this] { DoUpdateNetworks(); });
} else if (sent_first_update_) {
- rtc::Thread::Current()->PostTask([this] { SignalNetworksChanged(); });
+ Thread::Current()->PostTask([this] { SignalNetworksChanged(); });
}
}
diff --git a/rtc_base/firewall_socket_server.cc b/rtc_base/firewall_socket_server.cc
index 5d147f7..1301081 100644
--- a/rtc_base/firewall_socket_server.cc
+++ b/rtc_base/firewall_socket_server.cc
@@ -206,7 +206,7 @@
return WrapSocket(server_->CreateSocket(family, type), type);
}
-void FirewallSocketServer::SetMessageQueue(rtc::Thread* queue) {
+void FirewallSocketServer::SetMessageQueue(Thread* queue) {
server_->SetMessageQueue(queue);
}
diff --git a/rtc_base/firewall_socket_server.h b/rtc_base/firewall_socket_server.h
index b55ecdf..1f8c5e6 100644
--- a/rtc_base/firewall_socket_server.h
+++ b/rtc_base/firewall_socket_server.h
@@ -78,7 +78,7 @@
Socket* CreateSocket(int family, int type) override;
- void SetMessageQueue(rtc::Thread* queue) override;
+ void SetMessageQueue(Thread* queue) override;
bool Wait(TimeDelta max_wait_duration, bool process_io) override;
void WakeUp() override;
diff --git a/rtc_base/logging_unittest.cc b/rtc_base/logging_unittest.cc
index 6d41c6e..de25040 100644
--- a/rtc_base/logging_unittest.cc
+++ b/rtc_base/logging_unittest.cc
@@ -221,12 +221,12 @@
class LogThread {
public:
void Start() {
- thread_ = rtc::PlatformThread::SpawnJoinable(
+ thread_ = PlatformThread::SpawnJoinable(
[] { RTC_LOG(LS_VERBOSE) << "RTC_LOG"; }, "LogThread");
}
private:
- rtc::PlatformThread thread_;
+ PlatformThread thread_;
};
// Ensure we don't crash when adding/removing streams while threads are going.
diff --git a/rtc_base/memory/fifo_buffer.cc b/rtc_base/memory/fifo_buffer.cc
index 3fedf80b..c0b607a 100644
--- a/rtc_base/memory/fifo_buffer.cc
+++ b/rtc_base/memory/fifo_buffer.cc
@@ -22,11 +22,11 @@
buffer_length_(size),
data_length_(0),
read_position_(0),
- owner_(Thread::Current()) {
+ owner_(webrtc::Thread::Current()) {
// all events are done on the owner_ thread
}
-FifoBuffer::FifoBuffer(size_t size, Thread* owner)
+FifoBuffer::FifoBuffer(size_t size, webrtc::Thread* owner)
: state_(webrtc::SS_OPEN),
buffer_(new char[size]),
buffer_length_(size),
diff --git a/rtc_base/memory/fifo_buffer.h b/rtc_base/memory/fifo_buffer.h
index 6e4c973..5117bbd 100644
--- a/rtc_base/memory/fifo_buffer.h
+++ b/rtc_base/memory/fifo_buffer.h
@@ -31,7 +31,7 @@
// Creates a FIFO buffer with the specified capacity.
explicit FifoBuffer(size_t length);
// Creates a FIFO buffer with the specified capacity and owner
- FifoBuffer(size_t length, Thread* owner);
+ FifoBuffer(size_t length, webrtc::Thread* owner);
~FifoBuffer() override;
FifoBuffer(const FifoBuffer&) = delete;
@@ -118,7 +118,7 @@
// offset to the readable data
size_t read_position_ RTC_GUARDED_BY(callback_sequence_);
// stream callbacks are dispatched on this thread
- Thread* const owner_;
+ webrtc::Thread* const owner_;
};
} // namespace rtc
diff --git a/rtc_base/memory/fifo_buffer_unittest.cc b/rtc_base/memory/fifo_buffer_unittest.cc
index 27eb8d8..c7ac77a 100644
--- a/rtc_base/memory/fifo_buffer_unittest.cc
+++ b/rtc_base/memory/fifo_buffer_unittest.cc
@@ -17,7 +17,7 @@
namespace rtc {
TEST(FifoBufferTest, TestAll) {
- rtc::AutoThread main_thread;
+ webrtc::AutoThread main_thread;
const size_t kSize = 16;
const uint8_t in[kSize * 2 + 1] = "0123456789ABCDEFGHIJKLMNOPQRSTUV";
uint8_t out[kSize * 2];
@@ -237,7 +237,7 @@
}
TEST(FifoBufferTest, FullBufferCheck) {
- rtc::AutoThread main_thread;
+ webrtc::AutoThread main_thread;
FifoBuffer buff(10);
buff.ConsumeWriteBuffer(10);
diff --git a/rtc_base/network.cc b/rtc_base/network.cc
index 22fbeeb..4325d4a 100644
--- a/rtc_base/network.cc
+++ b/rtc_base/network.cc
@@ -581,13 +581,13 @@
}
#elif defined(WEBRTC_POSIX)
-NetworkMonitorInterface::InterfaceInfo BasicNetworkManager::GetInterfaceInfo(
- struct ifaddrs* cursor) const {
+webrtc::NetworkMonitorInterface::InterfaceInfo
+BasicNetworkManager::GetInterfaceInfo(struct ifaddrs* cursor) const {
if (cursor->ifa_flags & IFF_LOOPBACK) {
return {
.adapter_type = webrtc::ADAPTER_TYPE_LOOPBACK,
.underlying_type_for_vpn = webrtc::ADAPTER_TYPE_UNKNOWN,
- .network_preference = NetworkPreference::NEUTRAL,
+ .network_preference = webrtc::NetworkPreference::NEUTRAL,
.available = true,
};
} else if (network_monitor_) {
@@ -595,7 +595,7 @@
} else {
return {.adapter_type = GetAdapterTypeFromName(cursor->ifa_name),
.underlying_type_for_vpn = webrtc::ADAPTER_TYPE_UNKNOWN,
- .network_preference = NetworkPreference::NEUTRAL,
+ .network_preference = webrtc::NetworkPreference::NEUTRAL,
.available = true};
}
}
@@ -677,7 +677,8 @@
}
// Create a new network.
- NetworkMonitorInterface::InterfaceInfo if_info = GetInterfaceInfo(cursor);
+ webrtc::NetworkMonitorInterface::InterfaceInfo if_info =
+ GetInterfaceInfo(cursor);
// Check manually configured VPN override.
if (if_info.adapter_type != webrtc::ADAPTER_TYPE_VPN &&
@@ -955,7 +956,7 @@
}
void BasicNetworkManager::StartUpdating() {
- thread_ = Thread::Current();
+ thread_ = webrtc::Thread::Current();
// Redundant but necessary for thread annotations.
RTC_DCHECK_RUN_ON(thread_);
if (start_count_) {
@@ -1098,7 +1099,7 @@
}
}
-NetworkBindingResult BasicNetworkManager::BindSocketToNetwork(
+webrtc::NetworkBindingResult BasicNetworkManager::BindSocketToNetwork(
int socket_fd,
const webrtc::IPAddress& address) {
RTC_DCHECK_RUN_ON(thread_);
diff --git a/rtc_base/network.h b/rtc_base/network.h
index b35368d..65a6948 100644
--- a/rtc_base/network.h
+++ b/rtc_base/network.h
@@ -34,6 +34,7 @@
#include "rtc_base/socket_factory.h"
#include "rtc_base/system/rtc_export.h"
#include "rtc_base/third_party/sigslot/sigslot.h"
+#include "rtc_base/thread.h"
#include "rtc_base/thread_annotations.h"
#if defined(WEBRTC_POSIX)
@@ -47,8 +48,6 @@
class IfAddrsConverter;
class Network;
-class NetworkMonitorInterface;
-class Thread;
// By default, ignore loopback interfaces on the host.
const int kDefaultNetworkIgnoreMask = webrtc::ADAPTER_TYPE_LOOPBACK;
@@ -375,8 +374,10 @@
// Property set by operating system/firmware that has information
// about connection strength to e.g WIFI router or CELL base towers.
- NetworkPreference network_preference() const { return network_preference_; }
- void set_network_preference(NetworkPreference val) {
+ webrtc::NetworkPreference network_preference() const {
+ return network_preference_;
+ }
+ void set_network_preference(webrtc::NetworkPreference val) {
if (network_preference_ == val) {
return;
}
@@ -406,7 +407,8 @@
int preference_;
bool active_ = true;
uint16_t id_ = 0;
- NetworkPreference network_preference_ = NetworkPreference::NEUTRAL;
+ webrtc::NetworkPreference network_preference_ =
+ webrtc::NetworkPreference::NEUTRAL;
friend class NetworkManager;
};
@@ -484,7 +486,7 @@
// Basic implementation of the NetworkManager interface that gets list
// of networks using OS APIs.
class RTC_EXPORT BasicNetworkManager : public NetworkManagerBase,
- public NetworkBinderInterface,
+ public webrtc::NetworkBinderInterface,
public sigslot::has_slots<> {
public:
// This is used by lots of downstream code.
@@ -526,7 +528,7 @@
// The interface name is needed as e.g ipv4 over ipv6 addresses
// are not exposed using Android functions, but it is possible
// bind an ipv4 address to the interface.
- NetworkBindingResult BindSocketToNetwork(
+ webrtc::NetworkBindingResult BindSocketToNetwork(
int socket_fd,
const webrtc::IPAddress& address) override;
@@ -538,7 +540,7 @@
bool include_ignored,
std::vector<std::unique_ptr<Network>>* networks) const
RTC_RUN_ON(thread_);
- NetworkMonitorInterface::InterfaceInfo GetInterfaceInfo(
+ webrtc::NetworkMonitorInterface::InterfaceInfo GetInterfaceInfo(
struct ifaddrs* cursor) const RTC_RUN_ON(thread_);
#endif // defined(WEBRTC_POSIX)
@@ -572,7 +574,7 @@
// Only updates the networks; does not reschedule the next update.
void UpdateNetworksOnce() RTC_RUN_ON(thread_);
- Thread* thread_ = nullptr;
+ webrtc::Thread* thread_ = nullptr;
bool sent_first_update_ = true;
int start_count_ = 0;
@@ -582,7 +584,7 @@
std::vector<std::string> network_ignore_list_;
NetworkMonitorFactory* const network_monitor_factory_;
webrtc::SocketFactory* const socket_factory_;
- std::unique_ptr<NetworkMonitorInterface> network_monitor_
+ std::unique_ptr<webrtc::NetworkMonitorInterface> network_monitor_
RTC_GUARDED_BY(thread_);
bool allow_mac_based_ipv6_ RTC_GUARDED_BY(thread_) = false;
bool bind_using_ifname_ RTC_GUARDED_BY(thread_) = false;
diff --git a/rtc_base/network_monitor.cc b/rtc_base/network_monitor.cc
index 70c2ad5..0733d8e 100644
--- a/rtc_base/network_monitor.cc
+++ b/rtc_base/network_monitor.cc
@@ -12,7 +12,7 @@
#include "rtc_base/checks.h"
-namespace rtc {
+namespace webrtc {
const char* NetworkPreferenceToString(NetworkPreference preference) {
switch (preference) {
@@ -27,4 +27,4 @@
NetworkMonitorInterface::NetworkMonitorInterface() {}
NetworkMonitorInterface::~NetworkMonitorInterface() {}
-} // namespace rtc
+} // namespace webrtc
diff --git a/rtc_base/network_monitor.h b/rtc_base/network_monitor.h
index 49ca29e..2343e65 100644
--- a/rtc_base/network_monitor.h
+++ b/rtc_base/network_monitor.h
@@ -18,7 +18,7 @@
#include "rtc_base/ip_address.h"
#include "rtc_base/network_constants.h"
-namespace rtc {
+namespace webrtc {
enum class NetworkBindingResult {
SUCCESS = 0, // No error
@@ -48,7 +48,7 @@
// special bind call to put packets on a non-default network interface.
virtual NetworkBindingResult BindSocketToNetwork(
int socket_fd,
- const webrtc::IPAddress& address) = 0;
+ const IPAddress& address) = 0;
virtual ~NetworkBinderInterface() {}
};
@@ -74,10 +74,10 @@
public:
struct InterfaceInfo {
// The type of adapter if known.
- webrtc::AdapterType adapter_type;
+ AdapterType adapter_type;
// Is ADAPTER_TYPE_UNKNOWN unless adapter_type == ADAPTER_TYPE_VPN.
- webrtc::AdapterType underlying_type_for_vpn = webrtc::ADAPTER_TYPE_UNKNOWN;
+ AdapterType underlying_type_for_vpn = webrtc::ADAPTER_TYPE_UNKNOWN;
// The OS/firmware specific preference of this interface.
NetworkPreference network_preference = NetworkPreference::NEUTRAL;
@@ -113,7 +113,7 @@
// name. Only implemented on Android.
virtual NetworkBindingResult BindSocketToNetwork(
int /* socket_fd */,
- const webrtc::IPAddress& /* address */,
+ const IPAddress& /* address */,
absl::string_view /* interface_name */) {
return NetworkBindingResult::NOT_IMPLEMENTED;
}
@@ -133,6 +133,16 @@
std::function<void()> networks_changed_callback_;
};
+} // namespace webrtc
+
+// Re-export symbols from the webrtc namespace for backwards compatibility.
+// TODO(bugs.webrtc.org/4222596): Remove once all references are updated.
+namespace rtc {
+using ::webrtc::NetworkBinderInterface;
+using ::webrtc::NetworkBindingResult;
+using ::webrtc::NetworkMonitorInterface;
+using ::webrtc::NetworkPreference;
+using ::webrtc::NetworkPreferenceToString;
} // namespace rtc
#endif // RTC_BASE_NETWORK_MONITOR_H_
diff --git a/rtc_base/network_monitor_factory.h b/rtc_base/network_monitor_factory.h
index c76ed97..f000ddd 100644
--- a/rtc_base/network_monitor_factory.h
+++ b/rtc_base/network_monitor_factory.h
@@ -11,6 +11,7 @@
#ifndef RTC_BASE_NETWORK_MONITOR_FACTORY_H_
#define RTC_BASE_NETWORK_MONITOR_FACTORY_H_
+#include "rtc_base/network_monitor.h"
namespace webrtc {
class FieldTrialsView;
} // namespace webrtc
@@ -19,7 +20,6 @@
// Forward declaring this so it's not part of the API surface; it's only
// expected to be used by Android/iOS SDK code.
-class NetworkMonitorInterface;
/*
* NetworkMonitorFactory creates NetworkMonitors.
@@ -28,7 +28,7 @@
*/
class NetworkMonitorFactory {
public:
- virtual NetworkMonitorInterface* CreateNetworkMonitor(
+ virtual webrtc::NetworkMonitorInterface* CreateNetworkMonitor(
const webrtc::FieldTrialsView& field_trials) = 0;
virtual ~NetworkMonitorFactory();
diff --git a/rtc_base/network_unittest.cc b/rtc_base/network_unittest.cc
index 9acf138..83f1a43 100644
--- a/rtc_base/network_unittest.cc
+++ b/rtc_base/network_unittest.cc
@@ -74,7 +74,7 @@
return ip;
}
-class FakeNetworkMonitor : public NetworkMonitorInterface {
+class FakeNetworkMonitor : public webrtc::NetworkMonitorInterface {
public:
void Start() override { started_ = true; }
void Stop() override { started_ = false; }
@@ -99,19 +99,20 @@
bool SupportsBindSocketToNetwork() const override { return true; }
- NetworkBindingResult BindSocketToNetwork(int socket_fd,
- const webrtc::IPAddress& address,
- absl::string_view if_name) override {
+ webrtc::NetworkBindingResult BindSocketToNetwork(
+ int socket_fd,
+ const webrtc::IPAddress& address,
+ absl::string_view if_name) override {
if (absl::c_count(addresses_, address) > 0) {
- return NetworkBindingResult::SUCCESS;
+ return webrtc::NetworkBindingResult::SUCCESS;
}
for (auto const& iter : adapters_) {
if (absl::StrContains(if_name, iter)) {
- return NetworkBindingResult::SUCCESS;
+ return webrtc::NetworkBindingResult::SUCCESS;
}
}
- return NetworkBindingResult::ADDRESS_NOT_FOUND;
+ return webrtc::NetworkBindingResult::ADDRESS_NOT_FOUND;
}
void set_ip_addresses(std::vector<webrtc::IPAddress> addresses) {
@@ -134,7 +135,7 @@
class FakeNetworkMonitorFactory : public NetworkMonitorFactory {
public:
FakeNetworkMonitorFactory() {}
- NetworkMonitorInterface* CreateNetworkMonitor(
+ webrtc::NetworkMonitorInterface* CreateNetworkMonitor(
const webrtc::FieldTrialsView& field_trials) override {
return new FakeNetworkMonitor();
}
@@ -332,7 +333,7 @@
protected:
webrtc::test::ScopedKeyValueConfig field_trials_;
- rtc::AutoThread main_thread_;
+ webrtc::AutoThread main_thread_;
bool callback_called_;
};
@@ -438,14 +439,14 @@
EXPECT_EQ(NetworkManager::ENUMERATION_ALLOWED,
manager.enumeration_permission());
manager.StartUpdating();
- Thread::Current()->ProcessMessages(0);
+ webrtc::Thread::Current()->ProcessMessages(0);
EXPECT_TRUE(callback_called_);
callback_called_ = false;
// Callback should be triggered immediately when StartUpdating
// is called, after network update signal is already sent.
manager.StartUpdating();
EXPECT_TRUE(manager.started());
- Thread::Current()->ProcessMessages(0);
+ webrtc::Thread::Current()->ProcessMessages(0);
EXPECT_TRUE(callback_called_);
manager.StopUpdating();
EXPECT_TRUE(manager.started());
@@ -459,7 +460,7 @@
// Callback should be triggered immediately after StartUpdating is called
// when start_count_ is reset to 0.
manager.StartUpdating();
- Thread::Current()->ProcessMessages(0);
+ webrtc::Thread::Current()->ProcessMessages(0);
EXPECT_TRUE(callback_called_);
}
@@ -1511,11 +1512,11 @@
network_monitor->set_adapters({"wlan0"});
network_monitor->set_ip_addresses({ipv6});
EXPECT_EQ(manager.BindSocketToNetwork(/* fd */ 77, ipv6),
- NetworkBindingResult::SUCCESS);
+ webrtc::NetworkBindingResult::SUCCESS);
// But it will bind anyway using string matching...
EXPECT_EQ(manager.BindSocketToNetwork(/* fd */ 77, ipv4),
- NetworkBindingResult::SUCCESS);
+ webrtc::NetworkBindingResult::SUCCESS);
}
#endif
diff --git a/rtc_base/null_socket_server_unittest.cc b/rtc_base/null_socket_server_unittest.cc
index 3c60775..b89a241 100644
--- a/rtc_base/null_socket_server_unittest.cc
+++ b/rtc_base/null_socket_server_unittest.cc
@@ -26,9 +26,9 @@
namespace webrtc {
TEST(NullSocketServerTest, WaitAndSet) {
- rtc::AutoThread main_thread;
+ AutoThread main_thread;
NullSocketServer ss;
- auto thread = rtc::Thread::Create();
+ auto thread = Thread::Create();
EXPECT_TRUE(thread->Start());
thread->PostTask([&ss] { ss.WakeUp(); });
// The process_io will be ignored.
diff --git a/rtc_base/openssl_adapter.cc b/rtc_base/openssl_adapter.cc
index e22d419..a5b28ac 100644
--- a/rtc_base/openssl_adapter.cc
+++ b/rtc_base/openssl_adapter.cc
@@ -421,7 +421,7 @@
if (DTLSv1_get_timeout(ssl_, &timeout)) {
TimeDelta delay = TimeDelta::Seconds(timeout.tv_sec) +
TimeDelta::Micros(timeout.tv_usec);
- Thread::Current()->PostDelayedTask(
+ webrtc::Thread::Current()->PostDelayedTask(
SafeTask(timer_.flag(), [this] { OnTimeout(); }), delay);
}
break;
diff --git a/rtc_base/openssl_adapter_unittest.cc b/rtc_base/openssl_adapter_unittest.cc
index 8d52875..6d2fd5a 100644
--- a/rtc_base/openssl_adapter_unittest.cc
+++ b/rtc_base/openssl_adapter_unittest.cc
@@ -89,7 +89,7 @@
// Verifies that SSLStart works when OpenSSLAdapter is started in standalone
// mode.
TEST(OpenSSLAdapterTest, TestBeginSSLBeforeConnection) {
- rtc::AutoThread main_thread;
+ webrtc::AutoThread main_thread;
webrtc::Socket* async_socket = new MockAsyncSocket();
OpenSSLAdapter adapter(async_socket);
EXPECT_EQ(adapter.StartSSL("webrtc.org"), 0);
@@ -97,7 +97,7 @@
// Verifies that the adapter factory can create new adapters.
TEST(OpenSSLAdapterFactoryTest, CreateSingleOpenSSLAdapter) {
- rtc::AutoThread main_thread;
+ webrtc::AutoThread main_thread;
OpenSSLAdapterFactory adapter_factory;
webrtc::Socket* async_socket = new MockAsyncSocket();
auto simple_adapter = std::unique_ptr<OpenSSLAdapter>(
@@ -108,7 +108,7 @@
// Verifies that setting a custom verifier still allows for adapters to be
// created.
TEST(OpenSSLAdapterFactoryTest, CreateWorksWithCustomVerifier) {
- rtc::AutoThread main_thread;
+ webrtc::AutoThread main_thread;
MockCertVerifier* mock_verifier = new MockCertVerifier();
EXPECT_CALL(*mock_verifier, Verify(_)).WillRepeatedly(Return(true));
auto cert_verifier = std::unique_ptr<SSLCertificateVerifier>(mock_verifier);
diff --git a/rtc_base/openssl_stream_adapter.cc b/rtc_base/openssl_stream_adapter.cc
index 8d49bf7..95566ed 100644
--- a/rtc_base/openssl_stream_adapter.cc
+++ b/rtc_base/openssl_stream_adapter.cc
@@ -295,7 +295,7 @@
const webrtc::FieldTrialsView* field_trials)
: stream_(std::move(stream)),
handshake_error_(std::move(handshake_error)),
- owner_(rtc::Thread::Current()),
+ owner_(webrtc::Thread::Current()),
state_(SSL_NONE),
role_(webrtc::SSL_CLIENT),
ssl_read_needs_write_(false),
diff --git a/rtc_base/openssl_stream_adapter.h b/rtc_base/openssl_stream_adapter.h
index 14e3db9..a5c3684 100644
--- a/rtc_base/openssl_stream_adapter.h
+++ b/rtc_base/openssl_stream_adapter.h
@@ -202,7 +202,7 @@
const std::unique_ptr<webrtc::StreamInterface> stream_;
absl::AnyInvocable<void(webrtc::SSLHandshakeError)> handshake_error_;
- rtc::Thread* const owner_;
+ webrtc::Thread* const owner_;
webrtc::ScopedTaskSafety task_safety_;
webrtc::RepeatingTaskHandle timeout_task_;
diff --git a/rtc_base/operations_chain_unittest.cc b/rtc_base/operations_chain_unittest.cc
index dcd2355..16fcf8b 100644
--- a/rtc_base/operations_chain_unittest.cc
+++ b/rtc_base/operations_chain_unittest.cc
@@ -39,7 +39,7 @@
class OperationTracker {
public:
- OperationTracker() : background_thread_(Thread::Create()) {
+ OperationTracker() : background_thread_(webrtc::Thread::Create()) {
background_thread_->Start();
}
// The caller is responsible for ensuring that no operations are pending.
@@ -91,7 +91,7 @@
void StartAsynchronousOperation(webrtc::Event* unblock_operation_event,
webrtc::Event* operation_complete_event,
std::function<void()> callback) {
- Thread* current_thread = Thread::Current();
+ webrtc::Thread* current_thread = webrtc::Thread::Current();
background_thread_->PostTask([this, current_thread, unblock_operation_event,
operation_complete_event, callback]() {
unblock_operation_event->Wait(webrtc::Event::kForever);
@@ -103,7 +103,7 @@
});
}
- std::unique_ptr<Thread> background_thread_;
+ std::unique_ptr<webrtc::Thread> background_thread_;
std::vector<webrtc::Event*> completed_operation_events_;
};
@@ -113,7 +113,7 @@
class OperationTrackerProxy {
public:
OperationTrackerProxy()
- : operations_chain_thread_(Thread::Create()),
+ : operations_chain_thread_(webrtc::Thread::Create()),
operation_tracker_(nullptr),
operations_chain_(nullptr) {
operations_chain_thread_->Start();
@@ -199,7 +199,7 @@
}
private:
- std::unique_ptr<Thread> operations_chain_thread_;
+ std::unique_ptr<webrtc::Thread> operations_chain_thread_;
std::unique_ptr<OperationTracker> operation_tracker_;
scoped_refptr<OperationsChain> operations_chain_;
};
@@ -401,7 +401,7 @@
}
TEST(OperationsChainTest, OnChainEmptyCallback) {
- rtc::AutoThread main_thread;
+ webrtc::AutoThread main_thread;
OperationTrackerProxy operation_tracker_proxy;
operation_tracker_proxy.Initialize()->Wait(webrtc::Event::kForever);
diff --git a/rtc_base/physical_socket_server.cc b/rtc_base/physical_socket_server.cc
index aa010c9..fe18813 100644
--- a/rtc_base/physical_socket_server.cc
+++ b/rtc_base/physical_socket_server.cc
@@ -223,15 +223,15 @@
// instead of bind(), since this is more reliable on an OS with a weak host
// model.
if (ss_->network_binder() && !bind_addr.IsAnyIP()) {
- rtc::NetworkBindingResult result =
+ NetworkBindingResult result =
ss_->network_binder()->BindSocketToNetwork(s_, bind_addr.ipaddr());
- if (result == rtc::NetworkBindingResult::SUCCESS) {
+ if (result == NetworkBindingResult::SUCCESS) {
// Since the network binder handled binding the socket to the desired
// network interface, we don't need to (and shouldn't) include an IP in
// the bind() call; bind() just needs to assign a port.
copied_bind_addr.SetIP(
webrtc::GetAnyIP(copied_bind_addr.ipaddr().family()));
- } else if (result == rtc::NetworkBindingResult::NOT_IMPLEMENTED) {
+ } else if (result == NetworkBindingResult::NOT_IMPLEMENTED) {
RTC_LOG(LS_INFO) << "Can't bind socket to network because "
"network binding is not implemented for this OS.";
} else {
diff --git a/rtc_base/physical_socket_server_unittest.cc b/rtc_base/physical_socket_server_unittest.cc
index 75a69bb..5f5ba55 100644
--- a/rtc_base/physical_socket_server_unittest.cc
+++ b/rtc_base/physical_socket_server_unittest.cc
@@ -92,20 +92,19 @@
PhysicalSocketTest* test_;
};
-class FakeNetworkBinder : public rtc::NetworkBinderInterface {
+class FakeNetworkBinder : public NetworkBinderInterface {
public:
- rtc::NetworkBindingResult BindSocketToNetwork(int,
- const IPAddress&) override {
+ NetworkBindingResult BindSocketToNetwork(int, const IPAddress&) override {
++num_binds_;
return result_;
}
- void set_result(rtc::NetworkBindingResult result) { result_ = result; }
+ void set_result(NetworkBindingResult result) { result_ = result; }
int num_binds() { return num_binds_; }
private:
- rtc::NetworkBindingResult result_ = rtc::NetworkBindingResult::SUCCESS;
+ NetworkBindingResult result_ = rtc::NetworkBindingResult::SUCCESS;
int num_binds_ = 0;
};
@@ -131,7 +130,7 @@
void WritableAfterPartialWrite(const IPAddress& loopback);
FakePhysicalSocketServer server_;
- rtc::AutoSocketServerThread thread_;
+ AutoSocketServerThread thread_;
bool fail_accept_;
int max_send_size_;
};
@@ -501,7 +500,7 @@
FakeNetworkBinder fake_network_binder;
server_.set_network_binder(&fake_network_binder);
std::unique_ptr<Socket> socket(server_.CreateSocket(AF_INET, SOCK_DGRAM));
- fake_network_binder.set_result(rtc::NetworkBindingResult::FAILURE);
+ fake_network_binder.set_result(NetworkBindingResult::FAILURE);
EXPECT_EQ(-1, socket->Bind(SocketAddress("192.168.0.1", 0)));
server_.set_network_binder(nullptr);
}
@@ -525,7 +524,7 @@
FakeNetworkBinder fake_network_binder;
server_.set_network_binder(&fake_network_binder);
std::unique_ptr<Socket> socket(server_.CreateSocket(AF_INET, SOCK_DGRAM));
- fake_network_binder.set_result(rtc::NetworkBindingResult::FAILURE);
+ fake_network_binder.set_result(NetworkBindingResult::FAILURE);
EXPECT_EQ(0, socket->Bind(SocketAddress(kIPv4Loopback, 0)));
server_.set_network_binder(nullptr);
}
diff --git a/rtc_base/platform_thread.cc b/rtc_base/platform_thread.cc
index 6af1f3f..85b888e 100644
--- a/rtc_base/platform_thread.cc
+++ b/rtc_base/platform_thread.cc
@@ -19,7 +19,7 @@
#include "rtc_base/checks.h"
-namespace rtc {
+namespace webrtc {
namespace {
#if defined(WEBRTC_WIN)
@@ -210,4 +210,4 @@
return PlatformThread(handle, joinable);
}
-} // namespace rtc
+} // namespace webrtc
diff --git a/rtc_base/platform_thread.h b/rtc_base/platform_thread.h
index cfc9d17..0d1c40d 100644
--- a/rtc_base/platform_thread.h
+++ b/rtc_base/platform_thread.h
@@ -22,7 +22,7 @@
#include "absl/strings/string_view.h"
#include "rtc_base/platform_thread_types.h"
-namespace rtc {
+namespace webrtc {
enum class ThreadPriority {
kLow = 1,
@@ -116,6 +116,14 @@
bool joinable_ = false;
};
+} // namespace webrtc
+
+// Re-export symbols from the webrtc namespace for backwards compatibility.
+// TODO(bugs.webrtc.org/4222596): Remove once all references are updated.
+namespace rtc {
+using ::webrtc::PlatformThread;
+using ::webrtc::ThreadAttributes;
+using ::webrtc::ThreadPriority;
} // namespace rtc
#endif // RTC_BASE_PLATFORM_THREAD_H_
diff --git a/rtc_base/platform_thread_unittest.cc b/rtc_base/platform_thread_unittest.cc
index ba628ad..b25e06a 100644
--- a/rtc_base/platform_thread_unittest.cc
+++ b/rtc_base/platform_thread_unittest.cc
@@ -16,7 +16,7 @@
#include "system_wrappers/include/sleep.h"
#include "test/gmock.h"
-namespace rtc {
+namespace webrtc {
TEST(PlatformThreadTest, DefaultConstructedIsEmpty) {
PlatformThread thread;
@@ -30,12 +30,12 @@
EXPECT_FALSE(thread.empty());
thread.Finalize();
EXPECT_TRUE(thread.empty());
- webrtc::Event done;
+ Event done;
thread = PlatformThread::SpawnDetached([&] { done.Set(); }, "2");
EXPECT_FALSE(thread.empty());
thread.Finalize();
EXPECT_TRUE(thread.empty());
- done.Wait(webrtc::TimeDelta::Seconds(30));
+ done.Wait(TimeDelta::Seconds(30));
}
TEST(PlatformThreadTest, MovesEmpty) {
@@ -50,12 +50,12 @@
PlatformThread thread2 = std::move(thread1);
EXPECT_TRUE(thread1.empty());
EXPECT_FALSE(thread2.empty());
- webrtc::Event done;
+ Event done;
thread1 = PlatformThread::SpawnDetached([&] { done.Set(); }, "2");
thread2 = std::move(thread1);
EXPECT_TRUE(thread1.empty());
EXPECT_FALSE(thread2.empty());
- done.Wait(webrtc::TimeDelta::Seconds(30));
+ done.Wait(TimeDelta::Seconds(30));
}
TEST(PlatformThreadTest,
@@ -80,31 +80,31 @@
TEST(PlatformThreadTest, JoinsThread) {
// This test flakes if there are problems with the join implementation.
- webrtc::Event event;
+ Event event;
PlatformThread::SpawnJoinable([&] { event.Set(); }, "T");
- EXPECT_TRUE(event.Wait(/*give_up_after=*/webrtc::TimeDelta::Zero()));
+ EXPECT_TRUE(event.Wait(/*give_up_after=*/TimeDelta::Zero()));
}
TEST(PlatformThreadTest, StopsBeforeDetachedThreadExits) {
// This test flakes if there are problems with the detached thread
// implementation.
bool flag = false;
- webrtc::Event thread_started;
- webrtc::Event thread_continue;
- webrtc::Event thread_exiting;
+ Event thread_started;
+ Event thread_continue;
+ Event thread_exiting;
PlatformThread::SpawnDetached(
[&] {
thread_started.Set();
- thread_continue.Wait(webrtc::Event::kForever);
+ thread_continue.Wait(Event::kForever);
flag = true;
thread_exiting.Set();
},
"T");
- thread_started.Wait(webrtc::Event::kForever);
+ thread_started.Wait(Event::kForever);
EXPECT_FALSE(flag);
thread_continue.Set();
- thread_exiting.Wait(webrtc::Event::kForever);
+ thread_exiting.Wait(Event::kForever);
EXPECT_TRUE(flag);
}
-} // namespace rtc
+} // namespace webrtc
diff --git a/rtc_base/race_checker.cc b/rtc_base/race_checker.cc
index f0d4e86..f6d2712 100644
--- a/rtc_base/race_checker.cc
+++ b/rtc_base/race_checker.cc
@@ -10,7 +10,7 @@
#include "rtc_base/race_checker.h"
-namespace rtc {
+namespace webrtc {
RaceChecker::RaceChecker() {}
@@ -23,7 +23,7 @@
// is also a chance that an actual race is missed, however the probability of
// that has been considered small enough to be an acceptable trade off.
bool RaceChecker::Acquire() const {
- const PlatformThreadRef current_thread = CurrentThreadRef();
+ const rtc::PlatformThreadRef current_thread = rtc::CurrentThreadRef();
// Set new accessing thread if this is a new use.
const int current_access_count = access_count_;
access_count_ = access_count_ + 1;
@@ -32,8 +32,8 @@
// If this is being used concurrently this check will fail for the second
// thread entering since it won't set the thread. Recursive use of checked
// methods are OK since the accessing thread remains the same.
- const PlatformThreadRef accessing_thread = accessing_thread_;
- return IsThreadRefEqual(accessing_thread, current_thread);
+ const rtc::PlatformThreadRef accessing_thread = accessing_thread_;
+ return rtc::IsThreadRefEqual(accessing_thread, current_thread);
}
void RaceChecker::Release() const {
@@ -53,4 +53,4 @@
}
} // namespace internal
-} // namespace rtc
+} // namespace webrtc
diff --git a/rtc_base/race_checker.h b/rtc_base/race_checker.h
index 00bab52..56821d8 100644
--- a/rtc_base/race_checker.h
+++ b/rtc_base/race_checker.h
@@ -15,7 +15,7 @@
#include "rtc_base/platform_thread_types.h"
#include "rtc_base/thread_annotations.h"
-namespace rtc {
+namespace webrtc {
namespace internal {
class RaceCheckerScope;
@@ -34,7 +34,7 @@
// Volatile to prevent code being optimized away in Acquire()/Release().
mutable volatile int access_count_ = 0;
- mutable volatile PlatformThreadRef accessing_thread_;
+ mutable volatile rtc::PlatformThreadRef accessing_thread_;
};
namespace internal {
@@ -60,6 +60,12 @@
};
} // namespace internal
+} // namespace webrtc
+
+// Re-export symbols from the webrtc namespace for backwards compatibility.
+// TODO(bugs.webrtc.org/4222596): Remove once all references are updated.
+namespace rtc {
+using ::webrtc::RaceChecker;
} // namespace rtc
#define RTC_CHECK_RUNS_SERIALIZED(x) RTC_CHECK_RUNS_SERIALIZED_NEXT(x, __LINE__)
@@ -67,17 +73,17 @@
#define RTC_CHECK_RUNS_SERIALIZED_NEXT(x, suffix) \
RTC_CHECK_RUNS_SERIALIZED_IMPL(x, suffix)
-#define RTC_CHECK_RUNS_SERIALIZED_IMPL(x, suffix) \
- rtc::internal::RaceCheckerScope race_checker##suffix(x); \
+#define RTC_CHECK_RUNS_SERIALIZED_IMPL(x, suffix) \
+ webrtc::internal::RaceCheckerScope race_checker##suffix(x); \
RTC_CHECK(!race_checker##suffix.RaceDetected())
#if RTC_DCHECK_IS_ON
-#define RTC_DCHECK_RUNS_SERIALIZED(x) \
- rtc::internal::RaceCheckerScope race_checker(x); \
+#define RTC_DCHECK_RUNS_SERIALIZED(x) \
+ webrtc::internal::RaceCheckerScope race_checker(x); \
RTC_DCHECK(!race_checker.RaceDetected())
#else
#define RTC_DCHECK_RUNS_SERIALIZED(x) \
- rtc::internal::RaceCheckerScopeDoNothing race_checker(x)
+ webrtc::internal::RaceCheckerScopeDoNothing race_checker(x)
#endif
#endif // RTC_BASE_RACE_CHECKER_H_
diff --git a/rtc_base/rate_limiter_unittest.cc b/rtc_base/rate_limiter_unittest.cc
index 9d4caf5..a118e46 100644
--- a/rtc_base/rate_limiter_unittest.cc
+++ b/rtc_base/rate_limiter_unittest.cc
@@ -145,7 +145,7 @@
EXPECT_TRUE(rate_limiter_->SetWindowSize(kWindowSizeMs / 2));
}
} set_window_size_task(rate_limiter.get());
- auto thread1 = rtc::PlatformThread::SpawnJoinable(
+ auto thread1 = PlatformThread::SpawnJoinable(
[&set_window_size_task] { set_window_size_task.Run(); }, "Thread1");
class SetMaxRateTask : public ThreadTask {
@@ -156,7 +156,7 @@
void DoRun() override { rate_limiter_->SetMaxRate(kMaxRateBps * 2); }
} set_max_rate_task(rate_limiter.get());
- auto thread2 = rtc::PlatformThread::SpawnJoinable(
+ auto thread2 = PlatformThread::SpawnJoinable(
[&set_max_rate_task] { set_max_rate_task.Run(); }, "Thread2");
class UseRateTask : public ThreadTask {
@@ -173,7 +173,7 @@
SimulatedClock* const clock_;
} use_rate_task(rate_limiter.get(), &clock_);
- auto thread3 = rtc::PlatformThread::SpawnJoinable(
+ auto thread3 = PlatformThread::SpawnJoinable(
[&use_rate_task] { use_rate_task.Run(); }, "Thread3");
set_window_size_task.start_signal_.Set();
diff --git a/rtc_base/rtc_certificate_generator.cc b/rtc_base/rtc_certificate_generator.cc
index ff846e4..6df7071 100644
--- a/rtc_base/rtc_certificate_generator.cc
+++ b/rtc_base/rtc_certificate_generator.cc
@@ -60,8 +60,8 @@
return RTCCertificate::Create(std::move(identity));
}
-RTCCertificateGenerator::RTCCertificateGenerator(rtc::Thread* signaling_thread,
- rtc::Thread* worker_thread)
+RTCCertificateGenerator::RTCCertificateGenerator(Thread* signaling_thread,
+ Thread* worker_thread)
: signaling_thread_(signaling_thread), worker_thread_(worker_thread) {
RTC_DCHECK(signaling_thread_);
RTC_DCHECK(worker_thread_);
diff --git a/rtc_base/rtc_certificate_generator.h b/rtc_base/rtc_certificate_generator.h
index c41f3dc6..78fb157 100644
--- a/rtc_base/rtc_certificate_generator.h
+++ b/rtc_base/rtc_certificate_generator.h
@@ -62,8 +62,7 @@
const rtc::KeyParams& key_params,
const std::optional<uint64_t>& expires_ms);
- RTCCertificateGenerator(rtc::Thread* signaling_thread,
- rtc::Thread* worker_thread);
+ RTCCertificateGenerator(Thread* signaling_thread, Thread* worker_thread);
~RTCCertificateGenerator() override {}
// `RTCCertificateGeneratorInterface` overrides.
@@ -76,8 +75,8 @@
Callback callback) override;
private:
- rtc::Thread* const signaling_thread_;
- rtc::Thread* const worker_thread_;
+ Thread* const signaling_thread_;
+ Thread* const worker_thread_;
};
} // namespace webrtc
diff --git a/rtc_base/rtc_certificate_generator_unittest.cc b/rtc_base/rtc_certificate_generator_unittest.cc
index 860fb69..97ae15a 100644
--- a/rtc_base/rtc_certificate_generator_unittest.cc
+++ b/rtc_base/rtc_certificate_generator_unittest.cc
@@ -31,8 +31,8 @@
class RTCCertificateGeneratorFixture {
public:
RTCCertificateGeneratorFixture()
- : signaling_thread_(rtc::Thread::Current()),
- worker_thread_(rtc::Thread::Create()),
+ : signaling_thread_(Thread::Current()),
+ worker_thread_(Thread::Create()),
generate_async_completed_(false) {
RTC_CHECK(signaling_thread_);
RTC_CHECK(worker_thread_->Start());
@@ -62,8 +62,8 @@
}
protected:
- rtc::Thread* const signaling_thread_;
- std::unique_ptr<rtc::Thread> worker_thread_;
+ Thread* const signaling_thread_;
+ std::unique_ptr<Thread> worker_thread_;
std::unique_ptr<RTCCertificateGenerator> generator_;
scoped_refptr<RTCCertificate> certificate_;
bool generate_async_completed_;
@@ -74,7 +74,7 @@
protected:
static constexpr TimeDelta kGenerationTimeoutMs = TimeDelta::Millis(10000);
- rtc::AutoThread main_thread_;
+ AutoThread main_thread_;
RTCCertificateGeneratorFixture fixture_;
};
diff --git a/rtc_base/socket_server.h b/rtc_base/socket_server.h
index bf4664e..78ed0f3 100644
--- a/rtc_base/socket_server.h
+++ b/rtc_base/socket_server.h
@@ -16,13 +16,13 @@
#include "api/units/time_delta.h"
#include "rtc_base/event.h"
#include "rtc_base/socket_factory.h"
-namespace rtc {
-class Thread;
-class NetworkBinderInterface;
-} // namespace rtc
namespace webrtc {
+class NetworkBinderInterface;
+class Thread;
+class ThreadManager;
+
// Needs to be forward declared because there's a circular dependency between
// NetworkMonitor and Thread.
// TODO(deadbeef): Fix this.
@@ -41,7 +41,7 @@
// to allow the socket server to use the thread's message queue for any
// messaging that it might need to perform. It is also called with a null
// argument before the thread is destroyed.
- virtual void SetMessageQueue(rtc::Thread* /* queue */) {}
+ virtual void SetMessageQueue(Thread* /* queue */) {}
// Sleeps until:
// 1) `max_wait_duration` has elapsed (unless `max_wait_duration` ==
@@ -55,15 +55,13 @@
// A network binder will bind the created sockets to a network.
// It is only used in PhysicalSocketServer.
- void set_network_binder(rtc::NetworkBinderInterface* binder) {
+ void set_network_binder(NetworkBinderInterface* binder) {
network_binder_ = binder;
}
- rtc::NetworkBinderInterface* network_binder() const {
- return network_binder_;
- }
+ NetworkBinderInterface* network_binder() const { return network_binder_; }
private:
- rtc::NetworkBinderInterface* network_binder_ = nullptr;
+ NetworkBinderInterface* network_binder_ = nullptr;
};
} // namespace webrtc
diff --git a/rtc_base/socket_unittest.cc b/rtc_base/socket_unittest.cc
index 932ada9..8f8ca47 100644
--- a/rtc_base/socket_unittest.cc
+++ b/rtc_base/socket_unittest.cc
@@ -657,7 +657,7 @@
EXPECT_TRUE(accepted->GetRemoteAddress().IsNil());
// And the closee should only get a single signal.
- rtc::Thread::Current()->ProcessMessages(0);
+ Thread::Current()->ProcessMessages(0);
EXPECT_FALSE(sink.Check(client.get(), SSE_CLOSE));
// Close down the client and ensure all is good.
@@ -755,7 +755,7 @@
EXPECT_EQ(3, socket1->SendTo("foo", 3, socket1->GetLocalAddress()));
EXPECT_EQ(3, socket2->SendTo("bar", 3, socket1->GetLocalAddress()));
// Sleep a while to ensure sends are both completed at the same time.
- rtc::Thread::SleepMs(1000);
+ Thread::SleepMs(1000);
// Configure the helper class to delete socket 2 when socket 1 has a read
// event.
@@ -809,9 +809,9 @@
EXPECT_FALSE(sink.Check(accepted.get(), SSE_READ));
// Shouldn't signal when blocked in a thread Send, where process_io is false.
- std::unique_ptr<rtc::Thread> thread(rtc::Thread::CreateWithSocketServer());
+ std::unique_ptr<Thread> thread(Thread::CreateWithSocketServer());
thread->Start();
- thread->BlockingCall([] { rtc::Thread::SleepMs(500); });
+ thread->BlockingCall([] { Thread::SleepMs(500); });
EXPECT_FALSE(sink.Check(accepted.get(), SSE_READ));
// But should signal when process_io is true.
@@ -1034,7 +1034,7 @@
int extras = 0;
for (int i = 0; i < 100; ++i) {
accepted->Send(&buf, arraysize(buf));
- rtc::Thread::Current()->ProcessMessages(1);
+ Thread::Current()->ProcessMessages(1);
if (sink.Check(accepted.get(), SSE_WRITE)) {
extras++;
}
@@ -1254,7 +1254,7 @@
ASSERT_GT(socket->RecvFrom(receive_buffer_1), 0);
const int64_t kTimeBetweenPacketsMs = 100;
- rtc::Thread::SleepMs(kTimeBetweenPacketsMs);
+ Thread::SleepMs(kTimeBetweenPacketsMs);
int64_t send_time_2 = TimeMicros();
socket->SendTo("bar", 3, address);
@@ -1293,7 +1293,7 @@
ASSERT_TRUE(packet_1 != nullptr);
EXPECT_NEAR(packet_1->packet_time->us(), TimeMicros(), 1000'000);
- rtc::Thread::SleepMs(100);
+ Thread::SleepMs(100);
client2->SendTo("bar", 3, address);
std::unique_ptr<TestClient::Packet> packet_2 = client1->NextPacket(10000);
ASSERT_TRUE(packet_2 != nullptr);
diff --git a/rtc_base/ssl_adapter_unittest.cc b/rtc_base/ssl_adapter_unittest.cc
index b8c24bf..04c36bf 100644
--- a/rtc_base/ssl_adapter_unittest.cc
+++ b/rtc_base/ssl_adapter_unittest.cc
@@ -41,8 +41,9 @@
static webrtc::Socket* CreateSocket() {
webrtc::SocketAddress address(webrtc::IPAddress(INADDR_ANY), 0);
- webrtc::Socket* socket = rtc::Thread::Current()->socketserver()->CreateSocket(
- address.family(), SOCK_STREAM);
+ webrtc::Socket* socket =
+ webrtc::Thread::Current()->socketserver()->CreateSocket(address.family(),
+ SOCK_STREAM);
socket->Bind(address);
return socket;
@@ -299,7 +300,7 @@
protected:
std::unique_ptr<webrtc::VirtualSocketServer> vss_;
- rtc::AutoSocketServerThread thread_;
+ webrtc::AutoSocketServerThread thread_;
std::unique_ptr<SSLAdapterTestDummyServer> server_;
std::unique_ptr<SSLAdapterTestDummyClient> client_;
std::unique_ptr<rtc::SSLCertificateVerifier> cert_verifier_;
diff --git a/rtc_base/ssl_stream_adapter_unittest.cc b/rtc_base/ssl_stream_adapter_unittest.cc
index 828f7e8..0df6d1d 100644
--- a/rtc_base/ssl_stream_adapter_unittest.cc
+++ b/rtc_base/ssl_stream_adapter_unittest.cc
@@ -330,7 +330,7 @@
}
webrtc::ScopedTaskSafety task_safety_;
- rtc::Thread* const thread_ = rtc::Thread::Current();
+ webrtc::Thread* const thread_ = webrtc::Thread::Current();
SSLStreamAdapterTestBase* test_base_;
const std::string side_;
StreamWrapper* const in_;
@@ -391,7 +391,7 @@
}));
}
- rtc::Thread* const thread_ = rtc::Thread::Current();
+ webrtc::Thread* const thread_ = webrtc::Thread::Current();
webrtc::ScopedTaskSafety task_safety_;
rtc::BufferQueue buffer_;
};
@@ -876,7 +876,7 @@
return server_ssl_->GetIdentityForTesting();
}
- rtc::AutoThread main_thread_;
+ webrtc::AutoThread main_thread_;
webrtc::ScopedFakeClock clock_;
std::string client_cert_pem_;
std::string client_private_key_pem_;
diff --git a/rtc_base/task_queue_stdlib.cc b/rtc_base/task_queue_stdlib.cc
index 7016746..2311897 100644
--- a/rtc_base/task_queue_stdlib.cc
+++ b/rtc_base/task_queue_stdlib.cc
@@ -35,21 +35,21 @@
namespace webrtc {
namespace {
-rtc::ThreadPriority TaskQueuePriorityToThreadPriority(
+ThreadPriority TaskQueuePriorityToThreadPriority(
TaskQueueFactory::Priority priority) {
switch (priority) {
case TaskQueueFactory::Priority::HIGH:
- return rtc::ThreadPriority::kRealtime;
+ return ThreadPriority::kRealtime;
case TaskQueueFactory::Priority::LOW:
- return rtc::ThreadPriority::kLow;
+ return ThreadPriority::kLow;
case TaskQueueFactory::Priority::NORMAL:
- return rtc::ThreadPriority::kNormal;
+ return ThreadPriority::kNormal;
}
}
class TaskQueueStdlib final : public TaskQueueBase {
public:
- TaskQueueStdlib(absl::string_view queue_name, rtc::ThreadPriority priority);
+ TaskQueueStdlib(absl::string_view queue_name, ThreadPriority priority);
~TaskQueueStdlib() override = default;
void Delete() override;
@@ -83,9 +83,9 @@
TimeDelta sleep_time = rtc::Event::kForever;
};
- static rtc::PlatformThread InitializeThread(TaskQueueStdlib* me,
- absl::string_view queue_name,
- rtc::ThreadPriority priority);
+ static PlatformThread InitializeThread(TaskQueueStdlib* me,
+ absl::string_view queue_name,
+ ThreadPriority priority);
NextTask GetNextTask();
@@ -123,27 +123,26 @@
// tasks (including delayed tasks).
// Placing this last ensures the thread doesn't touch uninitialized attributes
// throughout it's lifetime.
- rtc::PlatformThread thread_;
+ PlatformThread thread_;
};
TaskQueueStdlib::TaskQueueStdlib(absl::string_view queue_name,
- rtc::ThreadPriority priority)
+ ThreadPriority priority)
: flag_notify_(/*manual_reset=*/false, /*initially_signaled=*/false),
thread_(InitializeThread(this, queue_name, priority)) {}
// static
-rtc::PlatformThread TaskQueueStdlib::InitializeThread(
- TaskQueueStdlib* me,
- absl::string_view queue_name,
- rtc::ThreadPriority priority) {
+PlatformThread TaskQueueStdlib::InitializeThread(TaskQueueStdlib* me,
+ absl::string_view queue_name,
+ ThreadPriority priority) {
Event started;
- auto thread = rtc::PlatformThread::SpawnJoinable(
+ auto thread = PlatformThread::SpawnJoinable(
[&started, me] {
CurrentTaskQueueSetter set_current(me);
started.Set();
me->ProcessTasks();
},
- queue_name, rtc::ThreadAttributes().SetPriority(priority));
+ queue_name, ThreadAttributes().SetPriority(priority));
started.Wait(Event::kForever);
return thread;
}
diff --git a/rtc_base/task_queue_win.cc b/rtc_base/task_queue_win.cc
index aaa4708..f104d1d 100644
--- a/rtc_base/task_queue_win.cc
+++ b/rtc_base/task_queue_win.cc
@@ -55,15 +55,15 @@
data->Set();
}
-rtc::ThreadPriority TaskQueuePriorityToThreadPriority(
+ThreadPriority TaskQueuePriorityToThreadPriority(
TaskQueueFactory::Priority priority) {
switch (priority) {
case TaskQueueFactory::Priority::HIGH:
- return rtc::ThreadPriority::kRealtime;
+ return ThreadPriority::kRealtime;
case TaskQueueFactory::Priority::LOW:
- return rtc::ThreadPriority::kLow;
+ return ThreadPriority::kLow;
case TaskQueueFactory::Priority::NORMAL:
- return rtc::ThreadPriority::kNormal;
+ return ThreadPriority::kNormal;
}
}
@@ -156,7 +156,7 @@
class TaskQueueWin : public TaskQueueBase {
public:
- TaskQueueWin(absl::string_view queue_name, rtc::ThreadPriority priority);
+ TaskQueueWin(absl::string_view queue_name, ThreadPriority priority);
~TaskQueueWin() override = default;
void Delete() override;
@@ -187,7 +187,7 @@
std::greater<DelayedTaskInfo>>
timer_tasks_;
UINT_PTR timer_id_ = 0;
- rtc::PlatformThread thread_;
+ PlatformThread thread_;
Mutex pending_lock_;
std::queue<absl::AnyInvocable<void() &&>> pending_
RTC_GUARDED_BY(pending_lock_);
@@ -195,7 +195,7 @@
};
TaskQueueWin::TaskQueueWin(absl::string_view queue_name,
- rtc::ThreadPriority priority)
+ ThreadPriority priority)
: in_queue_(::CreateEvent(nullptr, true, false, nullptr)) {
RTC_DCHECK(in_queue_);
thread_ = rtc::PlatformThread::SpawnJoinable(
diff --git a/rtc_base/test_client.cc b/rtc_base/test_client.cc
index e67a9c6..adb8036 100644
--- a/rtc_base/test_client.cc
+++ b/rtc_base/test_client.cc
@@ -141,7 +141,7 @@
fake_clock_->AdvanceTime(webrtc::TimeDelta::Millis(1));
};
} else {
- rtc::Thread::Current()->ProcessMessages(1);
+ Thread::Current()->ProcessMessages(1);
}
}
diff --git a/rtc_base/test_client_unittest.cc b/rtc_base/test_client_unittest.cc
index b83eaa5..a183f1a 100644
--- a/rtc_base/test_client_unittest.cc
+++ b/rtc_base/test_client_unittest.cc
@@ -41,7 +41,7 @@
void TestUdpInternal(const SocketAddress& loopback) {
PhysicalSocketServer socket_server;
- rtc::AutoSocketServerThread main_thread(&socket_server);
+ AutoSocketServerThread main_thread(&socket_server);
Socket* socket = socket_server.CreateSocket(loopback.family(), SOCK_DGRAM);
socket->Bind(loopback);
@@ -55,7 +55,7 @@
void TestTcpInternal(const SocketAddress& loopback) {
PhysicalSocketServer socket_server;
- rtc::AutoSocketServerThread main_thread(&socket_server);
+ AutoSocketServerThread main_thread(&socket_server);
webrtc::TestEchoServer server(&main_thread, loopback);
Socket* socket = socket_server.CreateSocket(loopback.family(), SOCK_STREAM);
diff --git a/rtc_base/test_echo_server.cc b/rtc_base/test_echo_server.cc
index 8f80220..484ed84 100644
--- a/rtc_base/test_echo_server.cc
+++ b/rtc_base/test_echo_server.cc
@@ -14,7 +14,7 @@
namespace webrtc {
-TestEchoServer::TestEchoServer(rtc::Thread* thread, const SocketAddress& addr)
+TestEchoServer::TestEchoServer(Thread* thread, const SocketAddress& addr)
: server_socket_(
thread->socketserver()->CreateSocket(addr.family(), SOCK_STREAM)) {
server_socket_->Bind(addr);
diff --git a/rtc_base/test_echo_server.h b/rtc_base/test_echo_server.h
index 7b8243e..75a6ce5 100644
--- a/rtc_base/test_echo_server.h
+++ b/rtc_base/test_echo_server.h
@@ -33,7 +33,7 @@
// Useful for unit tests.
class TestEchoServer : public sigslot::has_slots<> {
public:
- TestEchoServer(rtc::Thread* thread, const SocketAddress& addr);
+ TestEchoServer(Thread* thread, const SocketAddress& addr);
~TestEchoServer() override;
TestEchoServer(const TestEchoServer&) = delete;
@@ -65,7 +65,7 @@
client_sockets_.erase(it);
// `OnClose` is triggered by socket Close callback, deleting `socket` while
// processing that callback might be unsafe.
- rtc::Thread::Current()->PostTask([socket = absl::WrapUnique(socket)] {});
+ Thread::Current()->PostTask([socket = absl::WrapUnique(socket)] {});
}
typedef std::list<AsyncTCPSocket*> ClientList;
diff --git a/rtc_base/thread.cc b/rtc_base/thread.cc
index 604bf86..96ca557 100644
--- a/rtc_base/thread.cc
+++ b/rtc_base/thread.cc
@@ -72,7 +72,7 @@
} // namespace
#endif
-namespace rtc {
+namespace webrtc {
using ::webrtc::MutexLock;
using ::webrtc::TimeDelta;
@@ -179,7 +179,7 @@
}
}
- rtc::Thread* current = rtc::Thread::Current();
+ Thread* current = rtc::Thread::Current();
// Note: One of the message queues may have been on this thread, which is
// why we can't synchronously wait for queues_not_done to go to 0; we need
// to process messages as well.
@@ -251,14 +251,14 @@
SetCurrentThreadInternal(thread);
}
-void rtc::ThreadManager::ChangeCurrentThreadForTest(rtc::Thread* thread) {
+void rtc::ThreadManager::ChangeCurrentThreadForTest(Thread* thread) {
SetCurrentThreadInternal(thread);
}
Thread* ThreadManager::WrapCurrentThread() {
Thread* result = CurrentThread();
if (nullptr == result) {
- result = new Thread(CreateDefaultSocketServer());
+ result = new Thread(rtc::CreateDefaultSocketServer());
result->WrapCurrentWithThreadManager(this, true);
}
return result;
@@ -310,12 +310,12 @@
}
#endif
-Thread::Thread(webrtc::SocketServer* ss) : Thread(ss, /*do_init=*/true) {}
+Thread::Thread(SocketServer* ss) : Thread(ss, /*do_init=*/true) {}
-Thread::Thread(std::unique_ptr<webrtc::SocketServer> ss)
+Thread::Thread(std::unique_ptr<SocketServer> ss)
: Thread(std::move(ss), /*do_init=*/true) {}
-Thread::Thread(webrtc::SocketServer* ss, bool do_init)
+Thread::Thread(SocketServer* ss, bool do_init)
: delayed_next_num_(0),
fInitialized_(false),
fDestroyed_(false),
@@ -329,7 +329,7 @@
}
}
-Thread::Thread(std::unique_ptr<webrtc::SocketServer> ss, bool do_init)
+Thread::Thread(std::unique_ptr<SocketServer> ss, bool do_init)
: Thread(ss.get(), do_init) {
own_ss_ = std::move(ss);
}
@@ -367,7 +367,7 @@
delayed_messages_ = {};
}
-webrtc::SocketServer* Thread::socketserver() {
+SocketServer* Thread::socketserver() {
return ss_;
}
@@ -393,7 +393,7 @@
int64_t cmsTotal = cmsWait;
int64_t cmsElapsed = 0;
- int64_t msStart = webrtc::TimeMillis();
+ int64_t msStart = TimeMillis();
int64_t msCurrent = msStart;
while (true) {
// Check for posted events
@@ -407,7 +407,7 @@
while (!delayed_messages_.empty()) {
if (msCurrent < delayed_messages_.top().run_time_ms) {
cmsDelayNext =
- webrtc::TimeDiff(delayed_messages_.top().run_time_ms, msCurrent);
+ TimeDiff(delayed_messages_.top().run_time_ms, msCurrent);
break;
}
messages_.push(std::move(delayed_messages_.top().functor));
@@ -437,16 +437,16 @@
{
// Wait and multiplex in the meantime
- if (!ss_->Wait(cmsNext == kForever ? webrtc::SocketServer::kForever
- : webrtc::TimeDelta::Millis(cmsNext),
+ if (!ss_->Wait(cmsNext == kForever ? SocketServer::kForever
+ : TimeDelta::Millis(cmsNext),
/*process_io=*/true))
return nullptr;
}
// If the specified timeout expired, return
- msCurrent = webrtc::TimeMillis();
- cmsElapsed = webrtc::TimeDiff(msCurrent, msStart);
+ msCurrent = TimeMillis();
+ cmsElapsed = TimeDiff(msCurrent, msStart);
if (cmsWait != kForever) {
if (cmsElapsed >= cmsWait)
return nullptr;
@@ -457,7 +457,7 @@
void Thread::PostTaskImpl(absl::AnyInvocable<void() &&> task,
const PostTaskTraits& /* traits */,
- const webrtc::Location& /* location */) {
+ const Location& /* location */) {
if (IsQuitting()) {
return;
}
@@ -474,9 +474,9 @@
}
void Thread::PostDelayedTaskImpl(absl::AnyInvocable<void() &&> task,
- webrtc::TimeDelta delay,
+ TimeDelta delay,
const PostDelayedTaskTraits& /* traits */,
- const webrtc::Location& /* location */) {
+ const Location& /* location */) {
if (IsQuitting()) {
return;
}
@@ -486,7 +486,7 @@
// Signal for the multiplexer to return.
int64_t delay_ms = delay.RoundUpTo(webrtc::TimeDelta::Millis(1)).ms<int>();
- int64_t run_time_ms = webrtc::TimeAfter(delay_ms);
+ int64_t run_time_ms = TimeAfter(delay_ms);
{
MutexLock lock(&mutex_);
delayed_messages_.push({.delay_ms = delay_ms,
@@ -539,12 +539,12 @@
}
std::unique_ptr<Thread> Thread::CreateWithSocketServer() {
- return std::unique_ptr<Thread>(new Thread(CreateDefaultSocketServer()));
+ return std::unique_ptr<Thread>(new Thread(rtc::CreateDefaultSocketServer()));
}
std::unique_ptr<Thread> Thread::Create() {
- return std::unique_ptr<Thread>(new Thread(
- std::unique_ptr<webrtc::SocketServer>(new webrtc::NullSocketServer())));
+ return std::unique_ptr<Thread>(
+ new Thread(std::unique_ptr<SocketServer>(new NullSocketServer())));
}
bool Thread::SleepMs(int milliseconds) {
@@ -723,8 +723,8 @@
Join();
}
-void Thread::BlockingCallImpl(webrtc::FunctionView<void()> functor,
- const webrtc::Location& /* location */) {
+void Thread::BlockingCallImpl(FunctionView<void()> functor,
+ const Location& /* location */) {
TRACE_EVENT0("webrtc", "Thread::BlockingCall");
RTC_DCHECK(!IsQuitting());
@@ -752,10 +752,10 @@
}
#endif
- webrtc::Event done;
+ Event done;
absl::Cleanup cleanup = [&done] { done.Set(); };
PostTask([functor, cleanup = std::move(cleanup)] { functor(); });
- done.Wait(webrtc::Event::kForever);
+ done.Wait(Event::kForever);
}
// Called by the ThreadManager when being set as the current thread.
@@ -806,7 +806,7 @@
// Returns true if no policies added or if there is at least one policy
// that permits invocation to `target` thread.
-bool Thread::IsInvokeToThreadAllowed(rtc::Thread* target) {
+bool Thread::IsInvokeToThreadAllowed(Thread* target) {
#if (!defined(NDEBUG) || RTC_DCHECK_IS_ON)
RTC_DCHECK_RUN_ON(this);
if (!invoke_policy_enabled_) {
@@ -891,7 +891,7 @@
}
AutoThread::AutoThread()
- : Thread(CreateDefaultSocketServer(), /*do_init=*/false) {
+ : Thread(rtc::CreateDefaultSocketServer(), /*do_init=*/false) {
if (!ThreadManager::Instance()->CurrentThread()) {
// DoInit registers with ThreadManager. Do that only if we intend to
// be rtc::Thread::Current(), otherwise ProcessAllMessageQueuesInternal will
@@ -909,7 +909,7 @@
}
}
-AutoSocketServerThread::AutoSocketServerThread(webrtc::SocketServer* ss)
+AutoSocketServerThread::AutoSocketServerThread(SocketServer* ss)
: Thread(ss, /*do_init=*/false) {
DoInit();
old_thread_ = ThreadManager::Instance()->CurrentThread();
@@ -937,4 +937,4 @@
}
}
-} // namespace rtc
+} // namespace webrtc
diff --git a/rtc_base/thread.h b/rtc_base/thread.h
index 0d55087..5424b94 100644
--- a/rtc_base/thread.h
+++ b/rtc_base/thread.h
@@ -49,7 +49,7 @@
// Counts how many `Thread::BlockingCall` are made from within a scope and logs
// the number of blocking calls at the end of the scope.
#define RTC_LOG_THREAD_BLOCK_COUNT() \
- rtc::Thread::ScopedCountBlockingCalls blocked_call_count_printer( \
+ webrtc::Thread::ScopedCountBlockingCalls blocked_call_count_printer( \
[func = __func__](uint32_t actual_block, uint32_t could_block) { \
auto total = actual_block + could_block; \
if (total) { \
@@ -74,7 +74,7 @@
#define RTC_DCHECK_BLOCK_COUNT_NO_MORE_THAN(x)
#endif
-namespace rtc {
+namespace webrtc {
class Thread;
@@ -140,7 +140,7 @@
// This list contains all live Threads.
std::vector<Thread*> message_queues_ RTC_GUARDED_BY(crit_);
- webrtc::Mutex crit_;
+ Mutex crit_;
#if RTC_DCHECK_IS_ON
// Represents all thread seand actions by storing all send targets per thread.
@@ -160,7 +160,7 @@
// WARNING! SUBCLASSES MUST CALL Stop() IN THEIR DESTRUCTORS! See ~Thread().
-class RTC_LOCKABLE RTC_EXPORT Thread : public webrtc::TaskQueueBase {
+class RTC_LOCKABLE RTC_EXPORT Thread : public TaskQueueBase {
public:
static const int kForever = -1;
@@ -169,14 +169,14 @@
// init_queue and call DoInit() from their constructor to prevent races
// with the ThreadManager using the object while the vtable is still
// being created.
- explicit Thread(webrtc::SocketServer* ss);
- explicit Thread(std::unique_ptr<webrtc::SocketServer> ss);
+ explicit Thread(SocketServer* ss);
+ explicit Thread(std::unique_ptr<SocketServer> ss);
// Constructors meant for subclasses; they should call DoInit themselves and
// pass false for `do_init`, so that DoInit is called only on the fully
// instantiated class, which avoids a vptr data race.
- Thread(webrtc::SocketServer* ss, bool do_init);
- Thread(std::unique_ptr<webrtc::SocketServer> ss, bool do_init);
+ Thread(SocketServer* ss, bool do_init);
+ Thread(std::unique_ptr<SocketServer> ss, bool do_init);
// NOTE: ALL SUBCLASSES OF Thread MUST CALL Stop() IN THEIR DESTRUCTORS (or
// guarantee Stop() is explicitly called before the subclass is destroyed).
@@ -246,7 +246,7 @@
uint32_t GetCouldBeBlockingCallCount() const;
#endif
- webrtc::SocketServer* socketserver();
+ SocketServer* socketserver();
// Note: The behavior of Thread has changed. When a thread is stopped,
// futher Posts and Sends will fail. However, any pending Sends and *ready*
@@ -267,7 +267,7 @@
bool empty() const { return size() == 0u; }
size_t size() const {
- webrtc::MutexLock lock(&mutex_);
+ MutexLock lock(&mutex_);
return messages_.size() + delayed_messages_.size();
}
@@ -309,18 +309,16 @@
// See ScopedDisallowBlockingCalls for details.
// NOTE: Blocking calls are DISCOURAGED, consider if what you're doing can
// be achieved with PostTask() and callbacks instead.
- void BlockingCall(
- webrtc::FunctionView<void()> functor,
- const webrtc::Location& location = webrtc::Location::Current()) {
+ void BlockingCall(FunctionView<void()> functor,
+ const Location& location = Location::Current()) {
BlockingCallImpl(std::move(functor), location);
}
template <typename Functor,
typename ReturnT = std::invoke_result_t<Functor>,
typename = typename std::enable_if_t<!std::is_void_v<ReturnT>>>
- ReturnT BlockingCall(
- Functor&& functor,
- const webrtc::Location& location = webrtc::Location::Current()) {
+ ReturnT BlockingCall(Functor&& functor,
+ const Location& location = Location::Current()) {
ReturnT result;
BlockingCall([&] { result = std::forward<Functor>(functor)(); }, location);
return result;
@@ -339,7 +337,7 @@
// returns false.
// If NDEBUG is defined and RTC_DCHECK_IS_ON is undefined always returns
// true.
- bool IsInvokeToThreadAllowed(rtc::Thread* target);
+ bool IsInvokeToThreadAllowed(Thread* target);
// From TaskQueueBase
void Delete() override;
@@ -383,15 +381,15 @@
public:
explicit CurrentThreadSetter(Thread* thread)
: CurrentTaskQueueSetter(thread),
- manager_(rtc::ThreadManager::Instance()),
+ manager_(ThreadManager::Instance()),
previous_(manager_->CurrentThread()) {
manager_->ChangeCurrentThreadForTest(thread);
}
~CurrentThreadSetter() { manager_->ChangeCurrentThreadForTest(previous_); }
private:
- rtc::ThreadManager* const manager_;
- rtc::Thread* const previous_;
+ ThreadManager* const manager_;
+ Thread* const previous_;
};
// DelayedMessage goes into a priority queue, sorted by trigger time. Messages
@@ -417,14 +415,14 @@
// TaskQueueBase implementation.
void PostTaskImpl(absl::AnyInvocable<void() &&> task,
const PostTaskTraits& traits,
- const webrtc::Location& location) override;
+ const Location& location) override;
void PostDelayedTaskImpl(absl::AnyInvocable<void() &&> task,
- webrtc::TimeDelta delay,
+ TimeDelta delay,
const PostDelayedTaskTraits& traits,
- const webrtc::Location& location) override;
+ const Location& location) override;
- virtual void BlockingCallImpl(webrtc::FunctionView<void()> functor,
- const webrtc::Location& location);
+ virtual void BlockingCallImpl(FunctionView<void()> functor,
+ const Location& location);
// Perform initialization, subclasses must call this from their constructor
// if false was passed as init_queue to the Thread constructor.
@@ -494,16 +492,16 @@
std::vector<Thread*> allowed_threads_ RTC_GUARDED_BY(this);
bool invoke_policy_enabled_ RTC_GUARDED_BY(this) = false;
#endif
- mutable webrtc::Mutex mutex_;
+ mutable Mutex mutex_;
bool fInitialized_;
bool fDestroyed_;
std::atomic<int> stop_;
// The SocketServer might not be owned by Thread.
- webrtc::SocketServer* const ss_;
+ SocketServer* const ss_;
// Used if SocketServer ownership lies with `this`.
- std::unique_ptr<webrtc::SocketServer> own_ss_;
+ std::unique_ptr<SocketServer> own_ss_;
std::string name_;
@@ -557,15 +555,24 @@
class AutoSocketServerThread : public Thread {
public:
- explicit AutoSocketServerThread(webrtc::SocketServer* ss);
+ explicit AutoSocketServerThread(SocketServer* ss);
~AutoSocketServerThread() override;
AutoSocketServerThread(const AutoSocketServerThread&) = delete;
AutoSocketServerThread& operator=(const AutoSocketServerThread&) = delete;
private:
- rtc::Thread* old_thread_;
+ Thread* old_thread_;
};
+} // namespace webrtc
+
+// Re-export symbols from the webrtc namespace for backwards compatibility.
+// TODO(bugs.webrtc.org/4222596): Remove once all references are updated.
+namespace rtc {
+using ::webrtc::AutoSocketServerThread;
+using ::webrtc::AutoThread;
+using ::webrtc::Thread;
+using ::webrtc::ThreadManager;
} // namespace rtc
#endif // RTC_BASE_THREAD_H_
diff --git a/rtc_base/thread_unittest.cc b/rtc_base/thread_unittest.cc
index d72ba21..d124abc 100644
--- a/rtc_base/thread_unittest.cc
+++ b/rtc_base/thread_unittest.cc
@@ -49,7 +49,7 @@
#endif
-namespace rtc {
+namespace webrtc {
namespace {
using ::testing::ElementsAre;
@@ -74,7 +74,7 @@
// Receives messages and sends on a socket.
class MessageClient : public TestGenerator {
public:
- MessageClient(Thread* pth, webrtc::Socket* socket) : socket_(socket) {}
+ MessageClient(Thread* pth, Socket* socket) : socket_(socket) {}
~MessageClient() { delete socket_; }
@@ -84,17 +84,17 @@
}
private:
- webrtc::Socket* socket_;
+ Socket* socket_;
};
// Receives on a socket and sends by posting messages.
class SocketClient : public TestGenerator, public sigslot::has_slots<> {
public:
- SocketClient(webrtc::Socket* socket,
- const webrtc::SocketAddress& addr,
+ SocketClient(Socket* socket,
+ const SocketAddress& addr,
Thread* post_thread,
MessageClient* phandler)
- : socket_(webrtc::AsyncUDPSocket::Create(socket, addr)),
+ : socket_(AsyncUDPSocket::Create(socket, addr)),
post_thread_(post_thread),
post_handler_(phandler) {
socket_->RegisterReceivedPacketCallback(
@@ -105,10 +105,9 @@
~SocketClient() override { delete socket_; }
- webrtc::SocketAddress address() const { return socket_->GetLocalAddress(); }
+ SocketAddress address() const { return socket_->GetLocalAddress(); }
- void OnPacket(webrtc::AsyncPacketSocket* socket,
- const rtc::ReceivedPacket& packet) {
+ void OnPacket(AsyncPacketSocket* socket, const rtc::ReceivedPacket& packet) {
EXPECT_EQ(packet.payload().size(), sizeof(uint32_t));
uint32_t prev =
reinterpret_cast<const uint32_t*>(packet.payload().data())[0];
@@ -120,16 +119,15 @@
}
private:
- webrtc::AsyncUDPSocket* socket_;
+ AsyncUDPSocket* socket_;
Thread* post_thread_;
MessageClient* post_handler_;
};
-class CustomThread : public rtc::Thread {
+class CustomThread : public Thread {
public:
CustomThread()
- : Thread(std::unique_ptr<webrtc::SocketServer>(
- new webrtc::NullSocketServer())) {}
+ : Thread(std::unique_ptr<SocketServer>(new NullSocketServer())) {}
~CustomThread() override { Stop(); }
bool Start() { return false; }
@@ -141,9 +139,8 @@
// when it is destroyed.
class SignalWhenDestroyedThread : public Thread {
public:
- SignalWhenDestroyedThread(webrtc::Event* event)
- : Thread(std::unique_ptr<webrtc::SocketServer>(
- new webrtc::NullSocketServer())),
+ SignalWhenDestroyedThread(Event* event)
+ : Thread(std::unique_ptr<SocketServer>(new NullSocketServer())),
event_(event) {}
~SignalWhenDestroyedThread() override {
@@ -156,23 +153,22 @@
}
private:
- webrtc::Event* event_;
+ Event* event_;
};
// See: https://code.google.com/p/webrtc/issues/detail?id=2409
TEST(ThreadTest, DISABLED_Main) {
- rtc::AutoThread main_thread;
- const webrtc::SocketAddress addr("127.0.0.1", 0);
+ AutoThread main_thread;
+ const SocketAddress addr("127.0.0.1", 0);
// Create the messaging client on its own thread.
auto th1 = Thread::CreateWithSocketServer();
- webrtc::Socket* socket =
- th1->socketserver()->CreateSocket(addr.family(), SOCK_DGRAM);
+ Socket* socket = th1->socketserver()->CreateSocket(addr.family(), SOCK_DGRAM);
MessageClient msg_client(th1.get(), socket);
// Create the socket client on its own thread.
auto th2 = Thread::CreateWithSocketServer();
- webrtc::Socket* asocket =
+ Socket* asocket =
th2->socketserver()->CreateSocket(addr.family(), SOCK_DGRAM);
SocketClient sock_client(asocket, addr, th1.get(), &msg_client);
@@ -204,7 +200,7 @@
}
TEST(ThreadTest, CountBlockingCalls) {
- rtc::AutoThread current;
+ AutoThread current;
// When the test runs, this will print out:
// (thread_unittest.cc:262): Blocking TestBody: total=2 (actual=1, could=1)
@@ -357,7 +353,7 @@
#endif // (!defined(NDEBUG) || RTC_DCHECK_IS_ON)
TEST(ThreadTest, InvokesAllowedByDefault) {
- rtc::AutoThread main_thread;
+ AutoThread main_thread;
// Create and start the thread.
auto thread1 = Thread::CreateWithSocketServer();
auto thread2 = Thread::CreateWithSocketServer();
@@ -434,17 +430,17 @@
explicit LockedBool(bool value) : value_(value) {}
void Set(bool value) {
- webrtc::MutexLock lock(&mutex_);
+ MutexLock lock(&mutex_);
value_ = value;
}
bool Get() {
- webrtc::MutexLock lock(&mutex_);
+ MutexLock lock(&mutex_);
return value_;
}
private:
- webrtc::Mutex mutex_;
+ Mutex mutex_;
bool value_ RTC_GUARDED_BY(mutex_);
};
@@ -496,12 +492,12 @@
}
static void DelayedPostsWithIdenticalTimesAreProcessedInFifoOrder(
- webrtc::FakeClock& clock,
+ FakeClock& clock,
Thread& q) {
std::vector<int> run_order;
- webrtc::Event done;
- int64_t now = webrtc::TimeMillis();
+ Event done;
+ int64_t now = TimeMillis();
q.PostDelayedTask([&] { run_order.push_back(3); }, TimeDelta::Millis(3));
q.PostDelayedTask([&] { run_order.push_back(0); }, TimeDelta::Millis(1));
q.PostDelayedTask([&] { run_order.push_back(1); }, TimeDelta::Millis(2));
@@ -509,7 +505,7 @@
q.PostDelayedTask([&] { run_order.push_back(2); }, TimeDelta::Millis(2));
q.PostDelayedTask([&] { done.Set(); }, TimeDelta::Millis(4));
// Validate time was frozen while tasks were posted.
- RTC_DCHECK_EQ(webrtc::TimeMillis(), now);
+ RTC_DCHECK_EQ(TimeMillis(), now);
// Change time to make all tasks ready to run and wait for them.
clock.AdvanceTime(TimeDelta::Millis(4));
@@ -519,12 +515,12 @@
}
TEST(ThreadTest, DelayedPostsWithIdenticalTimesAreProcessedInFifoOrder) {
- webrtc::ScopedBaseFakeClock clock;
- Thread q(CreateDefaultSocketServer(), true);
+ ScopedBaseFakeClock clock;
+ Thread q(rtc::CreateDefaultSocketServer(), true);
q.Start();
DelayedPostsWithIdenticalTimesAreProcessedInFifoOrder(clock, q);
- webrtc::NullSocketServer nullss;
+ NullSocketServer nullss;
Thread q_nullss(&nullss, true);
q_nullss.Start();
DelayedPostsWithIdenticalTimesAreProcessedInFifoOrder(clock, q_nullss);
@@ -534,8 +530,8 @@
// all messages (both delayed and non delayed) up until the current time, on
// all registered message queues.
TEST(ThreadManager, ProcessAllMessageQueues) {
- rtc::AutoThread main_thread;
- webrtc::Event entered_process_all_message_queues(true, false);
+ AutoThread main_thread;
+ Event entered_process_all_message_queues(true, false);
auto a = Thread::CreateWithSocketServer();
auto b = Thread::CreateWithSocketServer();
a->Start();
@@ -548,7 +544,7 @@
// of ProcessAllMessageQueues. The event is set by a message posted to
// the main thread, which is guaranteed to be handled inside
// ProcessAllMessageQueues.
- entered_process_all_message_queues.Wait(webrtc::Event::kForever);
+ entered_process_all_message_queues.Wait(Event::kForever);
messages_processed.fetch_add(1);
};
auto event_signaler = [&entered_process_all_message_queues] {
@@ -574,8 +570,8 @@
ThreadManager::ProcessAllMessageQueuesForTesting();
}
-void WaitAndSetEvent(webrtc::Event* wait_event, webrtc::Event* set_event) {
- wait_event->Wait(webrtc::Event::kForever);
+void WaitAndSetEvent(Event* wait_event, Event* set_event) {
+ wait_event->Wait(Event::kForever);
set_event->Set();
}
@@ -587,8 +583,7 @@
size_t move_count = 0;
};
- LifeCycleFunctor(Stats* stats, webrtc::Event* event)
- : stats_(stats), event_(event) {}
+ LifeCycleFunctor(Stats* stats, Event* event) : stats_(stats), event_(event) {}
LifeCycleFunctor(const LifeCycleFunctor& other) { *this = other; }
LifeCycleFunctor(LifeCycleFunctor&& other) { *this = std::move(other); }
@@ -610,15 +605,13 @@
private:
Stats* stats_;
- webrtc::Event* event_;
+ Event* event_;
};
// A functor that verifies the thread it was destroyed on.
class DestructionFunctor {
public:
- DestructionFunctor(Thread* thread,
- bool* thread_was_current,
- webrtc::Event* event)
+ DestructionFunctor(Thread* thread, bool* thread_was_current, Event* event)
: thread_(thread),
thread_was_current_(thread_was_current),
event_(event) {}
@@ -637,111 +630,111 @@
private:
Thread* thread_;
bool* thread_was_current_;
- webrtc::Event* event_;
+ Event* event_;
bool was_invoked_ = false;
};
TEST(ThreadPostTaskTest, InvokesWithLambda) {
- std::unique_ptr<rtc::Thread> background_thread(rtc::Thread::Create());
+ std::unique_ptr<Thread> background_thread(rtc::Thread::Create());
background_thread->Start();
- webrtc::Event event;
+ Event event;
background_thread->PostTask([&event] { event.Set(); });
- event.Wait(webrtc::Event::kForever);
+ event.Wait(Event::kForever);
}
TEST(ThreadPostTaskTest, InvokesWithCopiedFunctor) {
- std::unique_ptr<rtc::Thread> background_thread(rtc::Thread::Create());
+ std::unique_ptr<Thread> background_thread(rtc::Thread::Create());
background_thread->Start();
LifeCycleFunctor::Stats stats;
- webrtc::Event event;
+ Event event;
LifeCycleFunctor functor(&stats, &event);
background_thread->PostTask(functor);
- event.Wait(webrtc::Event::kForever);
+ event.Wait(Event::kForever);
EXPECT_EQ(1u, stats.copy_count);
EXPECT_EQ(0u, stats.move_count);
}
TEST(ThreadPostTaskTest, InvokesWithMovedFunctor) {
- std::unique_ptr<rtc::Thread> background_thread(rtc::Thread::Create());
+ std::unique_ptr<Thread> background_thread(rtc::Thread::Create());
background_thread->Start();
LifeCycleFunctor::Stats stats;
- webrtc::Event event;
+ Event event;
LifeCycleFunctor functor(&stats, &event);
background_thread->PostTask(std::move(functor));
- event.Wait(webrtc::Event::kForever);
+ event.Wait(Event::kForever);
EXPECT_EQ(0u, stats.copy_count);
EXPECT_EQ(1u, stats.move_count);
}
TEST(ThreadPostTaskTest, InvokesWithReferencedFunctorShouldCopy) {
- std::unique_ptr<rtc::Thread> background_thread(rtc::Thread::Create());
+ std::unique_ptr<Thread> background_thread(rtc::Thread::Create());
background_thread->Start();
LifeCycleFunctor::Stats stats;
- webrtc::Event event;
+ Event event;
LifeCycleFunctor functor(&stats, &event);
LifeCycleFunctor& functor_ref = functor;
background_thread->PostTask(functor_ref);
- event.Wait(webrtc::Event::kForever);
+ event.Wait(Event::kForever);
EXPECT_EQ(1u, stats.copy_count);
EXPECT_EQ(0u, stats.move_count);
}
TEST(ThreadPostTaskTest, InvokesWithCopiedFunctorDestroyedOnTargetThread) {
- std::unique_ptr<rtc::Thread> background_thread(rtc::Thread::Create());
+ std::unique_ptr<Thread> background_thread(rtc::Thread::Create());
background_thread->Start();
- webrtc::Event event;
+ Event event;
bool was_invoked_on_background_thread = false;
DestructionFunctor functor(background_thread.get(),
&was_invoked_on_background_thread, &event);
background_thread->PostTask(functor);
- event.Wait(webrtc::Event::kForever);
+ event.Wait(Event::kForever);
EXPECT_TRUE(was_invoked_on_background_thread);
}
TEST(ThreadPostTaskTest, InvokesWithMovedFunctorDestroyedOnTargetThread) {
- std::unique_ptr<rtc::Thread> background_thread(rtc::Thread::Create());
+ std::unique_ptr<Thread> background_thread(rtc::Thread::Create());
background_thread->Start();
- webrtc::Event event;
+ Event event;
bool was_invoked_on_background_thread = false;
DestructionFunctor functor(background_thread.get(),
&was_invoked_on_background_thread, &event);
background_thread->PostTask(std::move(functor));
- event.Wait(webrtc::Event::kForever);
+ event.Wait(Event::kForever);
EXPECT_TRUE(was_invoked_on_background_thread);
}
TEST(ThreadPostTaskTest,
InvokesWithReferencedFunctorShouldCopyAndDestroyedOnTargetThread) {
- std::unique_ptr<rtc::Thread> background_thread(rtc::Thread::Create());
+ std::unique_ptr<Thread> background_thread(rtc::Thread::Create());
background_thread->Start();
- webrtc::Event event;
+ Event event;
bool was_invoked_on_background_thread = false;
DestructionFunctor functor(background_thread.get(),
&was_invoked_on_background_thread, &event);
DestructionFunctor& functor_ref = functor;
background_thread->PostTask(functor_ref);
- event.Wait(webrtc::Event::kForever);
+ event.Wait(Event::kForever);
EXPECT_TRUE(was_invoked_on_background_thread);
}
TEST(ThreadPostTaskTest, InvokesOnBackgroundThread) {
- std::unique_ptr<rtc::Thread> background_thread(rtc::Thread::Create());
+ std::unique_ptr<Thread> background_thread(rtc::Thread::Create());
background_thread->Start();
- webrtc::Event event;
+ Event event;
bool was_invoked_on_background_thread = false;
Thread* background_thread_ptr = background_thread.get();
background_thread->PostTask(
@@ -749,35 +742,35 @@
was_invoked_on_background_thread = background_thread_ptr->IsCurrent();
event.Set();
});
- event.Wait(webrtc::Event::kForever);
+ event.Wait(Event::kForever);
EXPECT_TRUE(was_invoked_on_background_thread);
}
TEST(ThreadPostTaskTest, InvokesAsynchronously) {
- std::unique_ptr<rtc::Thread> background_thread(rtc::Thread::Create());
+ std::unique_ptr<Thread> background_thread(rtc::Thread::Create());
background_thread->Start();
// The first event ensures that SendSingleMessage() is not blocking this
// thread. The second event ensures that the message is processed.
- webrtc::Event event_set_by_test_thread;
- webrtc::Event event_set_by_background_thread;
+ Event event_set_by_test_thread;
+ Event event_set_by_background_thread;
background_thread->PostTask([&event_set_by_test_thread,
&event_set_by_background_thread] {
WaitAndSetEvent(&event_set_by_test_thread, &event_set_by_background_thread);
});
event_set_by_test_thread.Set();
- event_set_by_background_thread.Wait(webrtc::Event::kForever);
+ event_set_by_background_thread.Wait(Event::kForever);
}
TEST(ThreadPostTaskTest, InvokesInPostedOrder) {
- std::unique_ptr<rtc::Thread> background_thread(rtc::Thread::Create());
+ std::unique_ptr<Thread> background_thread(rtc::Thread::Create());
background_thread->Start();
- webrtc::Event first;
- webrtc::Event second;
- webrtc::Event third;
- webrtc::Event fourth;
+ Event first;
+ Event second;
+ Event third;
+ Event fourth;
background_thread->PostTask(
[&first, &second] { WaitAndSetEvent(&first, &second); });
@@ -789,17 +782,17 @@
// All tasks have been posted before the first one is unblocked.
first.Set();
// Only if the chain is invoked in posted order will the last event be set.
- fourth.Wait(webrtc::Event::kForever);
+ fourth.Wait(Event::kForever);
}
TEST(ThreadPostDelayedTaskTest, InvokesAsynchronously) {
- std::unique_ptr<rtc::Thread> background_thread(rtc::Thread::Create());
+ std::unique_ptr<Thread> background_thread(rtc::Thread::Create());
background_thread->Start();
// The first event ensures that SendSingleMessage() is not blocking this
// thread. The second event ensures that the message is processed.
- webrtc::Event event_set_by_test_thread;
- webrtc::Event event_set_by_background_thread;
+ Event event_set_by_test_thread;
+ Event event_set_by_background_thread;
background_thread->PostDelayedTask(
[&event_set_by_test_thread, &event_set_by_background_thread] {
WaitAndSetEvent(&event_set_by_test_thread,
@@ -807,18 +800,18 @@
},
TimeDelta::Millis(10));
event_set_by_test_thread.Set();
- event_set_by_background_thread.Wait(webrtc::Event::kForever);
+ event_set_by_background_thread.Wait(Event::kForever);
}
TEST(ThreadPostDelayedTaskTest, InvokesInDelayOrder) {
- webrtc::ScopedFakeClock clock;
- std::unique_ptr<rtc::Thread> background_thread(rtc::Thread::Create());
+ ScopedFakeClock clock;
+ std::unique_ptr<Thread> background_thread(rtc::Thread::Create());
background_thread->Start();
- webrtc::Event first;
- webrtc::Event second;
- webrtc::Event third;
- webrtc::Event fourth;
+ Event first;
+ Event second;
+ Event third;
+ Event fourth;
background_thread->PostDelayedTask(
[&third, &fourth] { WaitAndSetEvent(&third, &fourth); },
@@ -838,31 +831,30 @@
}
TEST(ThreadPostDelayedTaskTest, IsCurrentTaskQueue) {
- auto current_tq = webrtc::TaskQueueBase::Current();
+ auto current_tq = TaskQueueBase::Current();
{
- std::unique_ptr<rtc::Thread> thread(rtc::Thread::Create());
+ std::unique_ptr<Thread> thread(rtc::Thread::Create());
thread->WrapCurrent();
- EXPECT_EQ(webrtc::TaskQueueBase::Current(),
- static_cast<webrtc::TaskQueueBase*>(thread.get()));
+ EXPECT_EQ(TaskQueueBase::Current(),
+ static_cast<TaskQueueBase*>(thread.get()));
thread->UnwrapCurrent();
}
- EXPECT_EQ(webrtc::TaskQueueBase::Current(), current_tq);
+ EXPECT_EQ(TaskQueueBase::Current(), current_tq);
}
-class ThreadFactory : public webrtc::TaskQueueFactory {
+class ThreadFactory : public TaskQueueFactory {
public:
- std::unique_ptr<webrtc::TaskQueueBase, webrtc::TaskQueueDeleter>
- CreateTaskQueue(absl::string_view /* name */,
- Priority /*priority*/) const override {
+ std::unique_ptr<TaskQueueBase, TaskQueueDeleter> CreateTaskQueue(
+ absl::string_view /* name */,
+ Priority /*priority*/) const override {
std::unique_ptr<Thread> thread = Thread::Create();
thread->Start();
- return std::unique_ptr<webrtc::TaskQueueBase, webrtc::TaskQueueDeleter>(
- thread.release());
+ return std::unique_ptr<TaskQueueBase, TaskQueueDeleter>(thread.release());
}
};
-std::unique_ptr<webrtc::TaskQueueFactory> CreateDefaultThreadFactory(
- const webrtc::FieldTrialsView*) {
+std::unique_ptr<TaskQueueFactory> CreateDefaultThreadFactory(
+ const FieldTrialsView*) {
return std::make_unique<ThreadFactory>();
}
@@ -873,4 +865,4 @@
::testing::Values(CreateDefaultThreadFactory));
} // namespace
-} // namespace rtc
+} // namespace webrtc
diff --git a/rtc_base/time_utils_unittest.cc b/rtc_base/time_utils_unittest.cc
index fe491ab..06d98f9 100644
--- a/rtc_base/time_utils_unittest.cc
+++ b/rtc_base/time_utils_unittest.cc
@@ -23,7 +23,7 @@
TEST(TimeTest, TimeInMs) {
int64_t ts_earlier = TimeMillis();
- rtc::Thread::SleepMs(100);
+ Thread::SleepMs(100);
int64_t ts_now = TimeMillis();
// Allow for the thread to wakeup ~20ms early.
EXPECT_GE(ts_now, ts_earlier + 80);
@@ -209,7 +209,7 @@
ThreadProcessingFakeClock clock;
SetClockForTesting(&clock);
- std::unique_ptr<rtc::Thread> worker(rtc::Thread::CreateWithSocketServer());
+ std::unique_ptr<Thread> worker(Thread::CreateWithSocketServer());
worker->Start();
// Post an event that won't be executed for 10 seconds.
@@ -221,7 +221,7 @@
// Wait for a bit for the worker thread to be started and enter its socket
// select(). Otherwise this test would be trivial since the worker thread
// would process the event as soon as it was started.
- rtc::Thread::Current()->SleepMs(1000);
+ Thread::Current()->SleepMs(1000);
// Advance the fake clock, expecting the worker thread to wake up
// and dispatch the message instantly.
diff --git a/rtc_base/virtual_socket_server.cc b/rtc_base/virtual_socket_server.cc
index 83682a7..9fad9df 100644
--- a/rtc_base/virtual_socket_server.cc
+++ b/rtc_base/virtual_socket_server.cc
@@ -723,13 +723,13 @@
return new VirtualSocket(this, family, type);
}
-void VirtualSocketServer::SetMessageQueue(rtc::Thread* msg_queue) {
+void VirtualSocketServer::SetMessageQueue(Thread* msg_queue) {
msg_queue_ = msg_queue;
}
bool VirtualSocketServer::Wait(TimeDelta max_wait_duration, bool process_io) {
RTC_DCHECK_RUN_ON(msg_queue_);
- if (stop_on_idle_ && rtc::Thread::Current()->empty()) {
+ if (stop_on_idle_ && Thread::Current()->empty()) {
return false;
}
// Note: we don't need to do anything with `process_io` since we don't have
@@ -760,7 +760,7 @@
fake_clock_->AdvanceTime(TimeDelta::Millis(1));
} else {
// Otherwise, run a normal message loop.
- msg_queue_->ProcessMessages(rtc::Thread::kForever);
+ msg_queue_->ProcessMessages(Thread::kForever);
}
}
stop_on_idle_ = false;
diff --git a/rtc_base/virtual_socket_server.h b/rtc_base/virtual_socket_server.h
index d9ca16d..88f7630 100644
--- a/rtc_base/virtual_socket_server.h
+++ b/rtc_base/virtual_socket_server.h
@@ -284,7 +284,7 @@
VirtualSocket* CreateSocket(int family, int type) override;
// SocketServer:
- void SetMessageQueue(rtc::Thread* queue) override;
+ void SetMessageQueue(Thread* queue) override;
bool Wait(TimeDelta max_wait_duration, bool process_io) override;
void WakeUp() override;
@@ -441,7 +441,7 @@
// Used to implement Wait/WakeUp.
Event wakeup_;
- rtc::Thread* msg_queue_;
+ Thread* msg_queue_;
bool stop_on_idle_;
in_addr next_ipv4_;
in6_addr next_ipv6_;
diff --git a/rtc_base/virtual_socket_unittest.cc b/rtc_base/virtual_socket_unittest.cc
index 81422bb..8b560c6 100644
--- a/rtc_base/virtual_socket_unittest.cc
+++ b/rtc_base/virtual_socket_unittest.cc
@@ -53,7 +53,7 @@
// Sends at a constant rate but with random packet sizes.
struct Sender {
- Sender(Thread* th, webrtc::Socket* s, uint32_t rt)
+ Sender(webrtc::Thread* th, webrtc::Socket* s, uint32_t rt)
: thread(th),
socket(std::make_unique<webrtc::AsyncUDPSocket>(s)),
rate(rt),
@@ -79,7 +79,7 @@
return TimeDelta::Seconds(1) * size / rate;
}
- Thread* thread;
+ webrtc::Thread* thread;
std::unique_ptr<webrtc::AsyncUDPSocket> socket;
rtc::PacketOptions options;
RepeatingTaskHandle periodic;
@@ -90,7 +90,7 @@
};
struct Receiver : public sigslot::has_slots<> {
- Receiver(Thread* th, webrtc::Socket* s, uint32_t bw)
+ Receiver(webrtc::Thread* th, webrtc::Socket* s, uint32_t bw)
: thread(th),
socket(std::make_unique<webrtc::AsyncUDPSocket>(s)),
bandwidth(bw),
@@ -134,7 +134,7 @@
samples += 1;
}
- Thread* thread;
+ webrtc::Thread* thread;
std::unique_ptr<webrtc::AsyncUDPSocket> socket;
uint32_t bandwidth;
RepeatingTaskHandle periodic;
@@ -692,7 +692,7 @@
uint32_t bandwidth = 64 * 1024;
ss_.set_bandwidth(bandwidth);
- Thread* pthMain = Thread::Current();
+ webrtc::Thread* pthMain = webrtc::Thread::Current();
Sender sender(pthMain, send_socket, 80 * 1024);
Receiver receiver(pthMain, recv_socket, bandwidth);
@@ -734,7 +734,7 @@
EXPECT_EQ(recv_socket->GetLocalAddress().family(), initial_addr.family());
ASSERT_EQ(0, send_socket->Connect(recv_socket->GetLocalAddress()));
- Thread* pthMain = Thread::Current();
+ webrtc::Thread* pthMain = webrtc::Thread::Current();
// Avg packet size is 2K, so at 200KB/s for 10s, we should see about
// 1000 packets, which is necessary to get a good distribution.
Sender sender(pthMain, send_socket, 100 * 2 * 1024);
@@ -851,7 +851,7 @@
protected:
webrtc::ScopedFakeClock fake_clock_;
webrtc::VirtualSocketServer ss_;
- AutoSocketServerThread thread_;
+ webrtc::AutoSocketServerThread thread_;
const webrtc::SocketAddress kIPv4AnyAddress;
const webrtc::SocketAddress kIPv6AnyAddress;
};
diff --git a/rtc_tools/data_channel_benchmark/data_channel_benchmark.cc b/rtc_tools/data_channel_benchmark/data_channel_benchmark.cc
index 4847f95..62bd5f6 100644
--- a/rtc_tools/data_channel_benchmark/data_channel_benchmark.cc
+++ b/rtc_tools/data_channel_benchmark/data_channel_benchmark.cc
@@ -74,7 +74,7 @@
class DataChannelServerObserverImpl : public webrtc::DataChannelObserver {
public:
explicit DataChannelServerObserverImpl(webrtc::DataChannelInterface* dc,
- rtc::Thread* signaling_thread)
+ webrtc::Thread* signaling_thread)
: dc_(dc), signaling_thread_(signaling_thread) {}
void OnStateChange() override {
@@ -170,7 +170,7 @@
}
webrtc::DataChannelInterface* const dc_;
- rtc::Thread* const signaling_thread_;
+ webrtc::Thread* const signaling_thread_;
webrtc::Event closed_event_;
webrtc::Event setup_message_event_;
size_t remaining_data_ = 0u;
@@ -227,7 +227,7 @@
bool oneshot = absl::GetFlag(FLAGS_oneshot);
uint16_t port = absl::GetFlag(FLAGS_port);
- auto signaling_thread = rtc::Thread::Create();
+ auto signaling_thread = webrtc::Thread::Create();
signaling_thread->Start();
{
auto factory = webrtc::PeerConnectionClient::CreateDefaultFactory(
@@ -297,7 +297,7 @@
size_t transfer_size = absl::GetFlag(FLAGS_transfer_size) * 1024 * 1024;
size_t packet_size = absl::GetFlag(FLAGS_packet_size);
- auto signaling_thread = rtc::Thread::Create();
+ auto signaling_thread = webrtc::Thread::Create();
signaling_thread->Start();
{
auto factory = webrtc::PeerConnectionClient::CreateDefaultFactory(
diff --git a/rtc_tools/data_channel_benchmark/grpc_signaling.cc b/rtc_tools/data_channel_benchmark/grpc_signaling.cc
index 8db717f..33fb600 100644
--- a/rtc_tools/data_channel_benchmark/grpc_signaling.cc
+++ b/rtc_tools/data_channel_benchmark/grpc_signaling.cc
@@ -175,14 +175,14 @@
if (oneshot_) {
// Request the termination of the server early so we don't serve another
// client in parallel.
- server_stop_thread_ = rtc::Thread::Create();
+ server_stop_thread_ = Thread::Create();
server_stop_thread_->Start();
server_stop_thread_->PostTask([this] { Stop(); });
}
ServerSessionData session(stream);
- auto reading_thread = rtc::Thread::Create();
+ auto reading_thread = Thread::Create();
reading_thread->Start();
reading_thread->PostTask([&session, &stream] {
ProcessMessages<SignalingMessage>(stream, &session);
@@ -202,7 +202,7 @@
bool oneshot_;
std::unique_ptr<grpc::Server> server_;
- std::unique_ptr<rtc::Thread> server_stop_thread_;
+ std::unique_ptr<Thread> server_stop_thread_;
};
class GrpcNegotiationClient : public GrpcSignalingClientInterface {
@@ -227,7 +227,7 @@
stream_ = stub_->Connect(&context_);
session_.SetStream(stream_.get());
- reading_thread_ = rtc::Thread::Create();
+ reading_thread_ = Thread::Create();
reading_thread_->Start();
reading_thread_->PostTask([this] {
ProcessMessages<SignalingMessage>(stream_.get(), &session_);
@@ -241,7 +241,7 @@
private:
std::shared_ptr<grpc::Channel> channel_;
std::unique_ptr<PeerConnectionSignaling::Stub> stub_;
- std::unique_ptr<rtc::Thread> reading_thread_;
+ std::unique_ptr<Thread> reading_thread_;
grpc::ClientContext context_;
std::unique_ptr<
::grpc::ClientReaderWriter<SignalingMessage, SignalingMessage>>
diff --git a/rtc_tools/data_channel_benchmark/peer_connection_client.cc b/rtc_tools/data_channel_benchmark/peer_connection_client.cc
index 4432956..8bafba0 100644
--- a/rtc_tools/data_channel_benchmark/peer_connection_client.cc
+++ b/rtc_tools/data_channel_benchmark/peer_connection_client.cc
@@ -147,7 +147,7 @@
}
rtc::scoped_refptr<PeerConnectionFactoryInterface>
-PeerConnectionClient::CreateDefaultFactory(rtc::Thread* signaling_thread) {
+PeerConnectionClient::CreateDefaultFactory(Thread* signaling_thread) {
auto factory = webrtc::CreatePeerConnectionFactory(
/*network_thread=*/nullptr, /*worker_thread=*/nullptr,
/*signaling_thread*/ signaling_thread,
diff --git a/rtc_tools/data_channel_benchmark/peer_connection_client.h b/rtc_tools/data_channel_benchmark/peer_connection_client.h
index c1842ef5..a72f837 100644
--- a/rtc_tools/data_channel_benchmark/peer_connection_client.h
+++ b/rtc_tools/data_channel_benchmark/peer_connection_client.h
@@ -67,7 +67,7 @@
// Creates a default PeerConnectionFactory object.
static rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface>
- CreateDefaultFactory(rtc::Thread* signaling_thread);
+ CreateDefaultFactory(Thread* signaling_thread);
private:
void AddIceCandidate(
diff --git a/rtc_tools/network_tester/server.cc b/rtc_tools/network_tester/server.cc
index 781b8b0..1c88ed5 100644
--- a/rtc_tools/network_tester/server.cc
+++ b/rtc_tools/network_tester/server.cc
@@ -13,7 +13,7 @@
#include "rtc_tools/network_tester/test_controller.h"
int main(int /*argn*/, char* /*argv*/[]) {
- rtc::Thread main_thread(std::make_unique<webrtc::NullSocketServer>());
+ webrtc::Thread main_thread(std::make_unique<webrtc::NullSocketServer>());
webrtc::TestController server(9090, 9090, "server_config.dat",
"server_packet_log.dat");
while (!server.IsTestDone()) {
diff --git a/rtc_tools/network_tester/test_controller.cc b/rtc_tools/network_tester/test_controller.cc
index f9e2ad6..d64551c 100644
--- a/rtc_tools/network_tester/test_controller.cc
+++ b/rtc_tools/network_tester/test_controller.cc
@@ -28,8 +28,7 @@
const std::string& config_file_path,
const std::string& log_file_path)
: socket_server_(rtc::CreateDefaultSocketServer()),
- packet_sender_thread_(
- std::make_unique<rtc::Thread>(socket_server_.get())),
+ packet_sender_thread_(std::make_unique<Thread>(socket_server_.get())),
socket_factory_(socket_server_.get()),
config_file_path_(config_file_path),
packet_logger_(log_file_path),
diff --git a/rtc_tools/network_tester/test_controller.h b/rtc_tools/network_tester/test_controller.h
index e18c8a0..484f78a 100644
--- a/rtc_tools/network_tester/test_controller.h
+++ b/rtc_tools/network_tester/test_controller.h
@@ -68,7 +68,7 @@
const rtc::ReceivedPacket& received_packet);
RTC_NO_UNIQUE_ADDRESS SequenceChecker test_controller_thread_checker_;
std::unique_ptr<rtc::SocketServer> socket_server_;
- std::unique_ptr<rtc::Thread> packet_sender_thread_;
+ std::unique_ptr<Thread> packet_sender_thread_;
BasicPacketSocketFactory socket_factory_
RTC_GUARDED_BY(packet_sender_thread_);
const std::string config_file_path_;
diff --git a/rtc_tools/rtp_generator/rtp_generator.cc b/rtc_tools/rtp_generator/rtp_generator.cc
index 5ab322d..935c38f 100644
--- a/rtc_tools/rtp_generator/rtp_generator.cc
+++ b/rtc_tools/rtp_generator/rtp_generator.cc
@@ -320,7 +320,7 @@
min_wait_time = std::min(min_wait_time, end_ms - current_time);
}
}
- rtc::Thread::Current()->SleepMs(min_wait_time);
+ Thread::Current()->SleepMs(min_wait_time);
} while (current_time < max_end_ms);
}
diff --git a/rtc_tools/video_replay.cc b/rtc_tools/video_replay.cc
index 18719d8..f0ecd59 100644
--- a/rtc_tools/video_replay.cc
+++ b/rtc_tools/video_replay.cc
@@ -726,7 +726,7 @@
RTC_CHECK(ValidateInputFilenameNotEmpty(absl::GetFlag(FLAGS_input_file)));
RTC_CHECK_GE(absl::GetFlag(FLAGS_extend_run_time_duration), 0);
- rtc::ThreadManager::Instance()->WrapCurrentThread();
+ webrtc::ThreadManager::Instance()->WrapCurrentThread();
webrtc::test::RunTest(webrtc::RtpReplay);
return 0;
}
diff --git a/sdk/android/native_api/peerconnection/peer_connection_factory.cc b/sdk/android/native_api/peerconnection/peer_connection_factory.cc
index 3c2abee..9ed9896 100644
--- a/sdk/android/native_api/peerconnection/peer_connection_factory.cc
+++ b/sdk/android/native_api/peerconnection/peer_connection_factory.cc
@@ -22,9 +22,9 @@
JNIEnv* jni,
rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> pcf,
std::unique_ptr<SocketFactory> socket_factory,
- std::unique_ptr<rtc::Thread> network_thread,
- std::unique_ptr<rtc::Thread> worker_thread,
- std::unique_ptr<rtc::Thread> signaling_thread) {
+ std::unique_ptr<Thread> network_thread,
+ std::unique_ptr<Thread> worker_thread,
+ std::unique_ptr<Thread> signaling_thread) {
return webrtc::jni::NativeToJavaPeerConnectionFactory(
jni, pcf, std::move(socket_factory), std::move(network_thread),
std::move(worker_thread), std::move(signaling_thread));
diff --git a/sdk/android/native_api/peerconnection/peer_connection_factory.h b/sdk/android/native_api/peerconnection/peer_connection_factory.h
index 4994aaa..6ae468b 100644
--- a/sdk/android/native_api/peerconnection/peer_connection_factory.h
+++ b/sdk/android/native_api/peerconnection/peer_connection_factory.h
@@ -25,9 +25,9 @@
JNIEnv* jni,
rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> pcf,
std::unique_ptr<SocketFactory> socket_factory,
- std::unique_ptr<rtc::Thread> network_thread,
- std::unique_ptr<rtc::Thread> worker_thread,
- std::unique_ptr<rtc::Thread> signaling_thread);
+ std::unique_ptr<Thread> network_thread,
+ std::unique_ptr<Thread> worker_thread,
+ std::unique_ptr<Thread> signaling_thread);
} // namespace webrtc
diff --git a/sdk/android/native_api/video/video_source.cc b/sdk/android/native_api/video/video_source.cc
index 6f66bd1..b7e83a5 100644
--- a/sdk/android/native_api/video/video_source.cc
+++ b/sdk/android/native_api/video/video_source.cc
@@ -24,7 +24,7 @@
class JavaVideoTrackSourceImpl : public JavaVideoTrackSourceInterface {
public:
JavaVideoTrackSourceImpl(JNIEnv* env,
- rtc::Thread* signaling_thread,
+ Thread* signaling_thread,
bool is_screencast,
bool align_timestamps)
: android_video_track_source_(
@@ -105,7 +105,7 @@
rtc::scoped_refptr<JavaVideoTrackSourceInterface> CreateJavaVideoSource(
JNIEnv* jni,
- rtc::Thread* signaling_thread,
+ Thread* signaling_thread,
bool is_screencast,
bool align_timestamps) {
return rtc::make_ref_counted<JavaVideoTrackSourceImpl>(
diff --git a/sdk/android/native_api/video/video_source.h b/sdk/android/native_api/video/video_source.h
index d46f3e8..91b4b0d 100644
--- a/sdk/android/native_api/video/video_source.h
+++ b/sdk/android/native_api/video/video_source.h
@@ -32,7 +32,7 @@
// Creates an instance of JavaVideoTrackSourceInterface,
rtc::scoped_refptr<JavaVideoTrackSourceInterface> CreateJavaVideoSource(
JNIEnv* env,
- rtc::Thread* signaling_thread,
+ Thread* signaling_thread,
bool is_screencast,
bool align_timestamps);
diff --git a/sdk/android/src/jni/android_network_monitor.cc b/sdk/android/src/jni/android_network_monitor.cc
index 8fc645d7..82762a0 100644
--- a/sdk/android/src/jni/android_network_monitor.cc
+++ b/sdk/android/src/jni/android_network_monitor.cc
@@ -231,7 +231,7 @@
: android_sdk_int_(Java_NetworkMonitor_androidSdkInt(env)),
j_application_context_(env, j_application_context),
j_network_monitor_(env, Java_NetworkMonitor_getInstance(env)),
- network_thread_(rtc::Thread::Current()),
+ network_thread_(Thread::Current()),
field_trials_(field_trials) {}
AndroidNetworkMonitor::~AndroidNetworkMonitor() {
@@ -295,7 +295,7 @@
// The implementation is largely taken from UDPSocketPosix::BindToNetwork in
// https://cs.chromium.org/chromium/src/net/udp/udp_socket_posix.cc
-rtc::NetworkBindingResult AndroidNetworkMonitor::BindSocketToNetwork(
+NetworkBindingResult AndroidNetworkMonitor::BindSocketToNetwork(
int socket_fd,
const IPAddress& address,
absl::string_view if_name) {
@@ -312,7 +312,7 @@
<< "BindSocketToNetwork is not supported on this platform "
"(Android SDK: "
<< android_sdk_int_ << ")";
- return rtc::NetworkBindingResult::NOT_IMPLEMENTED;
+ return NetworkBindingResult::NOT_IMPLEMENTED;
}
std::optional<NetworkHandle> network_handle =
@@ -321,14 +321,14 @@
RTC_LOG(LS_WARNING)
<< "BindSocketToNetwork unable to find network handle for"
<< " addr: " << address.ToSensitiveString() << " ifname: " << if_name;
- return rtc::NetworkBindingResult::ADDRESS_NOT_FOUND;
+ return NetworkBindingResult::ADDRESS_NOT_FOUND;
}
if (*network_handle == 0 /* NETWORK_UNSPECIFIED */) {
RTC_LOG(LS_WARNING) << "BindSocketToNetwork 0 network handle for"
<< " addr: " << address.ToSensitiveString()
<< " ifname: " << if_name;
- return rtc::NetworkBindingResult::NOT_IMPLEMENTED;
+ return NetworkBindingResult::NOT_IMPLEMENTED;
}
int rv = 0;
@@ -348,7 +348,7 @@
if (lib == nullptr) {
RTC_LOG(LS_ERROR) << "Library " << android_native_lib_path
<< " not found!";
- return rtc::NetworkBindingResult::NOT_IMPLEMENTED;
+ return NetworkBindingResult::NOT_IMPLEMENTED;
}
marshmallowSetNetworkForSocket =
reinterpret_cast<MarshmallowSetNetworkForSocket>(
@@ -356,7 +356,7 @@
}
if (!marshmallowSetNetworkForSocket) {
RTC_LOG(LS_ERROR) << "Symbol marshmallowSetNetworkForSocket is not found";
- return rtc::NetworkBindingResult::NOT_IMPLEMENTED;
+ return NetworkBindingResult::NOT_IMPLEMENTED;
}
rv = marshmallowSetNetworkForSocket(*network_handle, socket_fd);
} else {
@@ -377,7 +377,7 @@
void* lib = dlopen(net_library_path.c_str(), RTLD_NOW | RTLD_NOLOAD);
if (lib == nullptr) {
RTC_LOG(LS_ERROR) << "Library " << net_library_path << " not found!";
- return rtc::NetworkBindingResult::NOT_IMPLEMENTED;
+ return NetworkBindingResult::NOT_IMPLEMENTED;
}
lollipopSetNetworkForSocket =
reinterpret_cast<LollipopSetNetworkForSocket>(
@@ -385,7 +385,7 @@
}
if (!lollipopSetNetworkForSocket) {
RTC_LOG(LS_ERROR) << "Symbol lollipopSetNetworkForSocket is not found ";
- return rtc::NetworkBindingResult::NOT_IMPLEMENTED;
+ return NetworkBindingResult::NOT_IMPLEMENTED;
}
rv = lollipopSetNetworkForSocket(*network_handle, socket_fd);
}
@@ -397,17 +397,17 @@
RTC_LOG(LS_VERBOSE) << "BindSocketToNetwork bound network handle for"
<< " addr: " << address.ToSensitiveString()
<< " ifname: " << if_name;
- return rtc::NetworkBindingResult::SUCCESS;
+ return NetworkBindingResult::SUCCESS;
}
RTC_LOG(LS_WARNING) << "BindSocketToNetwork got error: " << rv
<< " addr: " << address.ToSensitiveString()
<< " ifname: " << if_name;
if (rv == ENONET) {
- return rtc::NetworkBindingResult::NETWORK_CHANGED;
+ return NetworkBindingResult::NETWORK_CHANGED;
}
- return rtc::NetworkBindingResult::FAILURE;
+ return NetworkBindingResult::FAILURE;
}
void AndroidNetworkMonitor::OnNetworkConnected_n(
@@ -550,11 +550,11 @@
void AndroidNetworkMonitor::OnNetworkPreference_n(
NetworkType type,
- rtc::NetworkPreference preference) {
+ NetworkPreference preference) {
RTC_DCHECK_RUN_ON(network_thread_);
RTC_LOG(LS_INFO) << "Android network monitor preference for "
<< NetworkTypeToString(type) << " changed to "
- << rtc::NetworkPreferenceToString(preference);
+ << NetworkPreferenceToString(preference);
auto adapter_type = AdapterTypeFromNetworkType(type, surface_cellular_types_);
network_preference_by_adapter_type_[adapter_type] = preference;
InvokeNetworksChangedCallback();
@@ -580,8 +580,8 @@
}
}
-rtc::NetworkMonitorInterface::InterfaceInfo
-AndroidNetworkMonitor::GetInterfaceInfo(absl::string_view if_name) {
+NetworkMonitorInterface::InterfaceInfo AndroidNetworkMonitor::GetInterfaceInfo(
+ absl::string_view if_name) {
RTC_DCHECK_RUN_ON(network_thread_);
auto handle = FindNetworkHandleFromIfname(if_name);
if (!handle) {
@@ -614,12 +614,12 @@
};
}
-rtc::NetworkPreference AndroidNetworkMonitor::GetNetworkPreference(
+NetworkPreference AndroidNetworkMonitor::GetNetworkPreference(
AdapterType adapter_type) const {
RTC_DCHECK_RUN_ON(network_thread_);
auto preference_iter = network_preference_by_adapter_type_.find(adapter_type);
if (preference_iter == network_preference_by_adapter_type_.end()) {
- return rtc::NetworkPreference::NEUTRAL;
+ return NetworkPreference::NEUTRAL;
}
return preference_iter->second;
@@ -635,8 +635,7 @@
AndroidNetworkMonitorFactory::~AndroidNetworkMonitorFactory() = default;
-rtc::NetworkMonitorInterface*
-AndroidNetworkMonitorFactory::CreateNetworkMonitor(
+NetworkMonitorInterface* AndroidNetworkMonitorFactory::CreateNetworkMonitor(
const FieldTrialsView& field_trials) {
return new AndroidNetworkMonitor(AttachCurrentThreadIfNeeded(),
j_application_context_, field_trials);
@@ -689,8 +688,7 @@
const JavaRef<jobject>& j_connection_type,
jint jpreference) {
NetworkType type = GetNetworkTypeFromJava(env, j_connection_type);
- rtc::NetworkPreference preference =
- static_cast<rtc::NetworkPreference>(jpreference);
+ NetworkPreference preference = static_cast<NetworkPreference>(jpreference);
network_thread_->PostTask(SafeTask(safety_flag_, [this, type, preference] {
OnNetworkPreference_n(type, preference);
diff --git a/sdk/android/src/jni/android_network_monitor.h b/sdk/android/src/jni/android_network_monitor.h
index a0cbb69..da405e1 100644
--- a/sdk/android/src/jni/android_network_monitor.h
+++ b/sdk/android/src/jni/android_network_monitor.h
@@ -71,7 +71,7 @@
std::string ToString() const;
};
-class AndroidNetworkMonitor : public rtc::NetworkMonitorInterface {
+class AndroidNetworkMonitor : public NetworkMonitorInterface {
public:
AndroidNetworkMonitor(JNIEnv* env,
const JavaRef<jobject>& j_application_context,
@@ -88,10 +88,9 @@
// Only Android returns true.
virtual bool SupportsBindSocketToNetwork() const override { return true; }
- rtc::NetworkBindingResult BindSocketToNetwork(
- int socket_fd,
- const IPAddress& address,
- absl::string_view if_name) override;
+ NetworkBindingResult BindSocketToNetwork(int socket_fd,
+ const IPAddress& address,
+ absl::string_view if_name) override;
InterfaceInfo GetInterfaceInfo(absl::string_view if_name) override;
@@ -125,17 +124,16 @@
private:
void reset();
void OnNetworkDisconnected_n(NetworkHandle network_handle);
- void OnNetworkPreference_n(NetworkType type,
- rtc::NetworkPreference preference);
+ void OnNetworkPreference_n(NetworkType type, NetworkPreference preference);
- rtc::NetworkPreference GetNetworkPreference(AdapterType) const;
+ NetworkPreference GetNetworkPreference(AdapterType) const;
std::optional<NetworkHandle> FindNetworkHandleFromIfname(
absl::string_view ifname) const;
const int android_sdk_int_;
ScopedJavaGlobalRef<jobject> j_application_context_;
ScopedJavaGlobalRef<jobject> j_network_monitor_;
- rtc::Thread* const network_thread_;
+ Thread* const network_thread_;
bool started_ RTC_GUARDED_BY(network_thread_) = false;
std::map<std::string, NetworkHandle, rtc::AbslStringViewCmp>
network_handle_by_if_name_ RTC_GUARDED_BY(network_thread_);
@@ -143,8 +141,8 @@
RTC_GUARDED_BY(network_thread_);
std::map<NetworkHandle, NetworkInformation> network_info_by_handle_
RTC_GUARDED_BY(network_thread_);
- std::map<AdapterType, rtc::NetworkPreference>
- network_preference_by_adapter_type_ RTC_GUARDED_BY(network_thread_);
+ std::map<AdapterType, NetworkPreference> network_preference_by_adapter_type_
+ RTC_GUARDED_BY(network_thread_);
bool find_network_handle_without_ipv6_temporary_part_
RTC_GUARDED_BY(network_thread_) = false;
bool surface_cellular_types_ RTC_GUARDED_BY(network_thread_) = false;
@@ -179,7 +177,7 @@
~AndroidNetworkMonitorFactory() override;
- rtc::NetworkMonitorInterface* CreateNetworkMonitor(
+ NetworkMonitorInterface* CreateNetworkMonitor(
const FieldTrialsView& field_trials) override;
private:
diff --git a/sdk/android/src/jni/android_video_track_source.cc b/sdk/android/src/jni/android_video_track_source.cc
index a5646eb..9866ae8 100644
--- a/sdk/android/src/jni/android_video_track_source.cc
+++ b/sdk/android/src/jni/android_video_track_source.cc
@@ -38,7 +38,7 @@
} // namespace
-AndroidVideoTrackSource::AndroidVideoTrackSource(rtc::Thread* signaling_thread,
+AndroidVideoTrackSource::AndroidVideoTrackSource(Thread* signaling_thread,
JNIEnv* jni,
bool is_screencast,
bool align_timestamps)
@@ -61,7 +61,7 @@
void AndroidVideoTrackSource::SetState(JNIEnv* env, jboolean j_is_live) {
const SourceState state = j_is_live ? kLive : kEnded;
if (state_.exchange(state) != state) {
- if (rtc::Thread::Current() == signaling_thread_) {
+ if (Thread::Current() == signaling_thread_) {
FireOnChanged();
} else {
signaling_thread_->PostTask([this] { FireOnChanged(); });
diff --git a/sdk/android/src/jni/android_video_track_source.h b/sdk/android/src/jni/android_video_track_source.h
index 12a599b..478598b 100644
--- a/sdk/android/src/jni/android_video_track_source.h
+++ b/sdk/android/src/jni/android_video_track_source.h
@@ -30,7 +30,7 @@
// order to onFrameCaptured().
class AndroidVideoTrackSource : public rtc::AdaptedVideoTrackSource {
public:
- AndroidVideoTrackSource(rtc::Thread* signaling_thread,
+ AndroidVideoTrackSource(Thread* signaling_thread,
JNIEnv* jni,
bool is_screencast,
bool align_timestamps);
@@ -84,7 +84,7 @@
void SetIsScreencast(JNIEnv* env, jboolean j_is_screencast);
private:
- rtc::Thread* signaling_thread_;
+ Thread* signaling_thread_;
std::atomic<SourceState> state_;
std::atomic<bool> is_screencast_;
TimestampAligner timestamp_aligner_;
diff --git a/sdk/android/src/jni/pc/owned_factory_and_threads.cc b/sdk/android/src/jni/pc/owned_factory_and_threads.cc
index e4e379c..9c945e0 100644
--- a/sdk/android/src/jni/pc/owned_factory_and_threads.cc
+++ b/sdk/android/src/jni/pc/owned_factory_and_threads.cc
@@ -17,9 +17,9 @@
OwnedFactoryAndThreads::OwnedFactoryAndThreads(
std::unique_ptr<SocketFactory> socket_factory,
- std::unique_ptr<rtc::Thread> network_thread,
- std::unique_ptr<rtc::Thread> worker_thread,
- std::unique_ptr<rtc::Thread> signaling_thread,
+ std::unique_ptr<Thread> network_thread,
+ std::unique_ptr<Thread> worker_thread,
+ std::unique_ptr<Thread> signaling_thread,
const rtc::scoped_refptr<PeerConnectionFactoryInterface>& factory)
: socket_factory_(std::move(socket_factory)),
network_thread_(std::move(network_thread)),
diff --git a/sdk/android/src/jni/pc/owned_factory_and_threads.h b/sdk/android/src/jni/pc/owned_factory_and_threads.h
index 83d386c..7b44971 100644
--- a/sdk/android/src/jni/pc/owned_factory_and_threads.h
+++ b/sdk/android/src/jni/pc/owned_factory_and_threads.h
@@ -32,26 +32,26 @@
public:
OwnedFactoryAndThreads(
std::unique_ptr<SocketFactory> socket_factory,
- std::unique_ptr<rtc::Thread> network_thread,
- std::unique_ptr<rtc::Thread> worker_thread,
- std::unique_ptr<rtc::Thread> signaling_thread,
+ std::unique_ptr<Thread> network_thread,
+ std::unique_ptr<Thread> worker_thread,
+ std::unique_ptr<Thread> signaling_thread,
const rtc::scoped_refptr<PeerConnectionFactoryInterface>& factory);
~OwnedFactoryAndThreads() = default;
PeerConnectionFactoryInterface* factory() { return factory_.get(); }
SocketFactory* socket_factory() { return socket_factory_.get(); }
- rtc::Thread* network_thread() { return network_thread_.get(); }
- rtc::Thread* signaling_thread() { return signaling_thread_.get(); }
- rtc::Thread* worker_thread() { return worker_thread_.get(); }
+ Thread* network_thread() { return network_thread_.get(); }
+ Thread* signaling_thread() { return signaling_thread_.get(); }
+ Thread* worker_thread() { return worker_thread_.get(); }
private:
// Usually implemented by the SocketServer associated with the network thread,
// so needs to outlive the network thread.
const std::unique_ptr<SocketFactory> socket_factory_;
- const std::unique_ptr<rtc::Thread> network_thread_;
- const std::unique_ptr<rtc::Thread> worker_thread_;
- const std::unique_ptr<rtc::Thread> signaling_thread_;
+ const std::unique_ptr<Thread> network_thread_;
+ const std::unique_ptr<Thread> worker_thread_;
+ const std::unique_ptr<Thread> signaling_thread_;
const rtc::scoped_refptr<PeerConnectionFactoryInterface> factory_;
};
diff --git a/sdk/android/src/jni/pc/peer_connection_factory.cc b/sdk/android/src/jni/pc/peer_connection_factory.cc
index c5ead55..bc00d90 100644
--- a/sdk/android/src/jni/pc/peer_connection_factory.cc
+++ b/sdk/android/src/jni/pc/peer_connection_factory.cc
@@ -67,7 +67,7 @@
// Post a message on the given thread that will call the Java method on the
// given Java object.
void PostJavaCallback(JNIEnv* env,
- rtc::Thread* queue,
+ Thread* queue,
const jni_zero::JavaRef<jobject>& j_object,
JavaMethodPointer java_method_pointer) {
jni_zero::ScopedJavaGlobalRef<jobject> object(env, j_object);
@@ -115,9 +115,9 @@
JNIEnv* env,
rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> pcf,
std::unique_ptr<SocketFactory> socket_factory,
- std::unique_ptr<rtc::Thread> network_thread,
- std::unique_ptr<rtc::Thread> worker_thread,
- std::unique_ptr<rtc::Thread> signaling_thread) {
+ std::unique_ptr<Thread> network_thread,
+ std::unique_ptr<Thread> worker_thread,
+ std::unique_ptr<Thread> signaling_thread) {
OwnedFactoryAndThreads* owned_factory = new OwnedFactoryAndThreads(
std::move(socket_factory), std::move(network_thread),
std::move(worker_thread), std::move(signaling_thread), pcf);
@@ -155,9 +155,9 @@
JNIEnv* jni,
rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> pcf,
std::unique_ptr<SocketFactory> socket_factory,
- std::unique_ptr<rtc::Thread> network_thread,
- std::unique_ptr<rtc::Thread> worker_thread,
- std::unique_ptr<rtc::Thread> signaling_thread) {
+ std::unique_ptr<Thread> network_thread,
+ std::unique_ptr<Thread> worker_thread,
+ std::unique_ptr<Thread> signaling_thread) {
return NativeToScopedJavaPeerConnectionFactory(
jni, pcf, std::move(socket_factory), std::move(network_thread),
std::move(worker_thread), std::move(signaling_thread))
@@ -247,18 +247,18 @@
// created. Since the semantics around when auto-wrapping happens in
// webrtc/rtc_base/ are convoluted, we simply wrap here to avoid having to
// think about ramifications of auto-wrapping there.
- rtc::ThreadManager::Instance()->WrapCurrentThread();
+ ThreadManager::Instance()->WrapCurrentThread();
auto socket_server = std::make_unique<PhysicalSocketServer>();
- auto network_thread = std::make_unique<rtc::Thread>(socket_server.get());
+ auto network_thread = std::make_unique<Thread>(socket_server.get());
network_thread->SetName("network_thread", nullptr);
RTC_CHECK(network_thread->Start()) << "Failed to start thread";
- std::unique_ptr<rtc::Thread> worker_thread = rtc::Thread::Create();
+ std::unique_ptr<Thread> worker_thread = Thread::Create();
worker_thread->SetName("worker_thread", nullptr);
RTC_CHECK(worker_thread->Start()) << "Failed to start thread";
- std::unique_ptr<rtc::Thread> signaling_thread = rtc::Thread::Create();
+ std::unique_ptr<Thread> signaling_thread = Thread::Create();
signaling_thread->SetName("signaling_thread", NULL);
RTC_CHECK(signaling_thread->Start()) << "Failed to start thread";
diff --git a/sdk/android/src/jni/pc/peer_connection_factory.h b/sdk/android/src/jni/pc/peer_connection_factory.h
index 211b0dd..7f7a6c7 100644
--- a/sdk/android/src/jni/pc/peer_connection_factory.h
+++ b/sdk/android/src/jni/pc/peer_connection_factory.h
@@ -24,9 +24,9 @@
JNIEnv* jni,
rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> pcf,
std::unique_ptr<SocketFactory> socket_factory,
- std::unique_ptr<rtc::Thread> network_thread,
- std::unique_ptr<rtc::Thread> worker_thread,
- std::unique_ptr<rtc::Thread> signaling_thread);
+ std::unique_ptr<Thread> network_thread,
+ std::unique_ptr<Thread> worker_thread,
+ std::unique_ptr<Thread> signaling_thread);
} // namespace jni
} // namespace webrtc
diff --git a/sdk/android/src/jni/pc/video.cc b/sdk/android/src/jni/pc/video.cc
index b955dbb..25447fb 100644
--- a/sdk/android/src/jni/pc/video.cc
+++ b/sdk/android/src/jni/pc/video.cc
@@ -42,8 +42,8 @@
}
void* CreateVideoSource(JNIEnv* env,
- rtc::Thread* signaling_thread,
- rtc::Thread* worker_thread,
+ Thread* signaling_thread,
+ Thread* worker_thread,
jboolean is_screencast,
jboolean align_timestamps) {
auto source = rtc::make_ref_counted<AndroidVideoTrackSource>(
diff --git a/sdk/android/src/jni/pc/video.h b/sdk/android/src/jni/pc/video.h
index 32bc640..1b8b5de 100644
--- a/sdk/android/src/jni/pc/video.h
+++ b/sdk/android/src/jni/pc/video.h
@@ -34,8 +34,8 @@
const JavaRef<jobject>& j_decoder_factory);
void* CreateVideoSource(JNIEnv* env,
- rtc::Thread* signaling_thread,
- rtc::Thread* worker_thread,
+ Thread* signaling_thread,
+ Thread* worker_thread,
jboolean is_screencast,
jboolean align_timestamps);
diff --git a/sdk/android/src/jni/video_decoder_wrapper.h b/sdk/android/src/jni/video_decoder_wrapper.h
index ff2ae29..4829890 100644
--- a/sdk/android/src/jni/video_decoder_wrapper.h
+++ b/sdk/android/src/jni/video_decoder_wrapper.h
@@ -90,7 +90,7 @@
SequenceChecker decoder_thread_checker_;
// Callbacks must be executed sequentially on an arbitrary thread. We do not
// own this thread so a thread checker cannot be used.
- rtc::RaceChecker callback_race_checker_;
+ RaceChecker callback_race_checker_;
// Initialized on Configure and immutable after that.
VideoDecoder::Settings decoder_settings_
diff --git a/sdk/objc/api/peerconnection/RTCVideoSource+Private.h b/sdk/objc/api/peerconnection/RTCVideoSource+Private.h
index 7278506..26f5b8a 100644
--- a/sdk/objc/api/peerconnection/RTCVideoSource+Private.h
+++ b/sdk/objc/api/peerconnection/RTCVideoSource+Private.h
@@ -42,13 +42,13 @@
- (instancetype)initWithFactory:
(RTC_OBJC_TYPE(RTCPeerConnectionFactory) *)factory
- signalingThread:(rtc::Thread *)signalingThread
- workerThread:(rtc::Thread *)workerThread;
+ signalingThread:(webrtc::Thread *)signalingThread
+ workerThread:(webrtc::Thread *)workerThread;
- (instancetype)initWithFactory:
(RTC_OBJC_TYPE(RTCPeerConnectionFactory) *)factory
- signalingThread:(rtc::Thread *)signalingThread
- workerThread:(rtc::Thread *)workerThread
+ signalingThread:(webrtc::Thread *)signalingThread
+ workerThread:(webrtc::Thread *)workerThread
isScreenCast:(BOOL)isScreenCast;
@end
diff --git a/sdk/objc/api/peerconnection/RTCVideoSource.mm b/sdk/objc/api/peerconnection/RTCVideoSource.mm
index 5099b23..3107e06 100644
--- a/sdk/objc/api/peerconnection/RTCVideoSource.mm
+++ b/sdk/objc/api/peerconnection/RTCVideoSource.mm
@@ -54,8 +54,8 @@
- (instancetype)initWithFactory:
(RTC_OBJC_TYPE(RTCPeerConnectionFactory) *)factory
- signalingThread:(rtc::Thread *)signalingThread
- workerThread:(rtc::Thread *)workerThread {
+ signalingThread:(webrtc::Thread *)signalingThread
+ workerThread:(webrtc::Thread *)workerThread {
return [self initWithFactory:factory
signalingThread:signalingThread
workerThread:workerThread
@@ -64,8 +64,8 @@
- (instancetype)initWithFactory:
(RTC_OBJC_TYPE(RTCPeerConnectionFactory) *)factory
- signalingThread:(rtc::Thread *)signalingThread
- workerThread:(rtc::Thread *)workerThread
+ signalingThread:(webrtc::Thread *)signalingThread
+ workerThread:(webrtc::Thread *)workerThread
isScreenCast:(BOOL)isScreenCast {
rtc::scoped_refptr<webrtc::ObjCVideoTrackSource> objCVideoTrackSource =
rtc::make_ref_counted<webrtc::ObjCVideoTrackSource>(isScreenCast);
diff --git a/sdk/objc/native/src/objc_audio_device.h b/sdk/objc/native/src/objc_audio_device.h
index 23368c9..1bbe070 100644
--- a/sdk/objc/native/src/objc_audio_device.h
+++ b/sdk/objc/native/src/objc_audio_device.h
@@ -245,7 +245,7 @@
std::atomic<int> cached_recording_delay_ms_ = 0;
// Thread that is initialized audio device module.
- rtc::Thread* thread_;
+ Thread* thread_;
// Ensures that methods are called from the same thread as this object is
// initialized on.
diff --git a/sdk/objc/native/src/objc_audio_device.mm b/sdk/objc/native/src/objc_audio_device.mm
index 5b51095..c6ea609 100644
--- a/sdk/objc/native/src/objc_audio_device.mm
+++ b/sdk/objc/native/src/objc_audio_device.mm
@@ -81,7 +81,7 @@
io_playout_thread_checker_.Detach();
io_record_thread_checker_.Detach();
- thread_ = rtc::Thread::Current();
+ thread_ = Thread::Current();
audio_device_buffer_.reset(
new webrtc::AudioDeviceBuffer(task_queue_factory_.get()));
diff --git a/sdk/objc/native/src/objc_audio_device_delegate.h b/sdk/objc/native/src/objc_audio_device_delegate.h
index 38c9374..0fc6a59 100644
--- a/sdk/objc/native/src/objc_audio_device_delegate.h
+++ b/sdk/objc/native/src/objc_audio_device_delegate.h
@@ -29,7 +29,7 @@
initWithAudioDeviceModule:
(rtc::scoped_refptr<webrtc::objc_adm::ObjCAudioDeviceModule>)
audioDeviceModule
- audioDeviceThread:(rtc::Thread*)thread;
+ audioDeviceThread:(webrtc::Thread*)thread;
- (void)resetAudioDeviceModule;
diff --git a/test/network/emulated_network_manager.cc b/test/network/emulated_network_manager.cc
index b1b6867..ae34132 100644
--- a/test/network/emulated_network_manager.cc
+++ b/test/network/emulated_network_manager.cc
@@ -35,7 +35,7 @@
: public rtc::NetworkManagerBase {
public:
explicit NetworkManagerImpl(
- absl::Nonnull<rtc::Thread*> network_thread,
+ absl::Nonnull<Thread*> network_thread,
absl::Nonnull<EndpointsContainer*> endpoints_container)
: network_thread_(network_thread),
endpoints_container_(endpoints_container) {}
@@ -52,7 +52,7 @@
}
private:
- const absl::Nonnull<rtc::Thread*> network_thread_;
+ const absl::Nonnull<Thread*> network_thread_;
const absl::Nonnull<const EndpointsContainer*> endpoints_container_;
bool sent_first_update_ RTC_GUARDED_BY(network_thread_) = false;
int start_count_ RTC_GUARDED_BY(network_thread_) = 0;
diff --git a/test/network/emulated_network_manager.h b/test/network/emulated_network_manager.h
index 37ad8de..261714d 100644
--- a/test/network/emulated_network_manager.h
+++ b/test/network/emulated_network_manager.h
@@ -38,7 +38,7 @@
void UpdateNetworks();
- absl::Nonnull<rtc::Thread*> network_thread() override {
+ absl::Nonnull<Thread*> network_thread() override {
return network_thread_.get();
}
absl::Nonnull<rtc::SocketFactory*> socket_factory() override {
@@ -62,7 +62,7 @@
// Socket server is owned by the `network_thread_'
const absl::Nonnull<rtc::SocketServer*> socket_server_;
- const absl::Nonnull<std::unique_ptr<rtc::Thread>> network_thread_;
+ const absl::Nonnull<std::unique_ptr<Thread>> network_thread_;
absl::Nullable<std::unique_ptr<NetworkManagerImpl>> network_manager_;
// Keep pointer to the network manager when it is extracted to be injected
diff --git a/test/network/emulated_turn_server.cc b/test/network/emulated_turn_server.cc
index e2a6ad5..fe0430a 100644
--- a/test/network/emulated_turn_server.cc
+++ b/test/network/emulated_turn_server.cc
@@ -132,7 +132,7 @@
};
EmulatedTURNServer::EmulatedTURNServer(const EmulatedTURNServerConfig& config,
- std::unique_ptr<rtc::Thread> thread,
+ std::unique_ptr<Thread> thread,
EmulatedEndpoint* client,
EmulatedEndpoint* peer)
: thread_(std::move(thread)), client_(client), peer_(peer) {
diff --git a/test/network/emulated_turn_server.h b/test/network/emulated_turn_server.h
index dc77cd2..36a526a 100644
--- a/test/network/emulated_turn_server.h
+++ b/test/network/emulated_turn_server.h
@@ -47,7 +47,7 @@
// `thread` is a thread that will be used to run cricket::TurnServer
// that expects all calls to be made from a single thread.
EmulatedTURNServer(const EmulatedTURNServerConfig& config,
- std::unique_ptr<rtc::Thread> thread,
+ std::unique_ptr<Thread> thread,
EmulatedEndpoint* client,
EmulatedEndpoint* peer);
~EmulatedTURNServer() override;
@@ -83,7 +83,7 @@
void Stop();
private:
- std::unique_ptr<rtc::Thread> thread_;
+ std::unique_ptr<Thread> thread_;
SocketAddress client_address_;
IceServerConfig ice_config_;
EmulatedEndpoint* const client_;
diff --git a/test/network/fake_network_socket_server.cc b/test/network/fake_network_socket_server.cc
index 5fc6cbb..90c5c54 100644
--- a/test/network/fake_network_socket_server.cc
+++ b/test/network/fake_network_socket_server.cc
@@ -52,7 +52,7 @@
public EmulatedNetworkReceiverInterface {
public:
explicit FakeNetworkSocket(FakeNetworkSocketServer* scoket_manager,
- rtc::Thread* thread);
+ Thread* thread);
~FakeNetworkSocket() override;
// Will be invoked by EmulatedEndpoint to deliver packets into this socket.
@@ -81,7 +81,7 @@
private:
FakeNetworkSocketServer* const socket_server_;
- rtc::Thread* const thread_;
+ Thread* const thread_;
EmulatedEndpointImpl* endpoint_ RTC_GUARDED_BY(&thread_);
SocketAddress local_addr_ RTC_GUARDED_BY(&thread_);
SocketAddress remote_addr_ RTC_GUARDED_BY(&thread_);
@@ -94,7 +94,7 @@
};
FakeNetworkSocket::FakeNetworkSocket(FakeNetworkSocketServer* socket_server,
- rtc::Thread* thread)
+ Thread* thread)
: socket_server_(socket_server),
thread_(thread),
state_(CS_CLOSED),
@@ -291,14 +291,14 @@
return out;
}
-void FakeNetworkSocketServer::SetMessageQueue(rtc::Thread* thread) {
+void FakeNetworkSocketServer::SetMessageQueue(Thread* thread) {
thread_ = thread;
}
// Always returns true (if return false, it won't be invoked again...)
bool FakeNetworkSocketServer::Wait(webrtc::TimeDelta max_wait_duration,
bool process_io) {
- RTC_DCHECK(thread_ == rtc::Thread::Current());
+ RTC_DCHECK(thread_ == Thread::Current());
if (!max_wait_duration.IsZero())
wakeup_.Wait(max_wait_duration);
diff --git a/test/network/fake_network_socket_server.h b/test/network/fake_network_socket_server.h
index a07c45d..23f1bb3 100644
--- a/test/network/fake_network_socket_server.h
+++ b/test/network/fake_network_socket_server.h
@@ -38,7 +38,7 @@
// rtc::SocketServer methods:
// Called by the network thread when this server is installed, kicking off the
// message handler loop.
- void SetMessageQueue(rtc::Thread* thread) override;
+ void SetMessageQueue(Thread* thread) override;
bool Wait(webrtc::TimeDelta max_wait_duration, bool process_io) override;
void WakeUp() override;
@@ -50,7 +50,7 @@
private:
const EndpointsContainer* endpoints_container_;
Event wakeup_;
- rtc::Thread* thread_ = nullptr;
+ Thread* thread_ = nullptr;
Mutex lock_;
std::vector<FakeNetworkSocket*> sockets_ RTC_GUARDED_BY(lock_);
diff --git a/test/network/network_emulation_pc_unittest.cc b/test/network/network_emulation_pc_unittest.cc
index 331f7fe..b020138 100644
--- a/test/network/network_emulation_pc_unittest.cc
+++ b/test/network/network_emulation_pc_unittest.cc
@@ -61,7 +61,7 @@
}
rtc::scoped_refptr<PeerConnectionFactoryInterface> CreatePeerConnectionFactory(
- rtc::Thread* signaling_thread,
+ Thread* signaling_thread,
EmulatedNetworkManagerInterface* network) {
PeerConnectionFactoryDependencies pcf_deps;
pcf_deps.task_queue_factory = CreateDefaultTaskQueueFactory();
@@ -111,7 +111,7 @@
} // namespace
TEST(NetworkEmulationManagerPCTest, Run) {
- std::unique_ptr<rtc::Thread> signaling_thread = rtc::Thread::Create();
+ std::unique_ptr<Thread> signaling_thread = Thread::Create();
signaling_thread->SetName(kSignalThreadName, nullptr);
signaling_thread->Start();
@@ -202,7 +202,7 @@
}
TEST(NetworkEmulationManagerPCTest, RunTURN) {
- std::unique_ptr<rtc::Thread> signaling_thread = rtc::Thread::Create();
+ std::unique_ptr<Thread> signaling_thread = Thread::Create();
signaling_thread->SetName(kSignalThreadName, nullptr);
signaling_thread->Start();
diff --git a/test/network/network_emulation_unittest.cc b/test/network/network_emulation_unittest.cc
index eee94c0..d7cfad3 100644
--- a/test/network/network_emulation_unittest.cc
+++ b/test/network/network_emulation_unittest.cc
@@ -64,7 +64,7 @@
class SocketReader : public sigslot::has_slots<> {
public:
- explicit SocketReader(Socket* socket, rtc::Thread* network_thread)
+ explicit SocketReader(Socket* socket, Thread* network_thread)
: socket_(socket), network_thread_(network_thread) {
socket_->SignalReadEvent.connect(this, &SocketReader::OnReadEvent);
}
@@ -93,7 +93,7 @@
private:
Socket* const socket_;
- rtc::Thread* const network_thread_;
+ Thread* const network_thread_;
rtc::Buffer payload_;
webrtc::EcnMarking last_ecn_mark_;
@@ -248,8 +248,8 @@
EmulatedNetworkManagerInterface* nt2 =
network_manager.CreateEmulatedNetworkManagerInterface({bob_endpoint});
- rtc::Thread* t1 = nt1->network_thread();
- rtc::Thread* t2 = nt2->network_thread();
+ Thread* t1 = nt1->network_thread();
+ Thread* t2 = nt2->network_thread();
rtc::CopyOnWriteBuffer data("Hello");
for (uint64_t j = 0; j < 2; j++) {
@@ -403,8 +403,8 @@
EmulatedNetworkManagerInterface* nt2 =
network_manager.CreateEmulatedNetworkManagerInterface({bob_endpoint});
- rtc::Thread* t1 = nt1->network_thread();
- rtc::Thread* t2 = nt2->network_thread();
+ Thread* t1 = nt1->network_thread();
+ Thread* t2 = nt2->network_thread();
Socket* s1 = nullptr;
Socket* s2 = nullptr;
@@ -489,8 +489,8 @@
EmulatedNetworkManagerInterface* nt2 =
network_manager.CreateEmulatedNetworkManagerInterface({bob_endpoint});
- rtc::Thread* t1 = nt1->network_thread();
- rtc::Thread* t2 = nt2->network_thread();
+ Thread* t1 = nt1->network_thread();
+ Thread* t2 = nt2->network_thread();
rtc::CopyOnWriteBuffer data("Hello");
for (uint64_t j = 0; j < 2; j++) {
@@ -590,8 +590,8 @@
EmulatedNetworkManagerInterface* nt2 =
network_manager.CreateEmulatedNetworkManagerInterface({bob_endpoint});
- rtc::Thread* t1 = nt1->network_thread();
- rtc::Thread* t2 = nt2->network_thread();
+ Thread* t1 = nt1->network_thread();
+ Thread* t2 = nt2->network_thread();
constexpr int64_t kUdpPayloadSize = 100;
constexpr int64_t kSinglePacketSize = kUdpPayloadSize + kOverheadIpv4Udp;
diff --git a/test/network/simulated_network.h b/test/network/simulated_network.h
index adb6ad0..7abf7ed 100644
--- a/test/network/simulated_network.h
+++ b/test/network/simulated_network.h
@@ -115,7 +115,7 @@
// Guards the data structures involved in delay and loss processing, such as
// the packet queues.
- rtc::RaceChecker process_checker_;
+ RaceChecker process_checker_;
// Models the capacity of the network by rejecting packets if the queue is
// full and keeping them in the queue until they are ready to exit (according
// to the link capacity, which cannot be violated, e.g. a 1 kbps link will
diff --git a/test/pc/e2e/analyzer/video/default_video_quality_analyzer_frames_comparator.cc b/test/pc/e2e/analyzer/video/default_video_quality_analyzer_frames_comparator.cc
index 96ba330..2906950 100644
--- a/test/pc/e2e/analyzer/video/default_video_quality_analyzer_frames_comparator.cc
+++ b/test/pc/e2e/analyzer/video/default_video_quality_analyzer_frames_comparator.cc
@@ -187,7 +187,7 @@
void DefaultVideoQualityAnalyzerFramesComparator::Start(int max_threads_count) {
for (int i = 0; i < max_threads_count; i++) {
- thread_pool_.push_back(rtc::PlatformThread::SpawnJoinable(
+ thread_pool_.push_back(PlatformThread::SpawnJoinable(
[this] { ProcessComparisons(); },
"DefaultVideoQualityAnalyzerFramesComparator-" + std::to_string(i)));
}
diff --git a/test/pc/e2e/analyzer/video/default_video_quality_analyzer_frames_comparator.h b/test/pc/e2e/analyzer/video/default_video_quality_analyzer_frames_comparator.h
index b41268d..4b079ff 100644
--- a/test/pc/e2e/analyzer/video/default_video_quality_analyzer_frames_comparator.h
+++ b/test/pc/e2e/analyzer/video/default_video_quality_analyzer_frames_comparator.h
@@ -148,7 +148,7 @@
std::deque<FrameComparison> comparisons_ RTC_GUARDED_BY(mutex_);
FramesComparatorStats frames_comparator_stats_ RTC_GUARDED_BY(mutex_);
- std::vector<rtc::PlatformThread> thread_pool_;
+ std::vector<PlatformThread> thread_pool_;
rtc::Event comparison_available_event_;
};
diff --git a/test/pc/e2e/peer_connection_quality_test.cc b/test/pc/e2e/peer_connection_quality_test.cc
index de35382..0a58040 100644
--- a/test/pc/e2e/peer_connection_quality_test.cc
+++ b/test/pc/e2e/peer_connection_quality_test.cc
@@ -273,7 +273,7 @@
<< !bob_configurer->configurable_params()->video_configs.empty()
<< "; audio=" << bob_configurer->params()->audio_config.has_value();
- const std::unique_ptr<rtc::Thread> signaling_thread =
+ const std::unique_ptr<Thread> signaling_thread =
time_controller_.CreateThread(kSignalThreadName);
media_helper_ = std::make_unique<MediaHelper>(
video_quality_analyzer_injection_helper_.get(), task_queue_factory_.get(),
@@ -646,7 +646,7 @@
}
void PeerConnectionE2EQualityTest::WaitUntilIceCandidatesGathered(
- rtc::Thread* signaling_thread) {
+ Thread* signaling_thread) {
ASSERT_TRUE(time_controller_.Wait(
[&]() {
bool result;
@@ -659,7 +659,7 @@
}
void PeerConnectionE2EQualityTest::WaitUntilPeersAreConnected(
- rtc::Thread* signaling_thread) {
+ Thread* signaling_thread) {
// This means that ICE and DTLS are connected.
alice_connected_ = time_controller_.Wait(
[&]() {
diff --git a/test/pc/e2e/peer_connection_quality_test.h b/test/pc/e2e/peer_connection_quality_test.h
index 6cbf232..d185de8 100644
--- a/test/pc/e2e/peer_connection_quality_test.h
+++ b/test/pc/e2e/peer_connection_quality_test.h
@@ -99,8 +99,8 @@
void SetPeerCodecPreferences(TestPeer* peer);
std::unique_ptr<SignalingInterceptor> CreateSignalingInterceptor(
const RunParams& run_params);
- void WaitUntilIceCandidatesGathered(rtc::Thread* signaling_thread);
- void WaitUntilPeersAreConnected(rtc::Thread* signaling_thread);
+ void WaitUntilIceCandidatesGathered(Thread* signaling_thread);
+ void WaitUntilPeersAreConnected(Thread* signaling_thread);
void ExchangeOfferAnswer(SignalingInterceptor* signaling_interceptor);
void ExchangeIceCandidates(SignalingInterceptor* signaling_interceptor);
void StartVideo(
diff --git a/test/pc/e2e/test_peer.cc b/test/pc/e2e/test_peer.cc
index 6c5f7d1..585ef35 100644
--- a/test/pc/e2e/test_peer.cc
+++ b/test/pc/e2e/test_peer.cc
@@ -147,7 +147,7 @@
Params params,
ConfigurableParams configurable_params,
std::vector<PeerConfigurer::VideoSource> video_sources,
- std::unique_ptr<rtc::Thread> worker_thread)
+ std::unique_ptr<Thread> worker_thread)
: params_(std::move(params)),
configurable_params_(std::move(configurable_params)),
worker_thread_(std::move(worker_thread)),
diff --git a/test/pc/e2e/test_peer.h b/test/pc/e2e/test_peer.h
index 96a376b..64b2947 100644
--- a/test/pc/e2e/test_peer.h
+++ b/test/pc/e2e/test_peer.h
@@ -167,7 +167,7 @@
Params params,
ConfigurableParams configurable_params,
std::vector<PeerConfigurer::VideoSource> video_sources,
- std::unique_ptr<rtc::Thread> worker_thread);
+ std::unique_ptr<Thread> worker_thread);
private:
const Params params_;
@@ -183,7 +183,7 @@
// Keeps ownership of worker thread. It has to be destroyed after `wrapper_`.
// `worker_thread_`can be null if the Peer use only one thread as both the
// worker thread and network thread.
- std::unique_ptr<rtc::Thread> worker_thread_;
+ std::unique_ptr<Thread> worker_thread_;
std::unique_ptr<PeerConnectionWrapper> wrapper_;
std::vector<PeerConfigurer::VideoSource> video_sources_;
diff --git a/test/pc/e2e/test_peer_factory.cc b/test/pc/e2e/test_peer_factory.cc
index 927daba..252853c 100644
--- a/test/pc/e2e/test_peer_factory.cc
+++ b/test/pc/e2e/test_peer_factory.cc
@@ -197,9 +197,9 @@
std::unique_ptr<PeerConnectionFactoryComponents> pcf_dependencies,
TimeController& time_controller,
rtc::scoped_refptr<AudioDeviceModule> audio_device_module,
- rtc::Thread* signaling_thread,
- rtc::Thread* worker_thread,
- rtc::Thread* network_thread) {
+ Thread* signaling_thread,
+ Thread* worker_thread,
+ Thread* network_thread) {
PeerConnectionFactoryDependencies pcf_deps;
pcf_deps.signaling_thread = signaling_thread;
pcf_deps.worker_thread = worker_thread;
@@ -313,7 +313,7 @@
components->pcf_dependencies.get(),
video_analyzer_helper_);
- std::unique_ptr<rtc::Thread> owned_worker_thread =
+ std::unique_ptr<Thread> owned_worker_thread =
components->worker_thread != nullptr
? nullptr
: time_controller_.CreateThread("worker_thread");
diff --git a/test/pc/e2e/test_peer_factory.h b/test/pc/e2e/test_peer_factory.h
index aa42f98..8f81363 100644
--- a/test/pc/e2e/test_peer_factory.h
+++ b/test/pc/e2e/test_peer_factory.h
@@ -49,7 +49,7 @@
// factories and call factory.
// `video_analyzer_helper` will be used to setup video quality analysis for
// created peers.
- TestPeerFactory(rtc::Thread* signaling_thread,
+ TestPeerFactory(Thread* signaling_thread,
TimeController& time_controller,
VideoQualityAnalyzerInjectionHelper* video_analyzer_helper)
: signaling_thread_(signaling_thread),
@@ -57,7 +57,7 @@
video_analyzer_helper_(video_analyzer_helper) {}
ABSL_DEPRECATE_AND_INLINE()
- TestPeerFactory(rtc::Thread* signaling_thread,
+ TestPeerFactory(Thread* signaling_thread,
TimeController& time_controller,
VideoQualityAnalyzerInjectionHelper* video_analyzer_helper,
TaskQueueBase* /*task_queue*/)
@@ -76,7 +76,7 @@
std::optional<EchoEmulationConfig> echo_emulation_config);
private:
- rtc::Thread* signaling_thread_;
+ Thread* signaling_thread_;
TimeController& time_controller_;
VideoQualityAnalyzerInjectionHelper* video_analyzer_helper_;
};
diff --git a/test/peer_scenario/peer_scenario.h b/test/peer_scenario/peer_scenario.h
index a177eea..f9cf063 100644
--- a/test/peer_scenario/peer_scenario.h
+++ b/test/peer_scenario/peer_scenario.h
@@ -112,7 +112,7 @@
const std::unique_ptr<LogWriterFactoryInterface> log_writer_manager_;
NetworkEmulationManagerImpl net_;
- rtc::Thread* const signaling_thread_;
+ Thread* const signaling_thread_;
std::list<PeerVideoQualityPair> video_quality_pairs_;
std::list<PeerScenarioClient> peer_clients_;
};
diff --git a/test/peer_scenario/peer_scenario_client.cc b/test/peer_scenario/peer_scenario_client.cc
index 50d788a..7b73240 100644
--- a/test/peer_scenario/peer_scenario_client.cc
+++ b/test/peer_scenario/peer_scenario_client.cc
@@ -241,7 +241,7 @@
PeerScenarioClient::PeerScenarioClient(
NetworkEmulationManager* net,
- rtc::Thread* signaling_thread,
+ Thread* signaling_thread,
std::unique_ptr<LogWriterFactoryInterface> log_writer_factory,
PeerScenarioClient::Config config)
: endpoints_(CreateEndpoints(net, config.endpoints)),
diff --git a/test/peer_scenario/peer_scenario_client.h b/test/peer_scenario/peer_scenario_client.h
index acf0382..b8198a9 100644
--- a/test/peer_scenario/peer_scenario_client.h
+++ b/test/peer_scenario/peer_scenario_client.h
@@ -114,7 +114,7 @@
PeerScenarioClient(
NetworkEmulationManager* net,
- rtc::Thread* signaling_thread,
+ Thread* signaling_thread,
std::unique_ptr<LogWriterFactoryInterface> log_writer_factory,
Config config);
@@ -123,7 +123,7 @@
RTC_DCHECK_RUN_ON(signaling_thread_);
return peer_connection_.get();
}
- rtc::Thread* thread() { return signaling_thread_; }
+ Thread* thread() { return signaling_thread_; }
Clock* clock() { return Clock::GetRealTimeClock(); }
// Returns the endpoint created from the EmulatedEndpointConfig with the same
@@ -160,9 +160,9 @@
private:
const std::map<int, EmulatedEndpoint*> endpoints_;
TaskQueueFactory* const task_queue_factory_;
- rtc::Thread* const signaling_thread_;
+ Thread* const signaling_thread_;
const std::unique_ptr<LogWriterFactoryInterface> log_writer_factory_;
- const std::unique_ptr<rtc::Thread> worker_thread_;
+ const std::unique_ptr<Thread> worker_thread_;
CallbackHandlers handlers_ RTC_GUARDED_BY(signaling_thread_);
const std::unique_ptr<PeerConnectionObserver> observer_;
std::map<std::string, std::vector<rtc::VideoSinkInterface<VideoFrame>*>>
diff --git a/test/peer_scenario/scenario_connection.cc b/test/peer_scenario/scenario_connection.cc
index 0b03199..cf60d7f 100644
--- a/test/peer_scenario/scenario_connection.cc
+++ b/test/peer_scenario/scenario_connection.cc
@@ -90,8 +90,8 @@
IceConnectionObserver* const observer_;
EmulatedEndpoint* const endpoint_;
EmulatedNetworkManagerInterface* const manager_;
- rtc::Thread* const signaling_thread_;
- rtc::Thread* const network_thread_;
+ Thread* const signaling_thread_;
+ Thread* const network_thread_;
rtc::scoped_refptr<RTCCertificate> const certificate_
RTC_GUARDED_BY(network_thread_);
cricket::TransportDescription const transport_description_
@@ -124,7 +124,7 @@
: observer_(observer),
endpoint_(net->CreateEndpoint(EmulatedEndpointConfig())),
manager_(net->CreateEmulatedNetworkManagerInterface({endpoint_})),
- signaling_thread_(rtc::Thread::Current()),
+ signaling_thread_(Thread::Current()),
network_thread_(manager_->network_thread()),
certificate_(RTCCertificate::Create(
rtc::SSLIdentity::Create("", ::rtc::KT_DEFAULT))),
diff --git a/test/run_loop.cc b/test/run_loop.cc
index e3b3eae..d3495e0 100644
--- a/test/run_loop.cc
+++ b/test/run_loop.cc
@@ -67,7 +67,7 @@
}
RunLoop::WorkerThread::WorkerThread(SocketServer* ss)
- : rtc::Thread(ss), tq_setter_(this) {}
+ : Thread(ss), tq_setter_(this) {}
} // namespace test
} // namespace webrtc
diff --git a/test/run_loop.h b/test/run_loop.h
index 828a104..17638f6 100644
--- a/test/run_loop.h
+++ b/test/run_loop.h
@@ -56,7 +56,7 @@
bool fail_next_wait_ = false;
};
- class WorkerThread : public rtc::Thread {
+ class WorkerThread : public Thread {
public:
explicit WorkerThread(SocketServer* ss);
diff --git a/test/scenario/stats_collection.h b/test/scenario/stats_collection.h
index fcf8f71..1be0508 100644
--- a/test/scenario/stats_collection.h
+++ b/test/scenario/stats_collection.h
@@ -24,7 +24,7 @@
struct VideoQualityAnalyzerConfig {
double psnr_coverage = 1;
- rtc::Thread* thread = nullptr;
+ Thread* thread = nullptr;
};
class VideoLayerAnalyzer {
diff --git a/test/time_controller/real_time_controller.cc b/test/time_controller/real_time_controller.cc
index 275e90f..5a27d25 100644
--- a/test/time_controller/real_time_controller.cc
+++ b/test/time_controller/real_time_controller.cc
@@ -15,7 +15,7 @@
namespace webrtc {
namespace {
-class MainThread : public rtc::Thread {
+class MainThread : public Thread {
public:
MainThread()
: Thread(std::make_unique<NullSocketServer>(), false),
@@ -45,18 +45,18 @@
return task_queue_factory_.get();
}
-std::unique_ptr<rtc::Thread> RealTimeController::CreateThread(
+std::unique_ptr<Thread> RealTimeController::CreateThread(
const std::string& name,
std::unique_ptr<SocketServer> socket_server) {
if (!socket_server)
socket_server = std::make_unique<NullSocketServer>();
- auto res = std::make_unique<rtc::Thread>(std::move(socket_server));
+ auto res = std::make_unique<Thread>(std::move(socket_server));
res->SetName(name, nullptr);
res->Start();
return res;
}
-rtc::Thread* RealTimeController::GetMainThread() {
+Thread* RealTimeController::GetMainThread() {
return main_thread_.get();
}
diff --git a/test/time_controller/real_time_controller.h b/test/time_controller/real_time_controller.h
index 1f6b001..99eb72e 100644
--- a/test/time_controller/real_time_controller.h
+++ b/test/time_controller/real_time_controller.h
@@ -26,15 +26,15 @@
Clock* GetClock() override;
TaskQueueFactory* GetTaskQueueFactory() override;
- std::unique_ptr<rtc::Thread> CreateThread(
+ std::unique_ptr<Thread> CreateThread(
const std::string& name,
std::unique_ptr<SocketServer> socket_server) override;
- rtc::Thread* GetMainThread() override;
+ Thread* GetMainThread() override;
void AdvanceTime(TimeDelta duration) override;
private:
const std::unique_ptr<TaskQueueFactory> task_queue_factory_;
- const std::unique_ptr<rtc::Thread> main_thread_;
+ const std::unique_ptr<Thread> main_thread_;
};
} // namespace webrtc
diff --git a/test/time_controller/simulated_thread.cc b/test/time_controller/simulated_thread.cc
index 025a5ad..d8ff5d9 100644
--- a/test/time_controller/simulated_thread.cc
+++ b/test/time_controller/simulated_thread.cc
@@ -37,8 +37,8 @@
sim_time_impl::SimulatedTimeControllerImpl* handler,
absl::string_view name,
std::unique_ptr<SocketServer> socket_server)
- : rtc::Thread(socket_server ? std::move(socket_server)
- : std::make_unique<DummySocketServer>()),
+ : Thread(socket_server ? std::move(socket_server)
+ : std::make_unique<DummySocketServer>()),
handler_(handler),
name_(new char[name.size()]) {
std::copy_n(name.begin(), name.size(), name_);
@@ -81,7 +81,7 @@
void SimulatedThread::PostTaskImpl(absl::AnyInvocable<void() &&> task,
const PostTaskTraits& traits,
const Location& location) {
- rtc::Thread::PostTaskImpl(std::move(task), traits, location);
+ Thread::PostTaskImpl(std::move(task), traits, location);
MutexLock lock(&lock_);
next_run_time_ = Timestamp::MinusInfinity();
}
@@ -90,7 +90,7 @@
TimeDelta delay,
const PostDelayedTaskTraits& traits,
const Location& location) {
- rtc::Thread::PostDelayedTaskImpl(std::move(task), delay, traits, location);
+ Thread::PostDelayedTaskImpl(std::move(task), delay, traits, location);
MutexLock lock(&lock_);
next_run_time_ =
std::min(next_run_time_, Timestamp::Millis(TimeMillis()) + delay);
diff --git a/test/time_controller/simulated_thread.h b/test/time_controller/simulated_thread.h
index 883f976..2c370a0 100644
--- a/test/time_controller/simulated_thread.h
+++ b/test/time_controller/simulated_thread.h
@@ -17,7 +17,7 @@
namespace webrtc {
-class SimulatedThread : public rtc::Thread,
+class SimulatedThread : public Thread,
public sim_time_impl::SimulatedSequenceRunner {
public:
using CurrentThreadSetter = CurrentThreadSetter;
diff --git a/test/time_controller/simulated_time_controller.cc b/test/time_controller/simulated_time_controller.cc
index be6f9a2..d68995b 100644
--- a/test/time_controller/simulated_time_controller.cc
+++ b/test/time_controller/simulated_time_controller.cc
@@ -53,7 +53,7 @@
return task_queue;
}
-std::unique_ptr<rtc::Thread> SimulatedTimeControllerImpl::CreateThread(
+std::unique_ptr<Thread> SimulatedTimeControllerImpl::CreateThread(
const std::string& name,
std::unique_ptr<SocketServer> socket_server) {
auto thread =
@@ -182,13 +182,13 @@
return &impl_;
}
-std::unique_ptr<rtc::Thread> GlobalSimulatedTimeController::CreateThread(
+std::unique_ptr<Thread> GlobalSimulatedTimeController::CreateThread(
const std::string& name,
std::unique_ptr<SocketServer> socket_server) {
return impl_.CreateThread(name, std::move(socket_server));
}
-rtc::Thread* GlobalSimulatedTimeController::GetMainThread() {
+Thread* GlobalSimulatedTimeController::GetMainThread() {
return main_thread_.get();
}
diff --git a/test/time_controller/simulated_time_controller.h b/test/time_controller/simulated_time_controller.h
index 70ece0e..1511429 100644
--- a/test/time_controller/simulated_time_controller.h
+++ b/test/time_controller/simulated_time_controller.h
@@ -58,7 +58,7 @@
void YieldExecution() RTC_LOCKS_EXCLUDED(time_lock_, lock_) override;
// Create thread using provided `socket_server`.
- std::unique_ptr<rtc::Thread> CreateThread(
+ std::unique_ptr<Thread> CreateThread(
const std::string& name,
std::unique_ptr<SocketServer> socket_server)
RTC_LOCKS_EXCLUDED(time_lock_, lock_);
@@ -84,7 +84,7 @@
private:
const rtc::PlatformThreadId thread_id_;
- const std::unique_ptr<rtc::Thread> dummy_thread_ = rtc::Thread::Create();
+ const std::unique_ptr<Thread> dummy_thread_ = Thread::Create();
mutable Mutex time_lock_;
Timestamp current_time_ RTC_GUARDED_BY(time_lock_);
mutable Mutex lock_;
@@ -131,10 +131,10 @@
Clock* GetClock() override;
TaskQueueFactory* GetTaskQueueFactory() override;
- std::unique_ptr<rtc::Thread> CreateThread(
+ std::unique_ptr<Thread> CreateThread(
const std::string& name,
std::unique_ptr<SocketServer> socket_server) override;
- rtc::Thread* GetMainThread() override;
+ Thread* GetMainThread() override;
void AdvanceTime(TimeDelta duration) override;
@@ -159,7 +159,7 @@
SimulatedClock sim_clock_;
sim_time_impl::SimulatedTimeControllerImpl impl_;
ScopedYieldPolicy yield_policy_;
- std::unique_ptr<rtc::Thread> main_thread_;
+ std::unique_ptr<Thread> main_thread_;
};
} // namespace webrtc
diff --git a/test/time_controller/time_controller_conformance_test.cc b/test/time_controller/time_controller_conformance_test.cc
index f5734e1..5e0dcf8 100644
--- a/test/time_controller/time_controller_conformance_test.cc
+++ b/test/time_controller/time_controller_conformance_test.cc
@@ -81,7 +81,7 @@
TEST_P(SimulatedRealTimeControllerConformanceTest, ThreadPostOrderTest) {
std::unique_ptr<TimeController> time_controller =
CreateTimeController(GetParam());
- std::unique_ptr<rtc::Thread> thread = time_controller->CreateThread("thread");
+ std::unique_ptr<Thread> thread = time_controller->CreateThread("thread");
// Tasks on thread have to be executed in order in which they were
// posted.
@@ -98,7 +98,7 @@
TEST_P(SimulatedRealTimeControllerConformanceTest, ThreadPostDelayedOrderTest) {
std::unique_ptr<TimeController> time_controller =
CreateTimeController(GetParam());
- std::unique_ptr<rtc::Thread> thread = time_controller->CreateThread("thread");
+ std::unique_ptr<Thread> thread = time_controller->CreateThread("thread");
ExecutionOrderKeeper execution_order;
thread->PostDelayedTask([&]() { execution_order.Executed(2); },
@@ -114,7 +114,7 @@
TEST_P(SimulatedRealTimeControllerConformanceTest, ThreadPostInvokeOrderTest) {
std::unique_ptr<TimeController> time_controller =
CreateTimeController(GetParam());
- std::unique_ptr<rtc::Thread> thread = time_controller->CreateThread("thread");
+ std::unique_ptr<Thread> thread = time_controller->CreateThread("thread");
// Tasks on thread have to be executed in order in which they were
// posted/invoked.
@@ -132,7 +132,7 @@
ThreadPostInvokeFromThreadOrderTest) {
std::unique_ptr<TimeController> time_controller =
CreateTimeController(GetParam());
- std::unique_ptr<rtc::Thread> thread = time_controller->CreateThread("thread");
+ std::unique_ptr<Thread> thread = time_controller->CreateThread("thread");
// If task is invoked from thread X on thread X it has to be executed
// immediately.
diff --git a/test/wait_until.cc b/test/wait_until.cc
index cfb0f88..b92f32c 100644
--- a/test/wait_until.cc
+++ b/test/wait_until.cc
@@ -41,8 +41,8 @@
void AdvanceTimeOnClockVariant(ClockVariant& clock, TimeDelta delta) {
std::visit(absl::Overload{
[&](const std::monostate&) {
- rtc::Thread::Current()->ProcessMessages(0);
- rtc::Thread::Current()->SleepMs(delta.ms());
+ Thread::Current()->ProcessMessages(0);
+ Thread::Current()->SleepMs(delta.ms());
},
[&](auto* clock) { clock->AdvanceTime(delta); },
},
diff --git a/test/wait_until.h b/test/wait_until.h
index 511f3bf..744e39f 100644
--- a/test/wait_until.h
+++ b/test/wait_until.h
@@ -67,8 +67,8 @@
WaitUntilSettings settings = {})
-> RTCErrorOr<decltype(fn())> {
if (std::holds_alternative<std::monostate>(settings.clock)) {
- RTC_CHECK(rtc::Thread::Current()) << "A current thread is required. An "
- "rtc::AutoThread can work for tests.";
+ RTC_CHECK(Thread::Current()) << "A current thread is required. An "
+ "rtc::AutoThread can work for tests.";
}
Timestamp start =
diff --git a/video/adaptation/quality_scaler_resource_unittest.cc b/video/adaptation/quality_scaler_resource_unittest.cc
index 3b9c523..b794c73 100644
--- a/video/adaptation/quality_scaler_resource_unittest.cc
+++ b/video/adaptation/quality_scaler_resource_unittest.cc
@@ -53,7 +53,7 @@
}
protected:
- rtc::AutoThread main_thread_;
+ AutoThread main_thread_;
StrictMock<MockResourceListener> fake_resource_listener_;
FakeDegradationPreferenceProvider degradation_preference_provider_;
rtc::scoped_refptr<QualityScalerResource> quality_scaler_resource_;
diff --git a/video/frame_cadence_adapter.cc b/video/frame_cadence_adapter.cc
index 21dec7f..3ee6ae0 100644
--- a/video/frame_cadence_adapter.cc
+++ b/video/frame_cadence_adapter.cc
@@ -436,7 +436,7 @@
// Race checker for incoming frames. This is the network thread in chromium,
// but may vary from test contexts.
- rtc::RaceChecker incoming_frame_race_checker_;
+ RaceChecker incoming_frame_race_checker_;
// Number of frames that are currently scheduled for processing on the
// `queue_`.
diff --git a/video/receive_statistics_proxy.cc b/video/receive_statistics_proxy.cc
index 4334ca3..47f9d5e 100644
--- a/video/receive_statistics_proxy.cc
+++ b/video/receive_statistics_proxy.cc
@@ -56,7 +56,7 @@
if (task_queue->IsCurrent())
return true;
- rtc::Thread* current_thread = rtc::ThreadManager::Instance()->CurrentThread();
+ Thread* current_thread = ThreadManager::Instance()->CurrentThread();
if (!current_thread)
return false;
diff --git a/video/render/incoming_video_stream.h b/video/render/incoming_video_stream.h
index 066c0db..909af2f 100644
--- a/video/render/incoming_video_stream.h
+++ b/video/render/incoming_video_stream.h
@@ -38,7 +38,7 @@
void Dequeue();
SequenceChecker main_thread_checker_;
- rtc::RaceChecker decoder_race_checker_;
+ RaceChecker decoder_race_checker_;
VideoRenderFrames render_buffers_ RTC_GUARDED_BY(incoming_render_queue_);
rtc::VideoSinkInterface<VideoFrame>* const callback_;
diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc
index 255dbbc..897d4c4 100644
--- a/video/rtp_video_stream_receiver2.cc
+++ b/video/rtp_video_stream_receiver2.cc
@@ -377,7 +377,7 @@
frame_transformer_delegate_ =
rtc::make_ref_counted<RtpVideoStreamReceiverFrameTransformerDelegate>(
this, &env_.clock(), std::move(frame_transformer),
- rtc::Thread::Current(), config_.rtp.remote_ssrc);
+ Thread::Current(), config_.rtp.remote_ssrc);
frame_transformer_delegate_->Init();
}
}
@@ -1070,8 +1070,8 @@
RTC_DCHECK_RUN_ON(&worker_task_checker_);
frame_transformer_delegate_ =
rtc::make_ref_counted<RtpVideoStreamReceiverFrameTransformerDelegate>(
- this, &env_.clock(), std::move(frame_transformer),
- rtc::Thread::Current(), config_.rtp.remote_ssrc);
+ this, &env_.clock(), std::move(frame_transformer), Thread::Current(),
+ config_.rtp.remote_ssrc);
frame_transformer_delegate_->Init();
}
diff --git a/video/video_analyzer.cc b/video/video_analyzer.cc
index ba98161..f8f4c19 100644
--- a/video/video_analyzer.cc
+++ b/video/video_analyzer.cc
@@ -149,7 +149,7 @@
}
for (uint32_t i = 0; i < num_cores; ++i) {
- comparison_thread_pool_.push_back(rtc::PlatformThread::SpawnJoinable(
+ comparison_thread_pool_.push_back(PlatformThread::SpawnJoinable(
[this] {
while (CompareFrames()) {
}
diff --git a/video/video_analyzer.h b/video/video_analyzer.h
index cbe1a4f..0366638 100644
--- a/video/video_analyzer.h
+++ b/video/video_analyzer.h
@@ -303,7 +303,7 @@
const double avg_ssim_threshold_;
bool is_quick_test_enabled_;
- std::vector<rtc::PlatformThread> comparison_thread_pool_;
+ std::vector<PlatformThread> comparison_thread_pool_;
Event comparison_available_event_;
std::deque<FrameComparison> comparisons_ RTC_GUARDED_BY(comparison_lock_);
bool quit_ RTC_GUARDED_BY(comparison_lock_);
diff --git a/video/video_send_stream_tests.cc b/video/video_send_stream_tests.cc
index de00c15..2a6f804 100644
--- a/video/video_send_stream_tests.cc
+++ b/video/video_send_stream_tests.cc
@@ -2232,7 +2232,7 @@
// the test code context is interpreted as the worker thread and we assume
// progress on it. The test should probably be ported to use simulated time
// instead (ported to a scenario test perhaps?).
- rtc::Thread::Current()->ProcessMessages(5000);
+ Thread::Current()->ProcessMessages(5000);
EXPECT_TRUE(encoder.WaitForStartBitrate());
EXPECT_EQ(GetVideoEncoderConfig()->max_bitrate_bps / 1000,
@@ -2246,7 +2246,7 @@
// the test code context is interpreted as the worker thread and we assume
// progress on it. The test should probably be ported to use simulated time
// instead (ported to a scenario test perhaps?).
- rtc::Thread::Current()->ProcessMessages(5000);
+ Thread::Current()->ProcessMessages(5000);
// New bitrate should be reconfigured above the previous max. As there's no
// network connection this shouldn't be flaky, as no bitrate should've been