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

Unified Diff: net/base/host_resolver_proc.cc

Issue 439007: Apply test isolation goodness to net_unittests. (Closed)
Patch Set: fix Linux failures Created 11 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 | « no previous file | net/base/run_all_unittests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/host_resolver_proc.cc
diff --git a/net/base/host_resolver_proc.cc b/net/base/host_resolver_proc.cc
index cd6fc12fe30bccdedc0289208c387942e513e98e..473a70c32c48ffad2ab3267e23733c1ffd9dbc05 100644
--- a/net/base/host_resolver_proc.cc
+++ b/net/base/host_resolver_proc.cc
@@ -77,12 +77,6 @@ int HostResolverProc::ResolveUsingPrevious(const std::string& host,
// Keep a timer per calling thread to rate limit the calling of res_ninit.
class DnsReloadTimer {
public:
- DnsReloadTimer() {
- tls_index_.Initialize(SlotReturnFunction);
- }
-
- ~DnsReloadTimer() { }
-
// Check if the timer for the calling thread has expired. When no
// timer exists for the calling thread, create one.
bool Expired() {
@@ -112,6 +106,16 @@ class DnsReloadTimer {
}
private:
+ friend struct DefaultSingletonTraits<DnsReloadTimer>;
wtc 2009/11/25 18:17:01 Do singleton classes need to have their constructo
+
+ DnsReloadTimer() {
+ tls_index_.Initialize(SlotReturnFunction);
+ }
+
+ ~DnsReloadTimer() {
+ tls_index_.Free();
+ }
+
// We use thread local storage to identify which base::TimeTicks to
// interact with.
static ThreadLocalStorage::Slot tls_index_ ;
« no previous file with comments | « no previous file | net/base/run_all_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698