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

Unified Diff: net/android/network_change_notifier_android.cc

Issue 11628008: Provide NetworkChangeNotifierAndroid with the actual initial connection type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Ryan's comments + fix Java comment Created 7 years, 12 months 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
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 6dce66981fbd921bc2d1bedbae3e26b73becd735..d4e1a5c8524f6975fd028b3f8b4cbab87cdc5d8c 100644
--- a/net/android/network_change_notifier_android.cc
+++ b/net/android/network_change_notifier_android.cc
@@ -67,13 +67,10 @@ NetworkChangeNotifierAndroid::~NetworkChangeNotifierAndroid() {
NetworkChangeNotifier::ConnectionType
NetworkChangeNotifierAndroid::GetCurrentConnectionType() const {
- base::AutoLock auto_lock(connection_type_lock_);
- return connection_type_;
+ return delegate_->GetCurrentConnectionType();
}
-void NetworkChangeNotifierAndroid::OnConnectionTypeChanged(
- ConnectionType new_connection_type) {
- SetConnectionType(new_connection_type);
+void NetworkChangeNotifierAndroid::OnConnectionTypeChanged() {
NetworkChangeNotifier::NotifyObserversOfIPAddressChange();
NetworkChangeNotifier::NotifyObserversOfConnectionTypeChange();
}
@@ -87,7 +84,6 @@ NetworkChangeNotifierAndroid::NetworkChangeNotifierAndroid(
NetworkChangeNotifierDelegateAndroid* delegate)
: NetworkChangeNotifier(NetworkChangeCalculatorParamsAndroid()),
delegate_(delegate) {
- SetConnectionType(NetworkChangeNotifier::CONNECTION_UNKNOWN);
delegate_->AddObserver(this);
}
@@ -105,10 +101,4 @@ NetworkChangeNotifierAndroid::NetworkChangeCalculatorParamsAndroid() {
return params;
}
-void NetworkChangeNotifierAndroid::SetConnectionType(
- ConnectionType new_connection_type) {
- base::AutoLock auto_lock(connection_type_lock_);
- connection_type_ = new_connection_type;
-}
-
} // namespace net
« no previous file with comments | « net/android/network_change_notifier_android.h ('k') | net/android/network_change_notifier_android_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698