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/dns_reloader.h" | 5 #include "net/base/dns_reloader.h" |
6 | 6 |
7 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \ | 7 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \ |
8 !defined(OS_ANDROID) | 8 !defined(OS_ANDROID) |
9 | 9 |
10 #include <resolv.h> | 10 #include <resolv.h> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/lazy_instance.h" | 13 #include "base/lazy_instance.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
16 #include "base/synchronization/lock.h" | 16 #include "base/synchronization/lock.h" |
17 #include "base/threading/thread_local_storage.h" | 17 #include "base/threading/thread_local_storage.h" |
18 #include "net/base/network_change_notifier.h" | 18 #include "net/base/network_change_notifier.h" |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 // On Linux/BSD, changes to /etc/resolv.conf can go unnoticed thus resulting | 22 // On Linux/BSD, changes to /etc/resolv.conf can go unnoticed thus resulting |
23 // in DNS queries failing either because nameservers are unknown on startup | 23 // in DNS queries failing either because nameservers are unknown on startup |
24 // or because nameserver info has changed as a result of e.g. connecting to | 24 // or because nameserver info has changed as a result of e.g. connecting to |
25 // a new network. Some distributions patch glibc to stat /etc/resolv.conf | 25 // a new network. Some distributions patch glibc to stat /etc/resolv.conf |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 void DnsReloaderMaybeReload() { | 116 void DnsReloaderMaybeReload() { |
117 // This routine can be called by any of the DNS worker threads. | 117 // This routine can be called by any of the DNS worker threads. |
118 DnsReloader* dns_reloader = g_dns_reloader.Pointer(); | 118 DnsReloader* dns_reloader = g_dns_reloader.Pointer(); |
119 dns_reloader->MaybeReload(); | 119 dns_reloader->MaybeReload(); |
120 } | 120 } |
121 | 121 |
122 } // namespace net | 122 } // namespace net |
123 | 123 |
124 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && | 124 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && |
125 // !defined(OS_ANDROID) | 125 // !defined(OS_ANDROID) |
OLD | NEW |