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

Unified Diff: webrtc/base/messagequeue.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/base.gyp ('k') | webrtc/base/messagequeue.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/messagequeue.h
diff --git a/webrtc/base/messagequeue.h b/webrtc/base/messagequeue.h
index d323283741cac23514799c7a15cc77b50e094dcd..30746f68eb11e37b70b9c426ef013e89603cc339 100644
--- a/webrtc/base/messagequeue.h
+++ b/webrtc/base/messagequeue.h
@@ -175,8 +175,8 @@ class MessageQueue {
// init_queue and call DoInit() from their constructor to prevent races
// with the MessageQueueManager using the object while the vtable is still
// being created.
- explicit MessageQueue(SocketServer* ss = NULL,
- bool init_queue = true);
+ MessageQueue(SocketServer* ss, bool init_queue);
+ MessageQueue(std::unique_ptr<SocketServer> ss, bool init_queue);
// NOTE: SUBCLASSES OF MessageQueue THAT OVERRIDE Clear MUST CALL
// DoDestroy() IN THEIR DESTRUCTORS! This is required to avoid a data race
@@ -276,13 +276,13 @@ class MessageQueue {
bool fDestroyed_;
private:
- // The SocketServer is not owned by MessageQueue.
+ // The SocketServer might not be owned by MessageQueue.
SocketServer* ss_ GUARDED_BY(ss_lock_);
- // If a server isn't supplied in the constructor, use this one.
- std::unique_ptr<SocketServer> default_ss_;
+ // Used if SocketServer ownership lies with |this|.
+ std::unique_ptr<SocketServer> own_ss_;
SharedExclusiveLock ss_lock_;
- RTC_DISALLOW_COPY_AND_ASSIGN(MessageQueue);
+ RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(MessageQueue);
};
} // namespace rtc
« no previous file with comments | « webrtc/base/base.gyp ('k') | webrtc/base/messagequeue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698