Created attachment 581063 [details] [diff] [review]
SetFromJSVal is currently the only user of xpc_qsAString outside of XPConnect.
Except for the additional API exposed, there are two problems with that. First, we don't check if IsValid() before using the string, which could (if I'm not mistaken, I may be) lead to dereferencing uninitialized memory in case of OOM, and second, there's really no need to invoke all the generic value -> string conversion code, because we already know we've got a string.
Fortunately, it can easily be replaced by nsDependentJSString.