From c29b5582830a726d2fdd841e2bdd05caaff50c38 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Wed, 11 Aug 2010 13:45:00 -0400 Subject: [PATCH] Bug 586362 - xpcshell: gczeal() doesn't work in the content process. r=bent a=bsmedberg --- ipc/testshell/XPCShellEnvironment.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ipc/testshell/XPCShellEnvironment.cpp b/ipc/testshell/XPCShellEnvironment.cpp index da632015d0a..d07f44fe91d 100644 --- a/ipc/testshell/XPCShellEnvironment.cpp +++ b/ipc/testshell/XPCShellEnvironment.cpp @@ -427,6 +427,23 @@ GC(JSContext *cx, return JS_TRUE; } +#ifdef JS_GC_ZEAL +static JSBool +GCZeal(JSContext *cx, + JSObject *obj, + uintN argc, + jsval *argv, + jsval *rval) +{ + uint32 zeal; + if (!JS_ValueToECMAUint32(cx, argv[0], &zeal)) + return JS_FALSE; + + JS_SetGCZeal(cx, (PRUint8)zeal); + return JS_TRUE; +} +#endif + #ifdef DEBUG static JSBool @@ -541,6 +558,9 @@ JSFunctionSpec gGlobalFunctions[] = {"dumpXPC", DumpXPC, 1,0}, {"dump", Dump, 1,0}, {"gc", GC, 0,0}, +#ifdef JS_GC_ZEAL + {"gczeal", GCZeal, 1,0}, +#endif {"clear", Clear, 1,0}, #ifdef DEBUG {"dumpHeap", DumpHeap, 5,0},