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

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

Issue 10580038: Allow OpenSSLPrivateKeyStore and Android global app context leaking. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 | « base/android/jni_android.cc ('k') | no next file » | 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) 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
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
OLDNEW
« no previous file with comments | « base/android/jni_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698