| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/openssl_private_key_store.h" | 5 #include "net/base/openssl_private_key_store.h" |
| 6 | 6 |
| 7 #include <openssl/evp.h> | 7 #include <openssl/evp.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 return ret; | 40 return ret; |
| 41 } | 41 } |
| 42 | 42 |
| 43 virtual EVP_PKEY* FetchPrivateKey(EVP_PKEY* pkey) { | 43 virtual EVP_PKEY* FetchPrivateKey(EVP_PKEY* pkey) { |
| 44 // TODO(joth): Implement when client authentication is required. | 44 // TODO(joth): Implement when client authentication is required. |
| 45 NOTIMPLEMENTED(); | 45 NOTIMPLEMENTED(); |
| 46 return NULL; | 46 return NULL; |
| 47 } | 47 } |
| 48 | 48 |
| 49 static OpenSSLKeyStoreAndroid* GetInstance() { | 49 static OpenSSLKeyStoreAndroid* GetInstance() { |
| 50 return Singleton<OpenSSLKeyStoreAndroid>::get(); | 50 // Leak the OpenSSL key store as it is used from a non-joinable worker |
| 51 // thread that may still be running at shutdown. |
| 52 return Singleton< |
| 53 OpenSSLKeyStoreAndroid, |
| 54 OpenSSLKeyStoreAndroidLeakyTraits>::get(); |
| 51 } | 55 } |
| 52 | 56 |
| 53 private: | 57 private: |
| 58 friend struct DefaultSingletonTraits<OpenSSLKeyStoreAndroid>; |
| 59 typedef LeakySingletonTraits<OpenSSLKeyStoreAndroid> |
| 60 OpenSSLKeyStoreAndroidLeakyTraits; |
| 61 |
| 54 OpenSSLKeyStoreAndroid() {} | 62 OpenSSLKeyStoreAndroid() {} |
| 55 friend struct DefaultSingletonTraits<OpenSSLKeyStoreAndroid>; | |
| 56 | 63 |
| 57 DISALLOW_COPY_AND_ASSIGN(OpenSSLKeyStoreAndroid); | 64 DISALLOW_COPY_AND_ASSIGN(OpenSSLKeyStoreAndroid); |
| 58 }; | 65 }; |
| 59 | 66 |
| 60 } // namespace | 67 } // namespace |
| 61 | 68 |
| 62 OpenSSLPrivateKeyStore* OpenSSLPrivateKeyStore::GetInstance() { | 69 OpenSSLPrivateKeyStore* OpenSSLPrivateKeyStore::GetInstance() { |
| 63 return OpenSSLKeyStoreAndroid::GetInstance(); | 70 return OpenSSLKeyStoreAndroid::GetInstance(); |
| 64 } | 71 } |
| 65 | 72 |
| 66 } // namespace net | 73 } // namespace net |
| OLD | NEW |