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

Side by Side Diff: crypto/keychain_mac.h

Issue 9699112: Move *keychain_mac* files to crypto/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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
OLDNEW
1 // Copyright (c) 2009 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 CHROME_BROWSER_KEYCHAIN_MAC_H_ 5 #ifndef CRYPTO_KEYCHAIN_MAC_H_
6 #define CHROME_BROWSER_KEYCHAIN_MAC_H_ 6 #define CRYPTO_KEYCHAIN_MAC_H_
7 #pragma once 7 #pragma once
8 8
9 #include <Security/Security.h> 9 #include <Security/Security.h>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 12
13 namespace crypto {
14
13 // Wraps the KeychainServices API in a very thin layer, to allow it to be 15 // Wraps the KeychainServices API in a very thin layer, to allow it to be
14 // mocked out for testing. 16 // mocked out for testing.
15 17
16 // See Keychain Services documentation for function documentation, as these call 18 // See Keychain Services documentation for function documentation, as these call
17 // through directly to their Keychain Services equivalents (Foo -> 19 // through directly to their Keychain Services equivalents (Foo ->
18 // SecKeychainFoo). The only exception is Free, which should be used for 20 // SecKeychainFoo). The only exception is Free, which should be used for
19 // anything returned from this class that would normally be freed with 21 // anything returned from this class that would normally be freed with
20 // CFRelease (to aid in testing). 22 // CFRelease (to aid in testing).
21 class MacKeychain { 23 class MacKeychain {
22 public: 24 public:
23 MacKeychain() {} 25 MacKeychain() {}
24 virtual ~MacKeychain() {} 26 virtual ~MacKeychain() {}
25 27
26 virtual OSStatus ItemCopyAttributesAndData( 28 virtual OSStatus ItemCopyAttributesAndData(
27 SecKeychainItemRef itemRef, SecKeychainAttributeInfo *info, 29 SecKeychainItemRef itemRef, SecKeychainAttributeInfo *info,
28 SecItemClass *itemClass, SecKeychainAttributeList **attrList, 30 SecItemClass *itemClass, SecKeychainAttributeList **attrList,
29 UInt32 *length, void **outData) const; 31 UInt32 *length, void **outData) const;
Ryan Sleevi 2012/03/16 20:58:37 Can you update these type names to have the * with
akalin 2012/03/17 07:19:44 I assume you mean the recommended one-arg-per-line
30 32
31 virtual OSStatus ItemModifyAttributesAndData( 33 virtual OSStatus ItemModifyAttributesAndData(
32 SecKeychainItemRef itemRef, const SecKeychainAttributeList *attrList, 34 SecKeychainItemRef itemRef, const SecKeychainAttributeList *attrList,
33 UInt32 length, const void *data) const; 35 UInt32 length, const void *data) const;
34 36
35 virtual OSStatus ItemFreeAttributesAndData(SecKeychainAttributeList *attrList, 37 virtual OSStatus ItemFreeAttributesAndData(SecKeychainAttributeList *attrList,
36 void *data) const; 38 void *data) const;
37 39
38 virtual OSStatus ItemDelete(SecKeychainItemRef itemRef) const; 40 virtual OSStatus ItemDelete(SecKeychainItemRef itemRef) const;
39 41
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 const void *passwordData, 82 const void *passwordData,
81 SecKeychainItemRef *itemRef) const; 83 SecKeychainItemRef *itemRef) const;
82 84
83 // Calls CFRelease on the given ref, after checking that |ref| is non-NULL. 85 // Calls CFRelease on the given ref, after checking that |ref| is non-NULL.
84 virtual void Free(CFTypeRef ref) const; 86 virtual void Free(CFTypeRef ref) const;
85 87
86 private: 88 private:
87 DISALLOW_COPY_AND_ASSIGN(MacKeychain); 89 DISALLOW_COPY_AND_ASSIGN(MacKeychain);
88 }; 90 };
89 91
90 #endif // CHROME_BROWSER_KEYCHAIN_MAC_H_ 92 } // namespace crypto
93
94 #endif // CRYPTO_KEYCHAIN_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698