Reland of Make the default ctor of rtc::Thread, protected
This is a partial re-land. The change doesn't make the default Thread ctor protected anymore but it does mark it as deprecated and updates all use of it in WebRTC.
Original issue's description:
Make the default ctor of rtc::Thread, protected.
The goal is to force use of Thread::Create or Thread::CreateWithSocketServer.
The default constructor constructs a 'default' socket server, which is usually a 'physical' socket server, but not always. Not every instance of Thread actually needs to have network support, so it's better to have this be explicit instead of unknowingly instantiate one.
BUG=none
Review-Url: https://codereview.webrtc.org/2977953002
Cr-Commit-Position: refs/heads/master@{#19031}
diff --git a/webrtc/rtc_base/physicalsocketserver_unittest.cc b/webrtc/rtc_base/physicalsocketserver_unittest.cc
index ee95c23..34ba027 100644
--- a/webrtc/rtc_base/physicalsocketserver_unittest.cc
+++ b/webrtc/rtc_base/physicalsocketserver_unittest.cc
@@ -610,7 +610,7 @@
// Start a new thread that raises it. It will have to be delivered to that
// thread. Our implementation should safely handle it and dispatch
// RecordSignal() on this thread.
- std::unique_ptr<Thread> thread(new Thread());
+ std::unique_ptr<Thread> thread(Thread::CreateWithSocketServer());
std::unique_ptr<RaiseSigTermRunnable> runnable(new RaiseSigTermRunnable());
thread->Start(runnable.get());
EXPECT_TRUE(ss_->Wait(1500, true));