Bug 1019191 part 8. Stop using xpc_qsACString in XPConnect. r=bholley

This commit is contained in:
Boris Zbarsky 2014-10-22 11:40:48 -04:00
parent e093c2bd4b
commit 6b807f9396

View File

@ -1199,12 +1199,10 @@ Base64Encode(JSContext *cx, HandleValue val, MutableHandleValue out)
{ {
MOZ_ASSERT(cx); MOZ_ASSERT(cx);
JS::RootedValue root(cx, val); nsAutoCString encodedString;
xpc_qsACString encodedString(cx, root, &root, false, if (!ConvertJSValueToByteString(cx, val, false, encodedString)) {
xpc_qsACString::eStringify,
xpc_qsACString::eStringify);
if (!encodedString.IsValid())
return false; return false;
}
nsAutoCString result; nsAutoCString result;
if (NS_FAILED(mozilla::Base64Encode(encodedString, result))) { if (NS_FAILED(mozilla::Base64Encode(encodedString, result))) {
@ -1225,12 +1223,10 @@ Base64Decode(JSContext *cx, HandleValue val, MutableHandleValue out)
{ {
MOZ_ASSERT(cx); MOZ_ASSERT(cx);
JS::RootedValue root(cx, val); nsAutoCString encodedString;
xpc_qsACString encodedString(cx, root, &root, false, if (!ConvertJSValueToByteString(cx, val, false, encodedString)) {
xpc_qsACString::eStringify,
xpc_qsACString::eStringify);
if (!encodedString.IsValid())
return false; return false;
}
nsAutoCString result; nsAutoCString result;
if (NS_FAILED(mozilla::Base64Decode(encodedString, result))) { if (NS_FAILED(mozilla::Base64Decode(encodedString, result))) {