rv = profileManager->GetProfileDir(currentProfile.get(), getter_AddRefs(file));
nsCOMPtr<nsIFile> profileDir; rv = profileManager->GetProfileDir(currentProfile.get(), getter_AddRefs(profileDir));
static nsresult getTrainingFile(nsCOMPtr<nsIFile>& file){    // should we cache the profile manager's directory?    nsresult rv;    nsCOMPtr<nsIProfileInternal> profileManager = do_GetService("@mozilla.org/profile/manager;1", &rv);    if (NS_FAILED(rv)) return rv;        nsXPIDLString currentProfile;    rv = profileManager->GetCurrentProfile(getter_Copies(currentProfile));    if (NS_FAILED(rv)) return rv;        rv = profileManager->GetProfileDir(currentProfile.get(), getter_AddRefs(file));    if (NS_FAILED(rv)) return rv;        return file->Append(NS_LITERAL_STRING("training.dat"));}