Remove CryptAcquireContextLocked.

With keygen gone, this is no longer called.

BUG=none

Review-Url: https://codereview.chromium.org/2606393002
Cr-Original-Commit-Position: refs/heads/master@{#441226}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: e125bd2844b955d426e639cebd45b3942e0aba85
diff --git a/capi_util.cc b/capi_util.cc
index 7adfeb8..1e199db 100644
--- a/capi_util.cc
+++ b/capi_util.cc
@@ -5,49 +5,10 @@
 #include "crypto/capi_util.h"
 
 #include <stddef.h>
-
-#include "base/macros.h"
-#include "base/memory/singleton.h"
-#include "base/synchronization/lock.h"
-
-namespace {
-
-class CAPIUtilSingleton {
- public:
-  static CAPIUtilSingleton* GetInstance() {
-    return base::Singleton<CAPIUtilSingleton>::get();
-  }
-
-  // Returns a lock to guard calls to CryptAcquireContext with
-  // CRYPT_DELETEKEYSET or CRYPT_NEWKEYSET.
-  base::Lock& acquire_context_lock() {
-    return acquire_context_lock_;
-  }
-
- private:
-  friend class base::Singleton<CAPIUtilSingleton>;
-  friend struct base::DefaultSingletonTraits<CAPIUtilSingleton>;
-
-  CAPIUtilSingleton() {}
-
-  base::Lock acquire_context_lock_;
-
-  DISALLOW_COPY_AND_ASSIGN(CAPIUtilSingleton);
-};
-
-}  // namespace
+#include <stdlib.h>
 
 namespace crypto {
 
-BOOL CryptAcquireContextLocked(HCRYPTPROV* prov,
-                               LPCWSTR container,
-                               LPCWSTR provider,
-                               DWORD prov_type,
-                               DWORD flags) {
-  base::AutoLock lock(CAPIUtilSingleton::GetInstance()->acquire_context_lock());
-  return CryptAcquireContext(prov, container, provider, prov_type, flags);
-}
-
 void* WINAPI CryptAlloc(size_t size) {
   return malloc(size);
 }
diff --git a/capi_util.h b/capi_util.h
index 6941033..11e2b7b 100644
--- a/capi_util.h
+++ b/capi_util.h
@@ -9,26 +9,9 @@
 #include <stddef.h>
 
 #include "crypto/crypto_export.h"
-#include "crypto/wincrypt_shim.h"
 
 namespace crypto {
 
-// CryptAcquireContext when passed CRYPT_NEWKEYSET or CRYPT_DELETEKEYSET in
-// flags is not thread-safe. For such calls, we create a global lock to
-// synchronize it.
-//
-// From "Threading Issues with Cryptographic Service Providers",
-// <http://msdn.microsoft.com/en-us/library/aa388149(v=VS.85).aspx>:
-//
-// "The CryptAcquireContext function is generally thread safe unless
-// CRYPT_NEWKEYSET or CRYPT_DELETEKEYSET is specified in the dwFlags
-// parameter."
-CRYPTO_EXPORT BOOL CryptAcquireContextLocked(HCRYPTPROV* prov,
-                                             LPCWSTR container,
-                                             LPCWSTR provider,
-                                             DWORD prov_type,
-                                             DWORD flags);
-
 // Wrappers of malloc and free for CryptoAPI routines that need memory
 // allocators, such as in CRYPT_DECODE_PARA. Such routines require WINAPI
 // calling conventions.