Comment on attachment 706354 Store Master Password to Gnome Keyring patch v1
You need build system and PSM reviews, so I'll just comment on code patterns.
>+ PRUnichar *password = nullptr; >+ nsAutoString promptString; >+ >+ // Get prompt message for Gnome Keyring master password >+ nsCOMPtr<nsINSSComponent> nssComponent(do_GetService(kNSSComponentCID, &rv)); >+ if (NS_FAILED(rv)) >+ return; >+ >+ const PRUnichar* formatStrings[1] = { >+ ToNewUnicode(NS_LITERAL_STRING("Gnome Keyring")) >+ }; NS_NAMED_LITERAL_STRING gnomeKeyring("Gnome Keyring"); const PRUnichar* formatStrings[] = { gnomeKeyring.get() }; Or since this is linux-only, MOZ_LL, NS_LL or u"Gnome Keyring" might work. This avoids having to free the string manually.
>+ // Return if promp was closed without confirmation or password is wrong Typo: prompt
>+ if (value) [I had to look up the .idl to find out what this value meant.]
>+ nsCString utf8password; >+ utf8password = NS_ConvertUTF16toUTF8(password); >+ NS_Free(password); >+ password = nullptr; >+ if (gnome_keyring_unlock_sync(NULL, utf8password.get()) == GNOME_KEYRING_RESULT_OK) gnome_keyring_unlock_sync(NULL, NS_ConvertUTF16toUTF8(password).get())
>+ mResult = g_strdup(keyringRecord->secret); [Does this get freed with g_free?]
Comment on attachment 706354
Store Master Password to Gnome Keyring patch v1
You need build system and PSM reviews, so I'll just comment on code patterns.
>+ PRUnichar *password = nullptr; nsINSSComponent > nssComponent( do_GetService( kNSSComponentCI D, &rv)); NS_LITERAL_ STRING( "Gnome Keyring")) LITERAL_ STRING gnomeKeyring("Gnome Keyring");
>+ nsAutoString promptString;
>+
>+ // Get prompt message for Gnome Keyring master password
>+ nsCOMPtr<
>+ if (NS_FAILED(rv))
>+ return;
>+
>+ const PRUnichar* formatStrings[1] = {
>+ ToNewUnicode(
>+ };
NS_NAMED_
const PRUnichar* formatStrings[] = { gnomeKeyring.get() };
Or since this is linux-only, MOZ_LL, NS_LL or u"Gnome Keyring" might work.
This avoids having to free the string manually.
>+ // Return if promp was closed without confirmation or password is wrong
Typo: prompt
>+ if (value)
[I had to look up the .idl to find out what this value meant.]
>+ nsCString utf8password; toUTF8( password) ; keyring_ unlock_ sync(NULL, utf8password.get()) == GNOME_KEYRING_ RESULT_ OK) unlock_ sync(NULL, NS_ConvertUTF16 toUTF8( password) .get())
>+ utf8password = NS_ConvertUTF16
>+ NS_Free(password);
>+ password = nullptr;
>+ if (gnome_
gnome_keyring_
>+ mResult = g_strdup( keyringRecord- >secret) ;
[Does this get freed with g_free?]