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" |
(...skipping 21 matching lines...) Expand all Loading... |
32 // thread. | 32 // thread. |
33 // NetworkChangeNotifierFactoryAndroid ('Factory') - Creates the Delegate on the | 33 // NetworkChangeNotifierFactoryAndroid ('Factory') - Creates the Delegate on the |
34 // main thread to receive JNI events, and vends Notifiers. Lives exclusively | 34 // main thread to receive JNI events, and vends Notifiers. Lives exclusively |
35 // on main application thread, and outlives all other classes. | 35 // on main application thread, and outlives all other classes. |
36 // NetworkChangeNotifierAndroid ('Notifier') - Receives event notifications from | 36 // NetworkChangeNotifierAndroid ('Notifier') - Receives event notifications from |
37 // the Delegate. Processes and forwards these events to the | 37 // the Delegate. Processes and forwards these events to the |
38 // NetworkChangeNotifier observers on their threads. May live on any thread | 38 // NetworkChangeNotifier observers on their threads. May live on any thread |
39 // and be called by any thread. | 39 // and be called by any thread. |
40 // | 40 // |
41 // For more details, see the implementation file. | 41 // For more details, see the implementation file. |
42 class 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 virtual ~NetworkChangeNotifierAndroid(); | 46 virtual ~NetworkChangeNotifierAndroid(); |
47 | 47 |
48 // NetworkChangeNotifier: | 48 // NetworkChangeNotifier: |
49 virtual ConnectionType GetCurrentConnectionType() const OVERRIDE; | 49 virtual ConnectionType GetCurrentConnectionType() const OVERRIDE; |
50 | 50 |
51 // NetworkChangeNotifierDelegateAndroid::Observer: | 51 // NetworkChangeNotifierDelegateAndroid::Observer: |
52 virtual void OnConnectionTypeChanged( | 52 virtual void OnConnectionTypeChanged( |
(...skipping 13 matching lines...) Expand all Loading... |
66 NetworkChangeNotifierDelegateAndroid* const delegate_; | 66 NetworkChangeNotifierDelegateAndroid* const delegate_; |
67 mutable base::Lock connection_type_lock_; // Protects the state below. | 67 mutable base::Lock connection_type_lock_; // Protects the state below. |
68 ConnectionType connection_type_; | 68 ConnectionType connection_type_; |
69 | 69 |
70 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierAndroid); | 70 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierAndroid); |
71 }; | 71 }; |
72 | 72 |
73 } // namespace net | 73 } // namespace net |
74 | 74 |
75 #endif // NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_ | 75 #endif // NET_ANDROID_NETWORK_CHANGE_NOTIFIER_ANDROID_H_ |
OLD | NEW |