Bug 397319 - "Add JSAutoRequest to other users of GetArgvPtr". r+sr+a=jst.

This commit is contained in:
bent.mozilla@gmail.com 2007-09-28 11:15:26 -07:00
parent a30983e10d
commit 1232ee381c
3 changed files with 9 additions and 0 deletions

View File

@ -2379,6 +2379,8 @@ nsCanvasRenderingContext2D::GetImageData()
ncc->GetArgc(&argc);
ncc->GetArgvPtr(&argv);
JSAutoRequest ar(ctx);
int32 x, y, w, h;
if (!JS_ConvertArguments (ctx, argc, argv, "jjjj", &x, &y, &w, &h))
return NS_ERROR_DOM_SYNTAX_ERR;
@ -2495,6 +2497,8 @@ nsCanvasRenderingContext2D::PutImageData()
ncc->GetArgc(&argc);
ncc->GetArgvPtr(&argv);
JSAutoRequest ar(ctx);
JSObject *dataObject;
int32 x, y;

View File

@ -317,6 +317,8 @@ nsHTMLCanvasElement::ToDataURL(nsAString& aDataURL)
return ToDataURLImpl(NS_LITERAL_STRING("image/png"), EmptyString(), aDataURL);
}
JSAutoRequest ar(ctx);
// 1-arg case; convert to given mime type
if (argc == 1) {
if (!JSVAL_IS_STRING(argv[0]))

View File

@ -1950,6 +1950,7 @@ nsCrypto::GenerateCRMFRequest(nsIDOMCRMFObject** aReturn)
JSObject* script_obj = nsnull;
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
JSAutoRequest ar(cx);
/*
* Get all of the parameters.
@ -2663,6 +2664,8 @@ nsCrypto::SignText(const nsAString& aStringToSign, const nsAString& aCaOption,
jsval *argv = nsnull;
ncc->GetArgvPtr(&argv);
JSAutoRequest ar(cx);
PRUint32 i;
for (i = 2; i < argc; ++i) {
JSString *caName = JS_ValueToString(cx, argv[i]);