OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BASE_NETWORK_CONFIG_WATCHER_MAC_H_ | 5 #ifndef NET_BASE_NETWORK_CONFIG_WATCHER_MAC_H_ |
6 #define NET_BASE_NETWORK_CONFIG_WATCHER_MAC_H_ | 6 #define NET_BASE_NETWORK_CONFIG_WATCHER_MAC_H_ |
7 | 7 |
8 #include <SystemConfiguration/SCDynamicStore.h> | 8 #include <SystemConfiguration/SCDynamicStore.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 virtual ~Delegate() {} | 28 virtual ~Delegate() {} |
29 | 29 |
30 // Called to register the notification keys on |store|. | 30 // Called to register the notification keys on |store|. |
31 // Implementors are expected to call SCDynamicStoreSetNotificationKeys(). | 31 // Implementors are expected to call SCDynamicStoreSetNotificationKeys(). |
32 // Will be called on the notifier thread. | 32 // Will be called on the notifier thread. |
33 virtual void SetDynamicStoreNotificationKeys(SCDynamicStoreRef store) = 0; | 33 virtual void SetDynamicStoreNotificationKeys(SCDynamicStoreRef store) = 0; |
34 | 34 |
35 // Called when one of the notification keys has changed. | 35 // Called when one of the notification keys has changed. |
36 // Will be called on the notifier thread. | 36 // Will be called on the notifier thread. |
37 virtual void OnNetworkConfigChange(CFArrayRef changed_keys) = 0; | 37 virtual void OnNetworkConfigChange(CFArrayRef changed_keys) = 0; |
| 38 |
| 39 // Called when the notifier thread is being destroyed. |
| 40 // Will be called on the notifier thread. |
| 41 virtual void CleanUp() {} |
38 }; | 42 }; |
39 | 43 |
40 explicit NetworkConfigWatcherMac(Delegate* delegate); | 44 explicit NetworkConfigWatcherMac(Delegate* delegate); |
41 virtual ~NetworkConfigWatcherMac(); | 45 virtual ~NetworkConfigWatcherMac(); |
42 | 46 |
43 private: | 47 private: |
44 // The thread used to listen for notifications. This relays the notification | 48 // The thread used to listen for notifications. This relays the notification |
45 // to the registered observers without posting back to the thread the object | 49 // to the registered observers without posting back to the thread the object |
46 // was created on. | 50 // was created on. |
47 scoped_ptr<base::Thread> notifier_thread_; | 51 scoped_ptr<base::Thread> notifier_thread_; |
48 | 52 |
49 DISALLOW_COPY_AND_ASSIGN(NetworkConfigWatcherMac); | 53 DISALLOW_COPY_AND_ASSIGN(NetworkConfigWatcherMac); |
50 }; | 54 }; |
51 | 55 |
52 } // namespace net | 56 } // namespace net |
53 | 57 |
54 #endif // NET_BASE_NETWORK_CONFIG_WATCHER_MAC_H_ | 58 #endif // NET_BASE_NETWORK_CONFIG_WATCHER_MAC_H_ |
OLD | NEW |