mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-05 22:05:40 +00:00
Bug 987556 Part 12 Remove the nsString ConvertToUTF16() compat shim. r=bz
This commit is contained in:
parent
382ac50423
commit
4f31b5b419
@ -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,
|
||||
|
@ -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.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user