| OLD | NEW |
| 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 #ifndef CRYPTO_MOCK_KEYCHAIN_MAC_H_ | 5 #ifndef CRYPTO_MOCK_KEYCHAIN_MAC_H_ |
| 6 #define CRYPTO_MOCK_KEYCHAIN_MAC_H_ | 6 #define CRYPTO_MOCK_KEYCHAIN_MAC_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 bool called_add_generic() const { return called_add_generic_; } | 133 bool called_add_generic() const { return called_add_generic_; } |
| 134 | 134 |
| 135 // Returns the value of the password set when |AddGenericPassword()| was | 135 // Returns the value of the password set when |AddGenericPassword()| was |
| 136 // called. | 136 // called. |
| 137 std::string add_generic_password() const { return add_generic_password_; } | 137 std::string add_generic_password() const { return add_generic_password_; } |
| 138 | 138 |
| 139 // Returns the number of allocations - deallocations for password data. | 139 // Returns the number of allocations - deallocations for password data. |
| 140 int password_data_count() const { return password_data_count_; } | 140 int password_data_count() const { return password_data_count_; } |
| 141 | 141 |
| 142 private: | 142 private: |
| 143 | |
| 144 // Type used for the keys in the std::map(s) and MockAppleKeychain items. | 143 // Type used for the keys in the std::map(s) and MockAppleKeychain items. |
| 145 typedef uintptr_t MockKeychainItemType; | 144 typedef uintptr_t MockKeychainItemType; |
| 146 | 145 |
| 147 // Type of the map holding the mock keychain attributes. | 146 // Type of the map holding the mock keychain attributes. |
| 148 typedef std::map<MockKeychainItemType, SecKeychainAttributeList> | 147 typedef std::map<MockKeychainItemType, SecKeychainAttributeList> |
| 149 MockKeychainAttributesMap; | 148 MockKeychainAttributesMap; |
| 150 | 149 |
| 151 #if !defined(OS_IOS) | 150 #if !defined(OS_IOS) |
| 152 // Returns true if the keychain already contains a password that matches the | 151 // Returns true if the keychain already contains a password that matches the |
| 153 // attributes provided. | 152 // attributes provided. |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 // and |ItemFreeContent|. | 241 // and |ItemFreeContent|. |
| 243 mutable int password_data_count_; | 242 mutable int password_data_count_; |
| 244 | 243 |
| 245 // Records the password being set when |AddGenericPassword()| gets called. | 244 // Records the password being set when |AddGenericPassword()| gets called. |
| 246 mutable std::string add_generic_password_; | 245 mutable std::string add_generic_password_; |
| 247 }; | 246 }; |
| 248 | 247 |
| 249 } // namespace crypto | 248 } // namespace crypto |
| 250 | 249 |
| 251 #endif // CRYPTO_MOCK_KEYCHAIN_MAC_H_ | 250 #endif // CRYPTO_MOCK_KEYCHAIN_MAC_H_ |
| OLD | NEW |