| 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 <memory> | 10 #include <memory> |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 void OnNetworkConfigChange(CFArrayRef changed_keys) override; | 41 void OnNetworkConfigChange(CFArrayRef changed_keys) override; |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 NetworkChangeNotifierMac* const net_config_watcher_; | 44 NetworkChangeNotifierMac* const net_config_watcher_; |
| 45 DISALLOW_COPY_AND_ASSIGN(Forwarder); | 45 DISALLOW_COPY_AND_ASSIGN(Forwarder); |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 class DnsConfigServiceThread; | 49 class DnsConfigServiceThread; |
| 50 | 50 |
| 51 // Called on the main thread on startup, afterwards on the notifier thread. |
| 52 static ConnectionType CalculateConnectionType(SCNetworkConnectionFlags flags); |
| 53 |
| 51 // Methods directly called by the NetworkConfigWatcherMac::Delegate: | 54 // Methods directly called by the NetworkConfigWatcherMac::Delegate: |
| 52 void StartReachabilityNotifications(); | 55 void StartReachabilityNotifications(); |
| 53 void SetDynamicStoreNotificationKeys(SCDynamicStoreRef store); | 56 void SetDynamicStoreNotificationKeys(SCDynamicStoreRef store); |
| 54 void OnNetworkConfigChange(CFArrayRef changed_keys); | 57 void OnNetworkConfigChange(CFArrayRef changed_keys); |
| 55 | 58 |
| 56 void SetInitialConnectionType(); | 59 void SetInitialConnectionType(); |
| 57 | 60 |
| 58 static void ReachabilityCallback(SCNetworkReachabilityRef target, | 61 static void ReachabilityCallback(SCNetworkReachabilityRef target, |
| 59 SCNetworkConnectionFlags flags, | 62 SCNetworkConnectionFlags flags, |
| 60 void* notifier); | 63 void* notifier); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 74 std::unique_ptr<const NetworkConfigWatcherMac> config_watcher_; | 77 std::unique_ptr<const NetworkConfigWatcherMac> config_watcher_; |
| 75 | 78 |
| 76 std::unique_ptr<DnsConfigServiceThread> dns_config_service_thread_; | 79 std::unique_ptr<DnsConfigServiceThread> dns_config_service_thread_; |
| 77 | 80 |
| 78 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierMac); | 81 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierMac); |
| 79 }; | 82 }; |
| 80 | 83 |
| 81 } // namespace net | 84 } // namespace net |
| 82 | 85 |
| 83 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_MAC_H_ | 86 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_MAC_H_ |
| OLD | NEW |