NS_ENSURE_ARG(profileName); NS_ENSURE_ARG(profileDir);
nsresult rv = NS_OK;
nsresult nsProfile::SetProfileDir(const PRUnichar *profileName, nsIFile *profileDir){    NS_ENSURE_ARG(profileName);    NS_ENSURE_ARG(profileDir);       nsresult rv = NS_OK;     // Need to ensure that this directory exists    PRBool exists;    rv = profileDir->Exists(&exists);    if (NS_SUCCEEDED(rv) && !exists)        rv = profileDir->Create(nsIFile::DIRECTORY_TYPE, 0700);    if (NS_FAILED(rv))         return rv;        nsCOMPtr<nsILocalFile> localFile(do_QueryInterface(profileDir));    NS_ENSURE_TRUE(localFile, NS_ERROR_FAILURE);                    ProfileStruct* aProfile = new ProfileStruct();    NS_ENSURE_TRUE(aProfile, NS_ERROR_OUT_OF_MEMORY);    aProfile->profileName = profileName;    aProfile->SetResolvedProfileDir(localFile);    aProfile->isMigrated = PR_TRUE;    aProfile->isImportType = PR_FALSE;    // convert "now" from microsecs to millisecs    PRInt64 oneThousand = LL_INIT(0, 1000);    PRInt64 nowInMilliSecs = PR_Now();    LL_DIV(aProfile->creationTime, nowInMilliSecs, oneThousand);     gProfileDataAccess->SetValue(aProfile);        delete aProfile;    return rv;}