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

Unified Diff: net/base/network_change_notifier_mac.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_mac.h ('k') | net/base/network_change_notifier_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/network_change_notifier_mac.cc
diff --git a/net/base/network_change_notifier_mac.cc b/net/base/network_change_notifier_mac.cc
index 515cbd0303397ba4b4bae44d3a0d22aa0e5ed060..2c350df6990a782e917cbd7c2d36da25f233aab3 100644
--- a/net/base/network_change_notifier_mac.cc
+++ b/net/base/network_change_notifier_mac.cc
@@ -63,7 +63,8 @@ class NetworkChangeNotifierMac::DnsConfigServiceThread : public base::Thread {
};
NetworkChangeNotifierMac::NetworkChangeNotifierMac()
- : connection_type_(CONNECTION_UNKNOWN),
+ : NetworkChangeNotifier(NetworkChangeCalculatorParamsMac()),
+ connection_type_(CONNECTION_UNKNOWN),
connection_type_initialized_(false),
initial_connection_type_cv_(&connection_type_lock_),
forwarder_(this),
@@ -89,6 +90,20 @@ NetworkChangeNotifierMac::~NetworkChangeNotifierMac() {
}
}
+// static
+NetworkChangeNotifier::NetworkChangeCalculatorParams
+NetworkChangeNotifierMac::NetworkChangeCalculatorParamsMac() {
+ 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(500);
+ params.ip_address_online_delay_ = base::TimeDelta::FromMilliseconds(500);
+ params.connection_type_offline_delay_ =
+ base::TimeDelta::FromMilliseconds(1000);
+ params.connection_type_online_delay_ = base::TimeDelta::FromMilliseconds(500);
+ return params;
+}
+
NetworkChangeNotifier::ConnectionType
NetworkChangeNotifierMac::GetCurrentConnectionType() const {
base::AutoLock lock(connection_type_lock_);
« no previous file with comments | « net/base/network_change_notifier_mac.h ('k') | net/base/network_change_notifier_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698