| 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 #include "crypto/mock_apple_keychain.h" | 5 #include "crypto/mock_apple_keychain.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 const char* accountName, | 65 const char* accountName, |
| 66 UInt32 passwordLength, | 66 UInt32 passwordLength, |
| 67 const void* passwordData, | 67 const void* passwordData, |
| 68 SecKeychainItemRef* itemRef) const { | 68 SecKeychainItemRef* itemRef) const { |
| 69 IncrementKeychainAccessHistogram(); | 69 IncrementKeychainAccessHistogram(); |
| 70 | 70 |
| 71 called_add_generic_ = true; | 71 called_add_generic_ = true; |
| 72 | 72 |
| 73 DCHECK_GT(passwordLength, 0U); | 73 DCHECK_GT(passwordLength, 0U); |
| 74 DCHECK(passwordData); | 74 DCHECK(passwordData); |
| 75 add_generic_password_ = | |
| 76 std::string(const_cast<char*>(static_cast<const char*>(passwordData)), | |
| 77 passwordLength); | |
| 78 return noErr; | 75 return noErr; |
| 79 } | 76 } |
| 80 | 77 |
| 81 std::string MockAppleKeychain::GetEncryptionPassword() const { | 78 std::string MockAppleKeychain::GetEncryptionPassword() const { |
| 82 IncrementKeychainAccessHistogram(); | 79 IncrementKeychainAccessHistogram(); |
| 83 return "mock_password"; | 80 return "mock_password"; |
| 84 } | 81 } |
| 85 | 82 |
| 86 } // namespace crypto | 83 } // namespace crypto |
| OLD | NEW |