Delete deprecated rtc::Thread default constructor

Bug: None
Change-Id: Ic0e2e94b174a49e5d20ebdea90568473e1b71d62
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/134640
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27958}
This commit is contained in:
Niels Möller
2019-04-30 11:45:58 +02:00
committed by Commit Bot
parent 198cf00532
commit fdd6d3e46e
5 changed files with 9 additions and 15 deletions

View File

@ -122,9 +122,9 @@ bool SimplePeerConnection::InitializePeerConnection(const char** turn_urls,
RTC_DCHECK(peer_connection_.get() == nullptr); RTC_DCHECK(peer_connection_.get() == nullptr);
if (g_peer_connection_factory == nullptr) { if (g_peer_connection_factory == nullptr) {
g_worker_thread.reset(new rtc::Thread()); g_worker_thread = rtc::Thread::Create();
g_worker_thread->Start(); g_worker_thread->Start();
g_signaling_thread.reset(new rtc::Thread()); g_signaling_thread = rtc::Thread::Create();
g_signaling_thread->Start(); g_signaling_thread->Start();
g_peer_connection_factory = webrtc::CreatePeerConnectionFactory( g_peer_connection_factory = webrtc::CreatePeerConnectionFactory(

View File

@ -10,10 +10,11 @@
#include <memory> #include <memory>
#include "absl/memory/memory.h"
#include "rtc_base/constructor_magic.h" #include "rtc_base/constructor_magic.h"
#include "rtc_base/gunit.h" #include "rtc_base/gunit.h"
#include "rtc_base/null_socket_server.h"
#include "rtc_base/signal_thread.h" #include "rtc_base/signal_thread.h"
#include "rtc_base/socket_server.h"
#include "rtc_base/thread.h" #include "rtc_base/thread.h"
#include "test/gtest.h" #include "test/gtest.h"
@ -129,7 +130,9 @@ class SignalThreadTest : public ::testing::Test, public sigslot::has_slots<> {
class OwnerThread : public Thread, public sigslot::has_slots<> { class OwnerThread : public Thread, public sigslot::has_slots<> {
public: public:
explicit OwnerThread(SignalThreadTest* harness) explicit OwnerThread(SignalThreadTest* harness)
: harness_(harness), has_run_(false) {} : Thread(absl::make_unique<NullSocketServer>()),
harness_(harness),
has_run_(false) {}
~OwnerThread() override { Stop(); } ~OwnerThread() override { Stop(); }

View File

@ -155,9 +155,6 @@ Thread::ScopedDisallowBlockingCalls::~ScopedDisallowBlockingCalls() {
thread_->SetAllowBlockingCalls(previous_state_); thread_->SetAllowBlockingCalls(previous_state_);
} }
// DEPRECATED.
Thread::Thread() : Thread(SocketServer::CreateDefault()) {}
Thread::Thread(SocketServer* ss) : Thread(ss, /*do_init=*/true) {} Thread::Thread(SocketServer* ss) : Thread(ss, /*do_init=*/true) {}
Thread::Thread(std::unique_ptr<SocketServer> ss) Thread::Thread(std::unique_ptr<SocketServer> ss)

View File

@ -128,13 +128,6 @@ class Runnable {
class RTC_LOCKABLE Thread : public MessageQueue { class RTC_LOCKABLE Thread : public MessageQueue {
public: public:
// DEPRECATED.
// The default constructor should not be used because it hides whether or
// not a socket server will be associated with the thread. Most instances
// of Thread do actually not need one, so please use either of the Create*
// methods to construct an instance of Thread.
Thread();
explicit Thread(SocketServer* ss); explicit Thread(SocketServer* ss);
explicit Thread(std::unique_ptr<SocketServer> ss); explicit Thread(std::unique_ptr<SocketServer> ss);
// Constructors meant for subclasses; they should call DoInit themselves and // Constructors meant for subclasses; they should call DoInit themselves and

View File

@ -10,6 +10,7 @@
#include <memory> #include <memory>
#include "absl/memory/memory.h"
#include "rtc_base/async_invoker.h" #include "rtc_base/async_invoker.h"
#include "rtc_base/async_udp_socket.h" #include "rtc_base/async_udp_socket.h"
#include "rtc_base/event.h" #include "rtc_base/event.h"
@ -513,7 +514,7 @@ TEST_F(AsyncInvokeTest, KillInvokerDuringExecuteWithReentrantInvoke) {
bool reentrant_functor_run = false; bool reentrant_functor_run = false;
Thread* main = Thread::Current(); Thread* main = Thread::Current();
Thread thread; Thread thread(absl::make_unique<NullSocketServer>());
thread.Start(); thread.Start();
{ {
AsyncInvoker invoker; AsyncInvoker invoker;