Index: webrtc/base/network.h |
diff --git a/webrtc/base/network.h b/webrtc/base/network.h |
index 05943fb9125ea23f9cc24cf7f30f45a7841175ee..578d077246f946e8d0e83364ac298da053ae3292 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 the same thread. |
pthatcher1
2016/06/23 23:41:35
Now it sounds like it should be on the same thread
Taylor Brandstetter
2016/06/24 00:43:07
Given the word "but" and the sentence below I thin
|
+// 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 |