Bug 987556 Part 12 Remove the nsString ConvertToUTF16() compat shim. r=bz

This commit is contained in:
Ben Kelly 2014-04-25 10:11:57 -04:00
parent 382ac50423
commit 4f31b5b419
2 changed files with 0 additions and 33 deletions

View File

@ -1346,23 +1346,6 @@ nsScriptLoader::ConvertToUTF16(nsIChannel* aChannel, const uint8_t* aData,
return rv;
}
/* static */ nsresult
nsScriptLoader::ConvertToUTF16(nsIChannel* aChannel, const uint8_t* aData,
uint32_t aLength, const nsAString& aHintCharset,
nsIDocument* aDocument, nsString& aString)
{
jschar* bufOut = nullptr;
size_t lengthOut = 0;
nsresult rv = ConvertToUTF16(aChannel, aData, aLength, aHintCharset,
aDocument, bufOut, lengthOut);
aString.SetLength(lengthOut);
if (bufOut) {
memcpy(aString.BeginWriting(), bufOut, lengthOut * sizeof(jschar));
js_free(bufOut);
}
return rv;
}
NS_IMETHODIMP
nsScriptLoader::OnStreamComplete(nsIStreamLoader* aLoader,
nsISupports* aContext,

View File

@ -156,22 +156,6 @@ public:
nsIDocument* aDocument,
jschar*& aBufOut, size_t& aLengthOut);
/**
* Convert the given buffer to a UTF-16 string.
* @param aChannel Channel corresponding to the data. May be null.
* @param aData The data to convert
* @param aLength Length of the data
* @param aHintCharset Hint for the character set (e.g., from a charset
* attribute). May be the empty string.
* @param aDocument Document which the data is loaded for. Must not be
* null.
* @param aString [out] Data as converted to unicode
*/
static nsresult ConvertToUTF16(nsIChannel* aChannel, const uint8_t* aData,
uint32_t aLength,
const nsAString& aHintCharset,
nsIDocument* aDocument, nsString& aString);
/**
* Processes any pending requests that are ready for processing.
*/