Delete method MessageQueue::set_socketserver

Instead, make the pointer to the associated socket server a
construction time const, and delete its lock.

Introduces a helper class AutoSocketServerThread for code
(mainly tests) which need a socket server associated with
the current thread.

BUG=webrtc:7501

Review-Url: https://codereview.webrtc.org/2828223002
Cr-Commit-Position: refs/heads/master@{#18047}
diff --git a/webrtc/base/messagequeue.h b/webrtc/base/messagequeue.h
index 20e2e13..e39c9f9 100644
--- a/webrtc/base/messagequeue.h
+++ b/webrtc/base/messagequeue.h
@@ -26,7 +26,6 @@
 #include "webrtc/base/location.h"
 #include "webrtc/base/messagehandler.h"
 #include "webrtc/base/scoped_ref_ptr.h"
-#include "webrtc/base/sharedexclusivelock.h"
 #include "webrtc/base/sigslot.h"
 #include "webrtc/base/socketserver.h"
 #include "webrtc/base/timeutils.h"
@@ -210,7 +209,6 @@
   virtual ~MessageQueue();
 
   SocketServer* socketserver();
-  void set_socketserver(SocketServer* ss);
 
   // Note: The behavior of MessageQueue has changed.  When a MQ is stopped,
   // futher Posts and Sends will fail.  However, any pending Sends and *ready*
@@ -317,10 +315,9 @@
   volatile int stop_;
 
   // The SocketServer might not be owned by MessageQueue.
-  SocketServer* ss_ GUARDED_BY(ss_lock_);
+  SocketServer* const ss_;
   // Used if SocketServer ownership lies with |this|.
   std::unique_ptr<SocketServer> own_ss_;
-  SharedExclusiveLock ss_lock_;
 
   RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(MessageQueue);
 };