Bug 1034689 part 3 - Fix remaining places in Gecko to handle Latin1 strings. r=bz
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "AndroidBridge.h"
|
||||
#include "mozilla/Vector.h"
|
||||
#include "prthread.h"
|
||||
#include "nsJSUtils.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::widget;
|
||||
@@ -502,14 +503,11 @@ struct StringProperty
|
||||
|
||||
static Type FromValue(JNIEnv* env, jobject instance,
|
||||
JSContext* cx, const JS::HandleString str) {
|
||||
size_t strLen = 0;
|
||||
const jschar* const strChars =
|
||||
JS_GetStringCharsAndLength(cx, str, &strLen);
|
||||
if (!CheckJSCall(env, !!strChars)) {
|
||||
nsAutoJSString autoStr;
|
||||
if (!CheckJSCall(env, autoStr.init(cx, str))) {
|
||||
return nullptr;
|
||||
}
|
||||
jstring ret = env->NewString(
|
||||
reinterpret_cast<const jchar*>(strChars), strLen);
|
||||
jstring ret = env->NewString(autoStr.BeginReading(), autoStr.Length());
|
||||
MOZ_ASSERT(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user