Index: net/base/network_change_notifier_linux.cc |
diff --git a/net/base/network_change_notifier_linux.cc b/net/base/network_change_notifier_linux.cc |
index a3753a96c1e27df910e751ae88a95d21ddbedf3f..64f0d28deddecc12c3a02eb2945764d002bb6bac 100644 |
--- a/net/base/network_change_notifier_linux.cc |
+++ b/net/base/network_change_notifier_linux.cc |
@@ -306,7 +306,8 @@ NetworkChangeNotifierLinux* NetworkChangeNotifierLinux::CreateForTest( |
} |
NetworkChangeNotifierLinux::NetworkChangeNotifierLinux(dbus::Bus* bus) |
- : notifier_thread_(new Thread(bus)) { |
+ : NetworkChangeNotifier(NetworkChangeCalculatorParamsLinux()), |
+ notifier_thread_(new Thread(bus)) { |
// We create this notifier thread because the notification implementation |
// needs a MessageLoopForIO, and there's no guarantee that |
// MessageLoop::current() meets that criterion. |
@@ -320,6 +321,20 @@ NetworkChangeNotifierLinux::~NetworkChangeNotifierLinux() { |
notifier_thread_->Stop(); |
} |
+// static |
+NetworkChangeNotifier::NetworkChangeCalculatorParams |
+NetworkChangeNotifierLinux::NetworkChangeCalculatorParamsLinux() { |
+ 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(500); |
+ params.connection_type_offline_delay_ = |
+ base::TimeDelta::FromMilliseconds(1500); |
+ params.connection_type_online_delay_ = base::TimeDelta::FromMilliseconds(500); |
+ return params; |
+} |
+ |
NetworkChangeNotifier::ConnectionType |
NetworkChangeNotifierLinux::GetCurrentConnectionType() const { |
return notifier_thread_->GetCurrentConnectionType(); |