string = new nsString(str);
aResult = str;
NS_NET nsresult NS_MakeAbsoluteURL(nsIURL* aURL,                                   const nsString& aBaseURL,                                   const nsString& aSpec,                                   nsString& aResult){    nsString* string;    nsIURL* base = nsnull;    if (0 < aBaseURL.Length()) {        nsresult err = NS_NewURL(&base, aBaseURL);        if (err != NS_OK) return err;    }    else {        const char* str;        aURL->GetSpec(&str);        nsresult err = NS_NewURL(&base, str);        if (err != NS_OK) return err;    }    nsIURL* url = nsnull;    nsresult err = NS_NewURL(&url, aSpec, base);    if (err != NS_OK) goto done;    PRUnichar* str;    err = url->ToString(&str);    if (err) goto done;    string = new nsString(str);    delete []str;    if (string == NULL)        err = NS_ERROR_OUT_OF_MEMORY;    else        aResult = *string;  done:    NS_IF_RELEASE(url);    NS_IF_RELEASE(base);    return err;}