// Copyright (c) 2012 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 CRYPTO_SCOPED_NSS_TYPES_H_ #define CRYPTO_SCOPED_NSS_TYPES_H_ #include #include #include #include #include "base/memory/scoped_ptr.h" namespace crypto { template struct NSSDestroyer { void operator()(Type* ptr) const { Destroyer(ptr); } }; template struct NSSDestroyer1 { void operator()(Type* ptr) const { Destroyer(ptr, freeit); } }; // Define some convenient scopers around NSS pointers. typedef scoped_ptr > ScopedPK11Context; typedef scoped_ptr > ScopedPK11Slot; typedef scoped_ptr > ScopedPK11SlotList; typedef scoped_ptr > ScopedPK11SymKey; typedef scoped_ptr > ScopedSECKEYPublicKey; typedef scoped_ptr > ScopedSECKEYPrivateKey; typedef scoped_ptr > ScopedSECAlgorithmID; typedef scoped_ptr > ScopedSECItem; typedef scoped_ptr > ScopedPLArenaPool; } // namespace crypto #endif // CRYPTO_SCOPED_NSS_TYPES_H_