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_BASE_NETWORK_CHANGE_NOTIFIER_MAC_H_ | 5 #ifndef NET_BASE_NETWORK_CHANGE_NOTIFIER_MAC_H_ |
6 #define NET_BASE_NETWORK_CHANGE_NOTIFIER_MAC_H_ | 6 #define NET_BASE_NETWORK_CHANGE_NOTIFIER_MAC_H_ |
7 | 7 |
8 #include <SystemConfiguration/SystemConfiguration.h> | 8 #include <SystemConfiguration/SystemConfiguration.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 void StartReachabilityNotifications(); | 52 void StartReachabilityNotifications(); |
53 void SetDynamicStoreNotificationKeys(SCDynamicStoreRef store); | 53 void SetDynamicStoreNotificationKeys(SCDynamicStoreRef store); |
54 void OnNetworkConfigChange(CFArrayRef changed_keys); | 54 void OnNetworkConfigChange(CFArrayRef changed_keys); |
55 | 55 |
56 void SetInitialConnectionType(); | 56 void SetInitialConnectionType(); |
57 | 57 |
58 static void ReachabilityCallback(SCNetworkReachabilityRef target, | 58 static void ReachabilityCallback(SCNetworkReachabilityRef target, |
59 SCNetworkConnectionFlags flags, | 59 SCNetworkConnectionFlags flags, |
60 void* notifier); | 60 void* notifier); |
61 | 61 |
| 62 static NetworkChangeCalculatorParams NetworkChangeCalculatorParamsMac(); |
| 63 |
62 // These must be constructed before config_watcher_ to ensure | 64 // These must be constructed before config_watcher_ to ensure |
63 // the lock is in a valid state when Forwarder::Init is called. | 65 // the lock is in a valid state when Forwarder::Init is called. |
64 ConnectionType connection_type_; | 66 ConnectionType connection_type_; |
65 bool connection_type_initialized_; | 67 bool connection_type_initialized_; |
66 mutable base::Lock connection_type_lock_; | 68 mutable base::Lock connection_type_lock_; |
67 mutable base::ConditionVariable initial_connection_type_cv_; | 69 mutable base::ConditionVariable initial_connection_type_cv_; |
68 base::mac::ScopedCFTypeRef<SCNetworkReachabilityRef> reachability_; | 70 base::mac::ScopedCFTypeRef<SCNetworkReachabilityRef> reachability_; |
69 base::mac::ScopedCFTypeRef<CFRunLoopRef> run_loop_; | 71 base::mac::ScopedCFTypeRef<CFRunLoopRef> run_loop_; |
70 | 72 |
71 Forwarder forwarder_; | 73 Forwarder forwarder_; |
72 scoped_ptr<const NetworkConfigWatcherMac> config_watcher_; | 74 scoped_ptr<const NetworkConfigWatcherMac> config_watcher_; |
73 | 75 |
74 scoped_ptr<DnsConfigServiceThread> dns_config_service_thread_; | 76 scoped_ptr<DnsConfigServiceThread> dns_config_service_thread_; |
75 | 77 |
76 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierMac); | 78 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierMac); |
77 }; | 79 }; |
78 | 80 |
79 } // namespace net | 81 } // namespace net |
80 | 82 |
81 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_MAC_H_ | 83 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_MAC_H_ |
OLD | NEW |