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

Unified Diff: webrtc/base/thread.h

Issue 2828223002: Delete method MessageQueue::set_socketserver (Closed)
Patch Set: Use AutoSocketServerThread at one more place, missed in prev patchset. Created 3 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/ssladapter_unittest.cc ('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 e9bb3249ea809f9b963d58a3a65d932a3e2d3be7..16810a1749456a23b2fa650968269536fcfc43b8 100644
--- a/webrtc/base/thread.h
+++ b/webrtc/base/thread.h
@@ -311,21 +311,21 @@ class AutoThread : public Thread {
RTC_DISALLOW_COPY_AND_ASSIGN(AutoThread);
};
-// Provides an easy way to install/uninstall a socketserver on a thread.
-class SocketServerScope {
+// AutoSocketServerThread automatically installs itself at
+// construction uninstalls at destruction. If a Thread object is
+// already associated with the current OS thread, it is temporarily
+// disassociated and restored by the destructor.
+
+class AutoSocketServerThread : public Thread {
tommi 2017/04/27 13:57:07 if this is only for tests, can we indicate that in
nisse-webrtc 2017/04/27 14:08:56 It's *almost* test-only ;-/ It's used by peerconn
public:
- explicit SocketServerScope(SocketServer* ss) {
- old_ss_ = Thread::Current()->socketserver();
- Thread::Current()->set_socketserver(ss);
- }
- ~SocketServerScope() {
- Thread::Current()->set_socketserver(old_ss_);
- }
+ explicit AutoSocketServerThread(SocketServer* ss);
+ ~AutoSocketServerThread() override;
private:
- SocketServer* old_ss_;
+ private:
tommi 2017/04/27 13:57:07 super private? :)
nisse-webrtc 2017/04/27 14:08:56 Top-secret! And deleted.
+ rtc::Thread* old_thread_;
- RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SocketServerScope);
+ RTC_DISALLOW_COPY_AND_ASSIGN(AutoSocketServerThread);
};
} // namespace rtc
« no previous file with comments | « webrtc/base/ssladapter_unittest.cc ('k') | webrtc/base/thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698