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/2981623002
Cr-Commit-Position: refs/heads/master@{#19001}
diff --git a/webrtc/rtc_base/thread.h b/webrtc/rtc_base/thread.h
index 35b28ea..72f15fde 100644
--- a/webrtc/rtc_base/thread.h
+++ b/webrtc/rtc_base/thread.h
@@ -101,9 +101,10 @@
// WARNING! SUBCLASSES MUST CALL Stop() IN THEIR DESTRUCTORS! See ~Thread().
class LOCKABLE Thread : public MessageQueue {
- public:
- // Create a new Thread and optionally assign it to the passed SocketServer.
+ protected:
Thread();
+
+ public:
explicit Thread(SocketServer* ss);
explicit Thread(std::unique_ptr<SocketServer> ss);