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

Unified Diff: webrtc/base/messagequeue.cc

Issue 2828223002: Delete method MessageQueue::set_socketserver (Closed)
Patch Set: Use unique_ptr, fixing one leak in VirtualSocketServerTest. Created 3 years, 7 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/messagequeue.cc
diff --git a/webrtc/base/messagequeue.cc b/webrtc/base/messagequeue.cc
index efe618851a82086c5450dd3096684ee04477ee58..cafb70bd002faaf3241db5f9f4633b70767cb887 100644
--- a/webrtc/base/messagequeue.cc
+++ b/webrtc/base/messagequeue.cc
@@ -216,30 +216,16 @@ void MessageQueue::DoDestroy() {
MessageQueueManager::Remove(this);
Clear(nullptr);
- SharedScope ss(&ss_lock_);
if (ss_) {
ss_->SetMessageQueue(nullptr);
}
}
SocketServer* MessageQueue::socketserver() {
- SharedScope ss(&ss_lock_);
return ss_;
}
-void MessageQueue::set_socketserver(SocketServer* ss) {
- // Need to lock exclusively here to prevent simultaneous modifications from
- // other threads. Can't be a shared lock to prevent races with other reading
- // threads.
- // Other places that only read "ss_" can use a shared lock as simultaneous
- // read access is allowed.
- ExclusiveScope es(&ss_lock_);
- ss_ = ss ? ss : own_ss_.get();
- ss_->SetMessageQueue(this);
-}
-
void MessageQueue::WakeUpSocketServer() {
- SharedScope ss(&ss_lock_);
ss_->WakeUp();
}
@@ -357,7 +343,6 @@ bool MessageQueue::Get(Message *pmsg, int cmsWait, bool process_io) {
{
// Wait and multiplex in the meantime
- SharedScope ss(&ss_lock_);
if (!ss_->Wait(static_cast<int>(cmsNext), process_io))
return false;
}

Powered by Google App Engine
This is Rietveld 408576698