NS_IMETHODIMP nsProfile::SetProfileDir(const PRUnichar *profileName, nsFileSpec& profileDir)
NS_IMETHODIMP nsProfile::SetProfileDir(const char *profileName, nsFileSpec& profileDir)
NS_IMETHODIMP nsProfile::SetProfileDir(const PRUnichar *profileName, nsFileSpec& profileDir){    NS_ENSURE_ARG_POINTER(profileName);       nsresult rv = NS_OK;     // Create a tmp Filespec and create a directory if required    nsFileSpec tmpDir(profileDir);                        if (!profileDir.Exists())    {        // nsPersistentFileDescriptor requires an existing        // object. Make it first.        tmpDir.CreateDirectory();    }                        nsXPIDLCString profileDirString;                        nsCOMPtr<nsIFileSpec>spec;    rv = NS_NewFileSpecWithSpec(profileDir, getter_AddRefs(spec));    if (NS_SUCCEEDED(rv)) {        rv = spec->GetPersistentDescriptorString(getter_Copies(profileDirString));    }    if (NS_FAILED(rv)) return rv;    // Do I need to check for NS_ERROR_OUT_OF_MEMORY when I do a new on a class?    ProfileStruct* aProfile = new ProfileStruct();    nsAutoString profileLocation; profileLocation.AssignWithConversion(profileDirString);    aProfile->profileName     = profileName;    aProfile->profileLocation = profileLocation;    aProfile->isMigrated.AssignWithConversion(REGISTRY_YES_STRING);    rv = CreateUserDirectories(tmpDir);    if (NS_FAILED(rv)) {        delete aProfile;        return rv;    }    gProfileDataAccess->SetValue(aProfile);                               gProfileDataAccess->SetCurrentProfile(profileName);        delete aProfile;    return rv;}