Index: chrome/browser/net/nss_slot_factory.h |
diff --git a/chrome/browser/net/nss_slot_factory.h b/chrome/browser/net/nss_slot_factory.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e315f46d8b4cac49e0a8aa4dba7449f8d6df4928 |
--- /dev/null |
+++ b/chrome/browser/net/nss_slot_factory.h |
@@ -0,0 +1,45 @@ |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_NET_NSS_SLOT_FACTORY_H_ |
+#define CHROME_BROWSER_NET_NSS_SLOT_FACTORY_H_ |
+ |
+#include "base/callback.h" |
+#include "crypto/scoped_nss_types.h" |
+ |
+namespace content { |
+class ResourceContext; |
+} |
+namespace net { |
+class NSSCertDatabase; |
+} |
+ |
+// XXX how should these interact with tests (should they return the |
+// ScopedTestNSSDB if it's active?) |
+ |
+// Returns a reference to the public slot for |context|. |
+// Should be called only on the IO thread. |
+crypto::ScopedPK11Slot GetPublicNSSKeySlotForResourceContext( |
+ content::ResourceContext* context); |
+ |
+// Returns a reference to the private slot for |context|. |
+// Should be called only on the IO thread. |
+// May return NULL if the slot is not ready yet. |
+crypto::ScopedPK11Slot GetPrivateNSSKeySlotForResourceContext( |
+ content::ResourceContext* context); |
+ |
+// Runs |callback| with the private slot handle when the private slot is loaded. |
+// If the slot is already loaded, the |callback| will be run synchronously. |
+// Should be called only on the IO thread. |
+void OnPrivateNSSKeySlotForResourceContextReady( |
+ content::ResourceContext* context, |
+ const base::Callback<void(crypto::ScopedPK11Slot)>& callback); |
+ |
+// Get a NSSCertDatabase for the given |context|. |
+void GetNSSCertDatabaseForResourceContext( |
+ content::ResourceContext* context, |
+ const base::Callback<void(net::NSSCertDatabase*)>& callback); |
+ |
+ |
+#endif // CHROME_BROWSER_NET_NSS_SLOT_FACTORY_H_ |