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

Unified Diff: net/android/network_change_notifier_android.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/android/network_change_notifier_android.h ('k') | net/base/net_log_event_type_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/android/network_change_notifier_android.cc
diff --git a/net/android/network_change_notifier_android.cc b/net/android/network_change_notifier_android.cc
index b765c859119c7ba06484756667ee1bab80e574ed..6dce66981fbd921bc2d1bedbae3e26b73becd735 100644
--- a/net/android/network_change_notifier_android.cc
+++ b/net/android/network_change_notifier_android.cc
@@ -85,11 +85,26 @@ bool NetworkChangeNotifierAndroid::Register(JNIEnv* env) {
NetworkChangeNotifierAndroid::NetworkChangeNotifierAndroid(
NetworkChangeNotifierDelegateAndroid* delegate)
- : delegate_(delegate) {
+ : NetworkChangeNotifier(NetworkChangeCalculatorParamsAndroid()),
+ delegate_(delegate) {
SetConnectionType(NetworkChangeNotifier::CONNECTION_UNKNOWN);
delegate_->AddObserver(this);
}
+// static
+NetworkChangeNotifier::NetworkChangeCalculatorParams
+NetworkChangeNotifierAndroid::NetworkChangeCalculatorParamsAndroid() {
+ NetworkChangeCalculatorParams params;
+ // IPAddressChanged is produced immediately prior to ConnectionTypeChanged
+ // so delay IPAddressChanged so they get merged with the following
+ // ConnectionTypeChanged signal.
+ params.ip_address_offline_delay_ = base::TimeDelta::FromSeconds(1);
+ params.ip_address_online_delay_ = base::TimeDelta::FromSeconds(1);
+ params.connection_type_offline_delay_ = base::TimeDelta::FromSeconds(0);
+ params.connection_type_online_delay_ = base::TimeDelta::FromSeconds(0);
+ return params;
+}
+
void NetworkChangeNotifierAndroid::SetConnectionType(
ConnectionType new_connection_type) {
base::AutoLock auto_lock(connection_type_lock_);
« no previous file with comments | « net/android/network_change_notifier_android.h ('k') | net/base/net_log_event_type_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698