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 15 matching lines...) Expand all Loading... | |
26 // NetworkChangeNotifier implementation: | 26 // NetworkChangeNotifier implementation: |
27 virtual ConnectionType GetCurrentConnectionType() const OVERRIDE; | 27 virtual ConnectionType GetCurrentConnectionType() const OVERRIDE; |
28 | 28 |
29 class DnsWatcherThread; | 29 class DnsWatcherThread; |
30 | 30 |
31 // Forwarder just exists to keep the NetworkConfigWatcherMac API out of | 31 // Forwarder just exists to keep the NetworkConfigWatcherMac API out of |
32 // NetworkChangeNotifierMac's public API. | 32 // NetworkChangeNotifierMac's public API. |
33 class Forwarder : public NetworkConfigWatcherMac::Delegate { | 33 class Forwarder : public NetworkConfigWatcherMac::Delegate { |
34 public: | 34 public: |
35 explicit Forwarder(NetworkChangeNotifierMac* net_config_watcher) | 35 explicit Forwarder(NetworkChangeNotifierMac* net_config_watcher) |
36 : net_config_watcher_(net_config_watcher) {} | 36 : net_config_watcher_(net_config_watcher) {} |
mmenke
2012/08/09 15:13:35
Shouldn't this be de-inlined as well?
hans
2012/08/09 15:35:42
The plugin doesn't consider it to be complex enoug
mmenke
2012/08/09 15:41:51
I'm fine with it as-is, just wasn't sure if you we
| |
37 | 37 |
38 // NetworkConfigWatcherMac::Delegate implementation: | 38 // NetworkConfigWatcherMac::Delegate implementation: |
39 virtual void Init() OVERRIDE { | 39 virtual void Init() OVERRIDE; |
40 net_config_watcher_->SetInitialConnectionType(); | 40 virtual void StartReachabilityNotifications() OVERRIDE; |
41 } | |
42 virtual void StartReachabilityNotifications() OVERRIDE { | |
43 net_config_watcher_->StartReachabilityNotifications(); | |
44 } | |
45 virtual void SetDynamicStoreNotificationKeys( | 41 virtual void SetDynamicStoreNotificationKeys( |
46 SCDynamicStoreRef store) OVERRIDE { | 42 SCDynamicStoreRef store) OVERRIDE; |
47 net_config_watcher_->SetDynamicStoreNotificationKeys(store); | 43 virtual void OnNetworkConfigChange(CFArrayRef changed_keys) OVERRIDE; |
48 } | |
49 virtual void OnNetworkConfigChange(CFArrayRef changed_keys) OVERRIDE { | |
50 net_config_watcher_->OnNetworkConfigChange(changed_keys); | |
51 } | |
52 | 44 |
53 private: | 45 private: |
54 NetworkChangeNotifierMac* const net_config_watcher_; | 46 NetworkChangeNotifierMac* const net_config_watcher_; |
55 DISALLOW_COPY_AND_ASSIGN(Forwarder); | 47 DISALLOW_COPY_AND_ASSIGN(Forwarder); |
56 }; | 48 }; |
57 | 49 |
58 // Methods directly called by the NetworkConfigWatcherMac::Delegate: | 50 // Methods directly called by the NetworkConfigWatcherMac::Delegate: |
59 void StartReachabilityNotifications(); | 51 void StartReachabilityNotifications(); |
60 void SetDynamicStoreNotificationKeys(SCDynamicStoreRef store); | 52 void SetDynamicStoreNotificationKeys(SCDynamicStoreRef store); |
61 void OnNetworkConfigChange(CFArrayRef changed_keys); | 53 void OnNetworkConfigChange(CFArrayRef changed_keys); |
(...skipping 18 matching lines...) Expand all Loading... | |
80 | 72 |
81 // Thread on which we can run DnsConfigWatcher, which requires TYPE_IO. | 73 // Thread on which we can run DnsConfigWatcher, which requires TYPE_IO. |
82 scoped_ptr<DnsWatcherThread> dns_watcher_thread_; | 74 scoped_ptr<DnsWatcherThread> dns_watcher_thread_; |
83 | 75 |
84 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierMac); | 76 DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierMac); |
85 }; | 77 }; |
86 | 78 |
87 } // namespace net | 79 } // namespace net |
88 | 80 |
89 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_MAC_H_ | 81 #endif // NET_BASE_NETWORK_CHANGE_NOTIFIER_MAC_H_ |
OLD | NEW |