Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: webrtc/rtc_base/thread.cc

Issue 2977953002: Partial Reland of Make the default ctor of rtc::Thread, protected (Closed)
Patch Set: Fix the same error elsewhere Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/rtc_base/thread.h ('k') | webrtc/rtc_base/thread_checker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/rtc_base/thread.cc
diff --git a/webrtc/rtc_base/thread.cc b/webrtc/rtc_base/thread.cc
index 56a145c7d9591c2d289576465a73674c4c63eb5c..9ba0f5134903171178783402a403840fb4c77e59 100644
--- a/webrtc/rtc_base/thread.cc
+++ b/webrtc/rtc_base/thread.cc
@@ -44,7 +44,7 @@ Thread* Thread::Current() {
#ifndef NO_MAIN_THREAD_WRAPPING
// Only autowrap the thread which instantiated the ThreadManager.
if (!thread && manager->IsMainThread()) {
- thread = new Thread();
+ thread = new Thread(SocketServer::CreateDefault());
thread->WrapCurrentWithThreadManager(manager, true);
}
#endif
@@ -87,7 +87,7 @@ void ThreadManager::SetCurrentThread(Thread *thread) {
Thread *ThreadManager::WrapCurrentThread() {
Thread* result = CurrentThread();
if (nullptr == result) {
- result = new Thread();
+ result = new Thread(SocketServer::CreateDefault());
result->WrapCurrentWithThreadManager(this, true);
}
return result;
@@ -115,6 +115,7 @@ Thread::ScopedDisallowBlockingCalls::~ScopedDisallowBlockingCalls() {
thread_->SetAllowBlockingCalls(previous_state_);
}
+// DEPRECATED.
Thread::Thread() : Thread(SocketServer::CreateDefault()) {}
Thread::Thread(SocketServer* ss)
@@ -520,7 +521,7 @@ bool Thread::WrapCurrentWithThreadManager(ThreadManager* thread_manager,
return true;
}
-AutoThread::AutoThread() {
+AutoThread::AutoThread() : Thread(SocketServer::CreateDefault()) {
if (!ThreadManager::Instance()->CurrentThread()) {
ThreadManager::Instance()->SetCurrentThread(this);
}
« no previous file with comments | « webrtc/rtc_base/thread.h ('k') | webrtc/rtc_base/thread_checker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698