nsString* processedValue = ProcessValue(aSource, aName, aValue);
nsAutoString processedValue; nsresult rv = ProcessValue(aSource, aName, aValue, processedValue);     nsCAutoString encodedVal; if (NS_SUCCEEDED(rv)) { rv = EncodeVal(processedValue, encodedVal); } else { rv = EncodeVal(aValue, encodedVal); } NS_ENSURE_SUCCESS(rv, rv);
nsFSMultipartFormData::ProcessAndEncode(nsIDOMHTMLElement* aSource,                                        const nsAString& aName,                                        const nsAString& aValue,                                        nsCString& aProcessedName,                                        nsCString& aProcessedValue){  //  // Let external code process (and possibly change) value  //  nsString* processedValue = ProcessValue(aSource, aName, aValue);  //  // Get name  //  char * encodedVal = EncodeVal(aName);  if (!encodedVal) {    delete processedValue;    return NS_ERROR_OUT_OF_MEMORY;  }  aProcessedName.Adopt(encodedVal);  //  // Get value  //  if (processedValue) {    encodedVal = EncodeVal(*processedValue);    delete processedValue;  } else {    encodedVal = EncodeVal(aValue);  }  if (!encodedVal) {    return NS_ERROR_OUT_OF_MEMORY;  }  aProcessedValue.Adopt(encodedVal);  //  // Convert linebreaks in value  //  aProcessedValue.Adopt(nsLinebreakConverter::ConvertLineBreaks(aProcessedValue.get(),                        nsLinebreakConverter::eLinebreakAny,                        nsLinebreakConverter::eLinebreakNet));  return NS_OK;}