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