| 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 |
| 11 #include <linux/rtnetlink.h> | 11 #include <linux/rtnetlink.h> |
| 12 #undef net | 12 #undef net |
| 13 #include <stddef.h> | 13 #include <stddef.h> |
| 14 | 14 |
| 15 #include <map> | 15 #include <map> |
| 16 #include <unordered_set> | 16 #include <unordered_set> |
| 17 | 17 |
| 18 #include "base/callback.h" | 18 #include "base/callback.h" |
| 19 #include "base/compiler_specific.h" | 19 #include "base/compiler_specific.h" |
| 20 #include "base/macros.h" | 20 #include "base/macros.h" |
| 21 #include "base/message_loop/message_loop.h" | 21 #include "base/message_loop/message_loop.h" |
| 22 #include "base/synchronization/condition_variable.h" | 22 #include "base/synchronization/condition_variable.h" |
| 23 #include "base/synchronization/lock.h" | 23 #include "base/synchronization/lock.h" |
| 24 #include "base/threading/thread_checker.h" | 24 #include "base/threading/thread_checker.h" |
| 25 #include "net/base/ip_address.h" | 25 #include "net/base/ip_address.h" |
| 26 #include "net/base/net_export.h" |
| 26 #include "net/base/network_change_notifier.h" | 27 #include "net/base/network_change_notifier.h" |
| 27 | 28 |
| 28 namespace net { | 29 namespace net { |
| 29 namespace internal { | 30 namespace internal { |
| 30 | 31 |
| 31 // Keeps track of network interface addresses using rtnetlink. Used by | 32 // Keeps track of network interface addresses using rtnetlink. Used by |
| 32 // NetworkChangeNotifier to provide signals to registered IPAddressObservers. | 33 // NetworkChangeNotifier to provide signals to registered IPAddressObservers. |
| 33 class NET_EXPORT_PRIVATE AddressTrackerLinux : | 34 class NET_EXPORT_PRIVATE AddressTrackerLinux : |
| 34 public base::MessageLoopForIO::Watcher { | 35 public base::MessageLoopForIO::Watcher { |
| 35 public: | 36 public: |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 int threads_waiting_for_connection_type_initialization_; | 175 int threads_waiting_for_connection_type_initialization_; |
| 175 | 176 |
| 176 // Used to verify single-threaded access in non-tracking mode. | 177 // Used to verify single-threaded access in non-tracking mode. |
| 177 base::ThreadChecker thread_checker_; | 178 base::ThreadChecker thread_checker_; |
| 178 }; | 179 }; |
| 179 | 180 |
| 180 } // namespace internal | 181 } // namespace internal |
| 181 } // namespace net | 182 } // namespace net |
| 182 | 183 |
| 183 #endif // NET_BASE_ADDRESS_TRACKER_LINUX_H_ | 184 #endif // NET_BASE_ADDRESS_TRACKER_LINUX_H_ |
| OLD | NEW |