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

Unified Diff: base/crypto/scoped_nss_types.h

Issue 2804042: Incomplete changes to make scoped_ptr_malloc use plain functions. (Closed)
Patch Set: chrome now builds & links Created 10 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « app/gfx/gl/gl_context_linux.cc ('k') | base/file_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/crypto/scoped_nss_types.h
diff --git a/base/crypto/scoped_nss_types.h b/base/crypto/scoped_nss_types.h
index c1c84c1e42cceb7455896d093e0a44b09703aba5..b5d48df601932b4605c9003b86d7db563ab0ca31 100644
--- a/base/crypto/scoped_nss_types.h
+++ b/base/crypto/scoped_nss_types.h
@@ -12,31 +12,18 @@
namespace base {
-template <typename Type, void (*Destroyer)(Type*)>
-struct NSSDestroyer {
- void operator()(Type* ptr) const {
- if (ptr)
- Destroyer(ptr);
- }
-};
-
template <typename Type, void (*Destroyer)(Type*, PRBool), PRBool freeit>
-struct NSSDestroyer1 {
- void operator()(Type* ptr) const {
- if (ptr)
- Destroyer(ptr, freeit);
- }
-};
+void NSSDestroyer1(Type* ptr) {
+ Destroyer(ptr, freeit);
+}
// Define some convenient scopers around NSS pointers.
typedef scoped_ptr_malloc<
PK11Context, NSSDestroyer1<PK11Context,
PK11_DestroyContext,
PR_TRUE> > ScopedPK11Context;
-typedef scoped_ptr_malloc<
- PK11SlotInfo, NSSDestroyer<PK11SlotInfo, PK11_FreeSlot> > ScopedPK11Slot;
-typedef scoped_ptr_malloc<
- PK11SymKey, NSSDestroyer<PK11SymKey, PK11_FreeSymKey> > ScopedPK11SymKey;
+typedef scoped_ptr_malloc<PK11SlotInfo, PK11_FreeSlot> ScopedPK11Slot;
+typedef scoped_ptr_malloc<PK11SymKey, PK11_FreeSymKey> ScopedPK11SymKey;
typedef scoped_ptr_malloc<
SECAlgorithmID, NSSDestroyer1<SECAlgorithmID,
SECOID_DestroyAlgorithmID,
« no previous file with comments | « app/gfx/gl/gl_context_linux.cc ('k') | base/file_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698