Bug 777582 - Make nsPrincipal deserialize members in the order that they are serialized. r=mounir

This commit is contained in:
William Chen 2012-07-25 20:12:03 -04:00
parent 461a44b5d8
commit 35a4609900

View File

@ -1159,6 +1159,12 @@ nsPrincipal::Read(nsIObjectInputStream* aStream)
return rv;
}
nsCOMPtr<nsIURI> domain;
rv = NS_ReadOptionalObject(aStream, true, getter_AddRefs(domain));
if (NS_FAILED(rv)) {
return rv;
}
PRUint32 appId;
rv = aStream->Read32(&appId);
NS_ENSURE_SUCCESS(rv, rv);
@ -1170,12 +1176,6 @@ nsPrincipal::Read(nsIObjectInputStream* aStream)
rv = Init(fingerprint, subjectName, prettyName, cert, codebase, appId, inMozBrowser);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIURI> domain;
rv = NS_ReadOptionalObject(aStream, true, getter_AddRefs(domain));
if (NS_FAILED(rv)) {
return rv;
}
SetDomain(domain);
rv = aStream->ReadBoolean(&mTrusted);