Revert of Make the default ctor of rtc::Thread, protected (patchset #3 id:40001 of https://codereview.webrtc.org/2981623002/ )
Reason for revert:
Break projects.
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/2981623002
> Cr-Commit-Position: refs/heads/master@{#19001}
> Committed: https://chromium.googlesource.com/external/webrtc/+/a8a351599788f346a2265cfcd3da9a06f577de7f
TBR=kthelgason@webrtc.org,tommi@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=none
Review-Url: https://codereview.webrtc.org/2979963002
Cr-Commit-Position: refs/heads/master@{#19003}
diff --git a/webrtc/rtc_base/timeutils_unittest.cc b/webrtc/rtc_base/timeutils_unittest.cc
index a409fb6..5fd9436 100644
--- a/webrtc/rtc_base/timeutils_unittest.cc
+++ b/webrtc/rtc_base/timeutils_unittest.cc
@@ -349,8 +349,8 @@
FakeClock clock;
SetClockForTesting(&clock);
- std::unique_ptr<Thread> worker(Thread::CreateWithSocketServer());
- worker->Start();
+ Thread worker;
+ worker.Start();
// Post an event that won't be executed for 10 seconds.
Event message_handler_dispatched(false, false);
@@ -358,7 +358,7 @@
message_handler_dispatched.Set();
};
FunctorMessageHandler<void, decltype(functor)> handler(functor);
- worker->PostDelayed(RTC_FROM_HERE, 60000, &handler);
+ worker.PostDelayed(RTC_FROM_HERE, 60000, &handler);
// 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
@@ -369,7 +369,7 @@
// and dispatch the message instantly.
clock.AdvanceTime(TimeDelta::FromSeconds(60u));
EXPECT_TRUE(message_handler_dispatched.Wait(0));
- worker->Stop();
+ worker.Stop();
SetClockForTesting(nullptr);