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

Unified Diff: net/base/network_change_notifier_linux.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_linux.h ('k') | net/base/network_change_notifier_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fc2b3720f9d61d6a842dc17f991ba646165c8a0b..1a16f04ab4bfca2e1ee3b2ae28f4cb85e7763d10 100644
--- a/net/base/network_change_notifier_linux.cc
+++ b/net/base/network_change_notifier_linux.cc
@@ -69,7 +69,8 @@ NetworkChangeNotifierLinux* NetworkChangeNotifierLinux::Create() {
}
NetworkChangeNotifierLinux::NetworkChangeNotifierLinux()
- : notifier_thread_(new Thread()) {
+ : NetworkChangeNotifier(NetworkChangeCalculatorParamsLinux()),
+ notifier_thread_(new Thread()) {
// We create this notifier thread because the notification implementation
// needs a MessageLoopForIO, and there's no guarantee that
// MessageLoop::current() meets that criterion.
@@ -83,6 +84,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(2000);
+ params.ip_address_online_delay_ = base::TimeDelta::FromMilliseconds(2000);
+ 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();
« no previous file with comments | « net/base/network_change_notifier_linux.h ('k') | net/base/network_change_notifier_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698