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

Side by Side Diff: crypto/cssm_init.cc

Issue 6880166: Improving logging in /app, /base, /crypto and /ipc. Updating plain DCHECK() usages for DCHECK_EQ/LE/ (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Static casting to DWORD to fix type mismatch Created 9 years, 8 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 | « base/at_exit.cc ('k') | crypto/signature_creator_mac.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) 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 #include "crypto/cssm_init.h" 5 #include "crypto/cssm_init.h"
6 6
7 #include <Security/SecBase.h> 7 #include <Security/SecBase.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/mac/scoped_cftyperef.h" 10 #include "base/mac/scoped_cftyperef.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 CSSMMalloc, 92 CSSMMalloc,
93 CSSMFree, 93 CSSMFree,
94 CSSMRealloc, 94 CSSMRealloc,
95 CSSMCalloc, 95 CSSMCalloc,
96 NULL 96 NULL
97 }; 97 };
98 98
99 crtn = CSSM_ModuleAttach(&gGuidAppleCSP, &version, &cssmMemoryFunctions, 0, 99 crtn = CSSM_ModuleAttach(&gGuidAppleCSP, &version, &cssmMemoryFunctions, 0,
100 CSSM_SERVICE_CSP, 0, CSSM_KEY_HIERARCHY_NONE, 100 CSSM_SERVICE_CSP, 0, CSSM_KEY_HIERARCHY_NONE,
101 NULL, 0, NULL, &csp_handle_); 101 NULL, 0, NULL, &csp_handle_);
102 DCHECK(crtn == CSSM_OK); 102 DCHECK_EQ(CSSM_OK, crtn);
103 crtn = CSSM_ModuleAttach(&gGuidAppleX509CL, &version, &cssmMemoryFunctions, 103 crtn = CSSM_ModuleAttach(&gGuidAppleX509CL, &version, &cssmMemoryFunctions,
104 0, CSSM_SERVICE_CL, 0, CSSM_KEY_HIERARCHY_NONE, 104 0, CSSM_SERVICE_CL, 0, CSSM_KEY_HIERARCHY_NONE,
105 NULL, 0, NULL, &cl_handle_); 105 NULL, 0, NULL, &cl_handle_);
106 DCHECK(crtn == CSSM_OK); 106 DCHECK_EQ(CSSM_OK, crtn);
107 crtn = CSSM_ModuleAttach(&gGuidAppleX509TP, &version, &cssmMemoryFunctions, 107 crtn = CSSM_ModuleAttach(&gGuidAppleX509TP, &version, &cssmMemoryFunctions,
108 0, CSSM_SERVICE_TP, 0, CSSM_KEY_HIERARCHY_NONE, 108 0, CSSM_SERVICE_TP, 0, CSSM_KEY_HIERARCHY_NONE,
109 NULL, 0, NULL, &tp_handle_); 109 NULL, 0, NULL, &tp_handle_);
110 DCHECK(crtn == CSSM_OK); 110 DCHECK_EQ(CSSM_OK, crtn);
111 } 111 }
112 112
113 ~CSSMInitSingleton() { 113 ~CSSMInitSingleton() {
114 CSSM_RETURN crtn; 114 CSSM_RETURN crtn;
115 if (csp_handle_) { 115 if (csp_handle_) {
116 CSSM_RETURN crtn = CSSM_ModuleDetach(csp_handle_); 116 CSSM_RETURN crtn = CSSM_ModuleDetach(csp_handle_);
117 DCHECK(crtn == CSSM_OK); 117 DCHECK_EQ(CSSM_OK, crtn);
118 } 118 }
119 if (cl_handle_) { 119 if (cl_handle_) {
120 CSSM_RETURN crtn = CSSM_ModuleDetach(cl_handle_); 120 CSSM_RETURN crtn = CSSM_ModuleDetach(cl_handle_);
121 DCHECK(crtn == CSSM_OK); 121 DCHECK_EQ(CSSM_OK, crtn);
122 } 122 }
123 if (tp_handle_) { 123 if (tp_handle_) {
124 CSSM_RETURN crtn = CSSM_ModuleDetach(tp_handle_); 124 CSSM_RETURN crtn = CSSM_ModuleDetach(tp_handle_);
125 DCHECK(crtn == CSSM_OK); 125 DCHECK_EQ(CSSM_OK, crtn);
126 } 126 }
127 if (csp_loaded_) { 127 if (csp_loaded_) {
128 crtn = CSSM_ModuleUnload(&gGuidAppleCSP, NULL, NULL); 128 crtn = CSSM_ModuleUnload(&gGuidAppleCSP, NULL, NULL);
129 DCHECK(crtn == CSSM_OK); 129 DCHECK_EQ(CSSM_OK, crtn);
130 } 130 }
131 if (cl_loaded_) { 131 if (cl_loaded_) {
132 crtn = CSSM_ModuleUnload(&gGuidAppleX509CL, NULL, NULL); 132 crtn = CSSM_ModuleUnload(&gGuidAppleX509CL, NULL, NULL);
133 DCHECK(crtn == CSSM_OK); 133 DCHECK_EQ(CSSM_OK, crtn);
134 } 134 }
135 if (tp_loaded_) { 135 if (tp_loaded_) {
136 crtn = CSSM_ModuleUnload(&gGuidAppleX509TP, NULL, NULL); 136 crtn = CSSM_ModuleUnload(&gGuidAppleX509TP, NULL, NULL);
137 DCHECK(crtn == CSSM_OK); 137 DCHECK_EQ(CSSM_OK, crtn);
138 } 138 }
139 if (inited_) { 139 if (inited_) {
140 crtn = CSSM_Terminate(); 140 crtn = CSSM_Terminate();
141 DCHECK(crtn == CSSM_OK); 141 DCHECK_EQ(CSSM_OK, crtn);
142 } 142 }
143 } 143 }
144 144
145 bool inited_; // True if CSSM_Init has been called successfully. 145 bool inited_; // True if CSSM_Init has been called successfully.
146 bool csp_loaded_; // True if gGuidAppleCSP has been loaded 146 bool csp_loaded_; // True if gGuidAppleCSP has been loaded
147 bool cl_loaded_; // True if gGuidAppleX509CL has been loaded. 147 bool cl_loaded_; // True if gGuidAppleX509CL has been loaded.
148 bool tp_loaded_; // True if gGuidAppleX509TP has been loaded. 148 bool tp_loaded_; // True if gGuidAppleX509TP has been loaded.
149 CSSM_CSP_HANDLE csp_handle_; 149 CSSM_CSP_HANDLE csp_handle_;
150 CSSM_CL_HANDLE cl_handle_; 150 CSSM_CL_HANDLE cl_handle_;
151 CSSM_TP_HANDLE tp_handle_; 151 CSSM_TP_HANDLE tp_handle_;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 } 195 }
196 196
197 ScopedCSSMData::~ScopedCSSMData() { 197 ScopedCSSMData::~ScopedCSSMData() {
198 if (data_.Data) { 198 if (data_.Data) {
199 CSSMFree(data_.Data); 199 CSSMFree(data_.Data);
200 data_.Data = NULL; 200 data_.Data = NULL;
201 } 201 }
202 } 202 }
203 203
204 } // namespace crypto 204 } // namespace crypto
OLDNEW
« no previous file with comments | « base/at_exit.cc ('k') | crypto/signature_creator_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698