[go: nahoru, domu]

Make crypto::GetSystemNSSKeySlot asynchronous.

The system slot is set asynchronously, so the getting the system slot should happen asynchronously as well.

BUG=210525
TBR=rsleevi@chromium.org

Review URL: https://codereview.chromium.org/426983002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286493 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/crypto/nss_util_internal.h b/crypto/nss_util_internal.h
index c40295f..cb1b9bd 100644
--- a/crypto/nss_util_internal.h
+++ b/crypto/nss_util_internal.h
@@ -47,9 +47,11 @@
 };
 
 #if defined(OS_CHROMEOS)
-// Returns a reference to the system-wide TPM slot. Caller must release returned
-// reference with PK11_FreeSlot.
-CRYPTO_EXPORT PK11SlotInfo* GetSystemNSSKeySlot() WARN_UNUSED_RESULT;
+// Returns a reference to the system-wide TPM slot if it is loaded. If it is not
+// loaded and |callback| is non-null, the |callback| will be run once the slot
+// is loaded.
+CRYPTO_EXPORT ScopedPK11Slot GetSystemNSSKeySlot(
+    const base::Callback<void(ScopedPK11Slot)>& callback) WARN_UNUSED_RESULT;
 
 // Sets the test system slot. If this was called before
 // InitializeTPMTokenAndSystemSlot and no system token is provided by the Chaps