Index: webrtc/base/network.h |
diff --git a/webrtc/base/network.h b/webrtc/base/network.h |
index 05943fb9125ea23f9cc24cf7f30f45a7841175ee..a8cfb6919423fe3c00748229364ba550e094ece5 100644 |
--- a/webrtc/base/network.h |
+++ b/webrtc/base/network.h |
@@ -63,6 +63,11 @@ class DefaultLocalAddressProvider { |
// Generic network manager interface. It provides list of local |
// networks. |
+// |
+// This class can be constructed on any thread, but every other method |
+// (including the destructor) should be called on a different thread. |
pthatcher1
2016/06/23 22:01:59
This makes it sound like it must be constructed an
Taylor Brandstetter
2016/06/23 22:59:07
Good catch. Just a situation where my brain was wo
|
+// This allows constructing a NetworkManager subclass on one thread and |
+// passing it into an object that uses it on a different thread. |
class NetworkManager : public DefaultLocalAddressProvider { |
public: |
typedef std::vector<Network*> NetworkList; |
@@ -85,6 +90,10 @@ class NetworkManager : public DefaultLocalAddressProvider { |
// Indicates a failure when getting list of network interfaces. |
sigslot::signal0<> SignalError; |
+ // This should be called on the NetworkManager's thread before the |
+ // NetworkManager is used. Subclasses may override this if necessary. |
+ virtual void Initialize() {} |
+ |
// Start/Stop monitoring of network interfaces |
// list. SignalNetworksChanged or SignalError is emitted immediately |
// after StartUpdating() is called. After that SignalNetworksChanged |