Index: net/base/dns_reload_timer.cc |
=================================================================== |
--- net/base/dns_reload_timer.cc (revision 66806) |
+++ net/base/dns_reload_timer.cc (working copy) |
@@ -5,11 +5,11 @@ |
#include "net/base/dns_reload_timer.h" |
#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) |
-#include "base/singleton.h" |
+#include "base/lazy_instance.h" |
#include "base/thread_local_storage.h" |
#include "base/time.h" |
-namespace net { |
+namespace { |
// On Linux/BSD, changes to /etc/resolv.conf can go unnoticed thus resulting |
// in DNS queries failing either because nameservers are unknown on startup |
@@ -58,7 +58,7 @@ |
} |
private: |
- friend struct DefaultSingletonTraits<DnsReloadTimer>; |
+ friend struct base::DefaultLazyInstanceTraits<DnsReloadTimer>; |
DnsReloadTimer() { |
// During testing the DnsReloadTimer Singleton may be created and destroyed |
@@ -81,8 +81,16 @@ |
// static |
ThreadLocalStorage::Slot DnsReloadTimer::tls_index_(base::LINKER_INITIALIZED); |
+base::LazyInstance<DnsReloadTimer, |
+ base::LeakyLazyInstanceTraits<DnsReloadTimer> > |
+ g_dns_reload_timer(base::LINKER_INITIALIZED); |
+ |
+} // namespace |
+ |
+namespace net { |
+ |
bool DnsReloadTimerHasExpired() { |
- DnsReloadTimer* dns_timer = Singleton<DnsReloadTimer>::get(); |
+ DnsReloadTimer* dns_timer = g_dns_reload_timer.Pointer(); |
return dns_timer->Expired(); |
} |