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

Side by Side Diff: net/android/network_change_notifier_android.cc

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 //////////////////////////////////////////////////////////////////////////////// 5 ////////////////////////////////////////////////////////////////////////////////
6 // Threading considerations: 6 // Threading considerations:
7 // 7 //
8 // This class is designed to meet various threading guarantees starting from the 8 // This class is designed to meet various threading guarantees starting from the
9 // ones imposed by NetworkChangeNotifier: 9 // ones imposed by NetworkChangeNotifier:
10 // - The notifier can be constructed on any thread. 10 // - The notifier can be constructed on any thread.
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 107
108 NetworkChangeNotifierAndroid::~NetworkChangeNotifierAndroid() { 108 NetworkChangeNotifierAndroid::~NetworkChangeNotifierAndroid() {
109 delegate_->RemoveObserver(this); 109 delegate_->RemoveObserver(this);
110 } 110 }
111 111
112 NetworkChangeNotifier::ConnectionType 112 NetworkChangeNotifier::ConnectionType
113 NetworkChangeNotifierAndroid::GetCurrentConnectionType() const { 113 NetworkChangeNotifierAndroid::GetCurrentConnectionType() const {
114 return delegate_->GetCurrentConnectionType(); 114 return delegate_->GetCurrentConnectionType();
115 } 115 }
116 116
117 double NetworkChangeNotifierAndroid::GetCurrentMaxBandwidth() const {
118 return delegate_->GetCurrentMaxBandwidth();
119 }
120
117 void NetworkChangeNotifierAndroid::OnConnectionTypeChanged() { 121 void NetworkChangeNotifierAndroid::OnConnectionTypeChanged() {
118 DnsConfigServiceThread::NotifyNetworkChangeNotifierObservers(); 122 DnsConfigServiceThread::NotifyNetworkChangeNotifierObservers();
119 } 123 }
120 124
121 // static 125 // static
122 bool NetworkChangeNotifierAndroid::Register(JNIEnv* env) { 126 bool NetworkChangeNotifierAndroid::Register(JNIEnv* env) {
123 return NetworkChangeNotifierDelegateAndroid::Register(env); 127 return NetworkChangeNotifierDelegateAndroid::Register(env);
124 } 128 }
125 129
126 NetworkChangeNotifierAndroid::NetworkChangeNotifierAndroid( 130 NetworkChangeNotifierAndroid::NetworkChangeNotifierAndroid(
(...skipping 14 matching lines...) Expand all
141 // so delay IPAddressChanged so they get merged with the following 145 // so delay IPAddressChanged so they get merged with the following
142 // ConnectionTypeChanged signal. 146 // ConnectionTypeChanged signal.
143 params.ip_address_offline_delay_ = base::TimeDelta::FromSeconds(1); 147 params.ip_address_offline_delay_ = base::TimeDelta::FromSeconds(1);
144 params.ip_address_online_delay_ = base::TimeDelta::FromSeconds(1); 148 params.ip_address_online_delay_ = base::TimeDelta::FromSeconds(1);
145 params.connection_type_offline_delay_ = base::TimeDelta::FromSeconds(0); 149 params.connection_type_offline_delay_ = base::TimeDelta::FromSeconds(0);
146 params.connection_type_online_delay_ = base::TimeDelta::FromSeconds(0); 150 params.connection_type_online_delay_ = base::TimeDelta::FromSeconds(0);
147 return params; 151 return params;
148 } 152 }
149 153
150 } // namespace net 154 } // namespace net
OLDNEW
« 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