Bug 1559403 - Implement nsIStringInputStream.setUTF8Data. r=froydnj

Differential Revision: https://phabricator.services.mozilla.com/D35027

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Masatoshi Kimura 2019-06-14 15:48:41 +00:00
Родитель 7c478fba5b
Коммит c0b1864c56
2 изменённых файлов: 15 добавлений и 0 удалений

Просмотреть файл

@ -36,6 +36,16 @@ interface nsIStringInputStream : nsIInputStream
*/
void setData(in string data, in long dataLen);
/**
* SetUTF8Data - encode input data to UTF-8 and assign it to the input
* stream.
*
* @param data - stream data
*
* NOTE: This method is meant to be used by JS callers,
*/
void setUTF8Data(in AUTF8String data);
/**
* NOTE: the following methods are designed to give C++ code added control
* over the ownership and lifetime of the stream data. Use with care :-)

Просмотреть файл

@ -193,6 +193,11 @@ nsStringInputStream::SetData(const char* aData, int32_t aDataLen) {
return NS_OK;
}
NS_IMETHODIMP
nsStringInputStream::SetUTF8Data(const nsACString& aData) {
return nsStringInputStream::SetData(aData);
}
NS_IMETHODIMP
nsStringInputStream::AdoptData(char* aData, int32_t aDataLen) {
ReentrantMonitorAutoEnter lock(mMon);