Chromium Code Reviews| Index: components/os_crypt/keychain_password_mac.mm |
| diff --git a/components/os_crypt/keychain_password_mac.mm b/components/os_crypt/keychain_password_mac.mm |
| index 1f60b9f0572ae9c61cf1d257c1457bb5b42838a4..99b8b1734ca72d5861d8bf4ce5881897e45947ce 100644 |
| --- a/components/os_crypt/keychain_password_mac.mm |
| +++ b/components/os_crypt/keychain_password_mac.mm |
| @@ -47,28 +47,23 @@ std::string AddRandomPasswordToKeychain(const AppleKeychain& keychain, |
| } // namespace |
| -std::string KeychainPassword::GetPassword() const { |
| - // These two strings ARE indeed user facing. But they are used to access |
| - // the encryption keyword. So as to not lose encrypted data when system |
| - // locale changes we DO NOT LOCALIZE. |
| +// These two strings ARE indeed user facing. But they are used to access |
| +// the encryption keyword. So as to not lose encrypted data when system |
| +// locale changes we DO NOT LOCALIZE. |
| #if defined(GOOGLE_CHROME_BUILD) |
| - const std::string service_name = "Chrome Safe Storage"; |
| - const std::string account_name = "Chrome"; |
| +const char KeychainPassword::service_name[] = "Chrome Safe Storage"; |
| +const char KeychainPassword::account_name[] = "Chrome"; |
| #else |
| - const std::string service_name = "Chromium Safe Storage"; |
| - const std::string account_name = "Chromium"; |
| +const char KeychainPassword::service_name[] = "Chromium Safe Storage"; |
| +const char KeychainPassword::account_name[] = "Chromium"; |
| #endif |
| +std::string KeychainPassword::GetPassword() const { |
| UInt32 password_length = 0; |
| void* password_data = NULL; |
| - OSStatus error = keychain_.FindGenericPassword(NULL, |
| - service_name.size(), |
| - service_name.data(), |
| - account_name.size(), |
| - account_name.data(), |
| - &password_length, |
| - &password_data, |
| - NULL); |
| + OSStatus error = keychain_.FindGenericPassword( |
|
Mark Mentovai
2017/03/01 22:00:31
Again with the clang-format? “Before” was so much
Greg K
2017/03/02 01:28:27
Done.
|
| + NULL, strlen(service_name), service_name, strlen(account_name), |
| + account_name, &password_length, &password_data, NULL); |
| if (error == noErr) { |
| std::string password = |