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

Side by Side Diff: base/crypto/scoped_capi_types.h

Issue 2253001: Revert 48186, 48196, 48198 (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 7 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
« no previous file with comments | « app/win/window_impl.h ('k') | base/event_trace_consumer_win_unittest.cc » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 BASE_CRYPTO_SCOPED_CAPI_TYPES_H_ 5 #ifndef BASE_CRYPTO_SCOPED_CAPI_TYPES_H_
6 #define BASE_CRYPTO_SCOPED_CAPI_TYPES_H_ 6 #define BASE_CRYPTO_SCOPED_CAPI_TYPES_H_
7 7
8 #include <windows.h> 8 #include <windows.h>
9 #include <wincrypt.h> 9 #include <wincrypt.h>
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 if (handle_ != handle) { 57 if (handle_ != handle) {
58 free_(handle_); 58 free_(handle_);
59 handle_ = handle; 59 handle_ = handle;
60 } 60 }
61 } 61 }
62 62
63 operator CAPIHandle() const { return handle_; } 63 operator CAPIHandle() const { return handle_; }
64 CAPIHandle get() const { return handle_; } 64 CAPIHandle get() const { return handle_; }
65 65
66 CAPIHandle* receive() { 66 CAPIHandle* receive() {
67 CHECK(handle_ == NULL); 67 CHECK_EQ(NULL, handle_);
68 return &handle_; 68 return &handle_;
69 } 69 }
70 70
71 bool operator==(CAPIHandle handle) const { 71 bool operator==(CAPIHandle handle) const {
72 return handle_ == handle; 72 return handle_ == handle;
73 } 73 }
74 74
75 bool operator!=(CAPIHandle handle) const { 75 bool operator!=(CAPIHandle handle) const {
76 return handle_ != handle; 76 return handle_ != handle;
77 } 77 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 typedef ScopedCAPIHandle< 116 typedef ScopedCAPIHandle<
117 HCRYPTKEY, CAPIDestroyer<HCRYPTKEY, CryptDestroyKey> > ScopedHCRYPTKEY; 117 HCRYPTKEY, CAPIDestroyer<HCRYPTKEY, CryptDestroyKey> > ScopedHCRYPTKEY;
118 118
119 typedef ScopedCAPIHandle< 119 typedef ScopedCAPIHandle<
120 HCRYPTHASH, CAPIDestroyer<HCRYPTHASH, CryptDestroyHash> > ScopedHCRYPTHASH; 120 HCRYPTHASH, CAPIDestroyer<HCRYPTHASH, CryptDestroyHash> > ScopedHCRYPTHASH;
121 121
122 } // namespace base 122 } // namespace base
123 123
124 #endif // BASE_CRYPTO_SCOPED_CAPI_TYPES_H_ 124 #endif // BASE_CRYPTO_SCOPED_CAPI_TYPES_H_
OLDNEW
« no previous file with comments | « app/win/window_impl.h ('k') | base/event_trace_consumer_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698