summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorjoth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 17:58:00 +0000
committerjoth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 17:58:00 +0000
commit908e0805e70c87a898f536efa92ef2d76e41fd6d (patch)
tree04957f305583658eff6948d8a365c4fa72631c6c /net
parenta8099142a1a8b4fee2136669eb7ab41868e4e7a0 (diff)
downloadchromium_src-908e0805e70c87a898f536efa92ef2d76e41fd6d.zip
chromium_src-908e0805e70c87a898f536efa92ef2d76e41fd6d.tar.gz
chromium_src-908e0805e70c87a898f536efa92ef2d76e41fd6d.tar.bz2
Fix openssl build to work with AllowSingleton changes
BUG=61585 TEST=net & base unit tests; start & quit browser Review URL: http://codereview.chromium.org/5102006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66772 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/x509_certificate_openssl.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/net/base/x509_certificate_openssl.cc b/net/base/x509_certificate_openssl.cc
index 2be38dd..d2c7653 100644
--- a/net/base/x509_certificate_openssl.cc
+++ b/net/base/x509_certificate_openssl.cc
@@ -206,6 +206,13 @@ void DERCache_free(void* parent, void* ptr, CRYPTO_EX_DATA* ad, int idx,
class X509InitSingleton {
public:
+ static X509InitSingleton* Get() {
+ // We allow the X509 store to leak, because it is used from a non-joinable
+ // worker that is not stopped on shutdown, hence may still be using
+ // OpenSSL library after the AtExit runner has completed.
+ return Singleton<X509InitSingleton,
+ LeakySingletonTraits<X509InitSingleton> >::get();
+ }
int der_cache_ex_index() const { return der_cache_ex_index_; }
X509_STORE* store() const { return store_.get(); }
@@ -252,8 +259,7 @@ DERCache* SetDERCache(X509Certificate::OSCertHandle cert,
// not free it).
bool GetDERAndCacheIfNeeded(X509Certificate::OSCertHandle cert,
DERCache* der_cache) {
- int x509_der_cache_index =
- Singleton<X509InitSingleton>::get()->der_cache_ex_index();
+ int x509_der_cache_index = X509InitSingleton::Get()->der_cache_ex_index();
// Re-encoding the DER data via i2d_X509 is an expensive operation, but it's
// necessary for comparing two certificates. We re-encode at most once per
@@ -386,7 +392,7 @@ void X509Certificate::GetDNSNames(std::vector<std::string>* dns_names) const {
// static
X509_STORE* X509Certificate::cert_store() {
- return Singleton<X509InitSingleton>::get()->store();
+ return X509InitSingleton::Get()->store();
}
int X509Certificate::Verify(const std::string& hostname,