summaryrefslogtreecommitdiffstats
path: root/net/base/network_change_notifier.h
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-20 23:46:26 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-20 23:46:26 +0000
commita6b32f6e9f9aa4159831c357f59fce2d797556c3 (patch)
tree9f14b2c8475d7be5fca7f171b72f580ad2470bdc /net/base/network_change_notifier.h
parent35f94a440267e4c95985e5ad86715691123cd66f (diff)
downloadchromium_src-a6b32f6e9f9aa4159831c357f59fce2d797556c3.zip
chromium_src-a6b32f6e9f9aa4159831c357f59fce2d797556c3.tar.gz
chromium_src-a6b32f6e9f9aa4159831c357f59fce2d797556c3.tar.bz2
Add netwatcher command-line utility that watches and logs network events
Running netwatcher just creates a NetworkChangeNotifier and a ProxyConfigService and registers the NetWatcher class as observers for them. NetWatcher then logs whenever it receives an event from the NetworkChangeNotifier or ProxyConfigService. This is so that developers can quickly get an idea of what events are triggered when. It may also be useful for nailing down platform differences. Also clean up network_change_notifier.h a bit. BUG=106034 TEST= Review URL: https://chromiumcodereview.appspot.com/10578027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143301 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/network_change_notifier.h')
-rw-r--r--net/base/network_change_notifier.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/net/base/network_change_notifier.h b/net/base/network_change_notifier.h
index f527acd..5df16d0 100644
--- a/net/base/network_change_notifier.h
+++ b/net/base/network_change_notifier.h
@@ -27,6 +27,10 @@ class DnsConfigWatcher;
class NET_EXPORT NetworkChangeNotifier {
public:
// Flags which are ORed together to form |detail| in OnDNSChanged.
+ //
+ // TODO(akalin): Name this enum type and use it instead of plain
+ // 'unsigned' in OnDNSChanged. ORing together enum values always
+ // results in a valid enum value by the C++ standard.
enum {
// The DNS configuration (name servers, suffix search) has changed.
CHANGE_DNS_SETTINGS = 1 << 0,
@@ -41,14 +45,14 @@ class NET_EXPORT NetworkChangeNotifier {
// Using the terminology of the Network Information API:
// http://www.w3.org/TR/netinfo-api.
enum ConnectionType {
- CONNECTION_UNKNOWN, // A connection exists, but its type is unknown.
- CONNECTION_ETHERNET,
- CONNECTION_WIFI,
- CONNECTION_2G,
- CONNECTION_3G,
- CONNECTION_4G,
- CONNECTION_NONE // No connection.
-};
+ CONNECTION_UNKNOWN, // A connection exists, but its type is unknown.
+ CONNECTION_ETHERNET,
+ CONNECTION_WIFI,
+ CONNECTION_2G,
+ CONNECTION_3G,
+ CONNECTION_4G,
+ CONNECTION_NONE // No connection.
+ };
class NET_EXPORT IPAddressObserver {
public: