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

Unified Diff: webrtc/base/thread.h

Issue 1891293002: Adds clearer function to create rtc::Thread without Physical SocketServer (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 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/base/socketserver.h ('k') | webrtc/base/thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/thread.h
diff --git a/webrtc/base/thread.h b/webrtc/base/thread.h
index df5a686952f4efe49ea3873a844d245016b8c218..7623424104a0b87dcd9d6a9223eb76f07340dd08 100644
--- a/webrtc/base/thread.h
+++ b/webrtc/base/thread.h
@@ -95,11 +95,9 @@ class Runnable {
class Thread : public MessageQueue {
public:
// Create a new Thread and optionally assign it to the passed SocketServer.
- // Subclasses that override Clear should pass false for init_queue and call
- // DoInit() from their constructor to prevent races with the
- // MessageQueueManager already using the object while the vtable is still
- // being created.
- explicit Thread(SocketServer* ss = nullptr, bool init_queue = true);
+ Thread();
+ explicit Thread(SocketServer* ss);
+ explicit Thread(std::unique_ptr<SocketServer> ss);
// NOTE: ALL SUBCLASSES OF Thread MUST CALL Stop() IN THEIR DESTRUCTORS (or
// guarantee Stop() is explicitly called before the subclass is destroyed).
@@ -107,6 +105,8 @@ class Thread : public MessageQueue {
// vtable, and the Thread::PreRun calling the virtual method Run().
~Thread() override;
+ static std::unique_ptr<Thread> CreateWithSocketServer();
+ static std::unique_ptr<Thread> Create();
static Thread* Current();
// Used to catch performance regressions. Use this to disallow blocking calls
@@ -291,7 +291,7 @@ class Thread : public MessageQueue {
class AutoThread : public Thread {
public:
- explicit AutoThread(SocketServer* ss = nullptr);
+ AutoThread();
~AutoThread() override;
private:
« no previous file with comments | « webrtc/base/socketserver.h ('k') | webrtc/base/thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698