Fixing windows build - need to use a constructor for initializing reference-type members.

This commit is contained in:
bryner%brianryner.com 2003-07-27 21:21:45 +00:00
Родитель 2c1b4727ee
Коммит 7fec9b284e
1 изменённых файлов: 26 добавлений и 15 удалений

Просмотреть файл

@ -388,13 +388,25 @@ nsPasswordManager::GetRejectEnumerator(nsISimpleEnumerator** aEnumerator)
struct findEntryContext { struct findEntryContext {
nsPasswordManager* manager; nsPasswordManager* manager;
const nsACString& aHostURI; const nsACString& hostURI;
const nsAString& aUsername; const nsAString& username;
const nsAString& aPassword; const nsAString& password;
nsACString& aHostURIFound; nsACString& hostURIFound;
nsAString& aUsernameFound; nsAString& usernameFound;
nsAString& aPasswordFound; nsAString& passwordFound;
PRBool matched; PRBool matched;
findEntryContext(nsPasswordManager* aManager,
const nsACString& aHostURI,
const nsAString& aUsername,
const nsAString& aPassword,
nsACString& aHostURIFound,
nsAString& aUsernameFound,
nsAString& aPasswordFound)
: manager(aManager), hostURI(aHostURI), username(aUsername),
password(aPassword), hostURIFound(aHostURIFound),
usernameFound(aUsernameFound), passwordFound(aPasswordFound),
matched(PR_FALSE) { }
}; };
/* static */ PLDHashOperator PR_CALLBACK /* static */ PLDHashOperator PR_CALLBACK
@ -407,12 +419,12 @@ nsPasswordManager::FindEntryEnumerator(const nsACString& aKey,
nsresult rv; nsresult rv;
rv = manager->FindPasswordEntryFromSignonData(aEntry, rv = manager->FindPasswordEntryFromSignonData(aEntry,
context->aHostURI, context->hostURI,
context->aUsername, context->username,
context->aPassword, context->password,
context->aHostURIFound, context->hostURIFound,
context->aUsernameFound, context->usernameFound,
context->aPasswordFound); context->passwordFound);
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {
context->matched = PR_TRUE; context->matched = PR_TRUE;
return PL_DHASH_STOP; return PL_DHASH_STOP;
@ -441,9 +453,8 @@ nsPasswordManager::FindPasswordEntry(const nsACString& aHostURI,
} }
// No host given, so enumerate all entries in the hashtable // No host given, so enumerate all entries in the hashtable
findEntryContext context = { this, aHostURI, aUsername, aPassword, findEntryContext context(this, aHostURI, aUsername, aPassword,
aHostURIFound, aUsernameFound, aHostURIFound, aUsernameFound, aPasswordFound);
aPasswordFound, PR_FALSE };
mSignonTable.EnumerateRead(FindEntryEnumerator, &context); mSignonTable.EnumerateRead(FindEntryEnumerator, &context);