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 #include "net/base/network_change_notifier_mac.h" | 5 #include "net/base/network_change_notifier_mac.h" |
6 | 6 |
7 #include <netinet/in.h> | 7 #include <netinet/in.h> |
8 #include <resolv.h> | 8 #include <resolv.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/message_loop/message_loop.h" |
11 #include "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
12 #include "base/threading/thread_restrictions.h" | 13 #include "base/threading/thread_restrictions.h" |
13 #include "net/dns/dns_config_service.h" | 14 #include "net/dns/dns_config_service.h" |
14 | 15 |
15 namespace net { | 16 namespace net { |
16 | 17 |
17 static bool CalculateReachability(SCNetworkConnectionFlags flags) { | 18 static bool CalculateReachability(SCNetworkConnectionFlags flags) { |
18 bool reachable = flags & kSCNetworkFlagsReachable; | 19 bool reachable = flags & kSCNetworkFlagsReachable; |
19 bool connection_required = flags & kSCNetworkFlagsConnectionRequired; | 20 bool connection_required = flags & kSCNetworkFlagsConnectionRequired; |
20 return reachable && !connection_required; | 21 return reachable && !connection_required; |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 } | 267 } |
267 | 268 |
268 #if defined(OS_IOS) | 269 #if defined(OS_IOS) |
269 // On iOS, the SCDynamicStore API does not exist, and we use the reachability | 270 // On iOS, the SCDynamicStore API does not exist, and we use the reachability |
270 // API to detect IP address changes instead. | 271 // API to detect IP address changes instead. |
271 NotifyObserversOfIPAddressChange(); | 272 NotifyObserversOfIPAddressChange(); |
272 #endif // defined(OS_IOS) | 273 #endif // defined(OS_IOS) |
273 } | 274 } |
274 | 275 |
275 } // namespace net | 276 } // namespace net |
OLD | NEW |