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

Side by Side Diff: crypto/scoped_capi_types.h

Issue 1539353003: Switch to standard integer types in crypto/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 years 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
« no previous file with comments | « crypto/rsa_private_key_unittest.cc ('k') | crypto/scoped_openssl_types.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_CAPI_TYPES_H_ 5 #ifndef CRYPTO_SCOPED_CAPI_TYPES_H_
6 #define CRYPTO_SCOPED_CAPI_TYPES_H_ 6 #define CRYPTO_SCOPED_CAPI_TYPES_H_
7 7
8 #include <windows.h> 8 #include <windows.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
11 11
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/macros.h"
13 #include "crypto/wincrypt_shim.h" 14 #include "crypto/wincrypt_shim.h"
14 15
15 namespace crypto { 16 namespace crypto {
16 17
17 // Simple destructor for the Free family of CryptoAPI functions, such as 18 // Simple destructor for the Free family of CryptoAPI functions, such as
18 // CryptDestroyHash, which take only a single argument to release. 19 // CryptDestroyHash, which take only a single argument to release.
19 template <typename CAPIHandle, BOOL (WINAPI *Destroyer)(CAPIHandle)> 20 template <typename CAPIHandle, BOOL (WINAPI *Destroyer)(CAPIHandle)>
20 struct CAPIDestroyer { 21 struct CAPIDestroyer {
21 void operator()(CAPIHandle handle) const { 22 void operator()(CAPIHandle handle) const {
22 if (handle) { 23 if (handle) {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 113
113 typedef ScopedCAPIHandle< 114 typedef ScopedCAPIHandle<
114 HCRYPTKEY, CAPIDestroyer<HCRYPTKEY, CryptDestroyKey> > ScopedHCRYPTKEY; 115 HCRYPTKEY, CAPIDestroyer<HCRYPTKEY, CryptDestroyKey> > ScopedHCRYPTKEY;
115 116
116 typedef ScopedCAPIHandle< 117 typedef ScopedCAPIHandle<
117 HCRYPTHASH, CAPIDestroyer<HCRYPTHASH, CryptDestroyHash> > ScopedHCRYPTHASH; 118 HCRYPTHASH, CAPIDestroyer<HCRYPTHASH, CryptDestroyHash> > ScopedHCRYPTHASH;
118 119
119 } // namespace crypto 120 } // namespace crypto
120 121
121 #endif // CRYPTO_SCOPED_CAPI_TYPES_H_ 122 #endif // CRYPTO_SCOPED_CAPI_TYPES_H_
OLDNEW
« no previous file with comments | « crypto/rsa_private_key_unittest.cc ('k') | crypto/scoped_openssl_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698