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

Side by Side Diff: crypto/scoped_nss_types.h

Issue 8296014: Use NSS to generate Origin-Bound Certs on Win and Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review changes Created 9 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | net/base/net_error_list.h » ('j') | net/base/net_error_list.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CRYPTO_SCOPED_NSS_TYPES_H_ 5 #ifndef CRYPTO_SCOPED_NSS_TYPES_H_
6 #define CRYPTO_SCOPED_NSS_TYPES_H_ 6 #define CRYPTO_SCOPED_NSS_TYPES_H_
7 #pragma once 7 #pragma once
8 8
9 #include <keyhi.h>
9 #include <nss.h> 10 #include <nss.h>
10 #include <pk11pub.h> 11 #include <pk11pub.h>
11 12
12 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
13 14
14 namespace crypto { 15 namespace crypto {
15 16
16 template <typename Type, void (*Destroyer)(Type*)> 17 template <typename Type, void (*Destroyer)(Type*)>
17 struct NSSDestroyer { 18 struct NSSDestroyer {
18 void operator()(Type* ptr) const { 19 void operator()(Type* ptr) const {
(...skipping 13 matching lines...) Expand all
32 // Define some convenient scopers around NSS pointers. 33 // Define some convenient scopers around NSS pointers.
33 typedef scoped_ptr_malloc< 34 typedef scoped_ptr_malloc<
34 PK11Context, NSSDestroyer1<PK11Context, 35 PK11Context, NSSDestroyer1<PK11Context,
35 PK11_DestroyContext, 36 PK11_DestroyContext,
36 PR_TRUE> > ScopedPK11Context; 37 PR_TRUE> > ScopedPK11Context;
37 typedef scoped_ptr_malloc< 38 typedef scoped_ptr_malloc<
38 PK11SlotInfo, NSSDestroyer<PK11SlotInfo, PK11_FreeSlot> > ScopedPK11Slot; 39 PK11SlotInfo, NSSDestroyer<PK11SlotInfo, PK11_FreeSlot> > ScopedPK11Slot;
39 typedef scoped_ptr_malloc< 40 typedef scoped_ptr_malloc<
40 PK11SymKey, NSSDestroyer<PK11SymKey, PK11_FreeSymKey> > ScopedPK11SymKey; 41 PK11SymKey, NSSDestroyer<PK11SymKey, PK11_FreeSymKey> > ScopedPK11SymKey;
41 typedef scoped_ptr_malloc< 42 typedef scoped_ptr_malloc<
43 SECKEYPublicKey, NSSDestroyer<SECKEYPublicKey, SECKEY_DestroyPublicKey> >
44 ScopedSECKEYPublicKey;
45 typedef scoped_ptr_malloc<
46 SECKEYPrivateKey, NSSDestroyer<SECKEYPrivateKey, SECKEY_DestroyPrivateKey> >
47 ScopedSECKEYPrivateKey;
48 typedef scoped_ptr_malloc<
42 SECAlgorithmID, NSSDestroyer1<SECAlgorithmID, 49 SECAlgorithmID, NSSDestroyer1<SECAlgorithmID,
43 SECOID_DestroyAlgorithmID, 50 SECOID_DestroyAlgorithmID,
44 PR_TRUE> > ScopedSECAlgorithmID; 51 PR_TRUE> > ScopedSECAlgorithmID;
45 typedef scoped_ptr_malloc< 52 typedef scoped_ptr_malloc<
46 SECItem, NSSDestroyer1<SECItem, 53 SECItem, NSSDestroyer1<SECItem,
47 SECITEM_FreeItem, 54 SECITEM_FreeItem,
48 PR_TRUE> > ScopedSECItem; 55 PR_TRUE> > ScopedSECItem;
49 56
50 } // namespace crypto 57 } // namespace crypto
51 58
52 #endif // CRYPTO_SCOPED_NSS_TYPES_H_ 59 #endif // CRYPTO_SCOPED_NSS_TYPES_H_
OLDNEW
« no previous file with comments | « no previous file | net/base/net_error_list.h » ('j') | net/base/net_error_list.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698