Backed out changeset 79fd90e2dd87, n810s all orange -- yay! Something fruitful to investigate!

This commit is contained in:
Jeff Walden 2010-03-29 19:46:37 -07:00
parent fa7bcd268b
commit fbc0da3a62
5 changed files with 22 additions and 22 deletions

View File

@ -2108,11 +2108,15 @@ nsJSContext::CallEventHandler(nsISupports* aTarget, void *aScope, void *aHandler
return NS_OK;
}
jsval targetVal = JSVAL_VOID;
JSAutoTempValueRooter tvr(mContext, 1, &targetVal);
JSObject* target = nsnull;
nsresult rv = JSObjectFromInterface(aTarget, aScope, &target);
NS_ENSURE_SUCCESS(rv, rv);
js::AutoObjectRooter targetVal(mContext, target);
targetVal = OBJECT_TO_JSVAL(target);
jsval rval = JSVAL_VOID;
// This one's a lot easier than EvaluateString because we don't have to
@ -2136,7 +2140,7 @@ nsJSContext::CallEventHandler(nsISupports* aTarget, void *aScope, void *aHandler
jsval *argv = nsnull;
js::LazilyConstructed<nsAutoPoolRelease> poolRelease;
js::LazilyConstructed<js::AutoArrayRooter> tvr;
js::LazilyConstructed<JSAutoTempValueRooter> tvr;
// Use |target| as the scope for wrapping the arguments, since aScope is
// the safe scope in many cases, which isn't very useful. Wrapping aTarget
@ -2650,7 +2654,7 @@ nsJSContext::SetProperty(void *aTarget, const char *aPropName, nsISupports *aArg
JSAutoRequest ar(mContext);
js::LazilyConstructed<nsAutoPoolRelease> poolRelease;
js::LazilyConstructed<js::AutoArrayRooter> tvr;
js::LazilyConstructed<JSAutoTempValueRooter> tvr;
nsresult rv;
rv = ConvertSupportsTojsvals(aArgs, GetNativeGlobal(), &argc,
@ -2685,7 +2689,7 @@ nsJSContext::ConvertSupportsTojsvals(nsISupports *aArgs,
PRUint32 *aArgc,
jsval **aArgv,
js::LazilyConstructed<nsAutoPoolRelease> &aPoolRelease,
js::LazilyConstructed<js::AutoArrayRooter> &aRooter)
js::LazilyConstructed<JSAutoTempValueRooter> &aRooter)
{
nsresult rv = NS_OK;

View File

@ -49,11 +49,8 @@
class nsIXPConnectJSObjectHolder;
class nsAutoPoolRelease;
namespace js {
class AutoObjectRooter;
class AutoArrayRooter;
template <class> class LazilyConstructed;
}
class JSAutoTempValueRooter;
namespace js { template <class> class LazilyConstructed; }
class nsJSContext : public nsIScriptContext,
public nsIXPCScriptNotify
@ -218,7 +215,7 @@ protected:
PRUint32 *aArgc,
jsval **aArgv,
js::LazilyConstructed<nsAutoPoolRelease> &aPoolRelease,
js::LazilyConstructed<js::AutoArrayRooter> &aRooter);
js::LazilyConstructed<JSAutoTempValueRooter> &aRooter);
nsresult AddSupportsPrimitiveTojsvals(nsISupports *aArg, jsval *aArgv);

View File

@ -5226,11 +5226,11 @@ js_InitRegExpStatics(JSContext *cx)
JS_FRIEND_API(void)
js_SaveAndClearRegExpStatics(JSContext *cx, JSRegExpStatics *statics,
AutoValueRooter *tvr)
JSTempValueRooter *tvr)
{
*statics = cx->regExpStatics;
if (statics->input)
tvr->setString(statics->input);
JS_PUSH_TEMP_ROOT_STRING(cx, statics->input, tvr);
/*
* Prevent JS_ClearRegExpStatics from freeing moreParens, since we've only
* moved it elsewhere (into statics->moreParens).
@ -5241,11 +5241,12 @@ js_SaveAndClearRegExpStatics(JSContext *cx, JSRegExpStatics *statics,
JS_FRIEND_API(void)
js_RestoreRegExpStatics(JSContext *cx, JSRegExpStatics *statics,
AutoValueRooter *tvr)
JSTempValueRooter *tvr)
{
/* Clear/free any new JSRegExpStatics data before clobbering. */
JS_ClearRegExpStatics(cx);
cx->regExpStatics = *statics;
JS_POP_TEMP_ROOT(cx, tvr);
}
void
@ -5838,7 +5839,7 @@ js_NewRegExpObject(JSContext *cx, TokenStream *ts,
str = js_NewStringCopyN(cx, chars, length);
if (!str)
return NULL;
AutoValueRooter tvr(cx, str);
JSAutoTempValueRooter tvr(cx, str);
re = js_NewRegExp(cx, ts, str, flags, JS_FALSE);
if (!re)
return NULL;

View File

@ -65,15 +65,13 @@ struct JSRegExpStatics {
JSSubString rightContext; /* input to right of last match (perl $') */
};
namespace js { class AutoValueRooter; }
extern JS_FRIEND_API(void)
js_SaveAndClearRegExpStatics(JSContext *cx, JSRegExpStatics *statics,
js::AutoValueRooter *tvr);
JSTempValueRooter *tvr);
extern JS_FRIEND_API(void)
js_RestoreRegExpStatics(JSContext *cx, JSRegExpStatics *statics,
js::AutoValueRooter *tvr);
JSTempValueRooter *tvr);
/*
* This struct holds a bitmap representation of a class from a regexp.

View File

@ -478,7 +478,7 @@ XPC_SJOW_DelProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
NS_STACK_CLASS class SafeCallGuard {
public:
SafeCallGuard(JSContext *cx, nsIPrincipal *principal)
: cx(cx), tvr(cx) {
: cx(cx) {
nsIScriptSecurityManager *ssm = XPCWrapper::GetSecurityManager();
if (ssm) {
// Note: We pass null as the target frame pointer because we know that
@ -517,7 +517,7 @@ public:
private:
JSContext *cx;
JSRegExpStatics statics;
js::AutoValueRooter tvr;
JSTempValueRooter tvr;
uint32 options;
JSStackFrame *fp;
};
@ -957,7 +957,7 @@ XPC_SJOW_Iterator(JSContext *cx, JSObject *obj, JSBool keysonly)
return nsnull;
}
js::AutoValueRooter tvr(cx, OBJECT_TO_JSVAL(wrapperIter));
JSAutoTempValueRooter tvr(cx, OBJECT_TO_JSVAL(wrapperIter));
// Initialize the wrapper.
return XPCWrapper::CreateIteratorObj(cx, wrapperIter, obj, unsafeObj,