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

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: rebase; move two Thread constructors to protected 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
Index: webrtc/base/thread.h
diff --git a/webrtc/base/thread.h b/webrtc/base/thread.h
index df5a686952f4efe49ea3873a844d245016b8c218..7928c934d4dc085fc39caca8cbdaab24b3def807 100644
--- a/webrtc/base/thread.h
+++ b/webrtc/base/thread.h
@@ -99,7 +99,8 @@ class Thread : public MessageQueue {
// 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);
tommi 2016/04/27 12:45:25 Down the line, I think it would be good if the soc
danilchap 2016/04/27 15:08:55 I see this cl as a small step towards that goal.
// NOTE: ALL SUBCLASSES OF Thread MUST CALL Stop() IN THEIR DESTRUCTORS (or
// guarantee Stop() is explicitly called before the subclass is destroyed).
@@ -107,6 +108,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
@@ -224,6 +227,9 @@ class Thread : public MessageQueue {
void UnwrapCurrent();
protected:
+ Thread(SocketServer* ss, bool init_queue);
+ Thread(std::unique_ptr<SocketServer> ss, bool init_queue);
+
// Same as WrapCurrent except that it never fails as it does not try to
// acquire the synchronization access of the thread. The caller should never
// call Stop() or Join() on this thread.
@@ -291,7 +297,7 @@ class Thread : public MessageQueue {
class AutoThread : public Thread {
public:
- explicit AutoThread(SocketServer* ss = nullptr);
+ AutoThread();
~AutoThread() override;
private:

Powered by Google App Engine
This is Rietveld 408576698