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

Unified Diff: webrtc/base/network.h

Issue 1391703003: Create network change notifier. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Minor fix on the comment Created 5 years, 2 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/network.h
diff --git a/webrtc/base/network.h b/webrtc/base/network.h
index f365a7877262ed30c149daa15bfcf63bf07eac0a..e467979aea9b3c4747f42a21abc70d434ac3b0a0 100644
--- a/webrtc/base/network.h
+++ b/webrtc/base/network.h
@@ -29,6 +29,7 @@ struct ifaddrs;
namespace rtc {
class Network;
+class NetworkChangeNotifier;
class Thread;
enum AdapterType {
@@ -147,7 +148,6 @@ class NetworkManagerBase : public NetworkManager {
private:
friend class NetworkTest;
- void DoUpdateNetworks();
EnumerationPermission enumeration_permission_;
@@ -164,7 +164,8 @@ class NetworkManagerBase : public NetworkManager {
// Basic implementation of the NetworkManager interface that gets list
// of networks using OS APIs.
class BasicNetworkManager : public NetworkManagerBase,
- public MessageHandler {
+ public MessageHandler,
+ public sigslot::has_slots<> {
public:
BasicNetworkManager();
~BasicNetworkManager() override;
@@ -222,6 +223,16 @@ class BasicNetworkManager : public NetworkManagerBase,
private:
friend class NetworkTest;
+ // Creates the network change notifier and starts to listen to the update.
+ void StartNetworkChangeNotifier();
+ // Removes the network change notifier.
+ void StopNetworkChangeNotifier();
+ // Called when it receives the update from the network change notifier.
+ void OnNetworkChangeNotified();
+
+ // Updates the network and reschedule the next update.
+ void UpdateNetworks();
+ // Only updates the network; do not reschedule the next update.
pthatcher1 2015/10/09 23:11:29 do not => does not
honghaiz3 2015/10/13 23:19:56 Done.
void DoUpdateNetworks();
pthatcher1 2015/10/09 23:11:29 I think a better name pair would be UpdateNetworks
honghaiz3 2015/10/13 23:19:56 Done.
Thread* thread_;
@@ -230,6 +241,7 @@ class BasicNetworkManager : public NetworkManagerBase,
std::vector<std::string> network_ignore_list_;
int network_ignore_mask_;
bool ignore_non_default_routes_;
+ scoped_ptr<NetworkChangeNotifier> network_change_notifier_;
};
// Represents a Unix-type network interface, with a name and single address.
« no previous file with comments | « webrtc/base/base.gyp ('k') | webrtc/base/network.cc » ('j') | webrtc/base/network.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698