Bug 884371 - Remove JSMutableHandleXXX from the js directory r=bholley

This commit is contained in:
Jon Coppeard 2013-06-19 11:32:27 +01:00
parent b4a1d2128a
commit d61000e77b
10 changed files with 50 additions and 47 deletions

View File

@ -388,7 +388,7 @@ jsval_to_nsString(JSContext* cx, jsid from, nsString* to)
/*static*/ JSBool
ObjectWrapperParent::CPOW_AddProperty(JSContext *cx, JSHandleObject obj, JSHandleId id,
JSMutableHandleValue vp)
MutableHandleValue vp)
{
CPOW_LOG(("Calling CPOW_AddProperty (%s)...",
JSVAL_TO_CSTR(cx, id)));
@ -415,7 +415,7 @@ ObjectWrapperParent::CPOW_AddProperty(JSContext *cx, JSHandleObject obj, JSHandl
/*static*/ JSBool
ObjectWrapperParent::CPOW_GetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id,
JSMutableHandleValue vp)
MutableHandleValue vp)
{
CPOW_LOG(("Calling CPOW_GetProperty (%s)...",
JSVAL_TO_CSTR(cx, id)));
@ -442,7 +442,7 @@ ObjectWrapperParent::CPOW_GetProperty(JSContext *cx, JSHandleObject obj, JSHandl
/*static*/ JSBool
ObjectWrapperParent::CPOW_SetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id,
JSBool strict, JSMutableHandleValue vp)
JSBool strict, MutableHandleValue vp)
{
CPOW_LOG(("Calling CPOW_SetProperty (%s)...",
JSVAL_TO_CSTR(cx, id)));
@ -614,7 +614,7 @@ ObjectWrapperParent::CPOW_NewResolve(JSContext *cx, JSHandleObject obj, JSHandle
/*static*/ JSBool
ObjectWrapperParent::CPOW_Convert(JSContext *cx, JSHandleObject obj, JSType type,
JSMutableHandleValue vp)
MutableHandleValue vp)
{
CPOW_LOG(("Calling CPOW_Convert (to %s)...",
JS_GetTypeName(cx, type)));
@ -708,7 +708,7 @@ ObjectWrapperParent::CPOW_Construct(JSContext* cx, unsigned argc, jsval* vp)
}
/*static*/ JSBool
ObjectWrapperParent::CPOW_HasInstance(JSContext *cx, JSHandleObject obj, JSMutableHandleValue v,
ObjectWrapperParent::CPOW_HasInstance(JSContext *cx, JSHandleObject obj, MutableHandleValue v,
JSBool *bp)
{
CPOW_LOG(("Calling CPOW_HasInstance..."));

View File

@ -59,16 +59,16 @@ private:
mutable JSObject* mObj;
static JSBool
CPOW_AddProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp);
CPOW_AddProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JS::MutableHandleValue vp);
static JSBool
CPOW_DelProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool *succeeded);
static JSBool
CPOW_GetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp);
CPOW_GetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JS::MutableHandleValue vp);
static JSBool
CPOW_SetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, JSMutableHandleValue vp);
CPOW_SetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, JS::MutableHandleValue vp);
JSBool NewEnumerateInit(JSContext* cx, jsval* statep, jsid* idp);
JSBool NewEnumerateNext(JSContext* cx, jsval* statep, jsid* idp);
@ -82,7 +82,7 @@ private:
JS::MutableHandleObject objp);
static JSBool
CPOW_Convert(JSContext *cx, JSHandleObject obj, JSType type, JSMutableHandleValue vp);
CPOW_Convert(JSContext *cx, JSHandleObject obj, JSType type, JS::MutableHandleValue vp);
static void
CPOW_Finalize(js::FreeOp* fop, JSObject* obj);
@ -94,7 +94,7 @@ private:
CPOW_Construct(JSContext *cx, unsigned argc, jsval *vp);
static JSBool
CPOW_HasInstance(JSContext *cx, JSHandleObject obj, JSMutableHandleValue vp, JSBool *bp);
CPOW_HasInstance(JSContext *cx, JSHandleObject obj, JS::MutableHandleValue vp, JSBool *bp);
static bool jsval_to_JSVariant(JSContext* cx, jsval from, JSVariant* to);
static bool jsval_from_JSVariant(JSContext* cx, const JSVariant& from,

View File

@ -84,6 +84,7 @@
#endif
using namespace mozilla;
using namespace JS;
class XPCShellDirProvider : public nsIDirectoryServiceProvider2
{
@ -145,7 +146,7 @@ JSPrincipals *gJSPrincipals = nullptr;
nsAutoString *gWorkingDirectory = nullptr;
static JSBool
GetLocationProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp)
GetLocationProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, MutableHandleValue vp)
{
#if !defined(XP_WIN) && !defined(XP_UNIX)
//XXX: your platform should really implement this
@ -851,7 +852,7 @@ JSClass global_class = {
};
static JSBool
env_setProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, JSMutableHandleValue vp)
env_setProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, MutableHandleValue vp)
{
/* XXX porting may be easy, but these don't seem to supply setenv by default */
#if !defined XP_OS2 && !defined SOLARIS

View File

@ -2960,7 +2960,7 @@ sandbox_finalize(JSFreeOp *fop, JSObject *obj)
}
static JSBool
sandbox_convert(JSContext *cx, JSHandleObject obj, JSType type, JSMutableHandleValue vp)
sandbox_convert(JSContext *cx, JSHandleObject obj, JSType type, MutableHandleValue vp)
{
if (type == JSTYPE_OBJECT) {
vp.set(OBJECT_TO_JSVAL(obj));
@ -3126,9 +3126,9 @@ bool BindPropertyOp(JSContext *cx, Op &op, PropertyDescriptor *desc, HandleId id
}
extern JSBool
XPC_WN_Helper_GetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp);
XPC_WN_Helper_GetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, MutableHandleValue vp);
extern JSBool
XPC_WN_Helper_SetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, JSMutableHandleValue vp);
XPC_WN_Helper_SetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, MutableHandleValue vp);
bool
xpc::SandboxProxyHandler::getPropertyDescriptor(JSContext *cx,
@ -4828,7 +4828,7 @@ nsXPCComponents::SetProperty(nsIXPConnectWrappedNative *wrapper,
static JSBool
ContentComponentsGetterOp(JSContext *cx, JSHandleObject obj, JSHandleId id,
JSMutableHandleValue vp)
MutableHandleValue vp)
{
// If chrome is accessing the Components object of content, allow.
MOZ_ASSERT(nsContentUtils::GetCurrentJSContext() == cx);

View File

@ -22,6 +22,8 @@
#include "xpcpublic.h"
using namespace JS;
/**
* JS locale callbacks implemented by XPCOM modules. These are theoretically
* safe for use on multiple threads. Unfortunately, the intl code underlying
@ -72,32 +74,32 @@ struct XPCLocaleCallbacks : public JSLocaleCallbacks
}
static JSBool
LocaleToUpperCase(JSContext *cx, JSHandleString src, JSMutableHandleValue rval)
LocaleToUpperCase(JSContext *cx, JSHandleString src, MutableHandleValue rval)
{
return ChangeCase(cx, src, rval, ToUpperCase);
}
static JSBool
LocaleToLowerCase(JSContext *cx, JSHandleString src, JSMutableHandleValue rval)
LocaleToLowerCase(JSContext *cx, JSHandleString src, MutableHandleValue rval)
{
return ChangeCase(cx, src, rval, ToLowerCase);
}
static JSBool
LocaleToUnicode(JSContext* cx, const char* src, JSMutableHandleValue rval)
LocaleToUnicode(JSContext* cx, const char* src, MutableHandleValue rval)
{
return This(JS_GetRuntime(cx))->ToUnicode(cx, src, rval);
}
static JSBool
LocaleCompare(JSContext *cx, JSHandleString src1, JSHandleString src2, JSMutableHandleValue rval)
LocaleCompare(JSContext *cx, JSHandleString src1, JSHandleString src2, MutableHandleValue rval)
{
return This(JS_GetRuntime(cx))->Compare(cx, src1, src2, rval);
}
private:
static JSBool
ChangeCase(JSContext* cx, JSHandleString src, JSMutableHandleValue rval,
ChangeCase(JSContext* cx, JSHandleString src, MutableHandleValue rval,
void(*changeCaseFnc)(const nsAString&, nsAString&))
{
nsDependentJSString depStr;
@ -119,7 +121,7 @@ private:
}
JSBool
Compare(JSContext *cx, JSHandleString src1, JSHandleString src2, JSMutableHandleValue rval)
Compare(JSContext *cx, JSHandleString src1, JSHandleString src2, MutableHandleValue rval)
{
nsresult rv;
@ -166,7 +168,7 @@ private:
}
JSBool
ToUnicode(JSContext* cx, const char* src, JSMutableHandleValue rval)
ToUnicode(JSContext* cx, const char* src, MutableHandleValue rval)
{
nsresult rv;

View File

@ -395,7 +395,7 @@ xpc_qsThrowBadSetterValue(JSContext *cx, nsresult rv, JSObject *obj,
JSBool
xpc_qsGetterOnlyPropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict,
JSMutableHandleValue vp)
MutableHandleValue vp)
{
return JS_ReportErrorFlagsAndNumber(cx,
JSREPORT_WARNING | JSREPORT_STRICT |

View File

@ -131,7 +131,7 @@ xpc_qsThrowBadSetterValue(JSContext *cx, nsresult rv, JSObject *obj,
JSBool
xpc_qsGetterOnlyPropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, JSMutableHandleValue vp);
xpc_qsGetterOnlyPropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict, JS::MutableHandleValue vp);
JSBool
xpc_qsGetterOnlyNativeStub(JSContext *cx, unsigned argc, jsval *vp);
@ -569,11 +569,11 @@ xpc_qsSameResult(int32_t result1, int32_t result2)
// Apply |op| to |obj|, |id|, and |vp|. If |op| is a setter, treat the assignment as lenient.
template<typename Op>
inline JSBool ApplyPropertyOp(JSContext *cx, Op op, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp);
inline JSBool ApplyPropertyOp(JSContext *cx, Op op, JSHandleObject obj, JSHandleId id, JS::MutableHandleValue vp);
template<>
inline JSBool
ApplyPropertyOp<JSPropertyOp>(JSContext *cx, JSPropertyOp op, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp)
ApplyPropertyOp<JSPropertyOp>(JSContext *cx, JSPropertyOp op, JSHandleObject obj, JSHandleId id, JS::MutableHandleValue vp)
{
return op(cx, obj, id, vp);
}
@ -581,7 +581,7 @@ ApplyPropertyOp<JSPropertyOp>(JSContext *cx, JSPropertyOp op, JSHandleObject obj
template<>
inline JSBool
ApplyPropertyOp<JSStrictPropertyOp>(JSContext *cx, JSStrictPropertyOp op, JSHandleObject obj,
JSHandleId id, JSMutableHandleValue vp)
JSHandleId id, JS::MutableHandleValue vp)
{
return op(cx, obj, id, true, vp);
}

View File

@ -430,7 +430,7 @@ DefinePropertyIfFound(XPCCallContext& ccx,
/***************************************************************************/
static JSBool
XPC_WN_OnlyIWrite_AddPropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp)
XPC_WN_OnlyIWrite_AddPropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, MutableHandleValue vp)
{
XPCCallContext ccx(JS_CALLER, cx, obj, NullPtr(), id);
XPCWrappedNative* wrapper = ccx.GetWrapper();
@ -445,14 +445,14 @@ XPC_WN_OnlyIWrite_AddPropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId
static JSBool
XPC_WN_OnlyIWrite_SetPropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict,
JSMutableHandleValue vp)
MutableHandleValue vp)
{
return XPC_WN_OnlyIWrite_AddPropertyStub(cx, obj, id, vp);
}
static JSBool
XPC_WN_CannotModifyPropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id,
JSMutableHandleValue vp)
MutableHandleValue vp)
{
return Throw(NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN, cx);
}
@ -466,13 +466,13 @@ XPC_WN_CantDeletePropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id,
static JSBool
XPC_WN_CannotModifyStrictPropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict,
JSMutableHandleValue vp)
MutableHandleValue vp)
{
return XPC_WN_CannotModifyPropertyStub(cx, obj, id, vp);
}
static JSBool
XPC_WN_Shared_Convert(JSContext *cx, JSHandleObject obj, JSType type, JSMutableHandleValue vp)
XPC_WN_Shared_Convert(JSContext *cx, JSHandleObject obj, JSType type, MutableHandleValue vp)
{
if (type == JSTYPE_OBJECT) {
vp.set(OBJECT_TO_JSVAL(obj));
@ -756,7 +756,7 @@ XPCWrappedNativeJSClass XPC_WN_NoHelper_JSClass = {
/***************************************************************************/
static JSBool
XPC_WN_MaybeResolvingPropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp)
XPC_WN_MaybeResolvingPropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, MutableHandleValue vp)
{
XPCCallContext ccx(JS_CALLER, cx, obj);
XPCWrappedNative* wrapper = ccx.GetWrapper();
@ -769,7 +769,7 @@ XPC_WN_MaybeResolvingPropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId
static JSBool
XPC_WN_MaybeResolvingStrictPropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict,
JSMutableHandleValue vp)
MutableHandleValue vp)
{
return XPC_WN_MaybeResolvingPropertyStub(cx, obj, id, vp);
}
@ -810,7 +810,7 @@ XPC_WN_MaybeResolvingDeletePropertyStub(JSContext *cx, JSHandleObject obj, JSHan
static JSBool
XPC_WN_Helper_AddProperty(JSContext *cx, JSHandleObject obj, JSHandleId id,
JSMutableHandleValue vp)
MutableHandleValue vp)
{
PRE_HELPER_STUB
AddProperty(wrapper, cx, obj, id, vp.address(), &retval);
@ -828,7 +828,7 @@ XPC_WN_Helper_DelProperty(JSContext *cx, JSHandleObject obj, JSHandleId id,
JSBool
XPC_WN_Helper_GetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id,
JSMutableHandleValue vp)
MutableHandleValue vp)
{
PRE_HELPER_STUB
GetProperty(wrapper, cx, obj, id, vp.address(), &retval);
@ -837,7 +837,7 @@ XPC_WN_Helper_GetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id,
JSBool
XPC_WN_Helper_SetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict,
JSMutableHandleValue vp)
MutableHandleValue vp)
{
PRE_HELPER_STUB
SetProperty(wrapper, cx, obj, id, vp.address(), &retval);
@ -845,7 +845,7 @@ XPC_WN_Helper_SetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBo
}
static JSBool
XPC_WN_Helper_Convert(JSContext *cx, JSHandleObject obj, JSType type, JSMutableHandleValue vp)
XPC_WN_Helper_Convert(JSContext *cx, JSHandleObject obj, JSType type, MutableHandleValue vp)
{
PRE_HELPER_STUB
Convert(wrapper, cx, obj, type, vp.address(), &retval);
@ -854,7 +854,7 @@ XPC_WN_Helper_Convert(JSContext *cx, JSHandleObject obj, JSType type, JSMutableH
static JSBool
XPC_WN_Helper_CheckAccess(JSContext *cx, JSHandleObject obj, JSHandleId id,
JSAccessMode mode, JSMutableHandleValue vp)
JSAccessMode mode, MutableHandleValue vp)
{
PRE_HELPER_STUB
CheckAccess(wrapper, cx, obj, id, mode, vp.address(), &retval);
@ -901,7 +901,7 @@ XPC_WN_Helper_Construct(JSContext *cx, unsigned argc, jsval *vp)
}
static JSBool
XPC_WN_Helper_HasInstance(JSContext *cx, JSHandleObject obj, JSMutableHandleValue valp, JSBool *bp)
XPC_WN_Helper_HasInstance(JSContext *cx, JSHandleObject obj, MutableHandleValue valp, JSBool *bp)
{
bool retval2;
PRE_HELPER_STUB
@ -1035,7 +1035,7 @@ XPC_WN_Helper_NewResolve(JSContext *cx, JSHandleObject obj, JSHandleId id, unsig
JSBool
XPC_WN_JSOp_Enumerate(JSContext *cx, JSHandleObject obj, JSIterateOp enum_op,
JSMutableHandleValue statep, MutableHandleId idp)
MutableHandleValue statep, MutableHandleId idp)
{
js::Class *clazz = js::GetObjectClass(obj);
if (!IS_WN_CLASS(clazz) || clazz == &XPC_WN_NoHelper_JSClass.base) {
@ -1530,7 +1530,7 @@ js::Class XPC_WN_ModsAllowed_NoCall_Proto_JSClass = {
static JSBool
XPC_WN_OnlyIWrite_Proto_AddPropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id,
JSMutableHandleValue vp)
MutableHandleValue vp)
{
NS_ASSERTION(js::GetObjectClass(obj) == &XPC_WN_NoMods_WithCall_Proto_JSClass ||
js::GetObjectClass(obj) == &XPC_WN_NoMods_NoCall_Proto_JSClass,
@ -1554,7 +1554,7 @@ XPC_WN_OnlyIWrite_Proto_AddPropertyStub(JSContext *cx, JSHandleObject obj, JSHan
static JSBool
XPC_WN_OnlyIWrite_Proto_SetPropertyStub(JSContext *cx, JSHandleObject obj, JSHandleId id, JSBool strict,
JSMutableHandleValue vp)
MutableHandleValue vp)
{
return XPC_WN_OnlyIWrite_Proto_AddPropertyStub(cx, obj, id, vp);
}

View File

@ -1202,7 +1202,7 @@ XPC_WN_GetterSetter(JSContext *cx, unsigned argc, jsval *vp);
extern JSBool
XPC_WN_JSOp_Enumerate(JSContext *cx, JSHandleObject obj, JSIterateOp enum_op,
JSMutableHandleValue statep, JS::MutableHandleId idp);
JS::MutableHandleValue statep, JS::MutableHandleId idp);
extern JSObject*
XPC_WN_JSOp_ThisObject(JSContext *cx, JSHandleObject obj);

View File

@ -22,9 +22,9 @@ class XPCWrappedNative;
namespace xpc {
JSBool
holder_get(JSContext *cx, JSHandleObject holder, JSHandleId id, JSMutableHandleValue vp);
holder_get(JSContext *cx, JSHandleObject holder, JSHandleId id, JS::MutableHandleValue vp);
JSBool
holder_set(JSContext *cx, JSHandleObject holder, JSHandleId id, JSBool strict, JSMutableHandleValue vp);
holder_set(JSContext *cx, JSHandleObject holder, JSHandleId id, JSBool strict, JS::MutableHandleValue vp);
namespace XrayUtils {