| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_MOCK_MAC_H_ | 5 #ifndef CHROME_BROWSER_KEYCHAIN_MOCK_MAC_H_ |
| 6 #define CHROME_BROWSER_KEYCHAIN_MOCK_MAC_H_ | 6 #define CHROME_BROWSER_KEYCHAIN_MOCK_MAC_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 virtual OSStatus ItemCopyAttributesAndData( | 26 virtual OSStatus ItemCopyAttributesAndData( |
| 27 SecKeychainItemRef itemRef, SecKeychainAttributeInfo *info, | 27 SecKeychainItemRef itemRef, SecKeychainAttributeInfo *info, |
| 28 SecItemClass *itemClass, SecKeychainAttributeList **attrList, | 28 SecItemClass *itemClass, SecKeychainAttributeList **attrList, |
| 29 UInt32 *length, void **outData) const; | 29 UInt32 *length, void **outData) const; |
| 30 // Pass "fail_me" as the data to get errSecAuthFailed. | 30 // Pass "fail_me" as the data to get errSecAuthFailed. |
| 31 virtual OSStatus ItemModifyAttributesAndData( | 31 virtual OSStatus ItemModifyAttributesAndData( |
| 32 SecKeychainItemRef itemRef, const SecKeychainAttributeList *attrList, | 32 SecKeychainItemRef itemRef, const SecKeychainAttributeList *attrList, |
| 33 UInt32 length, const void *data) const; | 33 UInt32 length, const void *data) const; |
| 34 virtual OSStatus ItemFreeAttributesAndData(SecKeychainAttributeList *attrList, | 34 virtual OSStatus ItemFreeAttributesAndData(SecKeychainAttributeList *attrList, |
| 35 void *data) const; | 35 void *data) const; |
| 36 virtual OSStatus ItemDelete(SecKeychainItemRef itemRef) const; |
| 36 virtual OSStatus SearchCreateFromAttributes( | 37 virtual OSStatus SearchCreateFromAttributes( |
| 37 CFTypeRef keychainOrArray, SecItemClass itemClass, | 38 CFTypeRef keychainOrArray, SecItemClass itemClass, |
| 38 const SecKeychainAttributeList *attrList, | 39 const SecKeychainAttributeList *attrList, |
| 39 SecKeychainSearchRef *searchRef) const; | 40 SecKeychainSearchRef *searchRef) const; |
| 40 virtual OSStatus SearchCopyNext(SecKeychainSearchRef searchRef, | 41 virtual OSStatus SearchCopyNext(SecKeychainSearchRef searchRef, |
| 41 SecKeychainItemRef *itemRef) const; | 42 SecKeychainItemRef *itemRef) const; |
| 42 // If there are unused slots in the Mock Keychain's capacity, the new item | 43 // If there are unused slots in the Mock Keychain's capacity, the new item |
| 43 // will use the first free one, otherwise it will stomp the last item. | 44 // will use the first free one, otherwise it will stomp the last item. |
| 44 // Pass "some.domain.com" as the serverName to get errSecDuplicateItem. | 45 // Pass "some.domain.com" as the serverName to get errSecDuplicateItem. |
| 45 virtual OSStatus AddInternetPassword(SecKeychainRef keychain, | 46 virtual OSStatus AddInternetPassword(SecKeychainRef keychain, |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // real mistakes. | 132 // real mistakes. |
| 132 mutable int search_copy_count_; | 133 mutable int search_copy_count_; |
| 133 mutable int keychain_item_copy_count_; | 134 mutable int keychain_item_copy_count_; |
| 134 mutable int attribute_data_copy_count_; | 135 mutable int attribute_data_copy_count_; |
| 135 | 136 |
| 136 // Tracks which items (by index) were added with AddInternetPassword. | 137 // Tracks which items (by index) were added with AddInternetPassword. |
| 137 mutable std::set<unsigned int> added_via_api_; | 138 mutable std::set<unsigned int> added_via_api_; |
| 138 }; | 139 }; |
| 139 | 140 |
| 140 #endif // CHROME_BROWSER_KEYCHAIN_MOCK_MAC_H_ | 141 #endif // CHROME_BROWSER_KEYCHAIN_MOCK_MAC_H_ |
| OLD | NEW |