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

Unified Diff: crypto/mock_apple_keychain.h

Issue 1207373002: Implement Mac Keychain migration algorithm. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/mock_apple_keychain.h
diff --git a/crypto/mock_apple_keychain.h b/crypto/mock_apple_keychain.h
index 3948d489755a3049a268772763648fe5d3cf9994..37d4d061d22e632ec574a3f7ccfc593a73614cc4 100644
--- a/crypto/mock_apple_keychain.h
+++ b/crypto/mock_apple_keychain.h
@@ -118,6 +118,8 @@ class CRYPTO_EXPORT MockAppleKeychain : public AppleKeychain {
};
// Adds a keychain item with the given info to the test set.
void AddTestItem(const KeychainTestData& item_data);
+
+ static void set_locked(bool locked) { locked_ = locked; }
Ryan Sleevi 2015/06/26 10:46:38 I feel that, design wise, adding a static member v
vasilii 2015/06/26 12:18:48 You're absolutely right. The original idea was to
#endif // !defined(OS_IOS)
// |FindGenericPassword()| can return different results depending on user
@@ -201,6 +203,10 @@ class CRYPTO_EXPORT MockAppleKeychain : public AppleKeychain {
static const SecKeychainSearchRef kDummySearchRef;
+ // Simulates the state when the user refuses to unclock the Keychain.
+ // If true, reading and modifying a password value result in errSecAuthFailed.
+ static bool locked_;
+
typedef struct KeychainPasswordData {
KeychainPasswordData() : data(NULL), length(0) {}
void* data;

Powered by Google App Engine
This is Rietveld 408576698