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

Unified Diff: crypto/apple_keychain.h

Issue 10875029: Rename MacKeychain to AppleKeychain (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: crypto/apple_keychain.h
diff --git a/crypto/keychain_mac.h b/crypto/apple_keychain.h
similarity index 92%
rename from crypto/keychain_mac.h
rename to crypto/apple_keychain.h
index bbcf8b1463cdd302f8c5d1c7053c0be65174fe57..840ccee8c2032cc4b3914443d6c1f381eccd703f 100644
--- a/crypto/keychain_mac.h
+++ b/crypto/apple_keychain.h
@@ -10,6 +10,12 @@
#include "base/basictypes.h"
#include "crypto/crypto_export.h"
+#if defined (OS_IOS)
+typedef void* SecKeychainRef;
+typedef void* SecKeychainItemRef;
+typedef void SecKeychainAttributeList;
Ryan Sleevi 2012/08/23 22:22:58 typo: void -> void* However, is this necessary, s
msarda 2012/08/27 14:24:07 This is not a typo. On mac, the SecKeychainAttribu
+#endif
+
namespace crypto {
// Wraps the KeychainServices API in a very thin layer, to allow it to be
@@ -20,11 +26,33 @@ namespace crypto {
// SecKeychainFoo). The only exception is Free, which should be used for
// anything returned from this class that would normally be freed with
// CFRelease (to aid in testing).
-class CRYPTO_EXPORT MacKeychain {
+class CRYPTO_EXPORT AppleKeychain {
public:
- MacKeychain();
- virtual ~MacKeychain();
+ AppleKeychain();
+ virtual ~AppleKeychain();
+
+ virtual OSStatus FindGenericPassword(CFTypeRef keychainOrArray,
+ UInt32 serviceNameLength,
+ const char* serviceName,
+ UInt32 accountNameLength,
+ const char* accountName,
+ UInt32* passwordLength,
+ void** passwordData,
+ SecKeychainItemRef* itemRef) const;
+
+ virtual OSStatus ItemFreeContent(SecKeychainAttributeList* attrList,
+ void* data) const;
+
+ virtual OSStatus AddGenericPassword(SecKeychainRef keychain,
+ UInt32 serviceNameLength,
+ const char* serviceName,
+ UInt32 accountNameLength,
+ const char* accountName,
+ UInt32 passwordLength,
+ const void* passwordData,
+ SecKeychainItemRef* itemRef) const;
+#if !defined(OS_IOS)
virtual OSStatus ItemCopyAttributesAndData(
SecKeychainItemRef itemRef,
SecKeychainAttributeInfo* info,
@@ -67,32 +95,12 @@ class CRYPTO_EXPORT MacKeychain {
const void* passwordData,
SecKeychainItemRef* itemRef) const;
- virtual OSStatus FindGenericPassword(CFTypeRef keychainOrArray,
- UInt32 serviceNameLength,
- const char* serviceName,
- UInt32 accountNameLength,
- const char* accountName,
- UInt32* passwordLength,
- void** passwordData,
- SecKeychainItemRef* itemRef) const;
-
- virtual OSStatus ItemFreeContent(SecKeychainAttributeList* attrList,
- void* data) const;
-
- virtual OSStatus AddGenericPassword(SecKeychainRef keychain,
- UInt32 serviceNameLength,
- const char* serviceName,
- UInt32 accountNameLength,
- const char* accountName,
- UInt32 passwordLength,
- const void* passwordData,
- SecKeychainItemRef* itemRef) const;
-
// Calls CFRelease on the given ref, after checking that |ref| is non-NULL.
virtual void Free(CFTypeRef ref) const;
+#endif // !defined(OS_IOS)
private:
- DISALLOW_COPY_AND_ASSIGN(MacKeychain);
+ DISALLOW_COPY_AND_ASSIGN(AppleKeychain);
};
} // namespace crypto

Powered by Google App Engine
This is Rietveld 408576698