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

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

Issue 1306653003: Add connection type to NCN::MaxBandwidthChanged (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment nit Created 5 years, 3 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 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 #ifndef NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_ 5 #ifndef NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_
6 #define NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_ 6 #define NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_
7 7
8 #include "base/android/jni_android.h" 8 #include "base/android/jni_android.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 class NET_EXPORT_PRIVATE NetworkChangeNotifierAndroid 42 class NET_EXPORT_PRIVATE NetworkChangeNotifierAndroid
43 : public NetworkChangeNotifier, 43 : public NetworkChangeNotifier,
44 public NetworkChangeNotifierDelegateAndroid::Observer { 44 public NetworkChangeNotifierDelegateAndroid::Observer {
45 public: 45 public:
46 ~NetworkChangeNotifierAndroid() override; 46 ~NetworkChangeNotifierAndroid() override;
47 47
48 // NetworkChangeNotifier: 48 // NetworkChangeNotifier:
49 ConnectionType GetCurrentConnectionType() const override; 49 ConnectionType GetCurrentConnectionType() const override;
50 // Requires ACCESS_WIFI_STATE permission in order to provide precise WiFi link 50 // Requires ACCESS_WIFI_STATE permission in order to provide precise WiFi link
51 // speed. 51 // speed.
52 double GetCurrentMaxBandwidth() const override; 52 double GetCurrentMaxBandwidthAndConnectionType(
53 ConnectionType* connection_type) const override;
53 54
54 // NetworkChangeNotifierDelegateAndroid::Observer: 55 // NetworkChangeNotifierDelegateAndroid::Observer:
55 void OnConnectionTypeChanged() override; 56 void OnConnectionTypeChanged() override;
56 void OnMaxBandwidthChanged(double max_bandwidth_mbps) override; 57 void OnMaxBandwidthChanged(ConnectionType type,
58 double max_bandwidth_mbps) override;
57 59
58 static bool Register(JNIEnv* env); 60 static bool Register(JNIEnv* env);
59 61
60 // Promote GetMaxBandwidthForConnectionSubtype to public for the Android 62 // Promote GetMaxBandwidthForConnectionSubtype to public for the Android
61 // delegate class. 63 // delegate class.
62 using NetworkChangeNotifier::GetMaxBandwidthForConnectionSubtype; 64 using NetworkChangeNotifier::GetMaxBandwidthForConnectionSubtype;
63 65
64 private: 66 private:
65 friend class NetworkChangeNotifierAndroidTest; 67 friend class NetworkChangeNotifierAndroidTest;
66 friend class NetworkChangeNotifierFactoryAndroid; 68 friend class NetworkChangeNotifierFactoryAndroid;
67 69
68 class DnsConfigServiceThread; 70 class DnsConfigServiceThread;
69 71
70 NetworkChangeNotifierAndroid(NetworkChangeNotifierDelegateAndroid* delegate, 72 NetworkChangeNotifierAndroid(NetworkChangeNotifierDelegateAndroid* delegate,
71 const DnsConfig* dns_config_for_testing); 73 const DnsConfig* dns_config_for_testing);
72 74
73 static NetworkChangeCalculatorParams NetworkChangeCalculatorParamsAndroid(); 75 static NetworkChangeCalculatorParams NetworkChangeCalculatorParamsAndroid();
74 76
75 NetworkChangeNotifierDelegateAndroid* const delegate_; 77 NetworkChangeNotifierDelegateAndroid* const delegate_;
76 scoped_ptr<DnsConfigServiceThread> dns_config_service_thread_; 78 scoped_ptr<DnsConfigServiceThread> dns_config_service_thread_;
77 79
78 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierAndroid); 80 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierAndroid);
79 }; 81 };
80 82
81 } // namespace net 83 } // namespace net
82 84
83 #endif // NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_ 85 #endif // NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698