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

Side by Side Diff: crypto/cssm_init.cc

Issue 16917011: mac: Replace base::mac::ScopedCFTypeRef with base::ScopedCFTypeRef. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: with fixed off-by-1 in git-clang-format Created 7 years, 6 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 | « crypto/apple_keychain_ios.mm ('k') | gpu/config/gpu_info_collector_mac.mm » ('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 #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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 return ::CSSMMalloc(size, NULL); 177 return ::CSSMMalloc(size, NULL);
178 } 178 }
179 179
180 void CSSMFree(void* ptr) { 180 void CSSMFree(void* ptr) {
181 ::CSSMFree(ptr, NULL); 181 ::CSSMFree(ptr, NULL);
182 } 182 }
183 183
184 void LogCSSMError(const char* fn_name, CSSM_RETURN err) { 184 void LogCSSMError(const char* fn_name, CSSM_RETURN err) {
185 if (!err) 185 if (!err)
186 return; 186 return;
187 base::mac::ScopedCFTypeRef<CFStringRef> cfstr( 187 base::ScopedCFTypeRef<CFStringRef> cfstr(
188 SecCopyErrorMessageString(err, NULL)); 188 SecCopyErrorMessageString(err, NULL));
189 LOG(ERROR) << fn_name << " returned " << err 189 LOG(ERROR) << fn_name << " returned " << err
190 << " (" << base::SysCFStringRefToUTF8(cfstr) << ")"; 190 << " (" << base::SysCFStringRefToUTF8(cfstr) << ")";
191 } 191 }
192 192
193 ScopedCSSMData::ScopedCSSMData() { 193 ScopedCSSMData::ScopedCSSMData() {
194 memset(&data_, 0, sizeof(data_)); 194 memset(&data_, 0, sizeof(data_));
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 | « crypto/apple_keychain_ios.mm ('k') | gpu/config/gpu_info_collector_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698