Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Unified Diff: net/base/dns_reload_timer.cc

Issue 5242002: Reland 66791 (change was innocent)... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browser_thread.cc ('k') | net/base/ev_root_ca_metadata.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « chrome/browser/browser_thread.cc ('k') | net/base/ev_root_ca_metadata.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698