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

Unified Diff: net/base/dns_reload_timer.cc

Issue 5206005: Revert 66719 - Reland r65996. Disallows Singletons on non-joinable thread.... (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 66790)
+++ 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/lazy_instance.h"
+#include "base/singleton.h"
#include "base/thread_local_storage.h"
#include "base/time.h"
-namespace {
+namespace net {
// 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 base::DefaultLazyInstanceTraits<DnsReloadTimer>;
+ friend struct DefaultSingletonTraits<DnsReloadTimer>;
DnsReloadTimer() {
// During testing the DnsReloadTimer Singleton may be created and destroyed
@@ -81,16 +81,8 @@
// 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 = g_dns_reload_timer.Pointer();
+ DnsReloadTimer* dns_timer = Singleton<DnsReloadTimer>::get();
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