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

Unified Diff: net/base/network_change_notifier_win.cc

Issue 11360108: Start calculating new combined NetworkChangeNotifier signal (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switch to default argument constructor Created 8 years 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
« no previous file with comments | « net/base/network_change_notifier_win.h ('k') | net/tools/net_watcher/net_watcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/network_change_notifier_win.cc
diff --git a/net/base/network_change_notifier_win.cc b/net/base/network_change_notifier_win.cc
index a32a84dd31e1afaabc6a1ca31e176697a2ec5225..d891ecceb829845d37a9cc7defc04422726d16c7 100644
--- a/net/base/network_change_notifier_win.cc
+++ b/net/base/network_change_notifier_win.cc
@@ -52,7 +52,8 @@ class NetworkChangeNotifierWin::DnsConfigServiceThread : public base::Thread {
};
NetworkChangeNotifierWin::NetworkChangeNotifierWin()
- : is_watching_(false),
+ : NetworkChangeNotifier(NetworkChangeCalculatorParamsWin()),
+ is_watching_(false),
sequential_failures_(0),
ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
dns_config_service_thread_(new DnsConfigServiceThread()),
@@ -71,6 +72,20 @@ NetworkChangeNotifierWin::~NetworkChangeNotifierWin() {
WSACloseEvent(addr_overlapped_.hEvent);
}
+// static
+NetworkChangeNotifier::NetworkChangeCalculatorParams
+NetworkChangeNotifierWin::NetworkChangeCalculatorParamsWin() {
+ NetworkChangeCalculatorParams params;
+ // Delay values arrived at by simple experimentation and adjusted so as to
+ // produce a single signal when switching between network connections.
+ params.ip_address_offline_delay_ = base::TimeDelta::FromMilliseconds(1500);
+ params.ip_address_online_delay_ = base::TimeDelta::FromMilliseconds(1500);
+ params.connection_type_offline_delay_ =
+ base::TimeDelta::FromMilliseconds(1500);
+ params.connection_type_online_delay_ = base::TimeDelta::FromMilliseconds(500);
+ return params;
+}
+
// This implementation does not return the actual connection type but merely
// determines if the user is "online" (in which case it returns
// CONNECTION_UNKNOWN) or "offline" (and then it returns CONNECTION_NONE).
« no previous file with comments | « net/base/network_change_notifier_win.h ('k') | net/tools/net_watcher/net_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698