diff options
author | Ben Murdoch <benm@google.com> | 2011-01-07 14:18:56 +0000 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-01-11 10:23:13 +0000 |
commit | 201ade2fbba22bfb27ae029f4d23fca6ded109a0 (patch) | |
tree | b793f4ed916f73cf18357ea467ff3deb5ffb5b52 /net/base/dns_reload_timer.cc | |
parent | d8c4c37a7d0961944bfdfaa117d5c68c8e129c97 (diff) | |
download | external_chromium-201ade2fbba22bfb27ae029f4d23fca6ded109a0.zip external_chromium-201ade2fbba22bfb27ae029f4d23fca6ded109a0.tar.gz external_chromium-201ade2fbba22bfb27ae029f4d23fca6ded109a0.tar.bz2 |
Merge chromium at 9.0.597.55: Initial merge by git.
Change-Id: Id686a88437441ec7e17abb3328a404c7b6c3c6ad
Diffstat (limited to 'net/base/dns_reload_timer.cc')
-rw-r--r-- | net/base/dns_reload_timer.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/net/base/dns_reload_timer.cc b/net/base/dns_reload_timer.cc index 5931c5b..1bfe535 100644 --- a/net/base/dns_reload_timer.cc +++ b/net/base/dns_reload_timer.cc @@ -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 @@ class DnsReloadTimer { } 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 @@ class DnsReloadTimer { // 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(); } |