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/mock_apple_keychain.h

Issue 2095523002: Make //crypto factories return std::unique_ptr<>s (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: I'm blind Created 4 years, 5 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
« no previous file with comments | « crypto/hmac_unittest.cc ('k') | crypto/nss_util.cc » ('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 #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 <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 const SecKeychainAttributeList& attribute_list, 202 const SecKeychainAttributeList& attribute_list,
203 UInt32 tag); 203 UInt32 tag);
204 204
205 static const SecKeychainSearchRef kDummySearchRef; 205 static const SecKeychainSearchRef kDummySearchRef;
206 206
207 // Simulates the state when the user refuses to unclock the Keychain. 207 // Simulates the state when the user refuses to unclock the Keychain.
208 // If true, reading and modifying a password value result in errSecAuthFailed. 208 // If true, reading and modifying a password value result in errSecAuthFailed.
209 bool locked_; 209 bool locked_;
210 210
211 typedef struct KeychainPasswordData { 211 typedef struct KeychainPasswordData {
212 KeychainPasswordData() : data(NULL), length(0) {} 212 KeychainPasswordData() : data(nullptr), length(0) {}
213 void* data; 213 void* data;
214 UInt32 length; 214 UInt32 length;
215 } KeychainPasswordData; 215 } KeychainPasswordData;
216 216
217 // Mutable because the MockAppleKeychain API requires its internal keychain 217 // Mutable because the MockAppleKeychain API requires its internal keychain
218 // storage to be modifiable by users of this class. 218 // storage to be modifiable by users of this class.
219 mutable MockKeychainAttributesMap keychain_attr_list_; 219 mutable MockKeychainAttributesMap keychain_attr_list_;
220 mutable std::map<MockKeychainItemType, 220 mutable std::map<MockKeychainItemType,
221 KeychainPasswordData> keychain_data_; 221 KeychainPasswordData> keychain_data_;
222 mutable MockKeychainItemType next_item_key_; 222 mutable MockKeychainItemType next_item_key_;
(...skipping 25 matching lines...) Expand all
248 // and |ItemFreeContent|. 248 // and |ItemFreeContent|.
249 mutable int password_data_count_; 249 mutable int password_data_count_;
250 250
251 // Records the password being set when |AddGenericPassword()| gets called. 251 // Records the password being set when |AddGenericPassword()| gets called.
252 mutable std::string add_generic_password_; 252 mutable std::string add_generic_password_;
253 }; 253 };
254 254
255 } // namespace crypto 255 } // namespace crypto
256 256
257 #endif // CRYPTO_MOCK_KEYCHAIN_MAC_H_ 257 #endif // CRYPTO_MOCK_KEYCHAIN_MAC_H_
OLDNEW
« no previous file with comments | « crypto/hmac_unittest.cc ('k') | crypto/nss_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698