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

Side by Side Diff: net/base/dns_reloader.cc

Issue 9192024: Add a convenience typedef LazyInstance<T>::Leaky to avoid repeating T. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 11 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/base/media_log.cc ('k') | net/base/net_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/base/dns_reloader.h" 5 #include "net/base/dns_reloader.h"
6 6
7 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \ 7 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
8 !defined(OS_ANDROID) 8 !defined(OS_ANDROID)
9 9
10 #include <resolv.h> 10 #include <resolv.h>
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 static base::ThreadLocalStorage::Slot tls_index_ ; 96 static base::ThreadLocalStorage::Slot tls_index_ ;
97 97
98 DISALLOW_COPY_AND_ASSIGN(DnsReloader); 98 DISALLOW_COPY_AND_ASSIGN(DnsReloader);
99 }; 99 };
100 100
101 // A TLS slot to the ReloadState for the current thread. 101 // A TLS slot to the ReloadState for the current thread.
102 // static 102 // static
103 base::ThreadLocalStorage::Slot DnsReloader::tls_index_( 103 base::ThreadLocalStorage::Slot DnsReloader::tls_index_(
104 base::LINKER_INITIALIZED); 104 base::LINKER_INITIALIZED);
105 105
106 base::LazyInstance<DnsReloader, 106 base::LazyInstance<DnsReloader>::Leaky
107 base::LeakyLazyInstanceTraits<DnsReloader> >
108 g_dns_reloader = LAZY_INSTANCE_INITIALIZER; 107 g_dns_reloader = LAZY_INSTANCE_INITIALIZER;
109 108
110 } // namespace 109 } // namespace
111 110
112 namespace net { 111 namespace net {
113 112
114 void EnsureDnsReloaderInit() { 113 void EnsureDnsReloaderInit() {
115 DnsReloader* t ALLOW_UNUSED = g_dns_reloader.Pointer(); 114 DnsReloader* t ALLOW_UNUSED = g_dns_reloader.Pointer();
116 } 115 }
117 116
118 void DnsReloaderMaybeReload() { 117 void DnsReloaderMaybeReload() {
119 // This routine can be called by any of the DNS worker threads. 118 // This routine can be called by any of the DNS worker threads.
120 DnsReloader* dns_reloader = g_dns_reloader.Pointer(); 119 DnsReloader* dns_reloader = g_dns_reloader.Pointer();
121 dns_reloader->MaybeReload(); 120 dns_reloader->MaybeReload();
122 } 121 }
123 122
124 } // namespace net 123 } // namespace net
125 124
126 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && 125 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) &&
127 // !defined(OS_ANDROID) 126 // !defined(OS_ANDROID)
OLDNEW
« no previous file with comments | « media/base/media_log.cc ('k') | net/base/net_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698