OLD | NEW |
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/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "net/android/network_change_notifier_delegate_android.h" | 11 #include "net/android/network_change_notifier_delegate_android.h" |
12 #include "net/base/network_change_notifier.h" | 12 #include "net/base/network_change_notifier.h" |
13 | 13 |
14 namespace net { | 14 namespace net { |
15 | 15 |
| 16 struct DnsConfig; |
16 class NetworkChangeNotifierAndroidTest; | 17 class NetworkChangeNotifierAndroidTest; |
17 class NetworkChangeNotifierFactoryAndroid; | 18 class NetworkChangeNotifierFactoryAndroid; |
18 | 19 |
19 // NetworkChangeNotifierAndroid observes network events from the Android | 20 // NetworkChangeNotifierAndroid observes network events from the Android |
20 // notification system and forwards them to observers. | 21 // notification system and forwards them to observers. |
21 // | 22 // |
22 // The implementation is complicated by the differing lifetime and thread | 23 // The implementation is complicated by the differing lifetime and thread |
23 // affinity requirements of Android notifications and of NetworkChangeNotifier. | 24 // affinity requirements of Android notifications and of NetworkChangeNotifier. |
24 // | 25 // |
25 // High-level overview: | 26 // High-level overview: |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // Promote GetMaxBandwidthForConnectionSubtype to public for the Android | 60 // Promote GetMaxBandwidthForConnectionSubtype to public for the Android |
60 // delegate class. | 61 // delegate class. |
61 using NetworkChangeNotifier::GetMaxBandwidthForConnectionSubtype; | 62 using NetworkChangeNotifier::GetMaxBandwidthForConnectionSubtype; |
62 | 63 |
63 private: | 64 private: |
64 friend class NetworkChangeNotifierAndroidTest; | 65 friend class NetworkChangeNotifierAndroidTest; |
65 friend class NetworkChangeNotifierFactoryAndroid; | 66 friend class NetworkChangeNotifierFactoryAndroid; |
66 | 67 |
67 class DnsConfigServiceThread; | 68 class DnsConfigServiceThread; |
68 | 69 |
69 explicit NetworkChangeNotifierAndroid( | 70 NetworkChangeNotifierAndroid(NetworkChangeNotifierDelegateAndroid* delegate, |
70 NetworkChangeNotifierDelegateAndroid* delegate); | 71 const DnsConfig* dns_config_for_testing); |
71 | 72 |
72 static NetworkChangeCalculatorParams NetworkChangeCalculatorParamsAndroid(); | 73 static NetworkChangeCalculatorParams NetworkChangeCalculatorParamsAndroid(); |
73 | 74 |
74 NetworkChangeNotifierDelegateAndroid* const delegate_; | 75 NetworkChangeNotifierDelegateAndroid* const delegate_; |
75 scoped_ptr<DnsConfigServiceThread> dns_config_service_thread_; | 76 scoped_ptr<DnsConfigServiceThread> dns_config_service_thread_; |
76 | 77 |
77 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierAndroid); | 78 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierAndroid); |
78 }; | 79 }; |
79 | 80 |
80 } // namespace net | 81 } // namespace net |
81 | 82 |
82 #endif // NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_ | 83 #endif // NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_ |
OLD | NEW |