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_ADDRESS_TRACKER_LINUX_H_ | 5 #ifndef NET_BASE_ADDRESS_TRACKER_LINUX_H_ |
6 #define NET_BASE_ADDRESS_TRACKER_LINUX_H_ | 6 #define NET_BASE_ADDRESS_TRACKER_LINUX_H_ |
7 | 7 |
8 #include <sys/socket.h> // Needed to include netlink. | 8 #include <sys/socket.h> // Needed to include netlink. |
9 // Mask superfluous definition of |struct net|. This is fixed in Linux 2.6.38. | 9 // Mask superfluous definition of |struct net|. This is fixed in Linux 2.6.38. |
10 #define net net_kernel | 10 #define net net_kernel |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "base/synchronization/condition_variable.h" | 21 #include "base/synchronization/condition_variable.h" |
22 #include "base/synchronization/lock.h" | 22 #include "base/synchronization/lock.h" |
23 #include "net/base/net_util.h" | 23 #include "net/base/net_util.h" |
24 #include "net/base/network_change_notifier.h" | 24 #include "net/base/network_change_notifier.h" |
25 | 25 |
26 namespace net { | 26 namespace net { |
27 namespace internal { | 27 namespace internal { |
28 | 28 |
29 // Keeps track of network interface addresses using rtnetlink. Used by | 29 // Keeps track of network interface addresses using rtnetlink. Used by |
30 // NetworkChangeNotifier to provide signals to registered IPAddressObservers. | 30 // NetworkChangeNotifier to provide signals to registered IPAddressObservers. |
31 class NET_EXPORT_PRIVATE AddressTrackerLinux : | 31 class NET_EXPORT_PRIVATE AddressTrackerLinux |
32 public base::MessageLoopForIO::Watcher { | 32 : public base::MessageLoopForIO::Watcher { |
33 public: | 33 public: |
34 typedef std::map<IPAddressNumber, struct ifaddrmsg> AddressMap; | 34 typedef std::map<IPAddressNumber, struct ifaddrmsg> AddressMap; |
35 | 35 |
36 // Will run |address_callback| when the AddressMap changes, |link_callback| | 36 // Will run |address_callback| when the AddressMap changes, |link_callback| |
37 // when the list of online links changes, and |tunnel_callback| when the list | 37 // when the list of online links changes, and |tunnel_callback| when the list |
38 // of online tunnels changes. | 38 // of online tunnels changes. |
39 AddressTrackerLinux(const base::Closure& address_callback, | 39 AddressTrackerLinux(const base::Closure& address_callback, |
40 const base::Closure& link_callback, | 40 const base::Closure& link_callback, |
41 const base::Closure& tunnel_callback); | 41 const base::Closure& tunnel_callback); |
42 virtual ~AddressTrackerLinux(); | 42 virtual ~AddressTrackerLinux(); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 base::Lock is_offline_lock_; | 110 base::Lock is_offline_lock_; |
111 bool is_offline_; | 111 bool is_offline_; |
112 bool is_offline_initialized_; | 112 bool is_offline_initialized_; |
113 base::ConditionVariable is_offline_initialized_cv_; | 113 base::ConditionVariable is_offline_initialized_cv_; |
114 }; | 114 }; |
115 | 115 |
116 } // namespace internal | 116 } // namespace internal |
117 } // namespace net | 117 } // namespace net |
118 | 118 |
119 #endif // NET_BASE_ADDRESS_TRACKER_LINUX_H_ | 119 #endif // NET_BASE_ADDRESS_TRACKER_LINUX_H_ |
OLD | NEW |